vendor: 6,685 bytes, lines 1-9
1var j_=t=>{throw TypeError(t)};var hp=(t,e,n)=>e.has(t)||j_("Cannot "+n);var H=(t,e,n)=>(hp(t,e,"read from private field"),n?n.call(t):e.get(t)),Ve=(t,e,n)=>e.has(t)?j_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Te=(t,e,n,r)=>(hp(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Bt=(t,e,n)=>(hp(t,e,"access private method"),n);var Cc=(t,e,n,r)=>({set _(i){Te(t,e,i,n)},get _(){return H(t,e,r)}});function tR(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function nR(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var yb={exports:{}},Cf={},_b={exports:{}},Oe={};/** 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 ju=Symbol.for("react.element"),rR=Symbol.for("react.portal"),iR=Symbol.for("react.fragment"),sR=Symbol.for("react.strict_mode"),oR=Symbol.for("react.profiler"),aR=Symbol.for("react.provider"),lR=Symbol.for("react.context"),uR=Symbol.for("react.forward_ref"),cR=Symbol.for("react.suspense"),dR=Symbol.for("react.memo"),fR=Symbol.for("react.lazy"),D_=Symbol.iterator;function hR(t){return t===null||typeof t!="object"?null:(t=D_&&t[D_]||t["@@iterator"],typeof t=="function"?t:null)}var xb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wb=Object.assign,bb={};function Fa(t,e,n){this.props=t,this.context=e,this.refs=bb,this.updater=n||xb}Fa.prototype.isReactComponent={};Fa.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")};Fa.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Cb(){}Cb.prototype=Fa.prototype;function Jg(t,e,n){this.props=t,this.context=e,this.refs=bb,this.updater=n||xb}var Qg=Jg.prototype=new Cb;Qg.constructor=Jg;wb(Qg,Fa.prototype);Qg.isPureReactComponent=!0;var F_=Array.isArray,Sb=Object.prototype.hasOwnProperty,Xg={current:null},Tb={key:!0,ref:!0,__self:!0,__source:!0};function Eb(t,e,n){var r,i={},s=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(s=""+e.key),e)Sb.call(e,r)&&!Tb.hasOwnProperty(r)&&(i[r]=e[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),f=0;f<l;f++)c[f]=arguments[f+2];i.children=c}if(t&&t.defaultProps)for(r in l=t.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:ju,type:t,key:s,ref:a,props:i,_owner:Xg.current}}function pR(t,e){return{$$typeof:ju,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function ev(t){return typeof t=="object"&&t!==null&&t.$$typeof===ju}function mR(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var $_=/\/+/g;function pp(t,e){return typeof t=="object"&&t!==null&&t.key!=null?mR(""+t.key):e.toString(36)}function sd(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case ju:case rR:a=!0}}if(a)return a=t,i=i(a),t=r===""?"."+pp(a,0):r,F_(i)?(n="",t!=null&&(n=t.replace($_,"$&/")+"/"),sd(i,e,n,"",function(f){return f})):i!=null&&(ev(i)&&(i=pR(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace($_,"$&/")+"/")+t)),e.push(i)),1;if(a=0,r=r===""?".":r+":",F_(t))for(var l=0;l<t.length;l++){s=t[l];var c=r+pp(s,l);a+=sd(s,e,n,c,i)}else if(c=hR(t),typeof c=="function")for(t=c.call(t),l=0;!(s=t.next()).done;)s=s.value,c=r+pp(s,l++),a+=sd(s,e,n,c,i);else if(s==="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 Sc(t,e,n){if(t==null)return t;var r=[],i=0;return sd(t,r,"","",function(s){return e.call(n,s,i++)}),r}function gR(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var ln={current:null},od={transition:null},vR={ReactCurrentDispatcher:ln,ReactCurrentBatchConfig:od,ReactCurrentOwner:Xg};function Pb(){throw Error("act(...) is not supported in production builds of React.")}Oe.Children={map:Sc,forEach:function(t,e,n){Sc(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Sc(t,function(){e++}),e},toArray:function(t){return Sc(t,function(e){return e})||[]},only:function(t){if(!ev(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Oe.Component=Fa;Oe.Fragment=iR;Oe.Profiler=oR;Oe.PureComponent=Jg;Oe.StrictMode=sR;Oe.Suspense=cR;
vendor: 3,928 bytes, lines 9-25
9Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vR;Oe.act=Pb;Oe.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=wb({},t.props),i=t.key,s=t.ref,a=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,a=Xg.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(c in e)Sb.call(e,c)&&!Tb.hasOwnProperty(c)&&(r[c]=e[c]===void 0&&l!==void 0?l[c]:e[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var f=0;f<c;f++)l[f]=arguments[f+2];r.children=l}return{$$typeof:ju,type:t.type,key:i,ref:s,props:r,_owner:a}};Oe.createContext=function(t){return t={$$typeof:lR,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:aR,_context:t},t.Consumer=t};Oe.createElement=Eb;Oe.createFactory=function(t){var e=Eb.bind(null,t);return e.type=t,e};Oe.createRef=function(){return{current:null}};Oe.forwardRef=function(t){return{$$typeof:uR,render:t}};Oe.isValidElement=ev;Oe.lazy=function(t){return{$$typeof:fR,_payload:{_status:-1,_result:t},_init:gR}};Oe.memo=function(t,e){return{$$typeof:dR,type:t,compare:e===void 0?null:e}};Oe.startTransition=function(t){var e=od.transition;od.transition={};try{t()}finally{od.transition=e}};Oe.unstable_act=Pb;Oe.useCallback=function(t,e){return ln.current.useCallback(t,e)};Oe.useContext=function(t){return ln.current.useContext(t)};Oe.useDebugValue=function(){};Oe.useDeferredValue=function(t){return ln.current.useDeferredValue(t)};Oe.useEffect=function(t,e){return ln.current.useEffect(t,e)};Oe.useId=function(){return ln.current.useId()};Oe.useImperativeHandle=function(t,e,n){return ln.current.useImperativeHandle(t,e,n)};Oe.useInsertionEffect=function(t,e){return ln.current.useInsertionEffect(t,e)};Oe.useLayoutEffect=function(t,e){return ln.current.useLayoutEffect(t,e)};Oe.useMemo=function(t,e){return ln.current.useMemo(t,e)};Oe.useReducer=function(t,e,n){return ln.current.useReducer(t,e,n)};Oe.useRef=function(t){return ln.current.useRef(t)};Oe.useState=function(t){return ln.current.useState(t)};Oe.useSyncExternalStore=function(t,e,n){return ln.current.useSyncExternalStore(t,e,n)};Oe.useTransition=function(){return ln.current.useTransition()};Oe.version="18.3.1";_b.exports=Oe;var w=_b.exports;const te=Yg(w),kb=tR({__proto__:null,default:te},[w]);/** 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 yR=w,_R=Symbol.for("react.element"),xR=Symbol.for("react.fragment"),wR=Object.prototype.hasOwnProperty,bR=yR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,CR={key:!0,ref:!0,__self:!0,__source:!0};function Nb(t,e,n){var r,i={},s=null,a=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(a=e.ref);for(r in e)wR.call(e,r)&&!CR.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:_R,type:t,key:s,ref:a,props:i,_owner:bR.current}}Cf.Fragment=xR;Cf.jsx=Nb;Cf.jsxs=Nb;yb.exports=Cf;var d=yb.exports,Rb={exports:{}},On={},Ib={exports:{}},Ab={};/** 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(j,U){var V=j.length;j.push(U);e:for(;0<V;){var re=V-1>>>1,Q=j[re];if(0<i(Q,U))j[re]=U,j[V]=Q,V=re;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var U=j[0],V=j.pop();if(V!==U){j[0]=V;e:for(var re=0,Q=j.length,oe=Q>>>1;re<oe;){var ae=2*(re+1)-1,fe=j[ae],pe=ae+1,ee=j[pe];if(0>
vendor: 10,327 bytes, lines 25-34
25i(fe,V))pe<Q&&0>i(ee,fe)?(j[re]=ee,j[pe]=V,re=pe):(j[re]=fe,j[ae]=V,re=ae);else if(pe<Q&&0>i(ee,V))j[re]=ee,j[pe]=V,re=pe;else break e}}return U}function i(j,U){var V=j.sortIndex-U.sortIndex;return V!==0?V:j.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var c=[],f=[],p=1,m=null,_=3,x=!1,P=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(j){for(var U=n(f);U!==null;){if(U.callback===null)r(f);else if(U.startTime<=j)r(f),U.sortIndex=U.expirationTime,e(c,U);else break;U=n(f)}}function R(j){if(b=!1,S(j),!P)if(n(c)!==null)P=!0,G(I);else{var U=n(f);U!==null&&ce(R,U.startTime-j)}}function I(j,U){P=!1,b&&(b=!1,E(D),D=-1),x=!0;var V=_;try{for(S(U),m=n(c);m!==null&&(!(m.expirationTime>U)||j&&!ne());){var re=m.callback;if(typeof re=="function"){m.callback=null,_=m.priorityLevel;var Q=re(m.expirationTime<=U);U=t.unstable_now(),typeof Q=="function"?m.callback=Q:m===n(c)&&r(c),S(U)}else r(c);m=n(c)}if(m!==null)var oe=!0;else{var ae=n(f);ae!==null&&ce(R,ae.startTime-U),oe=!1}return oe}finally{m=null,_=V,x=!1}}var M=!1,O=null,D=-1,K=5,q=-1;function ne(){return!(t.unstable_now()-q<K)}function W(){if(O!==null){var j=t.unstable_now();q=j;var U=!0;try{U=O(!0,j)}finally{U?$():(M=!1,O=null)}}else M=!1}var $;if(typeof T=="function")$=function(){T(W)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,se=z.port2;z.port1.onmessage=W,$=function(){se.postMessage(null)}}else $=function(){k(W,0)};function G(j){O=j,M||(M=!0,$())}function ce(j,U){D=k(function(){j(t.unstable_now())},U)}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(j){j.callback=null},t.unstable_continueExecution=function(){P||x||(P=!0,G(I))},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return _},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(j){switch(_){case 1:case 2:case 3:var U=3;break;default:U=_}var V=_;_=U;try{return j()}finally{_=V}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(j,U){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var V=_;_=j;try{return U()}finally{_=V}},t.unstable_scheduleCallback=function(j,U,V){var re=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?re+V:re):V=re,j){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=V+Q,j={id:p++,callback:U,priorityLevel:j,startTime:V,expirationTime:Q,sortIndex:-1},V>re?(j.sortIndex=V,e(f,j),n(c)===null&&j===n(f)&&(b?(E(D),D=-1):b=!0,ce(R,V-re))):(j.sortIndex=Q,e(c,j),P||x||(P=!0,G(I))),j},t.unstable_shouldYield=ne,t.unstable_wrapCallback=function(j){var U=_;return function(){var V=_;_=U;try{return j.apply(this,arguments)}finally{_=V}}}})(Ab);Ib.exports=Ab;var SR=Ib.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 TR=w,Ln=SR;function J(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);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 Mb=new Set,Zl={};function uo(t,e){wa(t,e),wa(t+"Capture",e)}function wa(t,e){for(Zl[t]=e,t=0;t<e.length;t++)Mb.add(e[t])}var hi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dm=Object.prototype.hasOwnProperty,ER=/^[: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]*$/,z_={},B_={};function PR(t){return dm.call(B_,t)?!0:dm.call(z_,t)?!1:ER.test(t)?B_[t]=!0:(z_[t]=!0,!1)}function kR(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function NR(t,e,n,r){if(e===null||typeof e>"u"||kR(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function un(t,e,n,r,i,s,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=a}var $t={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){$t[t]=new un(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];$t[e]=new un(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){$t[t]=new un(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){$t[t]=new un(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){$t[t]=new un(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){$t[t]=new un(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){$t[t]=new un(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){$t[t]=new un(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){$t[t]=new un(t,5,!1,t.toLowerCase(),null,!1,!1)});var tv=/[\-:]([a-z])/g;function nv(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(tv,nv);$t[e]=new un(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(tv,nv);$t[e]=new un(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(tv,nv);$t[e]=new un(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){$t[t]=new un(t,1,!1,t.toLowerCase(),null,!1,!1)});$t.xlinkHref=new un("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){$t[t]=new un(t,1,!1,t.toLowerCase(),null,!0,!0)});function rv(t,e,n,r){var i=$t.hasOwnProperty(e)?$t[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(NR(e,n,i,r)&&(n=null),r||i===null?PR(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var xi=TR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Tc=Symbol.for("react.element"),Do=Symbol.for("react.portal"),Fo=Symbol.for("react.fragment"),iv=Symbol.for("react.strict_mode"),fm=Symbol.for("react.profiler"),Lb=Symbol.for("react.provider"),Ob=Symbol.for("react.context"),sv=Symbol.for("react.forward_ref"),hm=Symbol.for("react.suspense"),pm=Symbol.for("react.suspense_list"),ov=Symbol.for("react.memo"),Oi=Symbol.for("react.lazy"),jb=Symbol.for("react.offscreen"),U_=Symbol.iterator;function pl(t){return t===null||typeof t!="object"?null:(t=U_&&t[U_]||t["@@iterator"],typeof t=="function"?t:null)}var gt=Object.assign,mp;function Tl(t){if(mp===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);mp=e&&e[1]||""}return` 34`+mp+t}var gp=!1;function vp(t,e){if(!t||gp)return"";gp=!0;var n=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(f){var r=f}Reflect.construct(t,[],e)}else{try{e.call()}catch(f){r=f}t.call(e.prototype)}else{try{throw Error()}catch(f){r=f}t()}}
vendor: 16,691 bytes, lines 34-37
34catch(f){if(f&&r&&typeof f.stack=="string"){for(var i=f.stack.split(` 35`),s=r.stack.split(` 36`),a=i.length-1,l=s.length-1;1<=a&&0<=l&&i[a]!==s[l];)l--;for(;1<=a&&0<=l;a--,l--)if(i[a]!==s[l]){if(a!==1||l!==1)do if(a--,l--,0>l||i[a]!==s[l]){var c=` 37`+i[a].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=a&&0<=l);break}}}finally{gp=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Tl(t):""}function RR(t){switch(t.tag){case 5:return Tl(t.type);case 16:return Tl("Lazy");case 13:return Tl("Suspense");case 19:return Tl("SuspenseList");case 0:case 2:case 15:return t=vp(t.type,!1),t;case 11:return t=vp(t.type.render,!1),t;case 1:return t=vp(t.type,!0),t;default:return""}}function mm(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 Fo:return"Fragment";case Do:return"Portal";case fm:return"Profiler";case iv:return"StrictMode";case hm:return"Suspense";case pm:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Ob:return(t.displayName||"Context")+".Consumer";case Lb:return(t._context.displayName||"Context")+".Provider";case sv:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ov:return e=t.displayName||null,e!==null?e:mm(t.type)||"Memo";case Oi:e=t._payload,t=t._init;try{return mm(t(e))}catch{}}return null}function IR(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 mm(e);case 8:return e===iv?"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 is(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Db(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function AR(t){var e=Db(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ec(t){t._valueTracker||(t._valueTracker=AR(t))}function Fb(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Db(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Pd(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 gm(t,e){var n=e.checked;return gt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function V_(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=is(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function $b(t,e){e=e.checked,e!=null&&rv(t,"checked",e,!1)}function vm(t,e){$b(t,e);var n=is(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?ym(t,e.type,n):e.hasOwnProperty("defaultValue")&&ym(t,e.type,is(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function H_(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function ym(t,e,n){(e!=="number"||Pd(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var El=Array.isArray;function Xo(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+is(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function _m(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(J(91));return gt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function W_(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(J(92));if(El(n)){if(1<n.length)throw Error(J(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:is(n)}}function zb(t,e){var n=is(e.value),r=is(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function Z_(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Bb(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 xm(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Bb(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Pc,Ub=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Pc=Pc||document.createElement("div"),Pc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Pc.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function ql(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Ml={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},MR=["Webkit","ms","Moz","O"];Object.keys(Ml).forEach(function(t){MR.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ml[e]=Ml[t]})});function Vb(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Ml.hasOwnProperty(t)&&Ml[t]?(""+e).trim():e+"px"}function Hb(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Vb(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var LR=gt({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 wm(t,e){if(e){if(LR[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(J(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(J(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(J(61))}if(e.style!=null&&typeof e.style!="object")throw Error(J(62))}}function bm(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 Cm=null;function av(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Sm=null,ea=null,ta=null;function q_(t){if(t=$u(t)){if(typeof Sm!="function")throw Error(J(280));var e=t.stateNode;e&&(e=kf(e),Sm(t.stateNode,t.type,e))}}function Wb(t){ea?ta?ta.push(t):ta=[t]:ea=t}function Zb(){if(ea){var t=ea,e=ta;if(ta=ea=null,q_(t),e)for(t=0;t<e.length;t++)q_(e[t])}}function qb(t,e){return t(e)}function Gb(){}var yp=!1;function Kb(t,e,n){if(yp)return t(e,n);yp=!0;try{return qb(t,e,n)}finally{yp=!1,(ea!==null||ta!==null)&&(Gb(),Zb())}}function Gl(t,e){var n=t.stateNode;if(n===null)return null;var r=kf(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(J(231,e,typeof n));return n}var Tm=!1;if(hi)try{var ml={};Object.defineProperty(ml,"passive",{get:function(){Tm=!0}}),window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch{Tm=!1}function OR(t,e,n,r,i,s,a,l,c){var f=Array.prototype.slice.call(arguments,3);try{e.apply(n,f)}catch(p){this.onError(p)}}var Ll=!1,kd=null,Nd=!1,Em=null,jR={onError:function(t){Ll=!0,kd=t}};function DR(t,e,n,r,i,s,a,l,c){Ll=!1,kd=null,OR.apply(jR,arguments)}function FR(t,e,n,r,i,s,a,l,c){if(DR.apply(this,arguments),Ll){if(Ll){var f=kd;Ll=!1,kd=null}else throw Error(J(198));Nd||(Nd=!0,Em=f)}}function co(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Yb(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 G_(t){if(co(t)!==t)throw Error(J(188))}function $R(t){var e=t.alternate;if(!e){if(e=co(t),e===null)throw Error(J(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return G_(i),t;if(s===r)return G_(i),e;s=s.sibling}throw Error(J(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,l=i.child;l;){if(l===n){a=!0,n=i,r=s;break}if(l===r){a=!0,r=i,n=s;break}l=l.sibling}if(!a){for(l=s.child;l;){if(l===n){a=!0,n=s,r=i;break}if(l===r){a=!0,r=s,n=i;break}l=l.sibling}if(!a)throw Error(J(189))}}if(n.alternate!==r)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?t:e}function Jb(t){return t=$R(t),t!==null?Qb(t):null}function Qb(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Qb(t);if(e!==null)return e;t=t.sibling}return null}var Xb=Ln.unstable_scheduleCallback,K_=Ln.unstable_cancelCallback,zR=Ln.unstable_shouldYield,BR=Ln.unstable_requestPaint,wt=Ln.unstable_now,UR=Ln.unstable_getCurrentPriorityLevel,lv=Ln.unstable_ImmediatePriority,eC=Ln.unstable_UserBlockingPriority,Rd=Ln.unstable_NormalPriority,VR=Ln.unstable_LowPriority,tC=Ln.unstable_IdlePriority,Sf=null,Dr=null;function HR(t){if(Dr&&typeof Dr.onCommitFiberRoot=="function")try{Dr.onCommitFiberRoot(Sf,t,void 0,(t.current.flags&128)===128)}catch{}}var lr=Math.clz32?Math.clz32:qR,WR=Math.log,ZR=Math.LN2;function qR(t){return t>>>=0,t===0?32:31-(WR(t)/ZR|0)|0}var kc=64,Nc=4194304;function Pl(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 Id(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,a=n&268435455;if(a!==0){var l=a&~i;l!==0?r=Pl(l):(s&=a,s!==0&&(r=Pl(s)))}else a=n&~i,a!==0?r=Pl(a):s!==0&&(r=Pl(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-lr(e),i=1<<n,r|=t[n],e&=~i;return r}function GR(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 KR(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var a=31-lr(s),l=1<<a,c=i[a];c===-1?(!(l&n)||l&r)&&(i[a]=GR(l,e)):c<=e&&(t.expiredLanes|=l),s&=~l}}function Pm(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function nC(){var t=kc;return kc<<=1,!(kc&4194240)&&(kc=64),t}function _p(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Du(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-lr(e),t[e]=n}function YR(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-lr(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function uv(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-lr(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var Ye=0;function rC(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var iC,cv,sC,oC,aC,km=!1,Rc=[],Ki=null,Yi=null,Ji=null,Kl=new Map,Yl=new Map,Fi=[],JR="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 Y_(t,e){switch(t){case"focusin":case"focusout":Ki=null;break;case"dragenter":case"dragleave":Yi=null;break;case"mouseover":case"mouseout":Ji=null;break;case"pointerover":case"pointerout":Kl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yl.delete(e.pointerId)}}function gl(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=$u(e),e!==null&&cv(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function QR(t,e,n,r,i){switch(e){case"focusin":return Ki=gl(Ki,t,e,n,r,i),!0;case"dragenter":return Yi=gl(Yi,t,e,n,r,i),!0;case"mouseover":return Ji=gl(Ji,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return Kl.set(s,gl(Kl.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Yl.set(s,gl(Yl.get(s)||null,t,e,n,r,i)),!0}return!1}function lC(t){var e=zs(t.target);if(e!==null){var n=co(e);if(n!==null){if(e=n.tag,e===13){if(e=Yb(n),e!==null){t.blockedOn=e,aC(t.priority,function(){sC(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ad(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Nm(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Cm=r,n.target.dispatchEvent(r),Cm=null}else return e=$u(n),e!==null&&cv(e),t.blockedOn=n,!1;e.shift()}return!0}function J_(t,e,n){ad(t)&&n.delete(e)}function XR(){km=!1,Ki!==null&&ad(Ki)&&(Ki=null),Yi!==null&&ad(Yi)&&(Y
vendor: 10,241 bytes, line 37
37i=null),Ji!==null&&ad(Ji)&&(Ji=null),Kl.forEach(J_),Yl.forEach(J_)}function vl(t,e){t.blockedOn===e&&(t.blockedOn=null,km||(km=!0,Ln.unstable_scheduleCallback(Ln.unstable_NormalPriority,XR)))}function Jl(t){function e(i){return vl(i,t)}if(0<Rc.length){vl(Rc[0],t);for(var n=1;n<Rc.length;n++){var r=Rc[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Ki!==null&&vl(Ki,t),Yi!==null&&vl(Yi,t),Ji!==null&&vl(Ji,t),Kl.forEach(e),Yl.forEach(e),n=0;n<Fi.length;n++)r=Fi[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Fi.length&&(n=Fi[0],n.blockedOn===null);)lC(n),n.blockedOn===null&&Fi.shift()}var na=xi.ReactCurrentBatchConfig,Ad=!0;function eI(t,e,n,r){var i=Ye,s=na.transition;na.transition=null;try{Ye=1,dv(t,e,n,r)}finally{Ye=i,na.transition=s}}function tI(t,e,n,r){var i=Ye,s=na.transition;na.transition=null;try{Ye=4,dv(t,e,n,r)}finally{Ye=i,na.transition=s}}function dv(t,e,n,r){if(Ad){var i=Nm(t,e,n,r);if(i===null)Np(t,e,r,Md,n),Y_(t,r);else if(QR(i,t,e,n,r))r.stopPropagation();else if(Y_(t,r),e&4&&-1<JR.indexOf(t)){for(;i!==null;){var s=$u(i);if(s!==null&&iC(s),s=Nm(t,e,n,r),s===null&&Np(t,e,r,Md,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Np(t,e,r,null,n)}}var Md=null;function Nm(t,e,n,r){if(Md=null,t=av(r),t=zs(t),t!==null)if(e=co(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Yb(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Md=t,null}function uC(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(UR()){case lv:return 1;case eC:return 4;case Rd:case VR:return 16;case tC:return 536870912;default:return 16}default:return 16}}var Zi=null,fv=null,ld=null;function cC(){if(ld)return ld;var t,e=fv,n=e.length,r,i="value"in Zi?Zi.value:Zi.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var a=n-t;for(r=1;r<=a&&e[n-r]===i[s-r];r++);return ld=i.slice(t,1<r?1-r:void 0)}function ud(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 Ic(){return!0}function Q_(){return!1}function jn(t){function e(n,r,i,s,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Ic:Q_,this.isPropagationStopped=Q_,this}return gt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ic)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ic)},persist:function(){},isPersistent:Ic}),e}var $a={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hv=jn($a),Fu=gt({},$a,{view:0,detail:0}),nI=jn(Fu),xp,wp,yl,Tf=gt({},Fu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pv,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!==yl&&(yl&&t.type==="mousemove"?(xp=t.screenX-yl.screenX,wp=t.screenY-yl.screenY):wp=xp=0,yl=t),xp)},movementY:function(t){return"movementY"in t?t.movementY:wp}}),X_=jn(Tf),rI=gt({},Tf,{dataTransfer:0}),iI=jn(rI),sI=gt({},Fu,{relatedTarget:0}),bp=jn(sI),oI=gt({},$a,{animationName:0,elapsedTime:0,pseudoElement:0}),aI=jn(oI),lI=gt({},$a,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),uI=jn(lI),cI=gt({},$a,{data:0}),ex=jn(cI),dI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fI={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"},hI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pI(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=hI[t])?!!e[t]:!1}function pv(){return pI}var mI=gt({},Fu,{key:function(t){if(t.key){var e=dI[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ud(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?fI[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pv,charCode:function(t){return t.type==="keypress"?ud(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ud(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),gI=jn(mI),vI=gt({},Tf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tx=jn(vI),yI=gt({},Fu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pv}),_I=jn(yI),xI=gt({},$a,{propertyName:0,elapsedTime:0,pseudoElement:0}),wI=jn(xI),bI=gt({},Tf,{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}),CI=jn(bI),SI=[9,13,27,32],mv=hi&&"CompositionEvent"in window,Ol=null;hi&&"documentMode"in document&&(Ol=document.documentMode);var TI=hi&&"TextEvent"in window&&!Ol,dC=hi&&(!mv||Ol&&8<Ol&&11>=Ol),nx=" ",rx=!1;function fC(t,e){switch(t){case"keyup":return SI.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hC(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $o=!1;function EI(t,e){switch(t){case"compositionend":return hC(e);case"keypress":return e.which!==32?null:(rx=!0,nx);case"textInput":return t=e.data,t===nx&&rx?null:t;default:return null}}function PI(t,e){if($o)return t==="compositionend"||!mv&&fC(t,e)?(t=cC(),ld=fv=Zi=null,$o=!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 dC&&e.locale!=="ko"?null:e.data;default:return null}}var kI={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 ix(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!kI[t.type]:e==="textarea"}function pC(t,e,n,r){Wb(r),e=Ld(e,"onChange"),0<e.length&&(n=new hv("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var jl=null,Ql=null;function NI(t){TC(t,0)}function Ef(t){var e=Uo(t);if(Fb(e))return t}function RI(t,e){if(t==="change")return e}var mC=!1;if(hi){var Cp;if(hi){var Sp="oninput"in document;if(!Sp){var sx=document.createElement("div");sx.setAttribute("oninput","return;"),Sp=typeof sx.oninput=="function"}Cp=Sp}else Cp=!1;mC=Cp&&(!document.documentMode||9<document.documentMode)}function ox(){jl&&(jl.detachEvent("onpropertychange",gC),Ql=jl=null)}function gC(t){if(t.propertyName==="value"&&Ef(Ql)){var e=[];pC(e,Ql,t,av(t)),Kb(NI,e)}}function II(t,e,n){t==="focusin"?(ox(),jl=e,Ql=n,jl.attachEvent("onpropertychange",gC)):t==="focusout"&&ox()}function AI(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ef(Ql)}function MI(t,e){if(t==="click")return Ef(e)}function LI(t,e){if(t==="input"||t==="change")return Ef(e)}function OI(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var dr=typeof Object.is=="function"?Object.is:OI;function Xl(t,e){if(dr(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!dm.call(e,i)||!dr(t[i],e[i]))return!1}return!0}function ax(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function lx(t,e){var n=ax(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ax(n)}}function vC(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?vC(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function yC(){for(var t=window,e=Pd();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Pd(t.document)}return e}
vendor: 6,147 bytes, line 37
37function gv(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 jI(t){var e=yC(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&vC(n.ownerDocument.documentElement,n)){if(r!==null&&gv(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=lx(n,s);var a=lx(n,r);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var DI=hi&&"documentMode"in document&&11>=document.documentMode,zo=null,Rm=null,Dl=null,Im=!1;function ux(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Im||zo==null||zo!==Pd(r)||(r=zo,"selectionStart"in r&&gv(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dl&&Xl(Dl,r)||(Dl=r,r=Ld(Rm,"onSelect"),0<r.length&&(e=new hv("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=zo)))}function Ac(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Bo={animationend:Ac("Animation","AnimationEnd"),animationiteration:Ac("Animation","AnimationIteration"),animationstart:Ac("Animation","AnimationStart"),transitionend:Ac("Transition","TransitionEnd")},Tp={},_C={};hi&&(_C=document.createElement("div").style,"AnimationEvent"in window||(delete Bo.animationend.animation,delete Bo.animationiteration.animation,delete Bo.animationstart.animation),"TransitionEvent"in window||delete Bo.transitionend.transition);function Pf(t){if(Tp[t])return Tp[t];if(!Bo[t])return t;var e=Bo[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in _C)return Tp[t]=e[n];return t}var xC=Pf("animationend"),wC=Pf("animationiteration"),bC=Pf("animationstart"),CC=Pf("transitionend"),SC=new Map,cx="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 ms(t,e){SC.set(t,e),uo(e,[t])}for(var Ep=0;Ep<cx.length;Ep++){var Pp=cx[Ep],FI=Pp.toLowerCase(),$I=Pp[0].toUpperCase()+Pp.slice(1);ms(FI,"on"+$I)}ms(xC,"onAnimationEnd");ms(wC,"onAnimationIteration");ms(bC,"onAnimationStart");ms("dblclick","onDoubleClick");ms("focusin","onFocus");ms("focusout","onBlur");ms(CC,"onTransitionEnd");wa("onMouseEnter",["mouseout","mouseover"]);wa("onMouseLeave",["mouseout","mouseover"]);wa("onPointerEnter",["pointerout","pointerover"]);wa("onPointerLeave",["pointerout","pointerover"]);uo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));uo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));uo("onBeforeInput",["compositionend","keypress","textInput","paste"]);uo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));uo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));uo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kl="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(" "),zI=new Set("cancel close invalid load scroll toggle".split(" ").concat(kl));function dx(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,FR(r,e,void 0,t),t.currentTarget=null}function TC(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var a=r.length-1;0<=a;a--){var l=r[a],c=l.instance,f=l.currentTarget;if(l=l.listener,c!==s&&i.isPropagationStopped())break e;dx(i,l,f),s=c}else for(a=0;a<r.length;a++){if(l=r[a],c=l.instance,f=l.currentTarget,l=l.listener,c!==s&&i.isPropagationStopped())break e;dx(i,l,f),s=c}}}if(Nd)throw t=Em,Nd=!1,Em=null,t}function ot(t,e){var n=e[jm];n===void 0&&(n=e[jm]=new Set);var r=t+"__bubble";n.has(r)||(EC(e,t,2,!1),n.add(r))}function kp(t,e,n){var r=0;e&&(r|=4),EC(n,t,r,e)}var Mc="_reactListening"+Math.random().toString(36).slice(2);function eu(t){if(!t[Mc]){t[Mc]=!0,Mb.forEach(function(n){n!=="selectionchange"&&(zI.has(n)||kp(n,!1,t),kp(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Mc]||(e[Mc]=!0,kp("selectionchange",!1,e))}}function EC(t,e,n,r){switch(uC(e)){case 1:var i=eI;break;case 4:i=tI;break;default:i=dv}n=i.bind(null,e,n,t),i=void 0,!Tm||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function Np(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;
vendor: 2,527 bytes, line 37
37if(l===i||l.nodeType===8&&l.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;a=a.return}for(;l!==null;){if(a=zs(l),a===null)return;if(c=a.tag,c===5||c===6){r=s=a;continue e}l=l.parentNode}}r=r.return}Kb(function(){var f=s,p=av(n),m=[];e:{var _=SC.get(t);if(_!==void 0){var x=hv,P=t;switch(t){case"keypress":if(ud(n)===0)break e;case"keydown":case"keyup":x=gI;break;case"focusin":P="focus",x=bp;break;case"focusout":P="blur",x=bp;break;case"beforeblur":case"afterblur":x=bp;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=X_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=iI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=_I;break;case xC:case wC:case bC:x=aI;break;case CC:x=wI;break;case"scroll":x=nI;break;case"wheel":x=CI;break;case"copy":case"cut":case"paste":x=uI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=tx}var b=(e&4)!==0,k=!b&&t==="scroll",E=b?_!==null?_+"Capture":null:_;b=[];for(var T=f,S;T!==null;){S=T;var R=S.stateNode;if(S.tag===5&&R!==null&&(S=R,E!==null&&(R=Gl(T,E),R!=null&&b.push(tu(T,R,S)))),k)break;T=T.return}0<b.length&&(_=new x(_,P,null,n,p),m.push({event:_,listeners:b}))}}if(!(e&7)){e:{if(_=t==="mouseover"||t==="pointerover",x=t==="mouseout"||t==="pointerout",_&&n!==Cm&&(P=n.relatedTarget||n.fromElement)&&(zs(P)||P[pi]))break e;if((x||_)&&(_=p.window===p?p:(_=p.ownerDocument)?_.defaultView||_.parentWindow:window,x?(P=n.relatedTarget||n.toElement,x=f,P=P?zs(P):null,P!==null&&(k=co(P),P!==k||P.tag!==5&&P.tag!==6)&&(P=null)):(x=null,P=f),x!==P)){if(b=X_,R="onMouseLeave",E="onMouseEnter",T="mouse",(t==="pointerout"||t==="pointerover")&&(b=tx,R="onPointerLeave",E="onPointerEnter",T="pointer"),k=x==null?_:Uo(x),S=P==null?_:Uo(P),_=new b(R,T+"leave",x,n,p),_.target=k,_.relatedTarget=S,R=null,zs(p)===f&&(b=new b(E,T+"enter",P,n,p),b.target=S,b.relatedTarget=k,R=b),k=R,x&&P)t:{for(b=x,E=P,T=0,S=b;S;S=Eo(S))T++;for(S=0,R=E;R;R=Eo(R))S++;for(;0<T-S;)b=Eo(b),T--;for(;0<S-T;)E=Eo(E),S--;for(;T--;){if(b===E||E!==null&&b===E.alternate)break t;b=Eo(b),E=Eo(E)}b=null}else b=null;x!==null&&fx(m,_,x,b,!1),P!==null&&k!==null&&fx(m,k,P,b,!0)}}
vendor: 4,630 bytes, lines 37-38
37e:{if(_=f?Uo(f):window,x=_.nodeName&&_.nodeName.toLowerCase(),x==="select"||x==="input"&&_.type==="file")var I=RI;else if(ix(_))if(mC)I=LI;else{I=AI;var M=II}else(x=_.nodeName)&&x.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(I=MI);if(I&&(I=I(t,f))){pC(m,I,n,p);break e}M&&M(t,_,f),t==="focusout"&&(M=_._wrapperState)&&M.controlled&&_.type==="number"&&ym(_,"number",_.value)}switch(M=f?Uo(f):window,t){case"focusin":(ix(M)||M.contentEditable==="true")&&(zo=M,Rm=f,Dl=null);break;case"focusout":Dl=Rm=zo=null;break;case"mousedown":Im=!0;break;case"contextmenu":case"mouseup":case"dragend":Im=!1,ux(m,n,p);break;case"selectionchange":if(DI)break;case"keydown":case"keyup":ux(m,n,p)}var O;if(mv)e:{switch(t){case"compositionstart":var D="onCompositionStart";break e;case"compositionend":D="onCompositionEnd";break e;case"compositionupdate":D="onCompositionUpdate";break e}D=void 0}else $o?fC(t,n)&&(D="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(D="onCompositionStart");D&&(dC&&n.locale!=="ko"&&($o||D!=="onCompositionStart"?D==="onCompositionEnd"&&$o&&(O=cC()):(Zi=p,fv="value"in Zi?Zi.value:Zi.textContent,$o=!0)),M=Ld(f,D),0<M.length&&(D=new ex(D,t,null,n,p),m.push({event:D,listeners:M}),O?D.data=O:(O=hC(n),O!==null&&(D.data=O)))),(O=TI?EI(t,n):PI(t,n))&&(f=Ld(f,"onBeforeInput"),0<f.length&&(p=new ex("onBeforeInput","beforeinput",null,n,p),m.push({event:p,listeners:f}),p.data=O))}TC(m,e)})}function tu(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Ld(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Gl(t,n),s!=null&&r.unshift(tu(t,s,i)),s=Gl(t,e),s!=null&&r.push(tu(t,s,i))),t=t.return}return r}function Eo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function fx(t,e,n,r,i){for(var s=e._reactName,a=[];n!==null&&n!==r;){var l=n,c=l.alternate,f=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&f!==null&&(l=f,i?(c=Gl(n,s),c!=null&&a.unshift(tu(n,c,l))):i||(c=Gl(n,s),c!=null&&a.push(tu(n,c,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var BI=/\r\n?/g,UI=/\u0000|\uFFFD/g;function hx(t){return(typeof t=="string"?t:""+t).replace(BI,` 38`).replace(UI,"")}function Lc(t,e,n){if(e=hx(e),hx(t)!==e&&n)throw Error(J(425))}function Od(){}var Am=null,Mm=null;function Lm(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 Om=typeof setTimeout=="function"?setTimeout:void 0,VI=typeof clearTimeout=="function"?clearTimeout:void 0,px=typeof Promise=="function"?Promise:void 0,HI=typeof queueMicrotask=="function"?queueMicrotask:typeof px<"u"?function(t){return px.resolve(null).then(t).catch(WI)}:Om;function WI(t){setTimeout(function(){throw t})}function Rp(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Jl(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Jl(e)}function Qi(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 mx(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var za=Math.random().toString(36).slice(2),Mr="__reactFiber$"+za,nu="__reactProps$"+za,pi="__reactContainer$"+za,jm="__reactEvents$"+za,ZI="__reactListeners$"+za,qI="__reactHandles$"+za;function zs(t){var e=t[Mr];if(e)return e;for(var n=t.parentNode;n;){if(e=n[pi]||n[Mr]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=mx(t);t!==null;){if(n=t[Mr])return n;t=mx(t)}return e}t=n,n=t.parentNode}return null}function $u(t){return t=t[Mr]||t[pi],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Uo(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(J(33))}function kf(t){return t[nu]||null}var Dm=[],Vo=-1;function gs(t){return{current:t}}function lt(t){0>Vo||(t.current=Dm[Vo],Dm[Vo]=null,Vo--)}function it(t,e){Vo++,Dm[Vo]=t.current,t.current=e}var ss={},Zt=gs(ss),_n=gs(!1),Js=ss;function ba(t,e){var n=t.type.contextTypes;if(!n)return ss;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function xn(t){return t=t.childContextTypes,t!=null}
vendor: 4,219 bytes, line 38
38function jd(){lt(_n),lt(Zt)}function gx(t,e,n){if(Zt.current!==ss)throw Error(J(168));it(Zt,e),it(_n,n)}function PC(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(J(108,IR(t)||"Unknown",i));return gt({},n,r)}function Dd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ss,Js=Zt.current,it(Zt,t),it(_n,_n.current),!0}function vx(t,e,n){var r=t.stateNode;if(!r)throw Error(J(169));n?(t=PC(t,e,Js),r.__reactInternalMemoizedMergedChildContext=t,lt(_n),lt(Zt),it(Zt,t)):lt(_n),it(_n,n)}var ii=null,Nf=!1,Ip=!1;function kC(t){ii===null?ii=[t]:ii.push(t)}function GI(t){Nf=!0,kC(t)}function vs(){if(!Ip&&ii!==null){Ip=!0;var t=0,e=Ye;try{var n=ii;for(Ye=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}ii=null,Nf=!1}catch(i){throw ii!==null&&(ii=ii.slice(t+1)),Xb(lv,vs),i}finally{Ye=e,Ip=!1}}return null}var Ho=[],Wo=0,Fd=null,$d=0,Bn=[],Un=0,Qs=null,li=1,ui="";function Os(t,e){Ho[Wo++]=$d,Ho[Wo++]=Fd,Fd=t,$d=e}function NC(t,e,n){Bn[Un++]=li,Bn[Un++]=ui,Bn[Un++]=Qs,Qs=t;var r=li;t=ui;var i=32-lr(r)-1;r&=~(1<<i),n+=1;var s=32-lr(e)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,li=1<<32-lr(e)+i|n<<i|r,ui=s+t}else li=1<<s|n<<i|r,ui=t}function vv(t){t.return!==null&&(Os(t,1),NC(t,1,0))}function yv(t){for(;t===Fd;)Fd=Ho[--Wo],Ho[Wo]=null,$d=Ho[--Wo],Ho[Wo]=null;for(;t===Qs;)Qs=Bn[--Un],Bn[Un]=null,ui=Bn[--Un],Bn[Un]=null,li=Bn[--Un],Bn[Un]=null}var Rn=null,Nn=null,ct=!1,or=null;function RC(t,e){var n=Vn(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function yx(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Rn=t,Nn=Qi(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Rn=t,Nn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Qs!==null?{id:li,overflow:ui}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Vn(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Rn=t,Nn=null,!0):!1;default:return!1}}function Fm(t){return(t.mode&1)!==0&&(t.flags&128)===0}function $m(t){if(ct){var e=Nn;if(e){var n=e;if(!yx(t,e)){if(Fm(t))throw Error(J(418));e=Qi(n.nextSibling);var r=Rn;e&&yx(t,e)?RC(r,n):(t.flags=t.flags&-4097|2,ct=!1,Rn=t)}}else{if(Fm(t))throw Error(J(418));t.flags=t.flags&-4097|2,ct=!1,Rn=t}}}function _x(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Rn=t}function Oc(t){if(t!==Rn)return!1;if(!ct)return _x(t),ct=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Lm(t.type,t.memoizedProps)),e&&(e=Nn)){if(Fm(t))throw IC(),Error(J(418));for(;e;)RC(t,e),e=Qi(e.nextSibling)}if(_x(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(J(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Nn=Qi(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Nn=null}}else Nn=Rn?Qi(t.stateNode.nextSibling):null;return!0}function IC(){for(var t=Nn;t;)t=Qi(t.nextSibling)}function Ca(){Nn=Rn=null,ct=!1}function _v(t){or===null?or=[t]:or.push(t)}var KI=xi.ReactCurrentBatchConfig;function _l(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(J(309));var r=n.stateNode}if(!r)throw Error(J(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(a){var l=i.refs;a===null?delete l[s]:l[s]=a},e._stringRef=s,e)}if(typeof t!="string")throw Error(J(284));if(!n._owner)throw Error(J(290,t))}return t}function jc(t,e){throw t=Object.prototype.toString.call(e),Error(J(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function xx(t){var e=t._init;return e(t._payload)}function AC(t){function e(E,T){if(t){var S=E.deletions;S===null?(E.deletions=[T],E.flags|=16):S.push(T)}}function n(E,T){if(!t)return null;for(;T!==null;)e(E,T),T=T.sibling;return null}function r(E,T){for(E=new Map;T!==null;
vendor: 4,333 bytes, line 38
38)T.key!==null?E.set(T.key,T):E.set(T.index,T),T=T.sibling;return E}function i(E,T){return E=ns(E,T),E.index=0,E.sibling=null,E}function s(E,T,S){return E.index=S,t?(S=E.alternate,S!==null?(S=S.index,S<T?(E.flags|=2,T):S):(E.flags|=2,T)):(E.flags|=1048576,T)}function a(E){return t&&E.alternate===null&&(E.flags|=2),E}function l(E,T,S,R){return T===null||T.tag!==6?(T=Fp(S,E.mode,R),T.return=E,T):(T=i(T,S),T.return=E,T)}function c(E,T,S,R){var I=S.type;return I===Fo?p(E,T,S.props.children,R,S.key):T!==null&&(T.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Oi&&xx(I)===T.type)?(R=i(T,S.props),R.ref=_l(E,T,S),R.return=E,R):(R=gd(S.type,S.key,S.props,null,E.mode,R),R.ref=_l(E,T,S),R.return=E,R)}function f(E,T,S,R){return T===null||T.tag!==4||T.stateNode.containerInfo!==S.containerInfo||T.stateNode.implementation!==S.implementation?(T=$p(S,E.mode,R),T.return=E,T):(T=i(T,S.children||[]),T.return=E,T)}function p(E,T,S,R,I){return T===null||T.tag!==7?(T=Ks(S,E.mode,R,I),T.return=E,T):(T=i(T,S),T.return=E,T)}function m(E,T,S){if(typeof T=="string"&&T!==""||typeof T=="number")return T=Fp(""+T,E.mode,S),T.return=E,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case Tc:return S=gd(T.type,T.key,T.props,null,E.mode,S),S.ref=_l(E,null,T),S.return=E,S;case Do:return T=$p(T,E.mode,S),T.return=E,T;case Oi:var R=T._init;return m(E,R(T._payload),S)}if(El(T)||pl(T))return T=Ks(T,E.mode,S,null),T.return=E,T;jc(E,T)}return null}function _(E,T,S,R){var I=T!==null?T.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return I!==null?null:l(E,T,""+S,R);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Tc:return S.key===I?c(E,T,S,R):null;case Do:return S.key===I?f(E,T,S,R):null;case Oi:return I=S._init,_(E,T,I(S._payload),R)}if(El(S)||pl(S))return I!==null?null:p(E,T,S,R,null);jc(E,S)}return null}function x(E,T,S,R,I){if(typeof R=="string"&&R!==""||typeof R=="number")return E=E.get(S)||null,l(T,E,""+R,I);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case Tc:return E=E.get(R.key===null?S:R.key)||null,c(T,E,R,I);case Do:return E=E.get(R.key===null?S:R.key)||null,f(T,E,R,I);case Oi:var M=R._init;return x(E,T,S,M(R._payload),I)}if(El(R)||pl(R))return E=E.get(S)||null,p(T,E,R,I,null);jc(T,R)}return null}function P(E,T,S,R){for(var I=null,M=null,O=T,D=T=0,K=null;O!==null&&D<S.length;D++){O.index>D?(K=O,O=null):K=O.sibling;var q=_(E,O,S[D],R);if(q===null){O===null&&(O=K);break}t&&O&&q.alternate===null&&e(E,O),T=s(q,T,D),M===null?I=q:M.sibling=q,M=q,O=K}if(D===S.length)return n(E,O),ct&&Os(E,D),I;if(O===null){for(;D<S.length;D++)O=m(E,S[D],R),O!==null&&(T=s(O,T,D),M===null?I=O:M.sibling=O,M=O);return ct&&Os(E,D),I}for(O=r(E,O);D<S.length;D++)K=x(O,E,D,S[D],R),K!==null&&(t&&K.alternate!==null&&O.delete(K.key===null?D:K.key),T=s(K,T,D),M===null?I=K:M.sibling=K,M=K);return t&&O.forEach(function(ne){return e(E,ne)}),ct&&Os(E,D),I}function b(E,T,S,R){var I=pl(S);if(typeof I!="function")throw Error(J(150));if(S=I.call(S),S==null)throw Error(J(151));for(var M=I=null,O=T,D=T=0,K=null,q=S.next();O!==null&&!q.done;D++,q=S.next()){O.index>D?(K=O,O=null):K=O.sibling;var ne=_(E,O,q.value,R);if(ne===null){O===null&&(O=K);break}t&&O&&ne.alternate===null&&e(E,O),T=s(ne,T,D),M===null?I=ne:M.sibling=ne,M=ne,O=K}if(q.done)return n(E,O),ct&&Os(E,D),I;if(O===null){for(;!q.done;D++,q=S.next())q=m(E,q.value,R),q!==null&&(T=s(q,T,D),M===null?I=q:M.sibling=q,M=q);return ct&&Os(E,D),I}for(O=r(E,O);!q.done;D++,q=S.next())q=x(O,E,D,q.value,R),q!==null&&(t&&q.alternate!==null&&O.delete(q.key===null?D:q.key),T=s(q,T,D),M===null?I=q:M.sibling=q,M=q);return t&&O.forEach(function(W){return e(E,W)}),ct&&Os(E,D),I}function k(E,T,S,R){if(typeof S=="object"&&S!==null&&S.type===Fo&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Tc:e:{for(var I=S.key,M=T;M!==null;){if(M.key===I){if(I=S.type,I===Fo){if(M.tag===7){n(E,M.sibling),T=i(M,S.props.children),T.return=E,E=T;break e}}else if(M.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Oi&&xx(I)===M.type){n(E,M.sibling),T=i(M,S.props),T.ref=_l(E,M,S),T.return=E,E=T;break e}n(E,M);break}else e(E,M);M=M.sibling}S.type===Fo?(T=Ks(S.props.children,E.mode,R,S.key),T.return=E,E=T):(R=gd(S.type,S.key,S.props,null,E.mode,R),R.ref=_l(E,T,S),R.return=E,E=R)}return a(E);case Do:e:{for(M=S.key;T!==null;
vendor: 17,658 bytes, lines 38-40
38){if(T.key===M)if(T.tag===4&&T.stateNode.containerInfo===S.containerInfo&&T.stateNode.implementation===S.implementation){n(E,T.sibling),T=i(T,S.children||[]),T.return=E,E=T;break e}else{n(E,T);break}else e(E,T);T=T.sibling}T=$p(S,E.mode,R),T.return=E,E=T}return a(E);case Oi:return M=S._init,k(E,T,M(S._payload),R)}if(El(S))return P(E,T,S,R);if(pl(S))return b(E,T,S,R);jc(E,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,T!==null&&T.tag===6?(n(E,T.sibling),T=i(T,S),T.return=E,E=T):(n(E,T),T=Fp(S,E.mode,R),T.return=E,E=T),a(E)):n(E,T)}return k}var Sa=AC(!0),MC=AC(!1),zd=gs(null),Bd=null,Zo=null,xv=null;function wv(){xv=Zo=Bd=null}function bv(t){var e=zd.current;lt(zd),t._currentValue=e}function zm(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function ra(t,e){Bd=t,xv=Zo=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(yn=!0),t.firstContext=null)}function Zn(t){var e=t._currentValue;if(xv!==t)if(t={context:t,memoizedValue:e,next:null},Zo===null){if(Bd===null)throw Error(J(308));Zo=t,Bd.dependencies={lanes:0,firstContext:t}}else Zo=Zo.next=t;return e}var Bs=null;function Cv(t){Bs===null?Bs=[t]:Bs.push(t)}function LC(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Cv(e)):(n.next=i.next,i.next=n),e.interleaved=n,mi(t,r)}function mi(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var ji=!1;function Sv(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function OC(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ci(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Xi(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,ze&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,mi(t,n)}return i=r.interleaved,i===null?(e.next=e,Cv(r)):(e.next=i.next,i.next=e),r.interleaved=e,mi(t,n)}function cd(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,uv(t,n)}}function wx(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Ud(t,e,n,r){var i=t.updateQueue;ji=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,f=c.next;c.next=null,a===null?s=f:a.next=f,a=c;var p=t.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==a&&(l===null?p.firstBaseUpdate=f:l.next=f,p.lastBaseUpdate=c))}if(s!==null){var m=i.baseState;a=0,p=f=c=null,l=s;do{var _=l.lane,x=l.eventTime;if((r&_)===_){p!==null&&(p=p.next={eventTime:x,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var P=t,b=l;switch(_=e,x=n,b.tag){case 1:if(P=b.payload,typeof P=="function"){m=P.call(x,m,_);break e}m=P;break e;case 3:P.flags=P.flags&-65537|128;case 0:if(P=b.payload,_=typeof P=="function"?P.call(x,m,_):P,_==null)break e;m=gt({},m,_);break e;case 2:ji=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,_=i.effects,_===null?i.effects=[l]:_.push(l))}else x={eventTime:x,lane:_,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(f=p=x,c=m):p=p.next=x,a|=_;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;_=l,l=_.next,_.next=null,i.lastBaseUpdate=_,i.shared.pending=null}}while(!0);if(p===null&&(c=m),i.baseState=c,i.firstBaseUpdate=f,i.lastBaseUpdate=p,e=i.shared.interleaved,e!==null){i=e;do a|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);eo|=a,t.lanes=a,t.memoizedState=m}}function bx(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(J(191,i));i.call(r)}}}var zu={},Fr=gs(zu),ru=gs(zu),iu=gs(zu);function Us(t){if(t===zu)throw Error(J(174));return t}function Tv(t,e){switch(it(iu,e),it(ru,t),it(Fr,zu),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:xm(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=xm(e,t)}lt(Fr),it(Fr,e)}function Ta(){lt(Fr),lt(ru),lt(iu)}function jC(t){Us(iu.current);var e=Us(Fr.current),n=xm(e,t.type);e!==n&&(it(ru,t),it(Fr,n))}function Ev(t){ru.current===t&&(lt(Fr),lt(ru))}var ht=gs(0);function Vd(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 Ap=[];function Pv(){for(var t=0;t<Ap.length;t++)Ap[t]._workInProgressVersionPrimary=null;Ap.length=0}var dd=xi.ReactCurrentDispatcher,Mp=xi.ReactCurrentBatchConfig,Xs=0,pt=null,Tt=null,Mt=null,Hd=!1,Fl=!1,su=0,YI=0;function Ut(){throw Error(J(321))}function kv(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!dr(t[n],e[n]))return!1;return!0}function Nv(t,e,n,r,i,s){if(Xs=s,pt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,dd.current=t===null||t.memoizedState===null?eA:tA,t=n(r,i),Fl){s=0;do{if(Fl=!1,su=0,25<=s)throw Error(J(301));s+=1,Mt=Tt=null,e.updateQueue=null,dd.current=nA,t=n(r,i)}while(Fl)}if(dd.current=Wd,e=Tt!==null&&Tt.next!==null,Xs=0,Mt=Tt=pt=null,Hd=!1,e)throw Error(J(300));return t}function Rv(){var t=su!==0;return su=0,t}function kr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?pt.memoizedState=Mt=t:Mt=Mt.next=t,Mt}function qn(){if(Tt===null){var t=pt.alternate;t=t!==null?t.memoizedState:null}else t=Tt.next;var e=Mt===null?pt.memoizedState:Mt.next;if(e!==null)Mt=e,Tt=t;else{if(t===null)throw Error(J(310));Tt=t,t={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Mt===null?pt.memoizedState=Mt=t:Mt=Mt.next=t}return Mt}function ou(t,e){return typeof e=="function"?e(t):e}function Lp(t){var e=qn(),n=e.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=t;var r=Tt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var l=a=null,c=null,f=s;do{var p=f.lane;if((Xs&p)===p)c!==null&&(c=c.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),r=f.hasEagerState?f.eagerState:t(r,f.action);else{var m={lane:p,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};c===null?(l=c=m,a=r):c=c.next=m,pt.lanes|=p,eo|=p}f=f.next}while(f!==null&&f!==s);c===null?a=r:c.next=l,dr(r,e.memoizedState)||(yn=!0),e.memoizedState=r,e.baseState=a,e.baseQueue=c,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,pt.lanes|=s,eo|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Op(t){var e=qn(),n=e.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do s=t(s,a.action),a=a.next;while(a!==i);dr(s,e.memoizedState)||(yn=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function DC(){}function FC(t,e){var n=pt,r=qn(),i=e(),s=!dr(r.memoizedState,i);if(s&&(r.memoizedState=i,yn=!0),r=r.queue,Iv(BC.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||Mt!==null&&Mt.memoizedState.tag&1){if(n.flags|=2048,au(9,zC.bind(null,n,r,i,e),void 0,null),Lt===null)throw Error(J(349));Xs&30||$C(n,e,i)}return i}function $C(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=pt.updateQueue,e===null?(e={lastEffect:null,stores:null},pt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function zC(t,e,n,r){e.value=n,e.getSnapshot=r,UC(e)&&VC(t)}function BC(t,e,n){return n(function(){UC(e)&&VC(t)})}function UC(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!dr(t,n)}catch{return!0}}function VC(t){var e=mi(t,1);e!==null&&ur(e,t,1,-1)}function Cx(t){var e=kr();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ou,lastRenderedState:t},e.queue=t,t=t.dispatch=XI.bind(null,pt,t),[e.memoizedState,t]}function au(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=pt.updateQueue,e===null?(e={lastEffect:null,stores:null},pt.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function HC(){return qn().memoizedState}function fd(t,e,n,r){var i=kr();pt.flags|=t,i.memoizedState=au(1|e,n,void 0,r===void 0?null:r)}function Rf(t,e,n,r){var i=qn();r=r===void 0?null:r;var s=void 0;if(Tt!==null){var a=Tt.memoizedState;if(s=a.destroy,r!==null&&kv(r,a.deps)){i.memoizedState=au(e,n,s,r);return}}pt.flags|=t,i.memoizedState=au(1|e,n,s,r)}function Sx(t,e){return fd(8390656,8,t,e)}function Iv(t,e){return Rf(2048,8,t,e)}function WC(t,e){return Rf(4,2,t,e)}function ZC(t,e){return Rf(4,4,t,e)}function qC(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 GC(t,e,n){return n=n!=null?n.concat([t]):null,Rf(4,4,qC.bind(null,e,t),n)}function Av(){}function KC(t,e){var n=qn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&kv(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function YC(t,e){var n=qn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&kv(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function JC(t,e,n){return Xs&21?(dr(n,e)||(n=nC(),pt.lanes|=n,eo|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,yn=!0),t.memoizedState=n)}function JI(t,e){var n=Ye;Ye=n!==0&&4>n?n:4,t(!0);var r=Mp.transition;Mp.transition={};try{t(!1),e()}finally{Ye=n,Mp.transition=r}}function QC(){return qn().memoizedState}function QI(t,e,n){var r=ts(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},XC(t))eS(e,n);else if(n=LC(t,e,n,r),n!==null){var i=on();ur(n,t,r,i),tS(n,e,r)}}function XI(t,e,n){var r=ts(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(XC(t))eS(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,l=s(a,n);if(i.hasEagerState=!0,i.eagerState=l,dr(l,a)){var c=e.interleaved;c===null?(i.next=i,Cv(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}n=LC(t,e,i,r),n!==null&&(i=on(),ur(n,t,r,i),tS(n,e,r))}}function XC(t){var e=t.alternate;return t===pt||e!==null&&e===pt}function eS(t,e){Fl=Hd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function tS(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,uv(t,n)}}var Wd={readContext:Zn,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useInsertionEffect:Ut,useLayoutEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useMutableSource:Ut,useSyncExternalStore:Ut,useId:Ut,unstable_isNewReconciler:!1},eA={readContext:Zn,useCallback:function(t,e){return kr().memoizedState=[t,e===void 0?null:e],t},useContext:Zn,useEffect:Sx,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,fd(4194308,4,qC.bind(null,e,t),n)},useLayoutEffect:function(t,e){return fd(4194308,4,t,e)},useInsertionEffect:function(t,e){return fd(4,2,t,e)},useMemo:function(t,e){var n=kr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=kr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=QI.bind(null,pt,t),[r.memoizedState,t]},useRef:function(t){var e=kr();return t={current:t},e.memoizedState=t},useState:Cx,useDebugValue:Av,useDeferredValue:function(t){return kr().memoizedState=t},useTransition:function(){var t=Cx(!1),e=t[0];return t=JI.bind(null,t[1]),kr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=pt,i=kr();if(ct){if(n===void 0)throw Error(J(407));n=n()}else{if(n=e(),Lt===null)throw Error(J(349));Xs&30||$C(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,Sx(BC.bind(null,r,s,t),[t]),r.flags|=2048,au(9,zC.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=kr(),e=Lt.identifierPrefix;if(ct){var n=ui,r=li;n=(r&~(1<<32-lr(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=su++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=YI++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},tA={readContext:Zn,useCallback:KC,useContext:Zn,useEffect:Iv,useImperativeHandle:GC,useInsertionEffect:WC,useLayoutEffect:ZC,useMemo:YC,useReducer:Lp,useRef:HC,useState:function(){return Lp(ou)},useDebugValue:Av,useDeferredValue:function(t){var e=qn();return JC(e,Tt.memoizedState,t)},useTransition:function(){var t=Lp(ou)[0],e=qn().memoizedState;return[t,e]},useMutableSource:DC,useSyncExternalStore:FC,useId:QC,unstable_isNewReconciler:!1},nA={readContext:Zn,useCallback:KC,useContext:Zn,useEffect:Iv,useImperativeHandle:GC,useInsertionEffect:WC,useLayoutEffect:ZC,useMemo:YC,useReducer:Op,useRef:HC,useState:function(){return Op(ou)},useDebugValue:Av,useDeferredValue:function(t){var e=qn();return Tt===null?e.memoizedState=t:JC(e,Tt.memoizedState,t)},useTransition:function(){var t=Op(ou)[0],e=qn().memoizedState;return[t,e]},useMutableSource:DC,useSyncExternalStore:FC,useId:QC,unstable_isNewReconciler:!1};function er(t,e){if(t&&t.defaultProps){e=gt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Bm(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:gt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var If={isMounted:function(t){return(t=t._reactInternals)?co(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=on(),i=ts(t),s=ci(r,i);s.payload=e,n!=null&&(s.callback=n),e=Xi(t,s,i),e!==null&&(ur(e,t,i,r),cd(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=on(),i=ts(t),s=ci(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Xi(t,s,i),e!==null&&(ur(e,t,i,r),cd(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=on(),r=ts(t),i=ci(n,r);i.tag=2,e!=null&&(i.callback=e),e=Xi(t,i,r),e!==null&&(ur(e,t,r,n),cd(e,t,r))}};function Tx(t,e,n,r,i,s,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,a):e.prototype&&e.prototype.isPureReactComponent?!Xl(n,r)||!Xl(i,s):!0}function nS(t,e,n){var r=!1,i=ss,s=e.contextType;return typeof s=="object"&&s!==null?s=Zn(s):(i=xn(e)?Js:Zt.current,r=e.contextTypes,s=(r=r!=null)?ba(t,i):ss),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=If,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function Ex(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&If.enqueueReplaceState(e,e.state,null)}function Um(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},Sv(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Zn(s):(s=xn(e)?Js:Zt.current,i.context=ba(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(Bm(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&If.enqueueReplaceState(i,i.state,null),Ud(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Ea(t,e){try{var n="",r=e;do n+=RR(r),r=r.return;while(r);var i=n}catch(s){i=` 39Error generating stack: `+s.message+` 40`+s.stack}return{value:t,source:e,stack:i,digest:null}}function jp(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Vm(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var rA=typeof WeakMap=="function"?WeakMap:Map;function rS(t,e,n){n=ci(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){qd||(qd=!0,Xm=r),Vm(t,e)},n}function iS(t,e,n){n=ci(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Vm(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Vm(t,e),t
vendor: 7,622 bytes, line 40
40ypeof r!="function"&&(es===null?es=new Set([this]):es.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function Px(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new rA;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=vA.bind(null,t,e,n),e.then(t,t))}function kx(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 Nx(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=ci(-1,1),e.tag=2,Xi(n,e,1))),n.lanes|=1),t)}var iA=xi.ReactCurrentOwner,yn=!1;function tn(t,e,n,r){e.child=t===null?MC(e,null,n,r):Sa(e,t.child,n,r)}function Rx(t,e,n,r,i){n=n.render;var s=e.ref;return ra(e,i),r=Nv(t,e,n,r,s,i),n=Rv(),t!==null&&!yn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,gi(t,e,i)):(ct&&n&&vv(e),e.flags|=1,tn(t,e,r,i),e.child)}function Ix(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!zv(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,sS(t,e,s,r,i)):(t=gd(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:Xl,n(a,r)&&t.ref===e.ref)return gi(t,e,i)}return e.flags|=1,t=ns(s,r),t.ref=e.ref,t.return=e,e.child=t}function sS(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(Xl(s,r)&&t.ref===e.ref)if(yn=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(yn=!0);else return e.lanes=t.lanes,gi(t,e,i)}return Hm(t,e,n,r,i)}function oS(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},it(Go,En),En|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,it(Go,En),En|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,it(Go,En),En|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,it(Go,En),En|=r;return tn(t,e,i,n),e.child}function aS(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Hm(t,e,n,r,i){var s=xn(n)?Js:Zt.current;return s=ba(e,s),ra(e,i),n=Nv(t,e,n,r,s,i),r=Rv(),t!==null&&!yn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,gi(t,e,i)):(ct&&r&&vv(e),e.flags|=1,tn(t,e,n,i),e.child)}function Ax(t,e,n,r,i){if(xn(n)){var s=!0;Dd(e)}else s=!1;if(ra(e,i),e.stateNode===null)hd(t,e),nS(e,n,r),Um(e,n,r,i),r=!0;else if(t===null){var a=e.stateNode,l=e.memoizedProps;a.props=l;var c=a.context,f=n.contextType;typeof f=="object"&&f!==null?f=Zn(f):(f=xn(n)?Js:Zt.current,f=ba(e,f));var p=n.getDerivedStateFromProps,m=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function";m||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==f)&&Ex(e,a,r,f),ji=!1;var _=e.memoizedState;a.state=_,Ud(e,r,a,i),c=e.memoizedState,l!==r||_!==c||_n.current||ji?(typeof p=="function"&&(Bm(e,n,p,r),c=e.memoizedState),(l=ji||Tx(e,n,l,r,_,c,f))?(m||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=r,e.memoizedState=c),a.props=r,a.state=c,a.context=f,r=l):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{a=e.stateNode,OC(t,e),l=e.memoizedProps,f=e.type===e.elementType?l:er(e.type,l),a.props=f,m=e.pendingProps,_=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=Zn(c):(c=xn(n)?Js:Zt.current,c=ba(e,c));var x=n.getDerivedStateFromProps;(p=typeof x=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==m||_!==c)&&Ex(e,a,r,c),ji=!1,_=e.memoizedState,a.state=_,Ud(e,r,a,i);var P=e.memoizedState;l!==m||_!==P||_n.current||ji?(typeof x=="function"&&(Bm(e,n,x,r),P=e.memoizedState),(f=ji||Tx(e,n,f,r,_,P,c)||!1)?(p||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,P,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,P,c)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===t.memoizedProps&&_===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&_===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=P),a.props=r,a.state=P,a.context=c,r=f):(typeof a.componentDidUpdate!="function"||l===t.memoizedProps&&_===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&_===t.memoizedState||(e.flags|=1024),r=!1)}return Wm(t,e,n,r,s,i)}function Wm(t,e,n,r,i,s){aS(t,e);var a=(e.flags&128)!==0;if(!r&&!a)return i&&vx(e,n,!1),gi(t,e,s);r=e.stateNode,iA.current=e;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&a?(e.child=Sa(e,t.child,null,s),e.child=Sa(e,null,l,s)):tn(t,e,l,s),e.memoizedState=r.state,i&&vx(e,n,!0),e.child}function lS(t){var e=t.stateNode;e.pendingContext?gx(t,e.pendingContext,e.pendingContext!==e.context):e.context&&gx(t,e.context,!1),Tv(t,e.containerInfo)}function Mx(t,e,n,r,i){return Ca(),_v(i),e.flags|=256,tn(t,e,n,r),e.child}var Zm={dehydrated:null,treeContext:null,retryLane:0};function qm(t){return{baseLanes:t,cachePool:null,transitions:null}}function uS(t,e,n){var r=e.pendingProps,i=ht.current,s=!1,a=(e.flags&128)!==0,l;if((l=a)||(l=t!==null&&t.memoizedState===null?!1:(i&2)!==0),l?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),it(ht,i&1),t===null)return $m(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=r.children,t=r.fallback,s?(r=e.mode,s=e.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=Lf(a,r,0,null),t=Ks(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=qm(n),e.memoizedState=Zm,t):Mv(e,a));if(i=t.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return sA(t,e,a,r,l,i,n);if(s){s=r.fallback,a=e.mode,i=t.child,l=i.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=ns(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=ns(l,s):(s=Ks(s,a,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,a=t.child.memoizedState,a=a===null?qm(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=t.childLanes&~n,e.memoizedState=Zm,r}return s=t.child,t=s.sibling,r=ns(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Mv(t,e){return e=Lf({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Dc(t,e,n,r){return r!==null&&_v(r),Sa(e,t.child,null,n),t=Mv(e,e.pen
vendor: 6,812 bytes, line 40
40dingProps.children),t.flags|=2,e.memoizedState=null,t}function sA(t,e,n,r,i,s,a){if(n)return e.flags&256?(e.flags&=-257,r=jp(Error(J(422))),Dc(t,e,a,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Lf({mode:"visible",children:r.children},i,0,null),s=Ks(s,i,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&Sa(e,t.child,null,a),e.child.memoizedState=qm(a),e.memoizedState=Zm,s);if(!(e.mode&1))return Dc(t,e,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(J(419)),r=jp(s,r,void 0),Dc(t,e,a,r)}if(l=(a&t.childLanes)!==0,yn||l){if(r=Lt,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,mi(t,i),ur(r,t,i,-1))}return $v(),r=jp(Error(J(421))),Dc(t,e,a,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=yA.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,Nn=Qi(i.nextSibling),Rn=e,ct=!0,or=null,t!==null&&(Bn[Un++]=li,Bn[Un++]=ui,Bn[Un++]=Qs,li=t.id,ui=t.overflow,Qs=e),e=Mv(e,r.children),e.flags|=4096,e)}function Lx(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),zm(t.return,e,n)}function Dp(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function cS(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(tn(t,e,r.children,n),r=ht.current,r&2)r=r&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&&Lx(t,n,e);else if(t.tag===19)Lx(t,n,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}r&=1}if(it(ht,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Vd(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Dp(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Vd(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Dp(e,!0,n,null,s);break;case"together":Dp(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function hd(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function gi(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),eo|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(J(153));if(e.child!==null){for(t=e.child,n=ns(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ns(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function oA(t,e,n){switch(e.tag){case 3:lS(e),Ca();break;case 5:jC(e);break;case 1:xn(e.type)&&Dd(e);break;case 4:Tv(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;it(zd,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(it(ht,ht.current&1),e.flags|=128,null):n&e.child.childLanes?uS(t,e,n):(it(ht,ht.current&1),t=gi(t,e,n),t!==null?t.sibling:null);it(ht,ht.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return cS(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),it(ht,ht.current),r)break;return null;case 22:case 23:return e.lanes=0,oS(t,e,n)}return gi(t,e,n)}var dS,Gm,fS,hS;dS=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Gm=function(){};fS=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Us(Fr.current);var s=null;switch(n){case"input":i=gm(t,i),r=gm(t,r),s=[];break;case"select":i=gt({},i,{value:void 0}),r=gt({},r,{value:void 0}),s=[];break;case"textarea":i=_m(t,i),r=_m(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Od)}wm(n,r);var a;n=null;for(f in i)if(!r.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var l=i[f];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(Zl.hasOwnProperty(f)?s||(s=[]):(s=s||[]).push(f,null));for(f in r){var c=r[f];if(l=i!=null?i[f]:void 0,r.hasOwnProperty(f)&&c!==l&&(c!=null||l!=null))if(f==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(f,n)),n=c;else f==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(s=s||[]).push(f,c)):f==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(f,""+c):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(Zl.hasOwnProperty(f)?(c!=null&&f==="onScroll"&&ot("scroll",t),s||l===c||(s=[])):(s=s||[]).push(f,c))}n&&(s=s||[]).push("style",n);var f=s;(e.updateQueue=f)&&(e.flags|=4)}};hS=function(t,e,n,r){n!==r&&(e.flags|=4)};function xl(t,e){if(!ct)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Vt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function aA(t,e,n){var r=e.pendingProps;switch(yv(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(e),null;case 1:return xn(e.type)&&jd(),Vt(e),null;case 3:return r=e.stateNode,Ta(),lt(_n),lt(Zt),Pv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Oc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,or!==null&&(ng(or),or=null))),Gm
vendor: 31,056 bytes, line 40
40(t,e),Vt(e),null;case 5:Ev(e);var i=Us(iu.current);if(n=e.type,t!==null&&e.stateNode!=null)fS(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(J(166));return Vt(e),null}if(t=Us(Fr.current),Oc(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[Mr]=e,r[nu]=s,t=(e.mode&1)!==0,n){case"dialog":ot("cancel",r),ot("close",r);break;case"iframe":case"object":case"embed":ot("load",r);break;case"video":case"audio":for(i=0;i<kl.length;i++)ot(kl[i],r);break;case"source":ot("error",r);break;case"img":case"image":case"link":ot("error",r),ot("load",r);break;case"details":ot("toggle",r);break;case"input":V_(r,s),ot("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ot("invalid",r);break;case"textarea":W_(r,s),ot("invalid",r)}wm(n,s),i=null;for(var a in s)if(s.hasOwnProperty(a)){var l=s[a];a==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&Lc(r.textContent,l,t),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&Lc(r.textContent,l,t),i=["children",""+l]):Zl.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&ot("scroll",r)}switch(n){case"input":Ec(r),H_(r,s,!0);break;case"textarea":Ec(r),Z_(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Od)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Bb(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=a.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[Mr]=e,t[nu]=r,dS(t,e,!1,!1),e.stateNode=t;e:{switch(a=bm(n,r),n){case"dialog":ot("cancel",t),ot("close",t),i=r;break;case"iframe":case"object":case"embed":ot("load",t),i=r;break;case"video":case"audio":for(i=0;i<kl.length;i++)ot(kl[i],t);i=r;break;case"source":ot("error",t),i=r;break;case"img":case"image":case"link":ot("error",t),ot("load",t),i=r;break;case"details":ot("toggle",t),i=r;break;case"input":V_(t,r),i=gm(t,r),ot("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=gt({},r,{value:void 0}),ot("invalid",t);break;case"textarea":W_(t,r),i=_m(t,r),ot("invalid",t);break;default:i=r}wm(n,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var c=l[s];s==="style"?Hb(t,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Ub(t,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&ql(t,c):typeof c=="number"&&ql(t,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Zl.hasOwnProperty(s)?c!=null&&s==="onScroll"&&ot("scroll",t):c!=null&&rv(t,s,c,a))}switch(n){case"input":Ec(t),H_(t,r,!1);break;case"textarea":Ec(t),Z_(t);break;case"option":r.value!=null&&t.setAttribute("value",""+is(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?Xo(t,!!r.multiple,s,!1):r.defaultValue!=null&&Xo(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Od)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Vt(e),null;case 6:if(t&&e.stateNode!=null)hS(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(J(166));if(n=Us(iu.current),Us(Fr.current),Oc(e)){if(r=e.stateNode,n=e.memoizedProps,r[Mr]=e,(s=r.nodeValue!==n)&&(t=Rn,t!==null))switch(t.tag){case 3:Lc(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Lc(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Mr]=e,e.stateNode=r}return Vt(e),null;case 13:if(lt(ht),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ct&&Nn!==null&&e.mode&1&&!(e.flags&128))IC(),Ca(),e.flags|=98560,s=!1;else if(s=Oc(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(J(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(J(317));s[Mr]=e}else Ca(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Vt(e),s=!1}else or!==null&&(ng(or),or=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||ht.current&1?Pt===0&&(Pt=3):$v())),e.updateQueue!==null&&(e.flags|=4),Vt(e),null);case 4:return Ta(),Gm(t,e),t===null&&eu(e.stateNode.containerInfo),Vt(e),null;case 10:return bv(e.type._context),Vt(e),null;case 17:return xn(e.type)&&jd(),Vt(e),null;case 19:if(lt(ht),s=e.memoizedState,s===null)return Vt(e),null;if(r=(e.flags&128)!==0,a=s.rendering,a===null)if(r)xl(s,!1);else{if(Pt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=Vd(t),a!==null){for(e.flags|=128,xl(s,!1),r=a.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,t=a.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return it(ht,ht.current&1|2),e.child}t=t.sibling}s.tail!==null&&wt()>Pa&&(e.flags|=128,r=!0,xl(s,!1),e.lanes=4194304)}else{if(!r)if(t=Vd(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),xl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!ct)return Vt(e),null}else 2*wt()-s.renderingStartTime>Pa&&n!==1073741824&&(e.flags|=128,r=!0,xl(s,!1),e.lanes=4194304);s.isBackwards?(a.sibling=e.child,e.child=a):(n=s.last,n!==null?n.sibling=a:e.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=wt(),e.sibling=null,n=ht.current,it(ht,r?n&1|2:n&1),e):(Vt(e),null);case 22:case 23:return Fv(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?En&1073741824&&(Vt(e),e.subtreeFlags&6&&(e.flags|=8192)):Vt(e),null;case 24:return null;case 25:return null}throw Error(J(156,e.tag))}function lA(t,e){switch(yv(e),e.tag){case 1:return xn(e.type)&&jd(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ta(),lt(_n),lt(Zt),Pv(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Ev(e),null;case 13:if(lt(ht),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(J(340));Ca()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return lt(ht),null;case 4:return Ta(),null;case 10:return bv(e.type._context),null;case 22:case 23:return Fv(),null;case 24:return null;default:return null}}var Fc=!1,Wt=!1,uA=typeof WeakSet=="function"?WeakSet:Set,de=null;function qo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){yt(t,e,r)}else n.current=null}function Km(t,e,n){try{n()}catch(r){yt(t,e,r)}}var Ox=!1;function cA(t,e){if(Am=Ad,t=yC(),gv(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,f=0,p=0,m=t,_=null;t:for(;;){for(var x;m!==n||i!==0&&m.nodeType!==3||(l=a+i),m!==s||r!==0&&m.nodeType!==3||(c=a+r),m.nodeType===3&&(a+=m.nodeValue.length),(x=m.firstChild)!==null;)_=m,m=x;for(;;){if(m===t)break t;if(_===n&&++f===i&&(l=a),_===s&&++p===r&&(c=a),(x=m.nextSibling)!==null)break;m=_,_=m.parentNode}m=x}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Mm={focusedElem:t,selectionRange:n},Ad=!1,de=e;de!==null;)if(e=de,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,de=t;else for(;de!==null;){e=de;try{var P=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(P!==null){var b=P.memoizedProps,k=P.memoizedState,E=e.stateNode,T=E.getSnapshotBeforeUpdate(e.elementType===e.type?b:er(e.type,b),k);E.__reactInternalSnapshotBeforeUpdate=T}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(R){yt(e,e.return,R)}if(t=e.sibling,t!==null){t.return=e.return,de=t;break}de=e.return}return P=Ox,Ox=!1,P}function $l(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Km(e,n,s)}i=i.next}while(i!==r)}}function Af(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Ym(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function pS(t){var e=t.alternate;e!==null&&(t.alternate=null,pS(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Mr],delete e[nu],delete e[jm],delete e[ZI],delete e[qI])),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 mS(t){return t.tag===5||t.tag===3||t.tag===4}function jx(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||mS(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 Jm(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Od));else if(r!==4&&(t=t.child,t!==null))for(Jm(t,e,n),t=t.sibling;t!==null;)Jm(t,e,n),t=t.sibling}function Qm(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Qm(t,e,n),t=t.sibling;t!==null;)Qm(t,e,n),t=t.sibling}var Dt=null,ir=!1;function Pi(t,e,n){for(n=n.child;n!==null;)gS(t,e,n),n=n.sibling}function gS(t,e,n){if(Dr&&typeof Dr.onCommitFiberUnmount=="function")try{Dr.onCommitFiberUnmount(Sf,n)}catch{}switch(n.tag){case 5:Wt||qo(n,e);case 6:var r=Dt,i=ir;Dt=null,Pi(t,e,n),Dt=r,ir=i,Dt!==null&&(ir?(t=Dt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Dt.removeChild(n.stateNode));break;case 18:Dt!==null&&(ir?(t=Dt,n=n.stateNode,t.nodeType===8?Rp(t.parentNode,n):t.nodeType===1&&Rp(t,n),Jl(t)):Rp(Dt,n.stateNode));break;case 4:r=Dt,i=ir,Dt=n.stateNode.containerInfo,ir=!0,Pi(t,e,n),Dt=r,ir=i;break;case 0:case 11:case 14:case 15:if(!Wt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&Km(n,e,a),i=i.next}while(i!==r)}Pi(t,e,n);break;case 1:if(!Wt&&(qo(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){yt(n,e,l)}Pi(t,e,n);break;case 21:Pi(t,e,n);break;case 22:n.mode&1?(Wt=(r=Wt)||n.memoizedState!==null,Pi(t,e,n),Wt=r):Pi(t,e,n);break;default:Pi(t,e,n)}}function Dx(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new uA),e.forEach(function(r){var i=_A.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Jn(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,a=e,l=a;e:for(;l!==null;){switch(l.tag){case 5:Dt=l.stateNode,ir=!1;break e;case 3:Dt=l.stateNode.containerInfo,ir=!0;break e;case 4:Dt=l.stateNode.containerInfo,ir=!0;break e}l=l.return}if(Dt===null)throw Error(J(160));gS(s,a,i),Dt=null,ir=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(f){yt(i,e,f)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)vS(e,t),e=e.sibling}function vS(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Jn(e,t),Er(t),r&4){try{$l(3,t,t.return),Af(3,t)}catch(b){yt(t,t.return,b)}try{$l(5,t,t.return)}catch(b){yt(t,t.return,b)}}break;case 1:Jn(e,t),Er(t),r&512&&n!==null&&qo(n,n.return);break;case 5:if(Jn(e,t),Er(t),r&512&&n!==null&&qo(n,n.return),t.flags&32){var i=t.stateNode;try{ql(i,"")}catch(b){yt(t,t.return,b)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,a=n!==null?n.memoizedProps:s,l=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&$b(i,s),bm(l,a);var f=bm(l,s);for(a=0;a<c.length;a+=2){var p=c[a],m=c[a+1];p==="style"?Hb(i,m):p==="dangerouslySetInnerHTML"?Ub(i,m):p==="children"?ql(i,m):rv(i,p,m,f)}switch(l){case"input":vm(i,s);break;case"textarea":zb(i,s);break;case"select":var _=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var x=s.value;x!=null?Xo(i,!!s.multiple,x,!1):_!==!!s.multiple&&(s.defaultValue!=null?Xo(i,!!s.multiple,s.defaultValue,!0):Xo(i,!!s.multiple,s.multiple?[]:"",!1))}i[nu]=s}catch(b){yt(t,t.return,b)}}break;case 6:if(Jn(e,t),Er(t),r&4){if(t.stateNode===null)throw Error(J(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(b){yt(t,t.return,b)}}break;case 3:if(Jn(e,t),Er(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Jl(e.containerInfo)}catch(b){yt(t,t.return,b)}break;case 4:Jn(e,t),Er(t);break;case 13:Jn(e,t),Er(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(jv=wt())),r&4&&Dx(t);break;case 22:if(p=n!==null&&n.memoizedState!==null,t.mode&1?(Wt=(f=Wt)||p,Jn(e,t),Wt=f):Jn(e,t),Er(t),r&8192){if(f=t.memoizedState!==null,(t.stateNode.isHidden=f)&&!p&&t.mode&1)for(de=t,p=t.child;p!==null;){for(m=de=p;de!==null;){switch(_=de,x=_.child,_.tag){case 0:case 11:case 14:case 15:$l(4,_,_.return);break;case 1:qo(_,_.return);var P=_.stateNode;if(typeof P.componentWillUnmount=="function"){r=_,n=_.return;try{e=r,P.props=e.memoizedProps,P.state=e.memoizedState,P.componentWillUnmount()}catch(b){yt(r,n,b)}}break;case 5:qo(_,_.return);break;case 22:if(_.memoizedState!==null){$x(m);continue}}x!==null?(x.return=_,de=x):$x(m)}p=p.sibling}e:for(p=null,m=t;;){if(m.tag===5){if(p===null){p=m;try{i=m.stateNode,f?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=m.stateNode,c=m.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Vb("display",a))}catch(b){yt(t,t.return,b)}}}else if(m.tag===6){if(p===null)try{m.stateNode.nodeValue=f?"":m.memoizedProps}catch(b){yt(t,t.return,b)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===t)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;p===m&&(p=null),m=m.return}p===m&&(p=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:Jn(e,t),Er(t),r&4&&Dx(t);break;case 21:break;default:Jn(e,t),Er(t)}}function Er(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(mS(n)){var r=n;break e}n=n.return}throw Error(J(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ql(i,""),r.flags&=-33);var s=jx(t);Qm(t,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,l=jx(t);Jm(t,l,a);break;default:throw Error(J(161))}}catch(c){yt(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function dA(t,e,n){de=t,yS(t)}function yS(t,e,n){for(var r=(t.mode&1)!==0;de!==null;){var i=de,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Fc;if(!a){var l=i.alternate,c=l!==null&&l.memoizedState!==null||Wt;l=Fc;var f=Wt;if(Fc=a,(Wt=c)&&!f)for(de=i;de!==null;)a=de,c=a.child,a.tag===22&&a.memoizedState!==null?zx(i):c!==null?(c.return=a,de=c):zx(i);for(;s!==null;)de=s,yS(s),s=s.sibling;de=i,Fc=l,Wt=f}Fx(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,de=s):Fx(t)}}function Fx(t){for(;de!==null;){var e=de;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Wt||Af(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Wt)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:er(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&bx(e,s,r);break;case 3:var a=e.updateQueue;if(a!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}bx(e,a,n)}break;case 5:var l=e.stateNode;if(n===null&&e.flags&4){n=l;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var f=e.alternate;if(f!==null){var p=f.memoizedState;if(p!==null){var m=p.dehydrated;m!==null&&Jl(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}Wt||e.flags&512&&Ym(e)}catch(_){yt(e,e.return,_)}}if(e===t){de=null;break}if(n=e.sibling,n!==null){n.return=e.return,de=n;break}de=e.return}}function $x(t){for(;de!==null;){var e=de;if(e===t){de=null;break}var n=e.sibling;if(n!==null){n.return=e.return,de=n;break}de=e.return}}function zx(t){for(;de!==null;){var e=de;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Af(4,e)}catch(c){yt(e,n,c)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(c){yt(e,i,c)}}var s=e.return;try{Ym(e)}catch(c){yt(e,s,c)}break;case 5:var a=e.return;try{Ym(e)}catch(c){yt(e,a,c)}}}catch(c){yt(e,e.return,c)}if(e===t){de=null;break}var l=e.sibling;if(l!==null){l.return=e.return,de=l;break}de=e.return}}var fA=Math.ceil,Zd=xi.ReactCurrentDispatcher,Lv=xi.ReactCurrentOwner,Wn=xi.ReactCurrentBatchConfig,ze=0,Lt=null,St=null,Ft=0,En=0,Go=gs(0),Pt=0,lu=null,eo=0,Mf=0,Ov=0,zl=null,mn=null,jv=0,Pa=1/0,ni=null,qd=!1,Xm=null,es=null,$c=!1,qi=null,Gd=0,Bl=0,eg=null,pd=-1,md=0;function on(){return ze&6?wt():pd!==-1?pd:pd=wt()}function ts(t){return t.mode&1?ze&2&&Ft!==0?Ft&-Ft:KI.transition!==null?(md===0&&(md=nC()),md):(t=Ye,t!==0||(t=window.event,t=t===void 0?16:uC(t.type)),t):1}function ur(t,e,n,r){if(50<Bl)throw Bl=0,eg=null,Error(J(185));Du(t,n,r),(!(ze&2)||t!==Lt)&&(t===Lt&&(!(ze&2)&&(Mf|=n),Pt===4&&$i(t,Ft)),wn(t,r),n===1&&ze===0&&!(e.mode&1)&&(Pa=wt()+500,Nf&&vs()))}function wn(t,e){var n=t.callbackNode;KR(t,e);var r=Id(t,t===Lt?Ft:0);if(r===0)n!==null&&K_(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&K_(n),e===1)t.tag===0?GI(Bx.bind(null,t)):kC(Bx.bind(null,t)),HI(function(){!(ze&6)&&vs()}),n=null;else{switch(rC(r)){case 1:n=lv;break;case 4:n=eC;break;case 16:n=Rd;break;case 536870912:n=tC;break;default:n=Rd}n=ES(n,_S.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function _S(t,e){if(pd=-1,md=0,ze&6)throw Error(J(327));var n=t.callbackNode;if(ia()&&t.callbackNode!==n)return null;var r=Id(t,t===Lt?Ft:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Kd(t,r);else{e=r;var i=ze;ze|=2;var s=wS();(Lt!==t||Ft!==e)&&(ni=null,Pa=wt()+500,Gs(t,e));do try{mA();break}catch(l){xS(t,l)}while(!0);wv(),Zd.current=s,ze=i,St!==null?e=0:(Lt=null,Ft=0,e=Pt)}if(e!==0){if(e===2&&(i=Pm(t),i!==0&&(r=i,e=tg(t,i))),e===1)throw n=lu,Gs(t,0),$i(t,r),wn(t,wt()),n;if(e===6)$i(t,r);else{if(i=t.current.alternate,!(r&30)&&!hA(i)&&(e=Kd(t,r),e===2&&(s=Pm(t),s!==0&&(r=s,e=tg(t,s))),e===1))throw n=lu,Gs(t,0),$i(t,r),wn(t,wt()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(J(345));case 2:js(t,mn,ni);break;case 3:if($i(t,r),(r&130023424)===r&&(e=jv+500-wt(),10<e)){if(Id(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){on(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Om(js.bind(null,t,mn,ni),e);break}js(t,mn,ni);break;case 4:if($i(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var a=31-lr(r);s=1<<a,a=e[a],a>i&&(i=a),r&=~s}if(r=i,r=wt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fA(r/1960))-r,10<r){t.timeoutHandle=Om(js.bind(null,t,mn,ni),r);break}js(t,mn,ni);break;case 5:js(t,mn,ni);break;default:throw Error(J(329))}}}return wn(t,wt()),t.callbackNode===n?_S.bind(null,t):null}function tg(t,e){var n=zl;return t.current.memoizedState.isDehydrated&&(Gs(t,e).flags|=256),t=Kd(t,e),t!==2&&(e=mn,mn=n,e!==null&&ng(e)),t}function ng(t){mn===null?mn=t:mn.push.apply(mn,t)}function hA(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!dr(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;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 $i(t,e){for(e&=~Ov,e&=~Mf,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-lr(e),r=1<<n;t[n]=-1,e&=~r}}function Bx(t){if(ze&6)throw Error(J(327));ia();var e=Id(t,0);if(!(e&1))return wn(t,wt()),null;var n=Kd(t,e);if(t.tag!==0&&n===2){var r=Pm(t);r!==0&&(e=r,n=tg(t,r))}if(n===1)throw n=lu,Gs(t,0),$i(t,e),wn(t,wt()),n;if(n===6)throw Error(J(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,js(t,mn,ni),wn(t,wt()),null}function Dv(t,e){var n=ze;ze|=1;try{return t(e)}finally{ze=n,ze===0&&(Pa=wt()+500,Nf&&vs())}}function to(t){qi!==null&&qi.tag===0&&!(ze&6)&&ia();var e=ze;ze|=1;var n=Wn.transition,r=Ye;try{if(Wn.transition=null,Ye=1,t)return t()}finally{Ye=r,Wn.transition=n,ze=e,!(ze&6)&&vs()}}function Fv(){En=Go.current,lt(Go)}function Gs(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,VI(n)),St!==null)for(n=St.return;n!==null;){var r=n;switch(yv(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&jd();break;case 3:Ta(),lt(_n),lt(Zt),Pv();break;case 5:Ev(r);break;case 4:Ta();break;case 13:lt(ht);break;case 19:lt(ht);break;case 10:bv(r.type._context);break;case 22:case 23:Fv()}n=n.return}if(Lt=t,St=t=ns(t.current,null),Ft=En=e,Pt=0,lu=null,Ov=Mf=eo=0,mn=zl=null,Bs!==null){for(e=0;e<Bs.length;e++)if(n=Bs[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var a=s.next;s.next=i,r.next=a}n.pending=r}Bs=null}return t}function xS(t,e){do{var n=St;try{if(wv(),dd.current=Wd,Hd){for(var r=pt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Hd=!1}if(Xs=0,Mt=Tt=pt=null,Fl=!1,su=0,Lv.current=null,n===null||n.return===null){Pt=1,lu=e,St=null;break}e:{var s=t,a=n.return,l=n,c=e;if(e=Ft,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=c,p=l,m=p.tag;if(!(p.mode&1)&&(m===0||m===11||m===15)){var _=p.alternate;_?(p.updateQueue=_.updateQueue,p.memoizedState=_.memoizedState,p.lanes=_.lanes):(p.updateQueue=null,p.memoizedState=null)}var x=kx(a);if(x!==null){x.flags&=-257,Nx(x,a,l,s,e),x.mode&1&&Px(s,f,e),e=x,c=f;var P=e.updateQueue;if(P===null){var b=new Set;b.add(c),e.updateQueue=b}else P.add(c);break e}else{if(!(e&1)){Px(s,f,e),$v();break e}c=Error(J(426))}}else if(ct&&l.mode&1){var k=kx(a);if(k!==null){!(k.flags&65536)&&(k.flags|=256),Nx(k,a,l,s,e),_v(Ea(c,l));break e}}s=c=Ea(c,l),Pt!==4&&(Pt=2),zl===null?zl=[s]:zl.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var E=rS(s,c,e);wx(s,E);break e;case 1:l=c;var T=s.type,S=s.stateNode;if(!(s.flags&128)&&(typeof T.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(es===null||!es.has(S)))){s.flags|=65536,e&=-e,s.lanes|=e;var R=iS(s,l,e);wx(s,R);break e}}s=s.return}while(s!==null)}CS(n)}catch(I){e=I,St===n&&n!==null&&(St=n=n.return);continue}break}while(!0)}function wS(){var t=Zd.current;return Zd.current=Wd,t===null?Wd:t}function $v(){(Pt===0||Pt===3||Pt===2)&&(Pt=4),Lt===null||!(eo&268435455)&&!(Mf&268435455)||$i(Lt,Ft)}function Kd(t,e){var n=ze;ze|=2;var r=wS();(Lt!==t||Ft!==e)&&(ni=null,Gs(t,e));do try{pA();break}catch(i){xS(t,i)}while(!0);if(wv(),ze=n,Zd.current=r,St!==null)throw Error(J(261));return Lt=null,Ft=0,Pt}function pA(){for(;St!==null;)bS(St)}function mA(){for(;St!==null&&!zR();)bS(St)}function bS(t){var e=TS(t.alternate,t,En);t.memoizedProps=t.pendingProps,e===null?CS(t):St=e,Lv.current=null}function CS(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=lA(n,e),n!==null){n.flags&=32767,St=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Pt=6,St=null;return}}else if(n=aA(n,e,En),n!==null){St=n;return}if(e=e.sibling,e!==null){St=e;return}St=e=t}while(e!==null);Pt===0&&(Pt=5)}function js(t,e,n){var r=Ye,i=Wn.transition;try{Wn.transition=null,Ye=1,gA(t,e,n,r)}finally{Wn.transition=i,Ye=r}return null}function gA(t,e,n,r){do ia();while(qi!==null);if(ze&6)throw Error(J(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(J(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(YR(t,s),t===Lt&&(St=Lt=null,Ft=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||$c||($c=!0,ES(Rd,function(){return ia(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Wn.transition,Wn.transition=null;var a=Ye;Ye=1;var l=ze;ze|=4,Lv.current=null,cA(t,n),vS(n,t),jI(Mm),Ad=!!Am,Mm=Am=null,t.current=n,dA(n),BR(),ze=l,Ye=a,Wn.transition=s}else t.current=n;if($c&&($c=!1,qi=t,Gd=i),s=t.pendingLanes,s===0&&(es=null),HR(n.stateNode),wn(t,wt()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(qd)throw qd=!1,t=Xm,Xm=null,t;return Gd&1&&t.tag!==0&&ia(),s=t.pendingLanes,s&1?t===eg?Bl++:(Bl=0,eg=t):Bl=0,vs(),null}function ia(){if(qi!==null){var t=rC(Gd),e=Wn.transition,n=Ye;try{if(Wn.transition=null,Ye=16>t?16:t,qi===null)var r=!1;else{if(t=qi,qi=null,Gd=0,ze&6)throw Error(J(331));var i=ze;for(ze|=4,de=t.current;de!==null;){var s=de,a=s.child;if(de.flags&16){var l=s.deletions;if(l!==null){for(var c=0;c<l.length;c++){var f=l[c];for(de=f;de!==null;){var p=de;switch(p.tag){case 0:case 11:case 15:$l(8,p,s)}var m=p.child;if(m!==null)m.return=p,de=m;else for(;de!==null;){p=de;var _=p.sibling,x=p.return;if(pS(p),p===f){de=null;break}if(_!==null){_.return=x,de=_;break}de=x}}}var P=s.alternate;if(P!==null){var b=P.child;if(b!==null){P.child=null;do{var k=b.sibling;b.sibling=null,b=k}while(b!==null)}}de=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,de=a;else e:for(;de!==null;){if(s=de,s.flags&2048)switch(s.tag){case 0:case 11:case 15:$l(9,s,s.return)}var E=s.sibling;if(E!==null){E.return=s.return,de=E;break e}de=s.return}}var T=t.current;for(de=T;de!==null;){a=de;var S=a.child;if(a.subtreeFlags&2064&&S!==null)S.return=a,de=S;else e:for(a=T;de!==null;){if(l=de,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Af(9,l)}}catch(I){yt(l,l.return,I)}if(l===a){de=null;break e}var R=l.sibling;if(R!==null){R.return=l.return,de=R;break e}de=l.return}}if(ze=i,vs(),Dr&&typeof Dr.onPostCommitFiberRoot=="function")try{Dr.onPostCommitFiberRoot(Sf,t)}catch{}r=!0}return r}finally{Ye=n,Wn.transition=e}}return!1}function Ux(t,e,n){e=Ea(n,e),e=rS(t,e,1),t=Xi(t,e,1),e=on(),t!==null&&(Du(t,1,e),wn(t,e))}function yt(t,e,n){if(t.tag===3)Ux(t,t,n);else for(;e!==null;){if(e.tag===3){Ux(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(es===null||!es.has(r))){t=Ea(n,t),t=iS(e,t,1),e=Xi(e,t,1),t=on(),e!==null&&(Du(e,1,t),wn(e,t));break}}e=e.return}}function vA(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=on(),t.pingedLanes|=t.suspendedLanes&n,Lt===t&&(Ft&n)===n&&(Pt===4||Pt===3&&(Ft&130023424)===Ft&&500>wt()-jv?Gs(t,0):Ov|=n),wn(t,e)}function SS(t,e){e===0&&(t.mode&1?(e=Nc,Nc<<=1,!(Nc&130023424)&&(Nc=4194304)):e=1);var n=on();t=mi(t,e),t!==null&&(Du(t,e,n),wn(t,n))}function yA(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),SS(t,n)}function _A(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(J(314))}r!==null&&r.delete(e),SS(t,n)}var TS;TS=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||_n.current)yn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return yn=!1,oA(t,e,n);yn=!!(t.flags&131072)}else yn=!1,ct&&e.flags&1048576&&NC(e,$d,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;hd(t,e),t=e.pendingProps;var i=ba(e,Zt.current);ra(e,n),i=Nv(null,e,r,t,i,n);var s=Rv();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,xn(r)?(s=!0,Dd(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Sv(e),i.updater=If,e.stateNode=i,i._reactInternals=e,Um(e,r,t,n),e=Wm(null,e,r,!0,s,n)):(e.tag=0,ct&&s&&vv(e),tn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(hd(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=wA(r),t=er(r,t),i){case 0:e=Hm(null,e,r,t,n);break e;case 1:e=Ax(null,e,r,t,n);break e;case 11:e=Rx(null,e,r,t,n);break e;case 14:e=Ix(null,e,r,er(r.type,t),n);break e}throw Error(J(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),Hm(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),Ax(t,e,r,i,n);case 3:e:{if(lS(e),t===null)throw Error(J(387));r=e.pendingProps,s=e.memoizedState,i=s.element,OC(t,e),Ud(e,r,null,n);var a=e.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Ea(Error(J(423)),e),e=Mx(t,e,r,n,i);break e}else if(r!==i){i=Ea(Error(J(424)),e),e=Mx(t,e,r,n,i);break e}else for(Nn=Qi(e.stateNode.containerInfo.firstChild),Rn=e,ct=!0,or=null,n=MC(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ca(),r===i){e=gi(t,e,n);break e}tn(t,e,r,n)}e=e.child}return e;case 5:return jC(e),t===null&&$m(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,a=i.children,Lm(r,i)?a=null:s!==null&&Lm(r,s)&&(e.flags|=32),aS(t,e),tn(t,e,a,n),e.child;case 6:return t===null&&$m(e),null;case 13:return uS(t,e,n);case 4:return Tv(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Sa(e,null,r,n):tn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),Rx(t,e,r,i,n);case 7:return tn(t,e,e.pendingProps,n),e.child;case 8:return tn(t,e,e.pendingProps.children,n),e.child;case 12:return tn(t,e,e.pendingProps.children,n),e.child;
vendor: 7,212 bytes, line 40
40case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,a=i.value,it(zd,r._currentValue),r._currentValue=a,s!==null)if(dr(s.value,a)){if(s.children===i.children&&!_n.current){e=gi(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){a=s.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=ci(-1,n&-n),c.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var p=f.pending;p===null?c.next=c:(c.next=p.next,p.next=c),f.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),zm(s.return,n,e),l.lanes|=n;break}c=c.next}}else if(s.tag===10)a=s.type===e.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(J(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),zm(a,n,e),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}tn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,ra(e,n),i=Zn(i),r=r(i),e.flags|=1,tn(t,e,r,n),e.child;case 14:return r=e.type,i=er(r,e.pendingProps),i=er(r.type,i),Ix(t,e,r,i,n);case 15:return sS(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:er(r,i),hd(t,e),e.tag=1,xn(r)?(t=!0,Dd(e)):t=!1,ra(e,n),nS(e,r,i),Um(e,r,i,n),Wm(null,e,r,!0,t,n);case 19:return cS(t,e,n);case 22:return oS(t,e,n)}throw Error(J(156,e.tag))};function ES(t,e){return Xb(t,e)}function xA(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vn(t,e,n,r){return new xA(t,e,n,r)}function zv(t){return t=t.prototype,!(!t||!t.isReactComponent)}function wA(t){if(typeof t=="function")return zv(t)?1:0;if(t!=null){if(t=t.$$typeof,t===sv)return 11;if(t===ov)return 14}return 2}function ns(t,e){var n=t.alternate;return n===null?(n=Vn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function gd(t,e,n,r,i,s){var a=2;if(r=t,typeof t=="function")zv(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case Fo:return Ks(n.children,i,s,e);case iv:a=8,i|=8;break;case fm:return t=Vn(12,n,e,i|2),t.elementType=fm,t.lanes=s,t;case hm:return t=Vn(13,n,e,i),t.elementType=hm,t.lanes=s,t;case pm:return t=Vn(19,n,e,i),t.elementType=pm,t.lanes=s,t;case jb:return Lf(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Lb:a=10;break e;case Ob:a=9;break e;case sv:a=11;break e;case ov:a=14;break e;case Oi:a=16,r=null;break e}throw Error(J(130,t==null?t:typeof t,""))}return e=Vn(a,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function Ks(t,e,n,r){return t=Vn(7,t,r,e),t.lanes=n,t}function Lf(t,e,n,r){return t=Vn(22,t,r,e),t.elementType=jb,t.lanes=n,t.stateNode={isHidden:!1},t}function Fp(t,e,n){return t=Vn(6,t,null,e),t.lanes=n,t}function $p(t,e,n){return e=Vn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function bA(t,e,n,r,i){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=_p(0),this.expirationTimes=_p(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_p(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Bv(t,e,n,r,i,s,a,l,c){return t=new bA(t,e,n,l,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Vn(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sv(s),t}function CA(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Do,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function PS(t){if(!t)return ss;t=t._reactInternals;e:{if(co(t)!==t||t.tag!==1)throw Error(J(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(xn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(J(171))}if(t.tag===1){var n=t.type;if(xn(n))return PC(t,n,e)}return e}function kS(t,e,n,r,i,s,a,l,c){return t=Bv(n,r,!0,t,i,s,a,l,c),t.context=PS(null),n=t.current,r=on(),i=ts(n),s=ci(r,i),s.callback=e??null,Xi(n,s,i),t.current.lanes=i,Du(t,i,r),wn(t,r),t}function Of(t,e,n,r){var i=e.current,s=on(),a=ts(i);return n=PS(n),e.context===null?e.context=n:e.pendingContext=n,e=ci(s,a),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Xi(i,e,a),t!==null&&(ur(t,i,a,s),cd(t,i,a)),a}function Yd(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 Vx(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Uv(t,e){Vx(t,e),(t=t.alternate)&&Vx(t,e)}function SA(){return null}var NS=typeof reportError=="function"?reportError:function(t){console.error(t)};function Vv(t){this._internalRoot=t}jf.prototype.render=Vv.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(J(409));Of(t,e,null,null)};jf.prototype.unmount=Vv.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;to(function(){Of(null,t,null,null)}),e[pi]=null}};function jf(t){this._internalRoot=t}jf.prototype.unstable_scheduleHydration=function(t){if(t){var e=oC();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Fi.length&&e!==0&&e<Fi[n].priority;n++);Fi.splice(n,0,t),n===0&&lC(t)}};function Hv(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Df(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Hx(){}function TA(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var f=Yd(a);s.call(f)}}var a=kS(e,r,t,0,null,!1,!1,"",Hx);return t._reactRootContainer=a,t[pi]=a.current,eu(t.nodeType===8?t.parentNode:t),to(),a}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var f=Yd(c);l.call(f)}}var c=Bv(t,0,!1,null,null,!1,!1,"",Hx);return t._reactRootContainer=c,t[pi]=c.current,eu(t.nodeType===8?t.parentNode:t),to(function(){Of(e,c,n,r)}),c}function Ff(t,e,n,r,i){var s=n._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var l=i;
vendor: 4,339 bytes, line 40
40i=function(){var c=Yd(a);l.call(c)}}Of(e,a,t,i)}else a=TA(n,e,t,i,r);return Yd(a)}iC=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Pl(e.pendingLanes);n!==0&&(uv(e,n|1),wn(e,wt()),!(ze&6)&&(Pa=wt()+500,vs()))}break;case 13:to(function(){var r=mi(t,1);if(r!==null){var i=on();ur(r,t,1,i)}}),Uv(t,1)}};cv=function(t){if(t.tag===13){var e=mi(t,134217728);if(e!==null){var n=on();ur(e,t,134217728,n)}Uv(t,134217728)}};sC=function(t){if(t.tag===13){var e=ts(t),n=mi(t,e);if(n!==null){var r=on();ur(n,t,e,r)}Uv(t,e)}};oC=function(){return Ye};aC=function(t,e){var n=Ye;try{return Ye=t,e()}finally{Ye=n}};Sm=function(t,e,n){switch(e){case"input":if(vm(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=kf(r);if(!i)throw Error(J(90));Fb(r),vm(r,i)}}}break;case"textarea":zb(t,n);break;case"select":e=n.value,e!=null&&Xo(t,!!n.multiple,e,!1)}};qb=Dv;Gb=to;var EA={usingClientEntryPoint:!1,Events:[$u,Uo,kf,Wb,Zb,Dv]},wl={findFiberByHostInstance:zs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},PA={bundleType:wl.bundleType,version:wl.version,rendererPackageName:wl.rendererPackageName,rendererConfig:wl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:xi.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Jb(t),t===null?null:t.stateNode},findFiberByHostInstance:wl.findFiberByHostInstance||SA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zc.isDisabled&&zc.supportsFiber)try{Sf=zc.inject(PA),Dr=zc}catch{}}On.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=EA;On.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hv(e))throw Error(J(200));return CA(t,e,null,n)};On.createRoot=function(t,e){if(!Hv(t))throw Error(J(299));var n=!1,r="",i=NS;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Bv(t,1,!1,null,null,n,!1,r,i),t[pi]=e.current,eu(t.nodeType===8?t.parentNode:t),new Vv(e)};On.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(J(188)):(t=Object.keys(t).join(","),Error(J(268,t)));return t=Jb(e),t=t===null?null:t.stateNode,t};On.flushSync=function(t){return to(t)};On.hydrate=function(t,e,n){if(!Df(e))throw Error(J(200));return Ff(null,t,e,!0,n)};On.hydrateRoot=function(t,e,n){if(!Hv(t))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",a=NS;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),e=kS(e,null,t,1,n??null,i,!1,s,a),t[pi]=e.current,eu(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new jf(e)};On.render=function(t,e,n){if(!Df(e))throw Error(J(200));return Ff(null,t,e,!1,n)};On.unmountComponentAtNode=function(t){if(!Df(t))throw Error(J(40));return t._reactRootContainer?(to(function(){Ff(null,null,t,!1,function(){t._reactRootContainer=null,t[pi]=null})}),!0):!1};On.unstable_batchedUpdates=Dv;On.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Df(n))throw Error(J(200));if(t==null||t._reactInternals===void 0)throw Error(J(38));return Ff(t,e,n,!1,r)};On.version="18.3.1-next-f1338f8080-20240426";function RS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(RS)}catch(t){console.error(t)}}RS(),Rb.exports=On;var ys=Rb.exports;const IS=Yg(ys);var AS,Wx=ys;AS=Wx.createRoot,Wx.hydrateRoot;
40const kA=1,NA=1e6;let zp=0;function RA(){return zp=(zp+1)%Number.MAX_SAFE_INTEGER,zp.toString()}const Bp=new Map,Zx=t=>{if(Bp.has(t))return;const e=setTimeout(()=>{Bp.delete(t),Ul({type:"REMOVE_TOAST",toastId:t})},NA);Bp.set(t,e)},IA=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,kA)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?Zx(n):t.toasts.forEach(r=>{Zx(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},vd=[];let yd={toasts:[]};function Ul(t){yd=IA(yd,t),vd.forEach(e=>{e(yd)})}function AA({...t}){const e=RA(),n=i=>Ul({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>Ul({type:"DISMISS_TOAST",toastId:e});return Ul({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function _s(){const[t,e]=w.useState(yd);return w.useEffect(()=>(vd.push(e),()=>{const n=vd.indexOf(e);n>-1&&vd.splice(n,1)}),[t]),{...t,toast:AA,dismiss:n=>Ul({type:"DISMISS_TOAST",toastId:n})}}function ve(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function qx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function MS(...t){return e=>{let n=!1;const r=t.map(i=>{const s=qx(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():qx(t[i],null)}}}}function Qe(...t){return w.useCallback(MS(...t),t)}function MA(t,e){const n=w.createContext(e),r=s=>{const{children:a,...l}=s,c=w.useMemo(()=>l,Object.values(l));return d.jsx(n.Provider,{value:c,children:a})};r.displayName=t+"Provider";function i(s){const a=w.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function Hr(t,e=[]){let n=[];function r(s,a){const l=w.createContext(a),c=n.length;n=[...n,a];const f=m=>{var E;const{scope:_,children:x,...P}=m,b=((E=_==null?void 0:_[t])==null?void 0:E[c])||l,k=w.useMemo(()=>P,Object.values(P));return d.jsx(b.Provider,{value:k,children:x})};f.displayName=s+"Provider";function p(m,_){var b;const x=((b=_==null?void 0:_[t])==null?void 0:b[c])||l,P=w.useContext(x);if(P)return P;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${s}\``)}return[f,p]}const i=()=>{const s=n.map(a=>w.createContext(a));return function(l){const c=(l==null?void 0:l[t])||s;return w.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return i.scopeName=t,[r,LA(i,...e)]}function LA(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((l,{useScope:c,scopeName:f})=>{const m=c(s)[`__scope${f}`];return{...l,...m}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function ka(t){const e=OA(t),n=w.forwardRef((r,i)=>{const{children:s,...a}=r,l=w.Children.toArray(s),c=l.find(DA);if(c){const f=c.props.children,p=l.map(m=>m===c?w.Children.count(f)>1?w.Children.only(null):w.isValidElement(f)?f.props.children:null:m);return d.jsx(e,{...a,ref:i,children:w.isValidElement(f)?w.cloneElement(f,void 0,p):null})}return d.jsx(e,{...a,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}var Ba=ka("Slot");function OA(t){const e=w.forwardRef((n,r)=>{const{children:i,...s}=n;if(w.isValidElement(i)){const a=$A(i),l=FA(s,i.props);return i.type!==w.Fragment&&(l.ref=r?MS(r,a):a),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var LS=Symbol("radix.slottable");function jA(t){const e=({children:n})=>d.jsx(d.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=LS,e}function DA(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===LS}function FA(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...l)=>
vendor: 8,014 bytes, line 40
40{s(...l),i(...l)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function $A(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Wv(t){const e=t+"CollectionProvider",[n,r]=Hr(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=b=>{const{scope:k,children:E}=b,T=te.useRef(null),S=te.useRef(new Map).current;return d.jsx(i,{scope:k,itemMap:S,collectionRef:T,children:E})};a.displayName=e;const l=t+"CollectionSlot",c=ka(l),f=te.forwardRef((b,k)=>{const{scope:E,children:T}=b,S=s(l,E),R=Qe(k,S.collectionRef);return d.jsx(c,{ref:R,children:T})});f.displayName=l;const p=t+"CollectionItemSlot",m="data-radix-collection-item",_=ka(p),x=te.forwardRef((b,k)=>{const{scope:E,children:T,...S}=b,R=te.useRef(null),I=Qe(k,R),M=s(p,E);return te.useEffect(()=>(M.itemMap.set(R,{ref:R,...S}),()=>void M.itemMap.delete(R))),d.jsx(_,{[m]:"",ref:I,children:T})});x.displayName=p;function P(b){const k=s(t+"CollectionConsumer",b);return te.useCallback(()=>{const T=k.collectionRef.current;if(!T)return[];const S=Array.from(T.querySelectorAll(`[${m}]`));return Array.from(k.itemMap.values()).sort((M,O)=>S.indexOf(M.ref.current)-S.indexOf(O.ref.current))},[k.collectionRef,k.itemMap])}return[{Provider:a,Slot:f,ItemSlot:x},P,r]}var zA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],be=zA.reduce((t,e)=>{const n=ka(`Primitive.${e}`),r=w.forwardRef((i,s)=>{const{asChild:a,...l}=i,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function OS(t,e){t&&ys.flushSync(()=>t.dispatchEvent(e))}function bn(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function BA(t,e=globalThis==null?void 0:globalThis.document){const n=bn(t);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var UA="DismissableLayer",rg="dismissableLayer.update",VA="dismissableLayer.pointerDownOutside",HA="dismissableLayer.focusOutside",Gx,jS=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Bu=w.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=t,f=w.useContext(jS),[p,m]=w.useState(null),_=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=w.useState({}),P=Qe(e,O=>m(O)),b=Array.from(f.layers),[k]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=b.indexOf(k),T=p?b.indexOf(p):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,R=T>=E,I=ZA(O=>{const D=O.target,K=[...f.branches].some(q=>q.contains(D));!R||K||(i==null||i(O),a==null||a(O),O.defaultPrevented||l==null||l())},_),M=qA(O=>{const D=O.target;[...f.branches].some(q=>q.contains(D))||(s==null||s(O),a==null||a(O),O.defaultPrevented||l==null||l())},_);return BA(O=>{T===f.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&l&&(O.preventDefault(),l()))},_),w.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Gx=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),Kx(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=Gx)}},[p,_,n,f]),w.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),Kx())},[p,f]),w.useEffect(()=>{const O=()=>x({});return document.addEventListener(rg,O),()=>document.removeEventListener(rg,O)},[]),d.jsx(be.div,{...c,ref:P,style:{pointerEvents:S?R?"auto":"none":void 0,...t.style},onFocusCapture:ve(t.onFocusCapture,M.onFocusCapture),onBlurCapture:ve(t.onBlurCapture,M.onBlurCapture),onPointerDownCapture:ve(t.onPointerDownCapture,I.onPointerDownCapture)})});Bu.displayName=UA;var WA="DismissableLayerBranch",DS=w.forwardRef((t,e)=>{const n=w.useContext(jS),r=w.useRef(null),i=Qe(e,r);return w.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),d.jsx(be.div,{...t,ref:i})});DS.displayName=WA;function ZA(t,e=globalThis==null?void 0:globalThis.document){const n=bn(t),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let c=function(){FS(VA,n,f,{discrete:!0})};const f={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function qA(t,e=globalThis==null?void 0:globalThis.document){const n=bn(t),r=w.useRef(!1);return w.useEffect(()=>{const i=s=>{s.target&&!r.current&&FS(HA,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Kx(){const t=new CustomEvent(rg);document.dispatchEvent(t)}function FS(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?OS(i,s):i.dispatchEvent(s)}var GA=Bu,KA=DS,qt=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},YA="Portal",$f=w.forwardRef((t,e)=>{var l;const{container:n,...r}=t,[i,s]=w.useState(!1);qt(()=>s(!0),[]);const a=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?IS.createPortal(d.jsx(be.div,{...r,ref:e}),a):null});$f.displayName=YA;function JA(t,e){return w.useReducer((n,r)=>e[n][r]??n,t)}var xs=t=>{const{present:e,children:n}=t,r=QA(e),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),s=Qe(r.ref,XA(i));return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:s}):null};xs.displayName="Presence";function QA(t){const[e,n]=w.useState(),r=w.useRef({}),i=w.useRef(t),s=w.useRef("none"),a=t?"mounted":"unmounted",[l,c]=JA(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const f=Bc(r.current);s.current=l==="mounted"?f:"none"},[l]),qt(()=>{const f=r.current,p=i.current;if(p!==t){const _=s.current,x=Bc(f);t?c("MOUNT"):x==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(p&&_!==x?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),qt(()=>{if(e){let f;const p=e.ownerDocument.defaultView??window,m=x=>{const b=Bc(r.current).includes(x.animationName);if(x.target===e&&b&&(c("ANIMATION_END"),!i.current)){const k=e.style.animationFillMode;e.style.animationFillMode="forwards",f=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=k)})}},_=x=>{x.target===e&&(s.current=Bc(r.current))};return e.addEventListener("animationstart",_),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(f),e.removeEventListener("animationstart",_),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function Bc(t){return(t==null?void 0:t.animationName)||"none"}function XA(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.
40isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function os({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=eM({defaultProp:e,onChange:n}),s=t!==void 0,a=s?t:r,l=bn(n),c=w.useCallback(f=>{if(s){const m=typeof f=="function"?f(t):f;m!==t&&l(m)}else i(f)},[s,t,i,l]);return[a,c]}function eM({defaultProp:t,onChange:e}){const n=w.useState(t),[r]=n,i=w.useRef(r),s=bn(e);return w.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var tM="VisuallyHidden",Uu=w.forwardRef((t,e)=>d.jsx(be.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));Uu.displayName=tM;var nM=Uu,Zv="ToastProvider",[qv,rM,iM]=Wv("Toast"),[$S,o8]=Hr("Toast",[iM]),[sM,zf]=$S(Zv),zS=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:a}=t,[l,c]=w.useState(null),[f,p]=w.useState(0),m=w.useRef(!1),_=w.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Zv}\`. Expected non-empty \`string\`.`),d.jsx(qv.Provider,{scope:e,children:d.jsx(sM,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:f,viewport:l,onViewportChange:c,onToastAdd:w.useCallback(()=>p(x=>x+1),[]),onToastRemove:w.useCallback(()=>p(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:_,children:a})})};zS.displayName=Zv;var BS="ToastViewport",oM=["F8"],ig="toast.viewportPause",sg="toast.viewportResume",US=w.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=oM,label:i="Notifications ({hotkey})",...s}=t,a=zf(BS,n),l=rM(n),c=w.useRef(null),f=w.useRef(null),p=w.useRef(null),m=w.useRef(null),_=Qe(e,m,a.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=a.toastCount>0;w.useEffect(()=>{const k=E=>{var S;r.length!==0&&r.every(R=>E[R]||E.code===R)&&((S=m.current)==null||S.focus())};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[r]),w.useEffect(()=>{const k=c.current,E=m.current;if(P&&k&&E){const T=()=>{if(!a.isClosePausedRef.current){const M=new CustomEvent(ig);E.dispatchEvent(M),a.isClosePausedRef.current=!0}},S=()=>{if(a.isClosePausedRef.current){const M=new CustomEvent(sg);E.dispatchEvent(M),a.isClosePausedRef.current=!1}},R=M=>{!k.contains(M.relatedTarget)&&S()},I=()=>{k.contains(document.activeElement)||S()};return k.addEventListener("focusin",T),k.addEventListener("focusout",R),k.addEventListener("pointermove",T),k.addEventListener("pointerleave",I),window.addEventListener("blur",T),window.addEventListener("focus",S),()=>{k.removeEventListener("focusin",T),k.removeEventListener("focusout",R),k.removeEventListener("pointermove",T),k.removeEventListener("pointerleave",I),window.removeEventListener("blur",T),window.removeEventListener("focus",S)}}},[P,a.isClosePausedRef]);const b=w.useCallback(({tabbingDirection:k})=>{const T=l().map(S=>{const R=S.ref.current,I=[R,..._M(R)];return k==="forwards"?I:I.reverse()});return(k==="forwards"?T.reverse():T).flat()},[l]);return w.useEffect(()=>{const k=m.current;if(k){const E=T=>{var I,M,O;const S=T.altKey||T.ctrlKey||T.metaKey;if(T.key==="Tab"&&!S){const D=document.activeElement,K=T.shiftKey;if(T.target===k&&K){(I=f.current)==null||I.focus();return}const W=b({tabbingDirection:K?"backwards":"forwards"}),$=W.findIndex(z=>z===D);Up(W.slice($+1))?T.preventDefault():K?(M=f.current)==null||M.focus():(O=p.current)==null||O.focus()}};return k.addEventListener("keydown",E),()=>k.removeEventListener("keydown",E)}},[l,b]),d.jsxs(KA,{ref:c,role:"region","aria-label":i.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:P?void 0:"none"},children:[P&&d.jsx(og,{ref:f,onFocusFromOutsideViewport:()=>{const k=b({tabbingDirection:"forwards"});Up(k)}}),d.jsx(qv.Slot,{scope:n,children:d.jsx(be.ol,{tabIndex:-1,...s,ref:_})}),P&&d.jsx(og,{ref:p,onFocusFromOutsideViewport:()=>{const k=b({tabbingDirection:"backwards"});Up(k)}})]})});US.displayName=BS;var VS="ToastFocusProxy",og=w.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,s=zf(VS,n);return d.jsx(Uu,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:a=>{var f;const l=a.relatedTarget;!((f=s.viewport)!=null&&f.contains(l))&&r()}})});og.displayName=VS;var Bf="Toast",aM="toast.swipeStart",lM="toast.swipeMove",uM="toast.swipeCancel",cM="toast.swipeEnd",HS=w.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...a}
40=t,[l=!0,c]=os({prop:r,defaultProp:i,onChange:s});return d.jsx(xs,{present:n||l,children:d.jsx(hM,{open:l,...a,ref:e,onClose:()=>c(!1),onPause:bn(t.onPause),onResume:bn(t.onResume),onSwipeStart:ve(t.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ve(t.onSwipeMove,f=>{const{x:p,y:m}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:ve(t.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ve(t.onSwipeEnd,f=>{const{x:p,y:m}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),c(!1)})})})});HS.displayName=Bf;var[dM,fM]=$S(Bf,{onClose(){}}),hM=w.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:f,onSwipeStart:p,onSwipeMove:m,onSwipeCancel:_,onSwipeEnd:x,...P}=t,b=zf(Bf,n),[k,E]=w.useState(null),T=Qe(e,z=>E(z)),S=w.useRef(null),R=w.useRef(null),I=i||b.duration,M=w.useRef(0),O=w.useRef(I),D=w.useRef(0),{onToastAdd:K,onToastRemove:q}=b,ne=bn(()=>{var se;(k==null?void 0:k.contains(document.activeElement))&&((se=b.viewport)==null||se.focus()),a()}),W=w.useCallback(z=>{!z||z===1/0||(window.clearTimeout(D.current),M.current=new Date().getTime(),D.current=window.setTimeout(ne,z))},[ne]);w.useEffect(()=>{const z=b.viewport;if(z){const se=()=>{W(O.current),f==null||f()},G=()=>{const ce=new Date().getTime()-M.current;O.current=O.current-ce,window.clearTimeout(D.current),c==null||c()};return z.addEventListener(ig,G),z.addEventListener(sg,se),()=>{z.removeEventListener(ig,G),z.removeEventListener(sg,se)}}},[b.viewport,I,c,f,W]),w.useEffect(()=>{s&&!b.isClosePausedRef.current&&W(I)},[s,I,b.isClosePausedRef,W]),w.useEffect(()=>(K(),()=>q()),[K,q]);const $=w.useMemo(()=>k?JS(k):null,[k]);return b.viewport?d.jsxs(d.Fragment,{children:[$&&d.jsx(pM,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:$}),d.jsx(dM,{scope:n,onClose:ne,children:ys.createPortal(d.jsx(qv.ItemSlot,{scope:n,children:d.jsx(GA,{asChild:!0,onEscapeKeyDown:ve(l,()=>{b.isFocusedToastEscapeKeyDownRef.current||ne(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx(be.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":b.swipeDirection,...P,ref:T,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ve(t.onKeyDown,z=>{z.key==="Escape"&&(l==null||l(z.nativeEvent),z.nativeEvent.defaultPrevented||(b.is
40FocusedToastEscapeKeyDownRef.current=!0,ne()))}),onPointerDown:ve(t.onPointerDown,z=>{z.button===0&&(S.current={x:z.clientX,y:z.clientY})}),onPointerMove:ve(t.onPointerMove,z=>{if(!S.current)return;const se=z.clientX-S.current.x,G=z.clientY-S.current.y,ce=!!R.current,j=["left","right"].includes(b.swipeDirection),U=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,V=j?U(0,se):0,re=j?0:U(0,G),Q=z.pointerType==="touch"?10:2,oe={x:V,y:re},ae={originalEvent:z,delta:oe};ce?(R.current=oe,Uc(lM,m,ae,{discrete:!1})):Yx(oe,b.swipeDirection,Q)?(R.current=oe,Uc(aM,p,ae,{discrete:!1}),z.target.setPointerCapture(z.pointerId)):(Math.abs(se)>Q||Math.abs(G)>Q)&&(S.current=null)}),onPointerUp:ve(t.onPointerUp,z=>{const se=R.current,G=z.target;if(G.hasPointerCapture(z.pointerId)&&G.releasePointerCapture(z.pointerId),R.current=null,S.current=null,se){const ce=z.currentTarget,j={originalEvent:z,delta:se};Yx(se,b.swipeDirection,b.swipeThreshold)?Uc(cM,x,j,{discrete:!0}):Uc(uM,_,j,{discrete:!0}),ce.addEventListener("click",U=>U.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),pM=t=>{const{__scopeToast:e,children:n,...r}=t,i=zf(Bf,e),[s,a]=w.useState(!1),[l,c]=w.useState(!1);return vM(()=>a(!0)),w.useEffect(()=>{const f=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(f)},[]),l?null:d.jsx($f,{asChild:!0,children:d.jsx(Uu,{...r,children:s&&d.jsxs(d.Fragment,{children:[i.label," ",n]})})})},mM="ToastTitle",WS=w.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return d.jsx(be.div,{...r,ref:e})});WS.displayName=mM;var gM="ToastDescription",ZS=w.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return d.jsx(be.div,{...r,ref:e})});ZS.displayName=gM;var qS="ToastAction",GS=w.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?d.jsx(YS,{altText:n,asChild:!0,children:d.jsx(Gv,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${qS}\`. Expected non-empty \`string\`.`),null)});GS.displayName=qS;var KS="ToastClose",Gv=w.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=fM(KS,n);return d.jsx(YS,{asChild:!0,children:d.jsx(be.button,{type:"button",...r,ref:e,onClick:ve(t.onClick,i.onClose)})})});Gv.displayName=KS;var YS=w.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return d.jsx(be.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function JS(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),yM(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...JS(r))}}),e}function Uc(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?OS(i,s):i.dispatchEvent(s)}var Yx=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),s=r>i;return e==="left"||e==="right"?s&&r>n:!s&&i>n};function vM(t=()=>{}){const e=bn(t);qt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function yM(t){return t.nodeType===t.ELEMENT_NODE}function _M(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Up(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var xM=zS,QS=US,XS=HS,eT=WS,tT=ZS,nT=GS,rT=Gv;function iT(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=iT(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function sT(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=iT(t))&&(r&&(r+=" "),r+=e);return r}const Jx=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Qx=sT,fo=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return Qx(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(f=>{const p=n==null?void 0:n[f],m=s==null?void 0:s[f];if(p===null)return null;const _=Jx(p)||Jx(m);return i[f][_]}),l=n&&Object.entries(n).reduce((f,p)=>{let[m,_]=p;return _===void 0||(f[m]=_),f},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:_,...x}=p;return Object.entries(x).every(P=>{let[b,k]=P;return Array.isArray(k)?k.includes({...s,...l}[b]):{...s,...l}[b]===k})?[...f,m,_]:f},[]);return Qx(t,a,c,n==null?void 0:n.class,n==null?void 0:n.className)};/** 41 * @license lucide-react v0.462.0 - ISC 42 * 43 * This source code is licensed under the ISC license. 44 * See the LICENSE file in the root directory of this source tree. 45 */const wM=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oT=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** 46 * @license lucide-react v0.462.0 - ISC 47 * 48 * This source code is licensed under the ISC license. 49 * See the LICENSE file in the root directory of this source tree. 50 */var bM={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"};/** 51 * @license lucide-react v0.462.0 - ISC 52 * 53 * This source code is licensed under the ISC license. 54 * See the LICENSE file in the root directory of this source tree. 55 */const CM=w.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...l},c)=>w.createElement("svg",{ref:c,...bM,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:oT("lucide",i),...l},[...a.map(([f,p])=>w.createElement(f,p)),...Array.isArray(s)?s:[s]]));/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const Be=(t,e)=>{const n=w.forwardRef(({className:r,...i},s)=>w.createElement(CM,{ref:s,iconNode:e,className:oT(`lucide-${wM(t)}`,r),...i}));return n.displayName=`${t}`,n};/** 61 * @license lucide-react v0.462.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */const Xx=Be("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const SM=Be("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"}]]);/** 71 * @license lucide-react v0.462.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const TM=Be("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 76 * @license lucide-react v0.462.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const aT=Be("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 81 * @license lucide-react v0.462.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */const ag=Be("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 86 * @license lucide-react v0.462.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const EM=Be("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 91 * @license lucide-react v0.462.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const PM=Be("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 96 * @license lucide-react v0.462.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const Uf=Be("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"}]]);/** 101 * @license lucide-react v0.462.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const kM=Be("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 106 * @license lucide-react v0.462.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const NM=Be("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 111 * @license lucide-react v0.462.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const RM=Be("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 116 * @license lucide-react v0.462.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const IM=Be("Droplet",[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]]);/** 121 * @license lucide-react v0.462.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const AM=Be("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 126 * @license lucide-react v0.462.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const MM=Be("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** 131 * @license lucide-react v0.462.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const Vf=Be("Hospital",[["path",{d:"M12 6v4",key:"16clxf"}],["path",{d:"M14 14h-4",key:"esezmu"}
135],["path",{d:"M14 18h-4",key:"16mqa2"}],["path",{d:"M14 8h-4",key:"z8ypaz"}],["path",{d:"M18 12h2a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2h2",key:"b1k337"}],["path",{d:"M18 22V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v18",key:"16g51d"}]]);/** 136 * @license lucide-react v0.462.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const LM=Be("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 141 * @license lucide-react v0.462.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const ew=Be("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 146 * @license lucide-react v0.462.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree. 150 */const OM=Be("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"}]]);/** 151 * @license lucide-react v0.462.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const lT=Be("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 156 * @license lucide-react v0.462.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const jM=Be("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/** 161 * @license lucide-react v0.462.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const DM=Be("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** 166 * @license lucide-react v0.462.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const FM=Be("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** 171 * @license lucide-react v0.462.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const uT=Be("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 176 * @license lucide-react v0.462.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const Kv=Be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 181 * @license lucide-react v0.462.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const cT=Be("ScanEye",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]);/** 186 * @license lucide-react v0.462.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const dT=Be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 191 * @license lucide-react v0.462.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const $M=Be("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 196 * @license lucide-react v0.462.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const zM=Be("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** 201 * @license lucide-react v0.462.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree. 205 */const Yv=Be("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** 206 * @license lucide-react v0.462.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree. 210 */const Jv=Be("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
vendor: 7,058 bytes, lines 210-225
210],["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"}]]);/** 211 * @license lucide-react v0.462.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const fT=Be("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"}]]);/** 216 * @license lucide-react v0.462.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const Qv=Be("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 221 * @license lucide-react v0.462.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const Hf=Be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Xv="-",BM=t=>{const e=VM(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const l=a.split(Xv);return l[0]===""&&l.length!==1&&l.shift(),hT(l,e)||UM(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&r[a]?[...c,...r[a]]:c}}},hT=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?hT(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(Xv);return(a=e.validators.find(({validator:l})=>l(s)))==null?void 0:a.classGroupId},tw=/^\[(.+)\]$/,UM=t=>{if(tw.test(t)){const e=tw.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},VM=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return WM(Object.entries(t.classGroups),n).forEach(([s,a])=>{lg(a,r,s,e)}),r},lg=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:nw(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(HM(i)){lg(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{lg(a,nw(e,s),n,r)})})},nw=(t,e)=>{let n=t;return e.split(Xv).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},HM=t=>t.isThemeGetter,WM=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,l])=>[e+a,l])):s);return[n,i]}):t,ZM=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},pT="!",qM=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,a=l=>{const c=[];let f=0,p=0,m;for(let k=0;k<l.length;k++){let E=l[k];if(f===0){if(E===i&&(r||l.slice(k,k+s)===e)){c.push(l.slice(p,k)),p=k+s;continue}if(E==="/"){m=k;continue}}E==="["?f++:E==="]"&&f--}const _=c.length===0?l:l.substring(p),x=_.startsWith(pT),P=x?_.substring(1):_,b=m&&m>p?m-p:void 0;return{modifiers:c,hasImportantModifier:x,baseClassName:P,maybePostfixModifierPosition:b}};return n?l=>n({className:l,parseClassName:a}):a},GM=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},KM=t=>({cache:ZM(t.cacheSize),parseClassName:qM(t),...BM(t)}),YM=/\s+/,JM=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],a=t.trim().split(YM);let l="";for(let c=a.length-1;c>=0;c-=1){const f=a[c],{modifiers:p,hasImportantModifier:m,baseClassName:_,maybePostfixModifierPosition:x}=n(f);let P=!!x,b=r(P?_.substring(0,x):_);if(!b){if(!P){l=f+(l.length>0?" "+l:l);continue}if(b=r(_),!b){l=f+(l.length>0?" "+l:l);continue}P=!1}const k=GM(p).join(":"),E=m?k+pT:k,T=E+b;if(s.includes(T))continue;s.push(T);const S=i(b,P);for(let R=0;R<S.length;++R){const I=S[R];s.push(E+I)}l=f+(l.length>0?" "+l:l)}return l};function QM(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=mT(e))&&(r&&(r+=" "),r+=n);return r}const mT=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=mT(t[r]))&&(n&&(n+=" "),n+=e);return n};function XM(t,...e){let n,r,i,s=a;function a(c){const f=e.reduce((p,m)=>m(p),t());return n=KM(f),r=n.cache.get,i=n.cache.set,s=l,l(c)}function l(c){const f=r(c);if(f)return f;const p=JM(c,n);return i(c,p),p}return function(){return s(QM.apply(null,arguments))}}const st=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},gT=/^\[(?:([a-z-]+):)?(.+)\]$/i,eL=/^\d+\/\d+$/,tL=new Set(["px","full","screen"]),nL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,iL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,sL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xr=t=>sa(t)||tL.has(t)||eL.test(t),ki=t=>Ua(t,"length",pL),sa=t=>!!t&&!Number.isNaN(Number(t)),Vp=t=>Ua(t,"number",sa),bl=t=>!!t&&Number.isInteger(Number(t)),aL=t=>t.endsWith("%")&&sa(t.slice(0,-1)),Pe=t=>gT.test(t),Ni=t=>nL.test(t),lL=new Set(["length","size","percentage"]),uL=t=>Ua(t,lL,vT),cL=t=>Ua(t,"position",vT),dL=new Set(["image","url"]),fL=t=>Ua(t,dL,gL),hL=t=>Ua(t,"",mL),Cl=()=>!0,Ua=(t,e,n)=>{const r=gT.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},pL=t=>rL.test(t)&&!iL.test(t),vT=()=>!1,mL=t=>sL.test(t),gL=t=>oL.test(t),vL=()=>{const t=st("colors"),e=st("spacing"),n=st("blur"),r=st("brightness"),i=st("borderColor"),s=st("borderRadius"),a=st("borderSpacing"),l=st("borderWidth"),c=st("contrast"),f=st("grayscale"),p=st("hueRotate"),m=st("invert"),_=st("gap"),x=st("gradientColorStops"),P=st("gradientColorStopPositions"),b=st("inset"),k=st("margin"),E=st("opacity"),T=st("padding"),S=st("saturate"),R=st("scale"),I=st("sepia"),M=st("skew"),O=st("space"),D=st("translate"),K=()=>["auto","contain","none"],q=()=>["auto","hidden","clip","visible","scroll"],ne=()=>["auto",Pe,e],W=()=>[Pe,e],$=()=>["",Xr,ki],z=()=>["auto",sa,Pe],se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",Pe],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],re=()=>[sa,Pe];return{cacheSize:500,separator:":",theme:{colors:[Cl],spacing:[Xr,ki],blur:["none","",
vendor: 11,593 bytes, line 225
225Ni,Pe],brightness:re(),borderColor:[t],borderRadius:["none","","full",Ni,Pe],borderSpacing:W(),borderWidth:$(),contrast:re(),grayscale:U(),hueRotate:re(),invert:U(),gap:W(),gradientColorStops:[t],gradientColorStopPositions:[aL,ki],inset:ne(),margin:ne(),opacity:re(),padding:W(),saturate:re(),scale:re(),sepia:U(),skew:re(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",Pe]}],container:["container"],columns:[{columns:[Ni]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...se(),Pe]}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bl,Pe]}],basis:[{basis:ne()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pe]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",bl,Pe]}],"grid-cols":[{"grid-cols":[Cl]}],"col-start-end":[{col:["auto",{span:["full",bl,Pe]},Pe]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[Cl]}],"row-start-end":[{row:["auto",{span:[bl,Pe]},Pe]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pe]}],gap:[{gap:[_]}],"gap-x":[{"gap-x":[_]}],"gap-y":[{"gap-y":[_]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pe,e]}],"min-w":[{"min-w":[Pe,e,"min","max","fit"]}],"max-w":[{"max-w":[Pe,e,"none","full","min","max","fit","prose",{screen:[Ni]},Ni]}],h:[{h:[Pe,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pe,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pe,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pe,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Ni,ki]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Vp]}],"font-family":[{font:[Cl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Pe]}],"line-clamp":[{"line-clamp":["none",sa,Vp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Xr,Pe]}],"list-image":[{"list-image":["none",Pe]}],"list-style-type":[{list:["none","disc","decimal",Pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Xr,ki]}],"underline-offset":[{"underline-offset":["auto",Xr,Pe]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...se(),cL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},fL]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[P]}],"gradient-via-pos":[{via:[P]}],"gradient-to-pos":[{to:[P]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:G()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[Xr,Pe]}],"outline-w":[{outline:[Xr,ki]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[Xr,ki]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Ni,hL]}],"shadow-color":[{shadow:[Cl]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...ce(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ce()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ni,Pe]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[m]}],saturate:[{saturate:[S]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pe]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",Pe]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[bl,Pe]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pe]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pe]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,642 bytes, line 225
225],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pe]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Xr,ki,Vp]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},yL=XM(vL);function X(...t){return yL(sT(t))}const _L=xM,yT=w.forwardRef(({className:t,...e},n)=>d.jsx(QS,{ref:n,className:X("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));yT.displayName=QS.displayName;const xL=fo("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),_T=w.forwardRef(({className:t,variant:e,...n},r)=>d.jsx(XS,{ref:r,className:X(xL({variant:e}),t),...n}));_T.displayName=XS.displayName;const wL=w.forwardRef(({className:t,...e},n)=>d.jsx(nT,{ref:n,className:X("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));wL.displayName=nT.displayName;const xT=w.forwardRef(({className:t,...e},n)=>d.jsx(rT,{ref:n,className:X("absolute right-2 top-2 rounded-md p-1 text-foreground
225/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:d.jsx(Hf,{className:"h-4 w-4"})}));xT.displayName=rT.displayName;const wT=w.forwardRef(({className:t,...e},n)=>d.jsx(eT,{ref:n,className:X("text-sm font-semibold",t),...e}));wT.displayName=eT.displayName;const bT=w.forwardRef(({className:t,...e},n)=>d.jsx(tT,{ref:n,className:X("text-sm opacity-90",t),...e}));bT.displayName=tT.displayName;function bL(){const{toasts:t}=_s();return d.jsxs(_L,{children:[t.map(function({id:e,title:n,description:r,action:i,...s}){return d.jsxs(_T,{...s,children:[d.jsxs("div",{className:"grid gap-1",children:[n&&d.jsx(wT,{children:n}),r&&d.jsx(bT,{children:r})]}),i,d.jsx(xT,{})]},e)}),d.jsx(yT,{})]})}var rw=["light","dark"],CL="(prefers-color-scheme: dark)",SL=w.createContext(void 0),TL={setTheme:t=>{},themes:[]},EL=()=>{var t;return(t=w.useContext(SL))!=null?t:TL};w.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:a,attrs:l,nonce:c})=>{let f=s==="system",p=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(P=>`'${P}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,m=i?rw.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",_=(P,b=!1,k=!0)=>{let E=a?a[P]:P,T=b?P+"|| ''":`'${E}'`,S="";return i&&k&&!b&&rw.includes(P)&&(S+=`d.style.colorScheme = '${P}';`),n==="class"?b||E?S+=`c.add(${T})`:S+="null":E&&(S+=`d[s](n,${T})`),S},x=t?`!function(){${p}${_(t)}}()`:r?`!function(){try{${p}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${f})){var t='${CL}',m=window.matchMedia(t);if(m.media!==t||m.matches){${_("dark")}}else{${_("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${_(a?"x[e]":"e",!0)}}${f?"":"else{"+_(s,!1,!1)+"}"}${m}}catch(e){}}()`:`!function(){try{${p}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${_(a?"x[e]":"e",!0)}}else{${_(s,!1,!1)};}${m}}catch(t){}}();`;return w.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:x}})});var PL=t=>{switch(t){case"success":return RL;case"info":return AL;case"warning":return IL;case"error":return ML;default:return null}},kL=Array(12).fill(0),NL=({visible:t,className:e})=>te.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},te.createElement("div",{className:"sonner-spinner"},kL.map((n,r)=>te.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),RL=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),IL=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),AL=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ML=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),LL=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},te.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),te.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),OL=()=>{let[t,e]=te.useState(document.hidden);return te.useEffect(()=>{let n=()=>{e(document.hidden)};
225return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},ug=1,jL=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:ug++,s=this.toasts.find(l=>l.id===i),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),s?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:n}),{...l,...t,id:i,dismissible:a,title:n}):l):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),i=n!==void 0,s,a=r.then(async c=>{if(s=["resolve",c],te.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(FL(c)&&!c.ok){i=!1;let f=typeof e.error=="function"?await e.error(`HTTP error! status: ${c.status}`):e.error,p=typeof e.description=="function"?await e.description(`HTTP error! status: ${c.status}`):e.description;this.create({id:n,type:"error",message:f,description:p})}else if(e.success!==void 0){i=!1;let f=typeof e.success=="function"?await e.success(c):e.success,p=typeof e.description=="function"?await e.description(c):e.description;this.create({id:n,type:"success",message:f,description:p})}}).catch(async c=>{if(s=["reject",c],e.error!==void 0){i=!1;let f=typeof e.error=="function"?await e.error(c):e.error,p=typeof e.description=="function"?await e.description(c):e.description;this.create({id:n,type:"error",message:f,description:p})}}).finally(()=>{var c;i&&(this.dismiss(n),n=void 0),(c=e.finally)==null||c.call(e)}),l=()=>new Promise((c,f)=>a.then(()=>s[0]==="reject"?f(s[1]):c(s[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||ug++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},pn=new jL,DL=(t,e)=>{let n=(e==null?void 0:e.id)||ug++;return pn.addToast({title:t,...e,id:n}),n},FL=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",$L=DL,zL=()=>pn.toasts,BL=()=>pn.getActiveToasts();Object.assign($L,{success:pn.success,info:pn.info,warning:pn.warning,error:pn.error,custom:pn.custom,message:pn.message,promise:pn.promise,dismiss:pn.dismiss,loading:pn.loading},{getHistory:zL,getToasts:BL});function UL(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}UL(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
225left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
225:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
225--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 226`);function Vc(t){return t.label!==void 0}var VL=3,HL="32px",WL="16px",iw=4e3,ZL=356,qL=14,GL=20,KL=200;function Qn(...t){return t.filter(Boolean).join(" ")}function YL(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var JL=t=>{var e,n,r,i,s,a,l,c,f,p,m;let{invert:_,toast:x,unstyled:P,interacting:b,setHeights:k,visibleToasts:E,heights:T,index:S,toasts:R,expanded:I,removeToast:M,defaultRichColors:O,closeButton:D,style:K,cancelButtonStyle:q,actionButtonStyle:ne,className:W="",descriptionClassName:$="",duration:z,position:se,gap:G,loadingIcon:ce,expandByDefault:j,classNames:U,icons:V,
226closeButtonAriaLabel:re="Close toast",pauseWhenPageIsHidden:Q}=t,[oe,ae]=te.useState(null),[fe,pe]=te.useState(null),[ee,Ce]=te.useState(!1),[Ze,Ie]=te.useState(!1),[Ae,he]=te.useState(!1),[ut,Rt]=te.useState(!1),[Yt,cn]=te.useState(!1),[dn,gr]=te.useState(0),[Ci,Qa]=te.useState(0),Zr=te.useRef(x.duration||z||iw),Xa=te.useRef(null),vr=te.useRef(null),jh=S===0,Dh=S+1<=E,zt=x.type,qr=x.dismissible!==!1,ec=x.className||"",Fh=x.descriptionClassName||"",Ps=te.useMemo(()=>T.findIndex(we=>we.toastId===x.id)||0,[T,x.id]),tc=te.useMemo(()=>{var we;return(we=x.closeButton)!=null?we:D},[x.closeButton,D]),nc=te.useMemo(()=>x.duration||z||iw,[x.duration,z]),mo=te.useRef(0),yr=te.useRef(0),el=te.useRef(0),Si=te.useRef(null),[ks,$h]=se.split("-"),rc=te.useMemo(()=>T.reduce((we,qe,et)=>et>=Ps?we:we+qe.height,0),[T,Ps]),tl=OL(),ic=x.invert||_,go=zt==="loading";yr.current=te.useMemo(()=>Ps*G+rc,[Ps,rc]),te.useEffect(()=>{Zr.current=nc},[nc]),te.useEffect(()=>{Ce(!0)},[]),te.useEffect(()=>{let we=vr.current;if(we){let qe=we.getBoundingClientRect().height;return Qa(qe),k(et=>[{toastId:x.id,height:qe,position:x.position},...et]),()=>k(et=>et.filter(Cn=>Cn.toastId!==x.id))}},[k,x.id]),te.useLayoutEffect(()=>{if(!ee)return;let we=vr.current,qe=we.style.height;we.style.height="auto";let et=we.getBoundingClientRect().height;we.style.height=qe,Qa(et),k(Cn=>Cn.find(Jt=>Jt.toastId===x.id)?Cn.map(Jt=>Jt.toastId===x.id?{...Jt,height:et}:Jt):[{toastId:x.id,height:et,position:x.position},...Cn])},[ee,x.title,x.description,k,x.id]);let _r=te.useCallback(()=>{Ie(!0),gr(yr.current),k(we=>we.filter(qe=>qe.toastId!==x.id)),setTimeout(()=>{M(x)},KL)},[x,M,k,yr]);te.useEffect(()=>{if(x.promise&&zt==="loading"||x.duration===1/0||x.type==="loading")return;let we;return I||b||Q&&tl?(()=>{if(el.current<mo.current){let qe=new Date().getTime()-mo.current;Zr.current=Zr.current-qe}el.current=new Date().getTime()})():Zr.current!==1/0&&(mo.current=new Date().getTime(),we=setTimeout(()=>{var qe;(qe=x.onAutoClose)==null||qe.call(x,x),_r()},Zr.current)),()=>clearTimeout(we)},[I,b,x,zt,Q,tl,_r]),te.useEffect(()=>{x.delete&&_r()},[_r,x.delete]);function zh(){var we,qe,et;return V!=null&&V.loading?te.createElement("div",{className:Qn(U==null?void 0:U.loader,(we=x==null?void 0:x.classNames)==null?void 0:we.loader,"sonner-loader"),"data-visible":zt==="loading"},V.loading):ce?te.createElement("div",{className:Qn(U==null?void 0:U.loader,(qe=x==null?void 0:x.classNames)==null?void 0:qe.loader,"sonner-loader"),"data-visible":zt==="loading"},ce):te.createElement(NL,{className:Qn(U==null?void 0:U.loader,(et=x==null?void 0:x.classNames)==null?void 0:et.loader),visible:zt==="loading"})}return te.createElement("li",{tabIndex:0,ref:vr,className:Qn(W,ec,U==null?void 0:U.toast,(e=x==null?void 0:x.classNames)==null?void 0:e.toast,U==null?void 0:U.default,U==null?void 0:U[zt],(n=x==null?void 0:x.classNames)==null?void 0:n[zt]),"data-sonner-toast":"","data-rich-colors":(r=x.richColors)!=null?r:O,"data-styled":!(x.jsx||x.unstyled||P),"data-mounted":ee,"data-promise":!!x.promise,"data-swiped":Yt,"data-removed":Ze,"data-visible":Dh,"data-y-position":ks,"data-x-position":$h,"data-index":S,"data-front":jh,"data-swiping":Ae,"data-dismissible":qr,"data-type":zt,"data-invert":ic,"data-swipe-out":ut,"data-swipe-direction":fe,"data-expanded":!!(I||j&&ee),style:{"--index":S,"--toasts-before":S,"--z-index":R.length-S,"--offset":`${Ze?dn:yr.current}px`,"--initial-height":j?"auto":`${Ci}px`,...K,...x.style},onDragEnd:()=>{he(!1),ae(null),Si.current=null},onPointerDown:we=>{go||!qr||(Xa.current=new Date,gr(yr.current),we.target.setPointerCapture(we.pointerId),we.target.tagName!=="BUTTON"&&(he(!0),Si.current={x:we.clientX,y:we.clientY}))},onPointerUp:()=>{var we,qe,et,Cn;if(ut||!qr)return;Si.current=null;let Jt=Number(((we=vr.current)==null?void 0:we.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),xr=Number(((qe=vr.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Gr=new Date().getTime()-((et=Xa.current)==null?void 0:et.getTime()),Sn=oe==="x"?Jt:xr,wr=Math.abs(Sn)/Gr;if(Math.abs(Sn)>=GL||wr>.11){gr(yr.current),(Cn=x.onDismiss)==null||Cn.call(x,x),pe(oe==="x"?Jt>0?"right":"left":xr>0?"down":"up"),_r(),Rt(!0),cn(!1);return}he(!1),ae(null)},onPointerMove:we=>{var qe,et,Cn,Jt;if(!Si.current||!qr||((qe=window.getSelection())==null?void 0:qe.toString().length)>0)return;let xr=we.clientY-Si.current.y,Gr=we.clientX-Si.current.x,Sn=(et=t.swipeDirections)!=null?et:YL(se);!oe&&(Math.abs(Gr)>1||Math.abs(xr)>1)&&ae(Math.abs(Gr)>Math.abs(xr)?"x":"y");let wr={x:0,y:0};oe==="y"?(Sn.includes("top")||Sn.includes("bottom"))&&(Sn.includes("top")&&xr<0||Sn.includes("bottom")&&xr>0)&&(wr.y=xr):oe==="x"&&(Sn.includes("left")||Sn.includes("right"))&&(Sn.includes("left")&&Gr<0||Sn.includes("right")&&Gr>0)&&(wr.x=Gr),(Math.abs(wr.x)>0||Math.abs(wr.y)>0)&&cn(!0),(Cn=vr.current)==null||Cn.style.setProperty("--swipe-amount-x",`${wr.x}px`),(Jt=vr.current)==null||Jt.style.setProperty("--swipe-amount-y",`${wr.y}px`)}}
vendor: 7,398 bytes, line 226
226,tc&&!x.jsx?te.createElement("button",{"aria-label":re,"data-disabled":go,"data-close-button":!0,onClick:go||!qr?()=>{}:()=>{var we;_r(),(we=x.onDismiss)==null||we.call(x,x)},className:Qn(U==null?void 0:U.closeButton,(i=x==null?void 0:x.classNames)==null?void 0:i.closeButton)},(s=V==null?void 0:V.close)!=null?s:LL):null,x.jsx||w.isValidElement(x.title)?x.jsx?x.jsx:typeof x.title=="function"?x.title():x.title:te.createElement(te.Fragment,null,zt||x.icon||x.promise?te.createElement("div",{"data-icon":"",className:Qn(U==null?void 0:U.icon,(a=x==null?void 0:x.classNames)==null?void 0:a.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||zh():null,x.type!=="loading"?x.icon||(V==null?void 0:V[zt])||PL(zt):null):null,te.createElement("div",{"data-content":"",className:Qn(U==null?void 0:U.content,(l=x==null?void 0:x.classNames)==null?void 0:l.content)},te.createElement("div",{"data-title":"",className:Qn(U==null?void 0:U.title,(c=x==null?void 0:x.classNames)==null?void 0:c.title)},typeof x.title=="function"?x.title():x.title),x.description?te.createElement("div",{"data-description":"",className:Qn($,Fh,U==null?void 0:U.description,(f=x==null?void 0:x.classNames)==null?void 0:f.description)},typeof x.description=="function"?x.description():x.description):null),w.isValidElement(x.cancel)?x.cancel:x.cancel&&Vc(x.cancel)?te.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||q,onClick:we=>{var qe,et;Vc(x.cancel)&&qr&&((et=(qe=x.cancel).onClick)==null||et.call(qe,we),_r())},className:Qn(U==null?void 0:U.cancelButton,(p=x==null?void 0:x.classNames)==null?void 0:p.cancelButton)},x.cancel.label):null,w.isValidElement(x.action)?x.action:x.action&&Vc(x.action)?te.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||ne,onClick:we=>{var qe,et;Vc(x.action)&&((et=(qe=x.action).onClick)==null||et.call(qe,we),!we.defaultPrevented&&_r())},className:Qn(U==null?void 0:U.actionButton,(m=x==null?void 0:x.classNames)==null?void 0:m.actionButton)},x.action.label):null))};function sw(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function QL(t,e){let n={};return[t,e].forEach((r,i)=>{let s=i===1,a=s?"--mobile-offset":"--offset",l=s?WL:HL;function c(f){["top","right","bottom","left"].forEach(p=>{n[`${a}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${a}-${f}`]=l:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(l)}),n}var XL=w.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:a,className:l,offset:c,mobileOffset:f,theme:p="light",richColors:m,duration:_,style:x,visibleToasts:P=VL,toastOptions:b,dir:k=sw(),gap:E=qL,loadingIcon:T,icons:S,containerAriaLabel:R="Notifications",pauseWhenPageIsHidden:I}=t,[M,O]=te.useState([]),D=te.useMemo(()=>Array.from(new Set([r].concat(M.filter(Q=>Q.position).map(Q=>Q.position)))),[M,r]),[K,q]=te.useState([]),[ne,W]=te.useState(!1),[$,z]=te.useState(!1),[se,G]=te.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ce=te.useRef(null),j=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=te.useRef(null),V=te.useRef(!1),re=te.useCallback(Q=>{O(oe=>{var ae;return(ae=oe.find(fe=>fe.id===Q.id))!=null&&ae.delete||pn.dismiss(Q.id),oe.filter(({id:fe})=>fe!==Q.id)})},[]);return te.useEffect(()=>pn.subscribe(Q=>{if(Q.dismiss){O(oe=>oe.map(ae=>ae.id===Q.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{IS.flushSync(()=>{O(oe=>{let ae=oe.findIndex(fe=>fe.id===Q.id);return ae!==-1?[...oe.slice(0,ae),{...oe[ae],...Q},...oe.slice(ae+1)]:[Q,...oe]})})})}),[]),te.useEffect(()=>{if(p!=="system"){G(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:oe})=>{G(oe?"dark":"light")})}catch{Q.addListener(({matches:ae})=>{try{G(ae?"dark":"light")}catch(fe){console.error(fe)}})}},[p]),te.useEffect(()=>{M.length<=1&&W(!1)},[M]),te.useEffect(()=>{let Q=oe=>{var ae,fe;i.every(pe=>oe[pe]||oe.code===pe)&&(W(!0),(ae=ce.current)==null||ae.focus()),oe.code==="Escape"&&(document.activeElement===ce.current||(fe=ce.current)!=null&&fe.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[i]),te.useEffect(()=>{if(ce.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,V.current=!1)}},[ce.current]),te.createElement("section",{ref:e,"aria-label":`${R} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((Q,oe)=>{var ae;let[fe,pe]=Q.split("-");return M.length?te.createElement("ol",{key:Q,dir:k==="auto"?sw():k,tabIndex:-1,ref:ce,className:l,"data-sonner-toaster":!0,"data-theme":se,"data-y-position":fe,"data-lifted":ne&&M.length>1&&!s,"data-x-position":pe,style:{"--front-toast-height":`${((ae=K[0])==null?void 0:ae.height)||0}px`,"--width":`${ZL}px`,"--gap":`${E}px`,...x,...QL(c,f)},onBlur:ee=>{V.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(V.current=!1,U.current&&(U.current.focus({preventScroll:!0}),U.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||V.current||(V.current=!0,U.current=ee.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{$||W(!1)},onDragEnd:()=>W(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},M.filter(ee=>!ee.position&&oe===0||ee.position===Q).map((ee,Ce)=>{var Ze,Ie;return te.createElement(JL,{key:ee.id,icons:S,index:Ce,toast:ee,defaultRichColors:m,duration:(Ze=b==null?void 0:b.duration)!=null?Ze:_,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:n,visibleToasts:P,closeButton:(Ie=b==null?void 0:b.closeButton)!=null?Ie:a,interacting:$,position:Q,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,removeToast:re,toasts:M.filter(Ae=>Ae.position==ee.position),heights:K.filter(Ae=>Ae.position==ee.position),setHeights:q,expandByDefault:s,gap:E,loadingIcon:T,expanded:ne,pauseWhenPageIsHidden:I,swipeDirections:t.swipeDirections})})):null}))});const e2=({...t})=>{const{theme:e="system"}=EL();return d.jsx(XL,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var t2=kb[" useId ".trim().toString()]||(()=>{}),n2=0;function di(t){const[e,n]=w.useState(t2());return qt(()=>{n(r=>r??String(n2++))},[t]),e?`radix-${e}
226`:""}const r2=["top","right","bottom","left"],as=Math.min,kn=Math.max,Jd=Math.round,Hc=Math.floor,$r=t=>({x:t,y:t}),i2={left:"right",right:"left",bottom:"top",top:"bottom"},s2={start:"end",end:"start"};function cg(t,e,n){return kn(t,as(e,n))}function vi(t,e){return typeof t=="function"?t(e):t}function yi(t){return t.split("-")[0]}function Va(t){return t.split("-")[1]}function ey(t){return t==="x"?"y":"x"}function ty(t){return t==="y"?"height":"width"}function ls(t){return["top","bottom"].includes(yi(t))?"y":"x"}function ny(t){return ey(ls(t))}function o2(t,e,n){n===void 0&&(n=!1);const r=Va(t),i=ny(t),s=ty(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Qd(a)),[a,Qd(a)]}function a2(t){const e=Qd(t);return[dg(t),e,dg(e)]}function dg(t){return t.replace(/start|end/g,e=>s2[e])}function l2(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:a;default:return[]}}function u2(t,e,n,r){const i=Va(t);let s=l2(yi(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(dg)))),s}function Qd(t){return t.replace(/left|right|bottom|top/g,e=>i2[e])}function c2(t){return{top:0,right:0,bottom:0,left:0,...t}}function CT(t){return typeof t!="number"?c2(t):{top:t,right:t,bottom:t,left:t}}function Xd(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function ow(t,e,n){let{reference:r,floating:i}=t;const s=ls(e),a=ny(e),l=ty(a),c=yi(e),f=s==="y",p=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,_=r[l]/2-i[l]/2;let x;switch(c){case"top":x={x:p,y:r.y-i.height};break;case"bottom":x={x:p,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:m};break;case"left":x={x:r.x-i.width,y:m};break;default:x={x:r.x,y:r.y}}switch(Va(e)){case"start":x[a]-=_*(n&&f?-1:1);break;case"end":x[a]+=_*(n&&f?-1:1);break}return x}const d2=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,l=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(e));let f=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:m}=ow(f,r,c),_=r,x={},P=0;for(let b=0;b<l.length;b++){const{name:k,fn:E}=l[b],{x:T,y:S,data:R,reset:I}=await E({x:p,y:m,initialPlacement:r,placement:_,strategy:i,middlewareData:x,rects:f,platform:a,elements:{reference:t,floating:e}});p=T??p,m=S??m,x={...x,[k]:{...x[k],...R}},I&&P<=50&&(P++,typeof I=="object"&&(I.placement&&(_=I.placement),I.rects&&(f=I.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):I.rects),{x:p,y:m}=ow(f,_,c)),b=-1)}return{x:p,y:m,placement:_,strategy:i,middlewareData:x}};async function uu(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:l,strategy:c}=t,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:_=!1,padding:x=0}=vi(e,t),P=CT(x),k=l[_?m==="floating"?"reference":"floating":m],E=Xd(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(k)))==null||n?k:k.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:f,rootBoundary:p,strategy:c})),T=m==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),R=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},I=Xd(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:T,offsetParent:S,strategy:c}):T);return{top:(E.top-I.top+P.top)/R.y,bottom:(I.bottom-E.bottom+P.bottom)/R.y,left:(E.left-I.left+P.left)/R.x,right:(I.right-E.right+P.right)/R.x}}const f2=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:a,elements:l,middlewareData:c}=e,{element:f,padding:p=0}=vi(t,e)||{};if(f==null)return{};const m=CT(p),_={x:n,y:r},x=ny(i),P=ty(x),b=await a.getDimensions(f),k=x==="y",E=k?"top":"left",T=k?"bottom":"right",S=k?"clientHeight":"clientWidth",R=s.reference[P]+s.reference[x]-_[x]-s.floating[P],I=_[x]-s.reference[x],M=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let O=M?M[S]:0;(!O||!await(a.isElement==null?void 0:a.isElement(M)))&&(O=l.floating[S]||s.floating[P]);
vendor: 7,459 bytes, line 226
226const D=R/2-I/2,K=O/2-b[P]/2-1,q=as(m[E],K),ne=as(m[T],K),W=q,$=O-b[P]-ne,z=O/2-b[P]/2+D,se=cg(W,z,$),G=!c.arrow&&Va(i)!=null&&z!==se&&s.reference[P]/2-(z<W?q:ne)-b[P]/2<0,ce=G?z<W?z-W:z-$:0;return{[x]:_[x]+ce,data:{[x]:se,centerOffset:z-se-ce,...G&&{alignmentOffset:ce}},reset:G}}}),h2=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:l,platform:c,elements:f}=e,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:_,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:P="none",flipAlignment:b=!0,...k}=vi(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=yi(i),T=ls(l),S=yi(l)===l,R=await(c.isRTL==null?void 0:c.isRTL(f.floating)),I=_||(S||!b?[Qd(l)]:a2(l)),M=P!=="none";!_&&M&&I.push(...u2(l,b,P,R));const O=[l,...I],D=await uu(e,k),K=[];let q=((r=s.flip)==null?void 0:r.overflows)||[];if(p&&K.push(D[E]),m){const z=o2(i,a,R);K.push(D[z[0]],D[z[1]])}if(q=[...q,{placement:i,overflows:K}],!K.every(z=>z<=0)){var ne,W;const z=(((ne=s.flip)==null?void 0:ne.index)||0)+1,se=O[z];if(se)return{data:{index:z,overflows:q},reset:{placement:se}};let G=(W=q.filter(ce=>ce.overflows[0]<=0).sort((ce,j)=>ce.overflows[1]-j.overflows[1])[0])==null?void 0:W.placement;if(!G)switch(x){case"bestFit":{var $;const ce=($=q.filter(j=>{if(M){const U=ls(j.placement);return U===T||U==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(U=>U>0).reduce((U,V)=>U+V,0)]).sort((j,U)=>j[1]-U[1])[0])==null?void 0:$[0];ce&&(G=ce);break}case"initialPlacement":G=l;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function aw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function lw(t){return r2.some(e=>t[e]>=0)}const p2=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=vi(t,e);switch(r){case"referenceHidden":{const s=await uu(e,{...i,elementContext:"reference"}),a=aw(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:lw(a)}}}case"escaped":{const s=await uu(e,{...i,altBoundary:!0}),a=aw(s,n.floating);return{data:{escapedOffsets:a,escaped:lw(a)}}}default:return{}}}}};async function m2(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=yi(n),l=Va(n),c=ls(n)==="y",f=["left","top"].includes(a)?-1:1,p=s&&c?-1:1,m=vi(e,t);let{mainAxis:_,crossAxis:x,alignmentAxis:P}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof P=="number"&&(x=l==="end"?P*-1:P),c?{x:x*p,y:_*f}:{x:_*f,y:x*p}}const g2=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:a,middlewareData:l}=e,c=await m2(e,t);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:a}}}}},v2=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:k=>{let{x:E,y:T}=k;return{x:E,y:T}}},...c}=vi(t,e),f={x:n,y:r},p=await uu(e,c),m=ls(yi(i)),_=ey(m);let x=f[_],P=f[m];if(s){const k=_==="y"?"top":"left",E=_==="y"?"bottom":"right",T=x+p[k],S=x-p[E];x=cg(T,x,S)}if(a){const k=m==="y"?"top":"left",E=m==="y"?"bottom":"right",T=P+p[k],S=P-p[E];P=cg(T,P,S)}const b=l.fn({...e,[_]:x,[m]:P});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[_]:s,[m]:a}}}}}},y2=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=e,{offset:l=0,mainAxis:c=!0,crossAxis:f=!0}=vi(t,e),p={x:n,y:r},m=ls(i),_=ey(m);let x=p[_],P=p[m];const b=vi(l,e),k=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const S=_==="y"?"height":"width",R=s.reference[_]-s.floating[S]+k.mainAxis,I=s.reference[_]+s.reference[S]-k.mainAxis;x<R?x=R:x>I&&(x=I)}if(f){var E,T;const S=_==="y"?"width":"height",R=["top","left"].includes(yi(i)),I=s.reference[m]-s.floating[S]+(R&&((E=a.offset)==null?void 0:E[m])||0)+(R?0:k.crossAxis),M=s.reference[m]+s.reference[S]+(R?0:((T=a.offset)==null?void 0:T[m])||0)-(R?k.crossAxis:0);P<I?P=I:P>M&&(P=M)}return{[_]:x,[m]:P}}}},_2=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:a,elements:l}=e,{apply:c=()=>{},...f}=vi(t,e),p=await uu(e,f),m=yi(i),_=Va(i),x=ls(i)==="y",{width:P,height:b}=s.floating;let k,E;m==="top"||m==="bottom"?(k=m,E=_===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(E=m,k=_==="end"?"top":"bottom");const T=b-p.top-p.bottom,S=P-p.left-p.right,R=as(b-p[k],T),I=as(P-p[E],S),M=!e.middlewareData.shift;let O=R,D=I;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(D=S),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(O=T),M&&!_){const q=kn(p.left,0),ne=kn(p.right,0),W=kn(p.top,0),$=kn(p.bottom,0);x?D=P-2*(q!==0||ne!==0?q+ne:kn(p.left,p.right)):O=b-2*(W!==0||$!==0?W+$:kn(p.top,p.bottom))}await c({...e,availableWidth:D,availableHeight:O});const K=await a.getDimensions(l.floating);return P!==K.width||b!==K.height?{reset:{rects:!0}}:{}}}};function Wf(){return typeof window<"u"}function Ha(t){return ST(t)?(t.nodeName||"").toLowerCase():"#document"}function In(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Wr(t){var e;return(e=(ST(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ST(t){return Wf()?t instanceof Node||t instanceof In(t).Node:!1}function fr(t){return Wf()?t instanceof Element||t instanceof In(t).Element:!1}function Br(t){return Wf()?t instanceof HTMLElement||t instanceof In(t).HTMLElement:!1}function uw(t){return!Wf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof In(t).ShadowRoot}function Vu(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=hr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function x2(t){return["table","td","th"].includes(Ha(t))}function Zf(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function ry(t){const e=iy(),n=fr(t)?hr(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function w2(t){let e=us(t);for(;Br(e)&&!Na(e);){if(ry(e))return e;if(Zf(e))return null;e=us(e)}return null}function iy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Na(t){return["html","body","#document"].includes(Ha(t))}function hr(t){return In(t).getComputedStyle(t)}function qf(t){return fr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function us(t){if(Ha(t)==="html")return t;const e=t.assignedSlot||t.parentNode||uw(t)&&t.host||Wr(t);return uw(e)?e.host:e}function TT(t){const e=us(t);return Na(e)?t.ownerDocument?t.ownerDocument.body:t.body:Br(e)&&Vu(e)?e:TT(e)}function cu(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=TT(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=In(i);if(s){const l=fg(a);
vendor: 5,747 bytes, line 226
226return e.concat(a,a.visualViewport||[],Vu(i)?i:[],l&&n?cu(l):[])}return e.concat(i,cu(i,[],n))}function fg(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ET(t){const e=hr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Br(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,l=Jd(n)!==s||Jd(r)!==a;return l&&(n=s,r=a),{width:n,height:r,$:l}}function sy(t){return fr(t)?t:t.contextElement}function oa(t){const e=sy(t);if(!Br(e))return $r(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=ET(e);let a=(s?Jd(n.width):n.width)/r,l=(s?Jd(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const b2=$r(0);function PT(t){const e=In(t);return!iy()||!e.visualViewport?b2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function C2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==In(t)?!1:e}function no(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=sy(t);let a=$r(1);e&&(r?fr(r)&&(a=oa(r)):a=oa(t));const l=C2(s,n,r)?PT(s):$r(0);let c=(i.left+l.x)/a.x,f=(i.top+l.y)/a.y,p=i.width/a.x,m=i.height/a.y;if(s){const _=In(s),x=r&&fr(r)?In(r):r;let P=_,b=fg(P);for(;b&&r&&x!==P;){const k=oa(b),E=b.getBoundingClientRect(),T=hr(b),S=E.left+(b.clientLeft+parseFloat(T.paddingLeft))*k.x,R=E.top+(b.clientTop+parseFloat(T.paddingTop))*k.y;c*=k.x,f*=k.y,p*=k.x,m*=k.y,c+=S,f+=R,P=In(b),b=fg(P)}}return Xd({width:p,height:m,x:c,y:f})}function oy(t,e){const n=qf(t).scrollLeft;return e?e.left+n:no(Wr(t)).left+n}function kT(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:oy(t,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function S2(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=Wr(r),l=e?Zf(e.floating):!1;if(r===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},f=$r(1);const p=$r(0),m=Br(r);if((m||!m&&!s)&&((Ha(r)!=="body"||Vu(a))&&(c=qf(r)),Br(r))){const x=no(r);f=oa(r),p.x=x.x+r.clientLeft,p.y=x.y+r.clientTop}const _=a&&!m&&!s?kT(a,c,!0):$r(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+p.x+_.x,y:n.y*f.y-c.scrollTop*f.y+p.y+_.y}}function T2(t){return Array.from(t.getClientRects())}function E2(t){const e=Wr(t),n=qf(t),r=t.ownerDocument.body,i=kn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=kn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+oy(t);const l=-n.scrollTop;return hr(r).direction==="rtl"&&(a+=kn(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:l}}function P2(t,e){const n=In(t),r=Wr(t),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,l=0,c=0;if(i){s=i.width,a=i.height;const f=iy();(!f||f&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:s,height:a,x:l,y:c}}function k2(t,e){const n=no(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Br(t)?oa(t):$r(1),a=t.clientWidth*s.x,l=t.clientHeight*s.y,c=i*s.x,f=r*s.y;return{width:a,height:l,x:c,y:f}}function cw(t,e,n){let r;if(e==="viewport")r=P2(t,n);else if(e==="document")r=E2(Wr(t));else if(fr(e))r=k2(e,n);else{const i=PT(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Xd(r)}function NT(t,e){const n=us(t);return n===e||!fr(n)||Na(n)?!1:hr(n).position==="fixed"||NT(n,e)}function N2(t,e){const n=e.get(t);if(n)return n;let r=cu(t,[],!1).filter(l=>fr(l)&&Ha(l)!=="body"),i=null;const s=hr(t).position==="fixed";let a=s?us(t):t;for(;fr(a)&&!Na(a);){const l=hr(a),c=ry(a);!c&&l.position==="fixed"&&(i=null),(s?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Vu(a)&&!c&&NT(t,a))?r=r.filter(p=>p!==a):i=l,a=us(a)}return e.set(t,r),r}function R2(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?Zf(e)?[]:N2(e,this._c):[].concat(n),r],l=a[0],c=a.reduce((f,p)=>{const m=cw(e,p,i);return f.top=kn(m.top,f.top),f.right=as(m.right,f.right),f.bottom=as(m.bottom,f.bottom),f.left=kn(m.left,f.left),f},cw(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function I2(t){const{width:e,height:n}=ET(t);return{width:e,height:n}}function A2(t,e,n){const r=Br(e),i=Wr(e),s=n==="fixed",a=no(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=$r(0);if(r||!r&&!s)if((Ha(e)!=="body"||Vu(i))&&(l=qf(e)),r){const _=no(e,!0,s,e);c.x=_.x+e.clientLeft,c.y=_.y+e.clientTop}else i&&(c.x=oy(i));const f=i&&!r&&!s?kT(i,l):$r(0),p=a.left+l.scrollLeft-c.x-f.x,m=a.top+l.scrollTop-c.y-f.y;return{x:p,y:m,width:a.width,height:a.height}}function Hp(t){return hr(t).position==="static"}function dw(t,e){if(!Br(t)||hr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Wr(t)===n&&(n=n.ownerDocument.body),n}function RT(t,e){const n=In(t);if(Zf(t))return n;if(!Br(t)){let i=us(t);for(;i&&!Na(i);){if(fr(i)&&!Hp(i))return i;i=us(i)}return n}let r=dw(t,e);for(;r&&x2(r)&&Hp(r);)r=dw(r,e);return r&&Na(r)&&Hp(r)&&!ry(r)?n:r||w2(t)||n}const M2=async function(t){const e=this.getOffsetParent||RT,n=this.getDimensions,r=await n(t.floating);return{reference:A2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function L2(t){return hr(t).direction==="rtl"}const O2={convertOffsetParentRelativeRectToViewportRelativeRect:S2,getDocumentElement:Wr,getClippingRect:R2,getOffsetParent:RT,getElementRects:M2,getClientRects:T2,getDimensions:I2,getScale:oa,isElement:fr,isRTL:L2};function IT(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function j2(t,e){let n=null,r;const i=Wr(t);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const f=t.getBoundingClientRect(),{left:p,top:m,width:_,height:x}=f;if(l||e(),!_||!x)return;
vendor: 6,833 bytes, line 226
226const P=Hc(m),b=Hc(i.clientWidth-(p+_)),k=Hc(i.clientHeight-(m+x)),E=Hc(p),S={rootMargin:-P+"px "+-b+"px "+-k+"px "+-E+"px",threshold:kn(0,as(1,c))||1};let R=!0;function I(M){const O=M[0].intersectionRatio;if(O!==c){if(!R)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!IT(f,t.getBoundingClientRect())&&a(),R=!1}try{n=new IntersectionObserver(I,{...S,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,S)}n.observe(t)}return a(!0),s}function D2(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,f=sy(t),p=i||s?[...f?cu(f):[],...cu(e)]:[];p.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const m=f&&l?j2(f,n):null;let _=-1,x=null;a&&(x=new ResizeObserver(E=>{let[T]=E;T&&T.target===f&&x&&(x.unobserve(e),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var S;(S=x)==null||S.observe(e)})),n()}),f&&!c&&x.observe(f),x.observe(e));let P,b=c?no(t):null;c&&k();function k(){const E=no(t);b&&!IT(b,E)&&n(),b=E,P=requestAnimationFrame(k)}return n(),()=>{var E;p.forEach(T=>{i&&T.removeEventListener("scroll",n),s&&T.removeEventListener("resize",n)}),m==null||m(),(E=x)==null||E.disconnect(),x=null,c&&cancelAnimationFrame(P)}}const F2=g2,$2=v2,z2=h2,B2=_2,U2=p2,fw=f2,V2=y2,H2=(t,e,n)=>{const r=new Map,i={platform:O2,...n},s={...i.platform,_c:r};return d2(t,e,{...i,platform:s})};var _d=typeof document<"u"?w.useLayoutEffect:w.useEffect;function ef(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!ef(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!ef(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function AT(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function hw(t,e){const n=AT(t);return Math.round(e*n)/n}function Wp(t){const e=w.useRef(t);return _d(()=>{e.current=t}),e}function W2(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:f}=t,[p,m]=w.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[_,x]=w.useState(r);ef(_,r)||x(r);const[P,b]=w.useState(null),[k,E]=w.useState(null),T=w.useCallback(j=>{j!==M.current&&(M.current=j,b(j))},[]),S=w.useCallback(j=>{j!==O.current&&(O.current=j,E(j))},[]),R=s||P,I=a||k,M=w.useRef(null),O=w.useRef(null),D=w.useRef(p),K=c!=null,q=Wp(c),ne=Wp(i),W=Wp(f),$=w.useCallback(()=>{if(!M.current||!O.current)return;const j={placement:e,strategy:n,middleware:_};ne.current&&(j.platform=ne.current),H2(M.current,O.current,j).then(U=>{const V={...U,isPositioned:W.current!==!1};z.current&&!ef(D.current,V)&&(D.current=V,ys.flushSync(()=>{m(V)}))})},[_,e,n,ne,W]);_d(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,m(j=>({...j,isPositioned:!1})))},[f]);const z=w.useRef(!1);_d(()=>(z.current=!0,()=>{z.current=!1}),[]),_d(()=>{if(R&&(M.current=R),I&&(O.current=I),R&&I){if(q.current)return q.current(R,I,$);$()}},[R,I,$,q,K]);const se=w.useMemo(()=>({reference:M,floating:O,setReference:T,setFloating:S}),[T,S]),G=w.useMemo(()=>({reference:R,floating:I}),[R,I]),ce=w.useMemo(()=>{const j={position:n,left:0,top:0};if(!G.floating)return j;const U=hw(G.floating,p.x),V=hw(G.floating,p.y);return l?{...j,transform:"translate("+U+"px, "+V+"px)",...AT(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:V}},[n,l,G.floating,p.x,p.y]);return w.useMemo(()=>({...p,update:$,refs:se,elements:G,floatingStyles:ce}),[p,$,se,G,ce])}const Z2=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?fw({element:r.current,padding:i}).fn(n):{}:r?fw({element:r,padding:i}).fn(n):{}}}},q2=(t,e)=>({...F2(t),options:[t,e]}),G2=(t,e)=>({...$2(t),options:[t,e]}),K2=(t,e)=>({...V2(t),options:[t,e]}),Y2=(t,e)=>({...z2(t),options:[t,e]}),J2=(t,e)=>({...B2(t),options:[t,e]}),Q2=(t,e)=>({...U2(t),options:[t,e]}),X2=(t,e)=>({...Z2(t),options:[t,e]});var eO="Arrow",MT=w.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return d.jsx(be.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});MT.displayName=eO;var tO=MT;function LT(t){const[e,n]=w.useState(void 0);return qt(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,l;if("borderBoxSize"in s){const c=s.borderBoxSize,f=Array.isArray(c)?c[0]:c;a=f.inlineSize,l=f.blockSize}else a=t.offsetWidth,l=t.offsetHeight;n({width:a,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var ay="Popper",[OT,Gf]=Hr(ay),[nO,jT]=OT(ay),DT=t=>{const{__scopePopper:e,children:n}=t,[r,i]=w.useState(null);return d.jsx(nO,{scope:e,anchor:r,onAnchorChange:i,children:n})};DT.displayName=ay;var FT="PopperAnchor",$T=w.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=jT(FT,n),a=w.useRef(null),l=Qe(e,a);return w.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:d.jsx(be.div,{...i,ref:l})});$T.displayName=FT;var ly="PopperContent",[rO,iO]=OT(ly),zT=w.forwardRef((t,e)=>{var ee,Ce,Ze,Ie,Ae,he;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:x="optimized",onPlaced:P,...b}=t,k=jT(ly,n),[E,T]=w.useState(null),S=Qe(e,ut=>T(ut)),[R,I]=w.useState(null),M=LT(R),O=(M==null?void 0:M.width)??0,D=(M==null?void 0:M.height)??0,K=r+(s!=="center"?"-"+s:""),q=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},ne=Array.isArray(f)?f:[f],W=ne.length>0,$={padding:q,boundary:ne.filter(oO),altBoundary:W},{refs:z,floatingStyles:se,placement:G,isPositioned:ce,middlewareData:j}=W2({strategy:"fixed",placement:K,whileElementsMounted:(...ut)=>D2(...ut,{animationFrame:x==="always"}),elements:{reference:k.anchor},middleware:[q2({mainAxis:i+D,alignmentAxis:a}),c&&G2({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?K2():void 0,...$}),c&&Y2({...$}),J2({...$,apply:({elements:ut,rects:Rt,availableWidth:Yt,availableHeight:cn})=>{const{width:dn,height:gr}=Rt.reference,Ci=ut.floating.style;
vendor: 6,047 bytes, line 226
226Ci.setProperty("--radix-popper-available-width",`${Yt}px`),Ci.setProperty("--radix-popper-available-height",`${cn}px`),Ci.setProperty("--radix-popper-anchor-width",`${dn}px`),Ci.setProperty("--radix-popper-anchor-height",`${gr}px`)}}),R&&X2({element:R,padding:l}),aO({arrowWidth:O,arrowHeight:D}),_&&Q2({strategy:"referenceHidden",...$})]}),[U,V]=VT(G),re=bn(P);qt(()=>{ce&&(re==null||re())},[ce,re]);const Q=(ee=j.arrow)==null?void 0:ee.x,oe=(Ce=j.arrow)==null?void 0:Ce.y,ae=((Ze=j.arrow)==null?void 0:Ze.centerOffset)!==0,[fe,pe]=w.useState();return qt(()=>{E&&pe(window.getComputedStyle(E).zIndex)},[E]),d.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:ce?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(Ie=j.transformOrigin)==null?void 0:Ie.x,(Ae=j.transformOrigin)==null?void 0:Ae.y].join(" "),...((he=j.hide)==null?void 0:he.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d.jsx(rO,{scope:n,placedSide:U,onArrowChange:I,arrowX:Q,arrowY:oe,shouldHideArrow:ae,children:d.jsx(be.div,{"data-side":U,"data-align":V,...b,ref:S,style:{...b.style,animation:ce?void 0:"none"}})})})});zT.displayName=ly;var BT="PopperArrow",sO={top:"bottom",right:"left",bottom:"top",left:"right"},UT=w.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=iO(BT,r),a=sO[s.placedSide];return d.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:d.jsx(tO,{...i,ref:n,style:{...i.style,display:"block"}})})});UT.displayName=BT;function oO(t){return t!==null}var aO=t=>({name:"transformOrigin",options:t,fn(e){var k,E,T;const{placement:n,rects:r,middlewareData:i}=e,a=((k=i.arrow)==null?void 0:k.centerOffset)!==0,l=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[f,p]=VT(n),m={start:"0%",center:"50%",end:"100%"}[p],_=(((E=i.arrow)==null?void 0:E.x)??0)+l/2,x=(((T=i.arrow)==null?void 0:T.y)??0)+c/2;let P="",b="";return f==="bottom"?(P=a?m:`${_}px`,b=`${-c}px`):f==="top"?(P=a?m:`${_}px`,b=`${r.floating.height+c}px`):f==="right"?(P=`${-c}px`,b=a?m:`${x}px`):f==="left"&&(P=`${r.floating.width+c}px`,b=a?m:`${x}px`),{data:{x:P,y:b}}}});function VT(t){const[e,n="center"]=t.split("-");return[e,n]}var HT=DT,WT=$T,ZT=zT,qT=UT,[Kf,a8]=Hr("Tooltip",[Gf]),Yf=Gf(),GT="TooltipProvider",lO=700,hg="tooltip.open",[uO,uy]=Kf(GT),KT=t=>{const{__scopeTooltip:e,delayDuration:n=lO,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,a=w.useRef(!0),l=w.useRef(!1),c=w.useRef(0);return w.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),d.jsx(uO,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(f=>{l.current=f},[]),disableHoverableContent:i,children:s})};KT.displayName=GT;var Jf="Tooltip",[cO,Qf]=Kf(Jf),YT=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:a,delayDuration:l}=t,c=uy(Jf,t.__scopeTooltip),f=Yf(e),[p,m]=w.useState(null),_=di(),x=w.useRef(0),P=a??c.disableHoverableContent,b=l??c.delayDuration,k=w.useRef(!1),[E=!1,T]=os({prop:r,defaultProp:i,onChange:O=>{O?(c.onOpen(),document.dispatchEvent(new CustomEvent(hg))):c.onClose(),s==null||s(O)}}),S=w.useMemo(()=>E?k.current?"delayed-open":"instant-open":"closed",[E]),R=w.useCallback(()=>{window.clearTimeout(x.current),x.current=0,k.current=!1,T(!0)},[T]),I=w.useCallback(()=>{window.clearTimeout(x.current),x.current=0,T(!1)},[T]),M=w.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{k.current=!0,T(!0),x.current=0},b)},[b,T]);return w.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),d.jsx(HT,{...f,children:d.jsx(cO,{scope:e,contentId:_,open:E,stateAttribute:S,trigger:p,onTriggerChange:m,onTriggerEnter:w.useCallback(()=>{c.isOpenDelayedRef.current?M():R()},[c.isOpenDelayedRef,M,R]),onTriggerLeave:w.useCallback(()=>{P?I():(window.clearTimeout(x.current),x.current=0)},[I,P]),onOpen:R,onClose:I,disableHoverableContent:P,children:n})})};YT.displayName=Jf;var pg="TooltipTrigger",JT=w.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Qf(pg,n),s=uy(pg,n),a=Yf(n),l=w.useRef(null),c=Qe(e,l,i.onTriggerChange),f=w.useRef(!1),p=w.useRef(!1),m=w.useCallback(()=>f.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),d.jsx(WT,{asChild:!0,...a,children:d.jsx(be.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:ve(t.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:ve(t.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:ve(t.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ve(t.onFocus,()=>{f.current||i.onOpen()}),onBlur:ve(t.onBlur,i.onClose),onClick:ve(t.onClick,i.onClose)})})});JT.displayName=pg;var dO="TooltipPortal",[l8,fO]=Kf(dO,{forceMount:void 0}),Ra="TooltipContent",QT=w.forwardRef((t,e)=>{const n=fO(Ra,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,a=Qf(Ra,t.__scopeTooltip);return d.jsx(xs,{present:r||a.open,children:a.disableHoverableContent?d.jsx(XT,{side:i,...s,ref:e}):d.jsx(hO,{side:i,...s,ref:e})})}),hO=w.forwardRef((t,e)=>{const n=Qf(Ra,t.__scopeTooltip),r=uy(Ra,t.__scopeTooltip),i=w.useRef(null),s=Qe(e,i),[a,l]=w.useState(null),{trigger:c,onClose:f}=n,p=i.current,{onPointerInTransitChange:m}=r,_=w.useCallback(()=>
vendor: 4,193 bytes, line 226
226{l(null),m(!1)},[m]),x=w.useCallback((P,b)=>{const k=P.currentTarget,E={x:P.clientX,y:P.clientY},T=yO(E,k.getBoundingClientRect()),S=_O(E,T),R=xO(b.getBoundingClientRect()),I=bO([...S,...R]);l(I),m(!0)},[m]);return w.useEffect(()=>()=>_(),[_]),w.useEffect(()=>{if(c&&p){const P=k=>x(k,p),b=k=>x(k,c);return c.addEventListener("pointerleave",P),p.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",P),p.removeEventListener("pointerleave",b)}}},[c,p,x,_]),w.useEffect(()=>{if(a){const P=b=>{const k=b.target,E={x:b.clientX,y:b.clientY},T=(c==null?void 0:c.contains(k))||(p==null?void 0:p.contains(k)),S=!wO(E,a);T?_():S&&(_(),f())};return document.addEventListener("pointermove",P),()=>document.removeEventListener("pointermove",P)}},[c,p,a,f,_]),d.jsx(XT,{...t,ref:s})}),[pO,mO]=Kf(Jf,{isInside:!1}),gO=jA("TooltipContent"),XT=w.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...l}=t,c=Qf(Ra,n),f=Yf(n),{onClose:p}=c;return w.useEffect(()=>(document.addEventListener(hg,p),()=>document.removeEventListener(hg,p)),[p]),w.useEffect(()=>{if(c.trigger){const m=_=>{const x=_.target;x!=null&&x.contains(c.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,p]),d.jsx(Bu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:d.jsxs(ZT,{"data-state":c.stateAttribute,...f,...l,ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(gO,{children:r}),d.jsx(pO,{scope:n,isInside:!0,children:d.jsx(nM,{id:c.contentId,role:"tooltip",children:i||r})})]})})});QT.displayName=Ra;var eE="TooltipArrow",vO=w.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Yf(n);return mO(eE,n).isInside?null:d.jsx(qT,{...i,...r,ref:e})});vO.displayName=eE;function yO(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function _O(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function xO(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function wO(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const l=e[s].x,c=e[s].y,f=e[a].x,p=e[a].y;c>r!=p>r&&n<(f-l)*(r-c)/(p-c)+l&&(i=!i)}return i}function bO(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),CO(e)}function CO(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var SO=KT,TO=YT,EO=JT,tE=QT;const nE=SO,PO=TO,kO=EO,rE=w.forwardRef(({className:t,sideOffset:e=4,...n},r)=>d.jsx(tE,{ref:r,sideOffset:e,className:X("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
226de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));rE.displayName=tE.displayName;var Xf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},eh=typeof window>"u"||"Deno"in globalThis;function tr(){}function NO(t,e){return typeof t=="function"?t(e):t}function RO(t){return typeof t=="number"&&t>=0&&t!==1/0}function IO(t,e){return Math.max(t+(e||0)-Date.now(),0)}function pw(t,e){return typeof t=="function"?t(e):t}function AO(t,e){return typeof t=="function"?t(e):t}function mw(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:l}=t;if(a){if(r){if(e.queryHash!==cy(a,e.options))return!1}else if(!fu(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||i&&i!==e.state.fetchStatus||s&&!s(e))}function gw(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(du(e.options.mutationKey)!==du(s))return!1}else if(!fu(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function cy(t,e){return((e==null?void 0:e.queryKeyHashFn)||du)(t)}function du(t){return JSON.stringify(t,(e,n)=>mg(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function fu(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>fu(t[n],e[n])):!1}function iE(t,e){if(t===e)return t;const n=vw(t)&&vw(e);if(n||mg(t)&&mg(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),a=s.length,l=n?[]:{};let c=0;for(let f=0;f<a;f++){const p=n?f:s[f];(!n&&r.includes(p)||n)&&t[p]===void 0&&e[p]===void 0?(l[p]=void 0,c++):(l[p]=iE(t[p],e[p]),l[p]===t[p]&&t[p]!==void 0&&c++)}return i===a&&c===i?t:l}return e}function vw(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function mg(t){if(!yw(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!yw(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function yw(t){return Object.prototype.toString.call(t)==="[object Object]"}function MO(t){return new Promise(e=>{setTimeout(e,t)})}function LO(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?iE(t,e):e}function OO(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function jO(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var dy=Symbol();function sE(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===dy?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Vs,Bi,fa,cb,DO=(cb=class extends Xf{constructor(){super();Ve(this,Vs);Ve(this,Bi);Ve(this,fa);Te(this,fa,e=>{if(!eh&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){H(this,Bi)||this.setEventListener(H(this,fa))}onUnsubscribe(){var e;this.hasListeners()||((e=H(this,Bi))==null||e.call(this),Te(this,Bi,void 0))}setEventListener(e){var n;Te(this,fa,e),(n=H(this,Bi))==null||n.call(this),Te(this,Bi,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){H(this,Vs)!==e&&(Te(this,Vs,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof H(this,Vs)=="boolean"?H(this,Vs):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Vs=new WeakMap,Bi=new WeakMap,fa=new WeakMap,cb),oE=new DO,ha,Ui,pa,db,FO=(db=class extends Xf{constructor(){super();Ve(this,ha,!0);Ve(this,Ui);Ve(this,pa);Te(this,pa,e=>{if(!eh&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){H(this,Ui)||this.setEventListener(H(this,pa))}onUnsubscribe(){var e;this.hasListeners()||((e=H(this,Ui))==null||e.call(this),Te(this,Ui,void 0))}setEventListener(e){var n;Te(this,pa,e),(n=H(this,Ui))==null||n.call(this),Te(this,Ui,e(this.setOnline.bind(this)))}setOnline(e){H(this,ha)!==e&&(Te(this,ha,e),this.listeners.forEac
vendor: 19,186 bytes, line 226
226h(r=>{r(e)}))}isOnline(){return H(this,ha)}},ha=new WeakMap,Ui=new WeakMap,pa=new WeakMap,db),tf=new FO;function $O(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function zO(t){return Math.min(1e3*2**t,3e4)}function aE(t){return(t??"online")==="online"?tf.isOnline():!0}var lE=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Zp(t){return t instanceof lE}function uE(t){let e=!1,n=0,r=!1,i;const s=$O(),a=b=>{var k;r||(_(new lE(b)),(k=t.abort)==null||k.call(t))},l=()=>{e=!0},c=()=>{e=!1},f=()=>oE.isFocused()&&(t.networkMode==="always"||tf.isOnline())&&t.canRun(),p=()=>aE(t.networkMode)&&t.canRun(),m=b=>{var k;r||(r=!0,(k=t.onSuccess)==null||k.call(t,b),i==null||i(),s.resolve(b))},_=b=>{var k;r||(r=!0,(k=t.onError)==null||k.call(t,b),i==null||i(),s.reject(b))},x=()=>new Promise(b=>{var k;i=E=>{(r||f())&&b(E)},(k=t.onPause)==null||k.call(t)}).then(()=>{var b;i=void 0,r||(b=t.onContinue)==null||b.call(t)}),P=()=>{if(r)return;let b;const k=n===0?t.initialPromise:void 0;try{b=k??t.fn()}catch(E){b=Promise.reject(E)}Promise.resolve(b).then(m).catch(E=>{var M;if(r)return;const T=t.retry??(eh?0:3),S=t.retryDelay??zO,R=typeof S=="function"?S(n,E):S,I=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,E);if(e||!I){_(E);return}n++,(M=t.onFail)==null||M.call(t,n,E),MO(R).then(()=>f()?void 0:x()).then(()=>{e?_(E):P()})})};return{promise:s,cancel:a,continue:()=>(i==null||i(),s),cancelRetry:l,continueRetry:c,canStart:p,start:()=>(p()?P():x().then(P),s)}}var BO=t=>setTimeout(t,0);function UO(){let t=[],e=0,n=l=>{l()},r=l=>{l()},i=BO;const s=l=>{e?t.push(l):i(()=>{n(l)})},a=()=>{const l=t;t=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;e++;try{c=l()}finally{e--,e||a()}return c},batchCalls:l=>(...c)=>{s(()=>{l(...c)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var nn=UO(),Hs,fb,cE=(fb=class{constructor(){Ve(this,Hs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),RO(this.gcTime)&&Te(this,Hs,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(eh?1/0:5*60*1e3))}clearGcTimeout(){H(this,Hs)&&(clearTimeout(H(this,Hs)),Te(this,Hs,void 0))}},Hs=new WeakMap,fb),ma,ga,zn,Ws,Ht,Lu,Zs,nr,ei,hb,VO=(hb=class extends cE{constructor(e){super();Ve(this,nr);Ve(this,ma);Ve(this,ga);Ve(this,zn);Ve(this,Ws);Ve(this,Ht);Ve(this,Lu);Ve(this,Zs);Te(this,Zs,!1),Te(this,Lu,e.defaultOptions),this.setOptions(e.options),this.observers=[],Te(this,Ws,e.client),Te(this,zn,H(this,Ws).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Te(this,ma,WO(this.options)),this.state=e.state??H(this,ma),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=H(this,Ht))==null?void 0:e.promise}setOptions(e){this.options={...H(this,Lu),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&H(this,zn).remove(this)}setData(e,n){const r=LO(this.state.data,e,this.options);return Bt(this,nr,ei).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Bt(this,nr,ei).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=H(this,Ht))==null?void 0:r.promise;return(i=H(this,Ht))==null||i.cancel(e),n?n.then(tr).catch(tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(H(this,ma))}isActive(){return this.observers.some(e=>AO(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dy||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!IO(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=H(this,Ht))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=H(this,Ht))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),H(this,zn).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(H(this,Ht)&&(H(this,Zs)?H(this,Ht).cancel({revert:!0}):H(this,Ht).cancelRetry()),this.scheduleGc()),H(this,zn).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Bt(this,nr,ei).call(this,{type:"invalidate"})}fetch(e,n){var c,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(H(this,Ht))return H(this,Ht).continueRetry(),H(this,Ht).promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(_=>_.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(Te(this,Zs,!0),r.signal)})},s=()=>{const m=sE(this.options,n),_={client:H(this,Ws),queryKey:this.queryKey,meta:this.meta};return i(_),Te(this,Zs,!1),this.options.persister?this.options.persister(m,_,this):m(_)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:H(this,Ws),state:this.state,fetchFn:s};i(a),(c=this.options.behavior)==null||c.onFetch(a,this),Te(this,ga,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Bt(this,nr,ei).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=m=>{var _,x,P,b;Zp(m)&&m.silent||Bt(this,nr,ei).call(this,{type:"error",error:m}),Zp(m)||((x=(_=H(this,zn).config).onError)==null||x.call(_,m,this),(b=(P=H(this,zn).config).onSettled)==null||b.call(P,this.state.data,m,this)),this.scheduleGc()};return Te(this,Ht,uE({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var _,x,P,b;if(m===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(k){l(k);return}(x=(_=H(this,zn).config).onSuccess)==null||x.call(_,m,this),(b=(P=H(this,zn).config).onSettled)==null||b.call(P,m,this.state.error,this),this.scheduleGc()},onError:l,onFail:(m,_)=>{Bt(this,nr,ei).call(this,{type:"failed",failureCount:m,error:_})},onPause:()=>{Bt(this,nr,ei).call(this,{type:"pause"})},onContinue:()=>{Bt(this,nr,ei).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),H(this,Ht).start()}},ma=new WeakMap,ga=new WeakMap,zn=new WeakMap,Ws=new WeakMap,Ht=new WeakMap,Lu=new WeakMap,Zs=new WeakMap,nr=new WeakSet,ei=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...HO(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return Zp(i)&&i.revert&&H(this,ga)?{...H(this,ga),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),nn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),H(this,zn).notify({query:this,type:"updated",action:e})})},hb);function HO(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:aE(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function WO(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Rr,pb,ZO=(pb=class extends Xf{constructor(e={}){super();Ve(this,Rr);this.config=e,Te(this,Rr,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??cy(i,n);let a=this.get(s);return a||(a=new VO({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){H(this,Rr).has(e.queryHash)||(H(this,Rr).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=H(this,Rr).get(e.queryHash);n&&(e.destroy(),n===e&&H(this,Rr).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){nn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return H(this,Rr).get(e)}getAll(){return[...H(this,Rr).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>mw(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>mw(e,r)):n}notify(e){nn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){nn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){nn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Rr=new WeakMap,pb),Ir,en,qs,Ar,Ii,mb,qO=(mb=class extends cE{constructor(e){super();Ve(this,Ar);Ve(this,Ir);Ve(this,en);Ve(this,qs);this.mutationId=e.mutationId,Te(this,en,e.mutationCache),Te(this,Ir,[]),this.state=e.state||GO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){H(this,Ir).includes(e)||(H(this,Ir).push(e),this.clearGcTimeout(),H(this,en).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Te(this,Ir,H(this,Ir).filter(n=>n!==e)),this.scheduleGc(),H(this,en).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){H(this,Ir).length||(this.state.status==="pending"?this.scheduleGc():H(this,en).remove(this))}continue(){var e;return((e=H(this,qs))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,a,l,c,f,p,m,_,x,P,b,k,E,T,S,R,I,M,O;Te(this,qs,uE({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(D,K)=>{Bt(this,Ar,Ii).call(this,{type:"failed",failureCount:D,error:K})},onPause:()=>{Bt(this,Ar,Ii).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Ar,Ii).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>H(this,en).canRun(this)}));const n=this.state.status==="pending",r=!H(this,qs).canStart();try{if(!n){Bt(this,Ar,Ii).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=H(this,en).config).onMutate)==null?void 0:s.call(i,e,this));const K=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,e));K!==this.state.context&&Bt(this,Ar,Ii).call(this,{type:"pending",context:K,variables:e,isPaused:r})}const D=await H(this,qs).start();return await((f=(c=H(this,en).config).onSuccess)==null?void 0:f.call(c,D,e,this.state.context,this)),await((m=(p=this.options).onSuccess)==null?void 0:m.call(p,D,e,this.state.context)),await((x=(_=H(this,en).config).onSettled)==null?void 0:x.call(_,D,null,this.state.variables,this.state.context,this)),await((b=(P=this.options).onSettled)==null?void 0:b.call(P,D,null,e,this.state.context)),Bt(this,Ar,Ii).call(this,{type:"success",data:D}),D}catch(D){try{throw await((E=(k=H(this,en).config).onError)==null?void 0:E.call(k,D,e,this.state.context,this)),await((S=(T=this.options).onError)==null?void 0:S.call(T,D,e,this.state.context)),await((I=(R=H(this,en).config).onSettled)==null?void 0:I.call(R,void 0,D,this.state.variables,this.state.context,this)),await((O=(M=this.options).onSettled)==null?void 0:O.call(M,void 0,D,e,this.state.context)),D}finally{Bt(this,Ar,Ii).call(this,{type:"error",error:D})}}finally{H(this,en).runNext(this)}}},Ir=new WeakMap,en=new WeakMap,qs=new WeakMap,Ar=new WeakSet,Ii=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),nn.batch(()=>{H(this,Ir).forEach(r=>{r.onMutationUpdate(e)}),H(this,en).notify({mutation:this,type:"updated",action:e})})},mb);function GO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oi,rr,Ou,gb,KO=(gb=class extends Xf{constructor(e={}){super();Ve(this,oi);Ve(this,rr);Ve(this,Ou);this.config=e,Te(this,oi,new Set),Te(this,rr,new Map),Te(this,Ou,0)}build(e,n,r){const i=new qO({mutationCache:this,mutationId:++Cc(this,Ou)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){H(this,oi).add(e);const n=Wc(e);if(typeof n=="string"){const r=H(this,rr).get(n);r?r.push(e):H(this,rr).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(H(this,oi).delete(e)){const n=Wc(e);if(typeof n=="string"){const r=H(this,rr).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&H(this,rr).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Wc(e);if(typeof n=="string"){const r=H(this,rr).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=Wc(e);if(typeof n=="string"){const i=(r=H(this,rr).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){nn.batch(()=>{H(this,oi).forEach(e=>{this.notify({type:"removed",mutation:e})}),H(this,oi).clear(),H(this,rr).clear()})}getAll(){return Array.from(H(this,oi))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>gw(n,r))}findAll(e={}){return this.getAll().filter(n=>gw(e,n))}notify(e){nn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return nn.batch(()=>Promise.all(e.map(n=>n.continue().catch(tr))))}},oi=new WeakMap,rr=new WeakMap,Ou=new WeakMap,gb);function Wc(t){var e;return(e=t.options.scope)==null?void 0:e.id}function _w(t){return{onFetch:(e,n)=>{var p,m,_,x,P;const r=e.options,i=(_=(m=(p=e.fetchOptions)==null?void 0:p.meta)==null?void 0:m.fetchMore)==null?void 0:_.direction,s=((x=e.state.data)==null?void 0:x.pages)||[],a=((P=e.state.data)==null?void 0:P.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const f=async()=>{let b=!1;const k=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(e.signal.aborted?b=!0:e.signal.addEventListener("abort",()=>{b=!0}),e.signal)})},E=sE(e.options,e.fetchOptions),T=async(S,R,I)=>{if(b)return Promise.reject();if(R==null&&S.pages.length)return Promise.resolve(S);const M={client:e.client,queryKey:e.queryKey,pageParam:R,direction:I?"backward":"forward",meta:e.options.meta};k(M);const O=await E(M),{maxPages:D}=e.options,K=I?jO:OO;return{pages:K(S.pages,O,D),pageParams:K(S.pageParams,R,D)}};if(i&&s.length){const S=i==="backward",R=S?YO:xw,I={pages:s,pageParams:a},M=R(r,I);l=await T(I,M,S)}else{const S=t??s.length;do{const R=c===0?a[0]??r.initialPageParam:xw(r,l);if(c>0&&R==null)break;l=await T(l,R),c++}while(c<S)}return l};e.options.persister?e.fetchFn=()=>{var b,k;return(k=(b=e.options).persister)==null?void 0:k.call(b,f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=f}}}function xw(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function YO(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var vt,Vi,Hi,va,ya,Wi,_a,xa,vb,JO=(vb=class{constructor(t={}){Ve(this,vt);Ve(this,Vi);Ve(this,Hi);Ve(this,va);Ve(this,ya);Ve(this,Wi);Ve(this,_a);Ve(this,xa);Te(this,vt,t.queryCache||new ZO),Te(this,Vi,t.mutationCache||new KO),Te(this,Hi,t.defaultOptions||{}),Te(this,va,new Map),Te(this,ya,new Map),Te(this,Wi,0)}mount(){Cc(this,Wi)._++,H(this,Wi)===1&&(Te(this,_a,oE.subscribe(async t=>{t&&(await this.resumePausedMutations(),H(this,vt).onFocus())})),Te(this,xa,tf.subscribe(async t=>{t&&(await this.resumePausedMutations(),H(this,vt).onOnline())})))}unmount(){var t,e;Cc(this,Wi)._--,H(this,Wi)===0&&((t=H(this,_a))==null||t.call(this),Te(this,_a,void 0),(e=H(this,xa))==null||e.call(this),Te(this,xa,void 0))}isFetching(t){return H(this,vt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return H(this,Vi).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=H(this,vt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=H(this,vt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(pw(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return H(this,vt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=H(this,vt).get(r.queryHash),s=i==null?void 0:i.state.data,a=NO(e,s);if(a!==void 0)return H(this,vt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return nn.batch(()=>H(this,vt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=H(this,vt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=H(this,vt);nn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=H(this,vt);return nn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=nn.batch(()=>H(this,vt).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(tr).catch(tr)}invalidateQueries(t,e={}){return nn.batch(()=>(H(this,vt).findAll(t).forEach(n=>
226{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=nn.batch(()=>H(this,vt).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(tr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(tr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=H(this,vt).build(this,e);return n.isStaleByTime(pw(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(tr).catch(tr)}fetchInfiniteQuery(t){return t.behavior=_w(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(tr).catch(tr)}ensureInfiniteQueryData(t){return t.behavior=_w(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return tf.isOnline()?H(this,Vi).resumePausedMutations():Promise.resolve()}getQueryCache(){return H(this,vt)}getMutationCache(){return H(this,Vi)}getDefaultOptions(){return H(this,Hi)}setDefaultOptions(t){Te(this,Hi,t)}setQueryDefaults(t,e){H(this,va).set(du(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...H(this,va).values()],n={};return e.forEach(r=>{fu(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){H(this,ya).set(du(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...H(this,ya).values()],n={};return e.forEach(r=>{fu(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...H(this,Hi).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=cy(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===dy&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...H(this,Hi).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){H(this,vt).clear(),H(this,Vi).clear()}},vt=new WeakMap,Vi=new WeakMap,Hi=new WeakMap,va=new WeakMap,ya=new WeakMap,Wi=new WeakMap,_a=new WeakMap,xa=new WeakMap,vb),QO=w.createContext(void 0),XO=({client:t,children:e})=>(w.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),d.jsx(QO.Provider,{value:t,children:e}));/** 227 * @remix-run/router v1.23.0 228 * 229 * Copyright (c) Remix Software Inc. 230 * 231 * This source code is licensed under the MIT license found in the 232 * LICENSE.md file in the root directory of this source tree. 233 * 234 * @license MIT 235 */function hu(){return hu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},hu.apply(this,arguments)}var Gi;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Gi||(Gi={}));const ww="popstate";function ej(t){t===void 0&&(t={});function e(r,i){let{pathname:s,search:a,hash:l}=r.location;return gg("",{pathname:s,search:a,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:nf(i)}return nj(e,n,null,t)}function mt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function dE(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function tj(){return Math.random().toString(36).substr(2,8)}function bw(t,e){return{usr:t.state,key:t.key,idx:e}}function gg(t,e,n,r){return n===void 0&&(n=null),hu({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Wa(e):e,{state:n,key:e&&e.key||r||tj()})}function nf(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Wa(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function nj(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,l=Gi.Pop,c=null,f=p();f==null&&(f=0,a.replaceState(hu({},a.state,{idx:f}),""));function p(){return(a.state||{idx:null}).idx}function m(){l=Gi.Pop;let k=p(),E=k==null?null:k-f;f=k,c&&c({action:l,location:b.location,delta:E})}function _(k,E){l=Gi.Push;let T=gg(b.location,k,E);f=p()+1;let S=bw(T,f),R=b.createHref(T);try{a.pushState(S,"",R)}
vendor: 3,212 bytes, line 235
235catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(R)}s&&c&&c({action:l,location:b.location,delta:1})}function x(k,E){l=Gi.Replace;let T=gg(b.location,k,E);f=p();let S=bw(T,f),R=b.createHref(T);a.replaceState(S,"",R),s&&c&&c({action:l,location:b.location,delta:0})}function P(k){let E=i.location.origin!=="null"?i.location.origin:i.location.href,T=typeof k=="string"?k:nf(k);return T=T.replace(/ $/,"%20"),mt(E,"No window.location.(origin|href) available to create URL for href: "+T),new URL(T,E)}let b={get action(){return l},get location(){return t(i,a)},listen(k){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(ww,m),c=k,()=>{i.removeEventListener(ww,m),c=null}},createHref(k){return e(i,k)},createURL:P,encodeLocation(k){let E=P(k);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:_,replace:x,go(k){return a.go(k)}};return b}var Cw;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Cw||(Cw={}));function rj(t,e,n){return n===void 0&&(n="/"),ij(t,e,n)}function ij(t,e,n,r){let i=typeof e=="string"?Wa(e):e,s=Ia(i.pathname||"/",n);if(s==null)return null;let a=fE(t);sj(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let f=gj(s);l=pj(a[c],f)}return l}function fE(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,a,l)=>{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};c.relativePath.startsWith("/")&&(mt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let f=rs([r,c.relativePath]),p=n.concat(c);s.children&&s.children.length>0&&(mt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),fE(s.children,e,p,f)),!(s.path==null&&!s.index)&&e.push({path:f,score:fj(f,s.index),routesMeta:p})};return t.forEach((s,a)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,a);else for(let c of hE(s.path))i(s,a,c)}),e}function hE(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=hE(r.join("/")),l=[];return l.push(...a.map(c=>c===""?s:[s,c].join("/"))),i&&l.push(...a),l.map(c=>t.startsWith("/")&&c===""?"/":c)}function sj(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:hj(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const oj=/^:[\w-]+$/,aj=3,lj=2,uj=1,cj=10,dj=-2,Sw=t=>t==="*";function fj(t,e){let n=t.split("/"),r=n.length;return n.some(Sw)&&(r+=dj),e&&(r+=lj),n.filter(i=>!Sw(i)).reduce((i,s)=>i+(oj.test(s)?aj:s===""?uj:cj),r)}function hj(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function pj(t,e,n){let{routesMeta:r}=t,i={},s="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],f=l===r.length-1,p=s==="/"?e:e.slice(s.length)||"/",m=vg({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},p),_=c.route;if(!m)return null;
vendor: 8,996 bytes, lines 235-244
235Object.assign(i,m.params),a.push({params:i,pathname:rs([s,m.pathname]),pathnameBase:xj(rs([s,m.pathnameBase])),route:_}),m.pathnameBase!=="/"&&(s=rs([s,m.pathnameBase]))}return a}function vg(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=mj(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((f,p,m)=>{let{paramName:_,isOptional:x}=p;if(_==="*"){let b=l[m]||"";a=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const P=l[m];return x&&!P?f[_]=void 0:f[_]=(P||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:a,pattern:t}}function mj(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),dE(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function gj(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return dE(!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 Ia(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function vj(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Wa(t):t;return{pathname:n?n.startsWith("/")?n:yj(n,e):e,search:wj(r),hash:bj(i)}}function yj(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function qp(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function _j(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function fy(t,e){let n=_j(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function hy(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Wa(t):(i=hu({},t),mt(!i.pathname||!i.pathname.includes("?"),qp("?","pathname","search",i)),mt(!i.pathname||!i.pathname.includes("#"),qp("#","pathname","hash",i)),mt(!i.search||!i.search.includes("#"),qp("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,l;if(a==null)l=n;else{let m=e.length-1;if(!r&&a.startsWith("..")){let _=a.split("/");for(;_[0]==="..";)_.shift(),m-=1;i.pathname=_.join("/")}l=m>=0?e[m]:"/"}let c=vj(i,l),f=a&&a!=="/"&&a.endsWith("/"),p=(s||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||p)&&(c.pathname+="/"),c}const rs=t=>t.join("/").replace(/\/\/+/g,"/"),xj=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),wj=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,bj=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Cj(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const pE=["post","put","patch","delete"];new Set(pE);const Sj=["get",...pE];new Set(Sj);/** 236 * React Router v6.30.0 237 * 238 * Copyright (c) Remix Software Inc. 239 * 240 * This source code is licensed under the MIT license found in the 241 * LICENSE.md file in the root directory of this source tree. 242 * 243 * @license MIT 244 */function pu(){return pu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pu.apply(this,arguments)}const th=w.createContext(null),mE=w.createContext(null),wi=w.createContext(null),nh=w.createContext(null),bi=w.createContext({outlet:null,matches:[],isDataRoute:!1}),gE=w.createContext(null);function Tj(t,e){let{relative:n}=e===void 0?{}:e;Za()||mt(!1);let{basename:r,navigator:i}=w.useContext(wi),{hash:s,pathname:a,search:l}=rh(t,{relative:n}),c=a;return r!=="/"&&(c=a==="/"?r:rs([r,a])),i.createHref({pathname:c,search:l,hash:s})}function Za(){return w.useContext(nh)!=null}function ws(){return Za()||mt(!1),w.useContext(nh).location}function vE(t){w.useContext(wi).static||w.useLayoutEffect(t)}function qa(){let{isDataRoute:t}=w.useContext(bi);return t?$j():Ej()}function Ej(){Za()||mt(!1);let t=w.useContext(th),{basename:e,future:n,navigator:r}=w.useContext(wi),{matches:i}=w.useContext(bi),{pathname:s}=ws(),a=JSON.stringify(fy(i,n.v7_relativeSplatPath)),l=w.useRef(!1);return vE(()=>{l.current=!0}),w.useCallback(function(f,p){if(p===void 0&&(p={}),!l.current)return;if(typeof f=="number"){r.go(f);return}let m=hy(f,JSON.parse(a),s,p.relative==="path");t==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:rs([e,m.pathname])),(p.replace?r.replace:r.push)(m,p.state,p)},[e,r,a,s,t])}function Pj(){let{matches:t}=w.useContext(bi),e=t[t.length-1];return e?e.params:{}}function rh(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=w.useContext(wi),{matches:i}=w.useContext(bi),{pathname:s}=ws(),a=JSON.stringify(fy(i,r.v7_relativeSplatPath));return w.useMemo(()=>hy(t,JSON.parse(a),s,n==="path"),[t,a,s,n])}function kj(t,e){return Nj(t,e)}function Nj(t,e,n,r){Za()||mt(!1);let{navigator:i,static:s}=w.useContext(wi),{matches:a}=w.useContext(bi),l=a[a.length-1],c=l?l.params:{};l&&l.pathname;let f=l?l.pathnameBase:"/";l&&l.route;let p=ws(),m;if(e){var _;let E=typeof e=="string"?Wa(e):e;f==="/"||(_=E.pathname)!=null&&_.startsWith(f)||mt(!1),m=E}else m=p;let x=m.pathname||"/",P=x;if(f!=="/"){let E=f.replace(/^\//,"").split("/");P="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let b=rj(t,{pathname:P}),k=Lj(b&&b.map(E=>Object.assign({},E,{params:Object.assign({},c,E.params),pathname:rs([f,i.encodeLocation?i.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?f:rs([f,i.encodeLocation?i.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),a,n,r);return e&&k?w.createElement(nh.Provider,{value:{location:pu({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:Gi.Pop}},k):k}function Rj(){let t=Fj(),e=Cj(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),n?w.createElement("pre",{style:i},n):null,null)}const Ij=w.createElement(Rj,null);class Aj extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?w.createElement(bi.Provider,{value:this.props.routeContext},w.createElement(gE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Mj(t){let{routeContext:e,match:n,children:r}=t,i=w.useContext(th);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(bi.Provider,{value:e},r)}function Lj(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,l=(i=n)==null?void 0:i.errors;if(l!=null){let p=a.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);p>=0||mt(!1),a=a.slice(0,Math.min(a.length,p+1))}let c=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p<a.length;p++){let m=a[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(f=p),m.route.id){let{loaderData:_,errors:x}=n,P=m.route.loader&&_[m.route.id]===void 0&&(!x||x[m.route.id]===void 0);if(m.route.lazy||P){c=!0,f>=0?a=a.slice(0,f+1):a=[a[0]];break}}}return a.reduceRight((p,m,_)=>{let x,P=!1,b=null,k=null;n&&(x=l&&m.route.id?l[m.route.id]:void 0,b=m.route.errorElement||Ij,c&&
244(f<0&&_===0?(zj("route-fallback"),P=!0,k=null):f===_&&(P=!0,k=m.route.hydrateFallbackElement||null)));let E=e.concat(a.slice(0,_+1)),T=()=>{let S;return x?S=b:P?S=k:m.route.Component?S=w.createElement(m.route.Component,null):m.route.element?S=m.route.element:S=p,w.createElement(Mj,{match:m,routeContext:{outlet:p,matches:E,isDataRoute:n!=null},children:S})};return n&&(m.route.ErrorBoundary||m.route.errorElement||_===0)?w.createElement(Aj,{location:n.location,revalidation:n.revalidation,component:b,error:x,children:T(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):T()},null)}var yE=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(yE||{}),_E=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}(_E||{});function Oj(t){let e=w.useContext(th);return e||mt(!1),e}function jj(t){let e=w.useContext(mE);return e||mt(!1),e}function Dj(t){let e=w.useContext(bi);return e||mt(!1),e}function xE(t){let e=Dj(),n=e.matches[e.matches.length-1];return n.route.id||mt(!1),n.route.id}function Fj(){var t;let e=w.useContext(gE),n=jj(),r=xE();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function $j(){let{router:t}=Oj(yE.UseNavigateStable),e=xE(_E.UseNavigateStable),n=w.useRef(!1);return vE(()=>{n.current=!0}),w.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,pu({fromRouteId:e},s)))},[t,e])}const Tw={};function zj(t,e,n){Tw[t]||(Tw[t]=!0)}function Bj(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Uj(t){let{to:e,replace:n,state:r,relative:i}=t;Za()||mt(!1);let{future:s,static:a}=w.useContext(wi),{matches:l}=w.useContext(bi),{pathname:c}=ws(),f=qa(),p=hy(e,fy(l,s.v7_relativeSplatPath),c,i==="path"),m=JSON.stringify(p);return w.useEffect(()=>f(JSON.parse(m),{replace:n,state:r,relative:i}),[f,m,i,n,r]),null}function Xt(t){mt(!1)}function Vj(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Gi.Pop,navigator:s,static:a=!1,future:l}=t;Za()&&mt(!1);let c=e.replace(/^\/*/,"/"),f=w.useMemo(()=>({basename:c,navigator:s,static:a,future:pu({v7_relativeSplatPath:!1},l)}),[c,l,s,a]);typeof r=="string"&&(r=Wa(r));let{pathname:p="/",search:m="",hash:_="",state:x=null,key:P="default"}=r,b=w.useMemo(()=>{let k=Ia(p,c);return k==null?null:{location:{pathname:k,search:m,hash:_,state:x,key:P},navigationType:i}},[c,p,m,_,x,P,i]);return b==null?null:w.createElement(wi.Provider,{value:f},w.createElement(nh.Provider,{children:n,value:b}))}function Hj(t){let{children:e,location:n}=t;return kj(yg(e),n)}new Promise(()=>{});function yg(t,e){e===void 0&&(e=[]);let n=[];return w.Children.forEach(t,(r,i)=>{if(!w.isValidElement(r))return;let s=[...e,i];if(r.type===w.Fragment){n.push.apply(n,yg(r.props.children,s));return}r.type!==Xt&&mt(!1),!r.props.index||!r.props.children||mt(!1);let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=yg(r.props.children,s)),n.push(a)}),n}/** 245 * React Router DOM v6.30.0 246 * 247 * Copyright (c) Remix Software Inc. 248 * 249 * This source code is licensed under the MIT license found in the 250 * LICENSE.md file in the root directory of this source tree. 251 * 252 * @license MIT 253 */function rf(){return rf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},rf.apply(this,arguments)}function wE(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Wj(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Zj(t,e){return t.button===0&&(!e||e==="_self")&&!Wj(t)}const qj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Gj=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Kj="6";try{window.__reactRouterVersion=Kj}catch{}const Yj=w.createContext({isTransitioning:!1}),Jj="startTransition",Ew=kb[Jj];function Qj(t){let{basename:e,children:n,future:r,window:i}=t,s=w.useRef();s.current==null&&(s.current=ej({window:i,v5Compat:!0}));let a=s.current,[l,c]=w.useState({action:a.action,location:a.location}),{v7_startTransition:f}=r||{},p=w.useCallback(m=>{f&&Ew?Ew(()=>c(m)):c(m)},[c,f]);return w.useLayoutEffect(()=>a.listen(p),[a,p]),w.useEffect(()=>Bj(r),[r]),w.createElement(Vj,{basename:e,children:n,location:l.location,navigationType:l.action,navigator:a,future:r})}const Xj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fi=w.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:s,replace:a,state:l,target:c,to:f,preventScrollReset:p,viewTransition:m}=e,_=wE(e,qj),{basename:x}=w.useContext(wi),P,b=!1;if(typeof f=="string"&&eD.test(f)&&(P=f,Xj))try{let S=new URL(window.location.href),R=f.startsWith("//")?new URL(S.protocol+f):new URL(f),I=Ia(R.pathname,x);R.origin===S.origin&&I!=null?f=I+R.search+R.hash:b=!0}catch{}let k=Tj(f,{relative:i}),E=nD(f,{replace:a,state:l,target:c,preventScrollReset:p,relative:i,viewTransition:m});function T(S){r&&r(S),S.defaultPrevented||E(S)}return w.createElement("a",rf({},_,{href:P||k,onClick:b||s?r:T,ref:n,target:c}))}),py=w.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:a=!1,style:l,to:c,viewTransition:f,children:p}=e,m=wE(e,Gj),_=rh(c,{relative:m.relative}),x=ws(),P=w.useContext(mE),{navigator:b,basename:k}=w.useContext(wi),E=P!=null&&rD(_)&&f===!0,T=b.encodeLocation?b.encodeLocation(_).pathname:_.pathname,S=x.pathname,R=P&&P.navigation&&P.n
253avigation.location?P.navigation.location.pathname:null;i||(S=S.toLowerCase(),R=R?R.toLowerCase():null,T=T.toLowerCase()),R&&k&&(R=Ia(R,k)||R);const I=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let M=S===T||!a&&S.startsWith(T)&&S.charAt(I)==="/",O=R!=null&&(R===T||!a&&R.startsWith(T)&&R.charAt(T.length)==="/"),D={isActive:M,isPending:O,isTransitioning:E},K=M?r:void 0,q;typeof s=="function"?q=s(D):q=[s,M?"active":null,O?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let ne=typeof l=="function"?l(D):l;return w.createElement(fi,rf({},m,{"aria-current":K,className:q,ref:n,style:ne,to:c,viewTransition:f}),typeof p=="function"?p(D):p)});var _g;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(_g||(_g={}));var Pw;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Pw||(Pw={}));function tD(t){let e=w.useContext(th);return e||mt(!1),e}function nD(t,e){let{target:n,replace:r,state:i,preventScrollReset:s,relative:a,viewTransition:l}=e===void 0?{}:e,c=qa(),f=ws(),p=rh(t,{relative:a});return w.useCallback(m=>{if(Zj(m,n)){m.preventDefault();let _=r!==void 0?r:nf(f)===nf(p);c(t,{replace:_,state:i,preventScrollReset:s,relative:a,viewTransition:l})}},[f,c,p,r,i,n,t,s,a,l])}function rD(t,e){e===void 0&&(e={});let n=w.useContext(Yj);n==null&&mt(!1);let{basename:r}=tD(_g.useViewTransitionState),i=rh(t,{relative:e.relative});if(!n.isTransitioning)return!1;let s=Ia(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Ia(n.nextLocation.pathname,r)||n.nextLocation.pathname;return vg(i.pathname,a)!=null||vg(i.pathname,s)!=null}const bE=[{id:"h1",name:"Harbor Medical Center",address:"123 Main St",city:"Seattle",state:"WA",zipCode:"98101",phone:"(206) 555-1234",status:"receiving",latitude:47.6062,longitude:-122.3321,donationNeeds:[{id:"d1",type:"blood",bloodType:"O-",description:"Urgently needed for trauma patients",urgency:"critical"},{id:"d2",type:"supplies",description:"Medical masks and gloves",urgency:"medium"}],patients:[]},{id:"h2",name:"City General Hospital",address:"456 Oak Ave",city:"Seattle",state:"WA",zipCode:"98102",phone:"(206) 555-5678",status:"full",latitude:47.6152,longitude:-122.3261,donationNeeds:[{id:"d3",type:"blood",bloodType:"A+",description:"Needed for scheduled surgeries",urgency:"medium"}],patients:[]},{id:"h3",name:"Lakeside Medical",address:"789 Pine Blvd",city:"Bellevue",state:"WA",zipCode:"98004",phone:"(425) 555-9012",status:"receiving",latitude:47.6101,longitude:-122.2015,donationNeeds:[{id:"d4",type:"volunteers",description:"Medical professionals needed for night shifts",urgency:"high"}],patients:[]}],Gp=[{id:"e1",name:"Downtown Building Collapse",description:"A 5-story building collapsed in the downtown area following structural issues.",startDate:"2025-04-08T14:30:00Z",type:"accident",status:"active",affectedHospitalIds:["h1","h2"]},{id:"e2",name:"Highway 99 Multi-Vehicle Accident",description:"Major collision involving 8 vehicles on Highway 99 northbound.",startDate:"2025-04-09T08:15:00Z",type:"accident",status:"active",affectedHospitalIds:["h1","h3"]}],CE=[{id:"p1",name:"John Smith",condition:"stable",dateAdmitted:"2025-04-08T15:45:00Z",hospitalId:"h1",eventId:"e1"},{id:"p2",name:"Maria Rodriguez",condition:"critical",dateAdmitted:"2025-04-08T16:20:00Z",hospitalId:"h1",eventId:"e1"},{id:"p3",name:"David Lee",condition:"stable",dateAdmitted:"2025-04-08T16:45:00Z",hospitalId:"h2",eventId:"e1"},{id:"p4",name:"Sarah Johnson",condition:"unknown",dateAdmitted:"2025-04-09T09:15:00Z",hospitalId:"h1",eventId:"e2"},{id:"p5",name:"Michael Chen",condition:"stable",dateAdmitted:"2025-04-09T09:30:00Z",hospitalId:"h3",eventId:"e2"}];bE.forEach(t=>{t.patients=CE.filter(e=>e.hospitalId===t.id)});const iD="modulepreload",sD=function(t){return"/"+t},kw={},Aa=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(c=>{if(c=sD(c),c in kw)return;kw[c]=!0;const f=c.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;
253const m=document.createElement("link");if(m.rel=f?"stylesheet":iD,f||(m.as="script"),m.crossOrigin="",m.href=c,l&&m.setAttribute("nonce",l),document.head.appendChild(m),f)return new Promise((_,x)=>{m.addEventListener("load",_),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return e().catch(s)})},oD=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>Aa(async()=>{const{default:r}=await Promise.resolve().then(()=>Ga);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)};class my extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class aD extends my{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class lD extends my{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class uD extends my{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var xg;(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"})(xg||(xg={}));var cD=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function l(p){try{f(r.next(p))}catch(m){a(m)}}function c(p){try{f(r.throw(p))}catch(m){a(m)}}function f(p){p.done?s(p.value):i(p.value).then(l,c)}f((r=r.apply(t,e||[])).next())})};class dD{constructor(e,{headers:n={},customFetch:r,region:i=xg.Any}={}){this.url=e,this.headers=n,this.region=i,this.fetch=oD(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,n={}){var r;return cD(this,void 0,void 0,function*(){try{const{headers:i,method:s,body:a}=n;let l={},{region:c}=n;c||(c=this.region),c&&c!=="any"&&(l["x-region"]=c);let f;a&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&a instanceof Blob||a instanceof ArrayBuffer?(l["Content-Type"]="application/octet-stream",f=a):typeof a=="string"?(l["Content-Type"]="text/plain",f=a):typeof FormData<"u"&&a instanceof FormData?f=a:(l["Content-Type"]="application/json",f=JSON.stringify(a)));const p=yield this.fetch(`${this.url}/${e}`,{method:s||"POST",headers:Object.assign(Object.assign(Object.assign({},l),this.headers),i),body:f}).catch(P=>{throw new aD(P)}),m=p.headers.get("x-relay-error");if(m&&m==="true")throw new lD(p);if(!p.ok)throw new uD(p);let _=((r=p.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),x;return _==="application/json"?x=yield p.json():_==="application/octet-stream"?x=yield p.blob():_==="text/event-stream"?x=p:_==="multipart/form-data"?x=yield p.formData():x=yield p.text(),{data:x,error:null}}catch(i){return{data:null,error:i}}})}}var gn={},gy={},ih={},Hu={},sh={},oh={},fD=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Ma=fD();const hD=Ma.fetch,SE=Ma.fetch.bind(Ma),TE=Ma.Headers,pD=Ma.Request,mD=Ma.Response,Ga=Object.freeze(Object.defineProperty({__proto__:null,Headers:TE,Request:pD,Response:mD,default:SE,fetch:hD},Symbol.toStringTag,{value:"Module"})),gD=nR(Ga);var ah={};Object.defineProperty(ah,"__esModule",{value:!0});let vD=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
253de=e.code}};ah.default=vD;var EE=Mn&&Mn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oh,"__esModule",{value:!0});const yD=EE(gD),_D=EE(ah);let xD=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=yD.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,n){return this.headers=Object.assign({},this.headers),this.headers[e]=n,this}then(e,n){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const r=this.fetch;let i=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{var a,l,c;let f=null,p=null,m=null,_=s.status,x=s.statusText;if(s.ok){if(this.method!=="HEAD"){const E=await s.text();E===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?p=E:p=JSON.parse(E))}const b=(a=this.headers.Prefer)===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),k=(l=s.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");b&&k&&k.length>1&&(m=parseInt(k[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(p)&&(p.length>1?(f={code:"PGRST116",details:`Results contain ${p.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},p=null,m=null,_=406,x="Not Acceptable"):p.length===1?p=p[0]:p=null)}else{const b=await s.text();try{f=JSON.parse(b),Array.isArray(f)&&s.status===404&&(p=[],f=null,_=200,x="OK")}catch{s.status===404&&b===""?(_=204,x="No Content"):f={message:b}}if(f&&this.isMaybeSingle&&(!((c=f==null?void 0:f.details)===null||c===void 0)&&c.includes("0 rows"))&&(f=null,_=200,x="OK"),f&&this.shouldThrowOnError)throw new _D.default(f)}return{error:f,data:p,count:m,status:_,statusText:x}});return this.shouldThrowOnError||(i=i.catch(s=>{var a,l,c;return{error:{message:`${(a=s==null?void 0:s.name)!==null&&a!==void 0?a:"FetchError"}: ${s==null?void 0:s.message}`,details:`${(l=s==null?void 0:s.stack)!==null&&l!==void 0?l:""}`,hint:"",code:`${(c=s==null?void 0:s.code)!==null&&c!==void 0?c:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,n)}returns(){return this}overrideTypes(){return this}};oh.default=xD;var wD=Mn&&Mn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sh,"__esModule",{value:!0});const bD=wD(oh);let CD=class extends bD.default{select(e){let n=!1;const r=(e??"*").split("").map(i=>/\s/.test(i)&&!n?"":(i==='"'&&(n=!n),i)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:n=!0,nullsFirst:r,foreignTable:i,referencedTable:s=i}={}){const a=s?`${s}.order`:"order",l=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${l?`${l},`:""}${e}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:n,referencedTable:r=n}={}){const i=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,n,{foreignTable:r,referencedTable:i=r}={}){const s=typeof i>"u"?"offset":`${i}.offset`,a=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(a,`${n-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}
253explain({analyze:e=!1,verbose:n=!1,settings:r=!1,buffers:i=!1,wal:s=!1,format:a="text"}={}){var l;const c=[e?"analyze":null,n?"verbose":null,r?"settings":null,i?"buffers":null,s?"wal":null].filter(Boolean).join("|"),f=(l=this.headers.Accept)!==null&&l!==void 0?l:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${a}; for="${f}"; options=${c};`,a==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};sh.default=CD;var SD=Mn&&Mn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hu,"__esModule",{value:!0});const TD=SD(sh);let ED=class extends TD.default{eq(e,n){return this.url.searchParams.append(e,`eq.${n}`),this}neq(e,n){return this.url.searchParams.append(e,`neq.${n}`),this}gt(e,n){return this.url.searchParams.append(e,`gt.${n}`),this}gte(e,n){return this.url.searchParams.append(e,`gte.${n}`),this}lt(e,n){return this.url.searchParams.append(e,`lt.${n}`),this}lte(e,n){return this.url.searchParams.append(e,`lte.${n}`),this}like(e,n){return this.url.searchParams.append(e,`like.${n}`),this}likeAllOf(e,n){return this.url.searchParams.append(e,`like(all).{${n.join(",")}}`),this}likeAnyOf(e,n){return this.url.searchParams.append(e,`like(any).{${n.join(",")}}`),this}ilike(e,n){return this.url.searchParams.append(e,`ilike.${n}`),this}ilikeAllOf(e,n){return this.url.searchParams.append(e,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(e,n){return this.url.searchParams.append(e,`ilike(any).{${n.join(",")}}`),this}is(e,n){return this.url.searchParams.append(e,`is.${n}`),this}in(e,n){const r=Array.from(new Set(n)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}contains(e,n){return typeof n=="string"?this.url.searchParams.append(e,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(e,`cs.{${n.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(n)}`),this}containedBy(e,n){return typeof n=="string"?this.url.searchParams.append(e,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(e,`cd.{${n.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(n)}`),this}rangeGt(e,n){return this.url.searchParams.append(e,`sr.${n}`),this}rangeGte(e,n){return this.url.searchParams.append(e,`nxl.${n}`),this}rangeLt(e,n){return this.url.searchParams.append(e,`sl.${n}`),this}rangeLte(e,n){return this.url.searchParams.append(e,`nxr.${n}`),this}rangeAdjacent(e,n){return this.url.searchParams.append(e,`adj.${n}`),this}overlaps(e,n){return typeof n=="string"?this.url.searchParams.append(e,`ov.${n}`):this.url.searchParams.append(e,`ov.{${n.join(",")}}`),this}textSearch(e,n,{config:r,type:i}={}){let s="";i==="plain"?s="pl":i==="phrase"?s="ph":i==="websearch"&&(s="w");const a=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${a}.${n}`),this}match(e){return Object.entries(e).forEach(([n,r])=>{this.url.searchParams.append(n,`eq.${r}`)}),this}not(e,n,r){return this.url.searchParams.append(e,`not.${n}.${r}`),this}or(e,{foreignTable:n,referencedTable:r=n}={}){const i=r?`${r}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,n,r){return this.url.searchParams.append(e,`${n}.${r}`),this}};Hu.default=ED;var PD=Mn&&Mn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ih,"__esModule",{value:!0});const Sl=PD(Hu);let kD=class{constructor(e,{headers:n={},schema:r,fetch:i}){this.url=e,this.headers=n,this.schema=r,this.fetch=i}select(e,{head:n=!1,count:r}={}){const i=n?"HEAD":"GET";let s=!1;const a=(e??"*").split("").map(l=>/\s/.test(l)&&!s?"":(l==='"'&&(s=!s),l)).join("");return this.url.searchParams.set("select",a),r&&(this.headers.Prefer=`count=${r}`),new Sl.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:n,defaultToNull:r=!0}={}){const i="POST",s=[];if(this.headers.Prefer&&s.push(this.headers.Prefer),n&&s.push(`count=${n}`),r||s.push("missing=default"),this.headers.Prefer=s.join(","),Array.isArray(e)){const a=e.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(a.length>
2530){const l=[...new Set(a)].map(c=>`"${c}"`);this.url.searchParams.set("columns",l.join(","))}}return new Sl.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:n,ignoreDuplicates:r=!1,count:i,defaultToNull:s=!0}={}){const a="POST",l=[`resolution=${r?"ignore":"merge"}-duplicates`];if(n!==void 0&&this.url.searchParams.set("on_conflict",n),this.headers.Prefer&&l.push(this.headers.Prefer),i&&l.push(`count=${i}`),s||l.push("missing=default"),this.headers.Prefer=l.join(","),Array.isArray(e)){const c=e.reduce((f,p)=>f.concat(Object.keys(p)),[]);if(c.length>0){const f=[...new Set(c)].map(p=>`"${p}"`);this.url.searchParams.set("columns",f.join(","))}}return new Sl.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:n}={}){const r="PATCH",i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),n&&i.push(`count=${n}`),this.headers.Prefer=i.join(","),new Sl.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){const n="DELETE",r=[];return e&&r.push(`count=${e}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new Sl.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};ih.default=kD;var lh={},uh={};Object.defineProperty(uh,"__esModule",{value:!0});uh.version=void 0;uh.version="0.0.0-automated";Object.defineProperty(lh,"__esModule",{value:!0});lh.DEFAULT_HEADERS=void 0;const ND=uh;lh.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${ND.version}`};var PE=Mn&&Mn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gy,"__esModule",{value:!0});const RD=PE(ih),ID=PE(Hu),AD=lh;let MD=class kE{constructor(e,{headers:n={},schema:r,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},AD.DEFAULT_HEADERS),n),this.schemaName=r,this.fetch=i}from(e){const n=new URL(`${this.url}/${e}`);return new RD.default(n,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new kE(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,n={},{head:r=!1,get:i=!1,count:s}={}){let a;const l=new URL(`${this.url}/rpc/${e}`);let c;r||i?(a=r?"HEAD":"GET",Object.entries(n).filter(([p,m])=>m!==void 0).map(([p,m])=>[p,Array.isArray(m)?`{${m.join(",")}}`:`${m}`]).forEach(([p,m])=>{l.searchParams.append(p,m)})):(a="POST",c=n);const f=Object.assign({},this.headers);return s&&(f.Prefer=`count=${s}`),new ID.default({method:a,url:l,headers:f,schema:this.schemaName,body:c,fetch:this.fetch,allowEmpty:!1})}};gy.default=MD;var Ka=Mn&&Mn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gn,"__esModule",{value:!0});gn.PostgrestError=gn.PostgrestBuilder=gn.PostgrestTransformBuilder=gn.PostgrestFilterBuilder=gn.PostgrestQueryBuilder=gn.PostgrestClient=void 0;const NE=Ka(gy);gn.PostgrestClient=NE.default;const RE=Ka(ih);gn.PostgrestQueryBuilder=RE.default;const IE=Ka(Hu);gn.PostgrestFilterBuilder=IE.default;const AE=Ka(sh);gn.PostgrestTransformBuilder=AE.default;const ME=Ka(oh);gn.PostgrestBuilder=ME.default;const LE=Ka(ah);gn.PostgrestError=LE.default;var LD=gn.default={PostgrestClient:NE.default,PostgrestQueryBuilder:RE.default,PostgrestFilterBuilder:IE.default,PostgrestTransformBuilder:AE.default,PostgrestBuilder:ME.default,PostgrestError:LE.default};const{PostgrestClient:OD,PostgrestQueryBuilder:p8,PostgrestFilterBuilder:m8,PostgrestTransformBuilder:g8,PostgrestBuilder:v8,PostgrestError:y8}=LD,jD="2.11.2",DD={"X-Client-Info":`realtime-js/${jD}`},FD="1.0.0",OE=1e4,$D=1e3;var aa;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(aa||(aa={}));var Tn;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Tn||(Tn={}));var sr;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(sr||(sr={}));var wg;(function(t){t.websocket="websocket"})(wg||(wg={}));var $s;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})($s||($s={}));class zD{constructor(){this.HEADER_LENGTH=1}decode(e,n){return e.constructor===ArrayBuffer?n(this._binaryDecode(e)):n(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const n=new DataView(e),r=new TextDecoder;return this._decodeBroadcast(e,n,r)}_decodeBroadcast(e,n,r){const i=n.getUint8(1),s=n.getUint8(2);let a=this.HEADER_LENGTH+2;const l=r.decode(e.slice(a,a+i));a=a+i;const c=r.decode(e.slice(a,a+s));a=a+s;const f=JSON.parse(r.decode(e.slice(a,e.byteLength)));return{ref:null,topic:l,event:c,payload:f}}}class jE{constructor(e,n){this.callback=e,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=n}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))}}var nt;(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: 12,419 bytes, line 253
253srange="tsrange",t.tstzrange="tstzrange"})(nt||(nt={}));const Nw=(t,e,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(e).reduce((s,a)=>(s[a]=BD(a,t,e,i),s),{})},BD=(t,e,n,r)=>{const i=e.find(l=>l.name===t),s=i==null?void 0:i.type,a=n[t];return s&&!r.includes(s)?DE(s,a):bg(a)},DE=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return WD(e,n)}switch(t){case nt.bool:return UD(e);case nt.float4:case nt.float8:case nt.int2:case nt.int4:case nt.int8:case nt.numeric:case nt.oid:return VD(e);case nt.json:case nt.jsonb:return HD(e);case nt.timestamp:return ZD(e);case nt.abstime:case nt.date:case nt.daterange:case nt.int4range:case nt.int8range:case nt.money:case nt.reltime:case nt.text:case nt.time:case nt.timestamptz:case nt.timetz:case nt.tsrange:case nt.tstzrange:return bg(e);default:return bg(e)}},bg=t=>t,UD=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},VD=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},HD=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},WD=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let s;const a=t.slice(1,n);try{s=JSON.parse("["+a+"]")}catch{s=a?a.split(","):[]}return s.map(l=>DE(e,l))}return t},ZD=t=>typeof t=="string"?t.replace(" ","T"):t,FE=t=>{let e=t;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")};class Kp{constructor(e,n,r={},i=OE){this.channel=e,this.event=n,this.payload=r,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,n){var r;return this._hasReceived(e)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(n))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var Rw;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Rw||(Rw={}));class Vl{constructor(e,n){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},i=>{const{onJoin:s,onLeave:a,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Vl.syncState(this.state,i,s,a),this.pendingDiffs.forEach(c=>{this.state=Vl.syncDiff(this.state,c,s,a)}),this.pendingDiffs=[],l()}),this.channel._on(r.diff,{},i=>{const{onJoin:s,onLeave:a,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Vl.syncDiff(this.state,i,s,a),l())}),this.onJoin((i,s,a)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:s,newPresences:a})}),this.onLeave((i,s,a)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:s,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,n,r,i){const s=this.cloneDeep(e),a=this.transformState(n),l={},c={};return this.map(s,(f,p)=>{a[f]||(c[f]=p)}),this.map(a,(f,p)=>{const m=s[f];if(m){const _=p.map(k=>k.presence_ref),x=m.map(k=>k.presence_ref),P=p.filter(k=>x.indexOf(k.presence_ref)<0),b=m.filter(k=>_.indexOf(k.presence_ref)<0);P.length>0&&(l[f]=P),b.length>0&&(c[f]=b)}else l[f]=p}),this.syncDiff(s,{joins:l,leaves:c},r,i)}static syncDiff(e,n,r,i){const{joins:s,leaves:a}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),i||(i=()=>{}),this.map(s,(l,c)=>{var f;const p=(f=e[l])!==null&&f!==void 0?f:[];if(e[l]=this.cloneDeep(c),p.length>0){const m=e[l].map(x=>x.presence_ref),_=p.filter(x=>m.indexOf(x.presence_ref)<0);e[l].unshift(..._)}r(l,p,c)}),this.map(a,(l,c)=>{let f=e[l];if(!f)return;const p=c.map(m=>m.presence_ref);f=f.filter(m=>p.indexOf(m.presence_ref)<0),e[l]=f,i(l,f,c),f.length===0&&delete e[l]}),e}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const i=e[r];return"metas"in i?n[r]=i.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):n[r]=i,n},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Iw;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Iw||(Iw={}));var Aw;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Aw||(Aw={}));var ri;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(ri||(ri={}));class vy{constructor(e,n={config:{}},r){this.topic=e,this.params=n,this.socket=r,this.bindings={},this.state=Tn.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new Kp(this,sr.join,this.params,this.timeout),this.rejoinTimer=new jE(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Tn.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Tn.closed,this.socket._remove(this)}),this._onError(i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=Tn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Tn.errored,this.rejoinTimer.scheduleTimeout())}),this._on(sr.reply,{},(i,s)=>{this._trigger(this._replyEventName(s),i)}),this.presence=new Vl(this),this.broadcastEndpointURL=FE(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(e,n=this.timeout){var r,i;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:s,presence:a,private:l}}=this.params;this._onError(p=>e==null?void 0:e(ri.CHANNEL_ERROR,p)),this._onClose(()=>e==null?void 0:e(ri.CLOSED));const c={},f={broadcast:s,presence:a,postgres_changes:(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(p=>p.filter))!==null&&i!==void 0?i:[],private:l};this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:f},c)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:p})=>{var m;if(this.socket.setAuth(),p===void 0){e==null||e(ri.SUBSCRIBED);return}else{const _=this.bindings.postgres_changes,x=(m=_==null?void 0:_.length)!==null&&m!==void 0?m:0,P=[];for(let b=0;b<x;b++){const k=_[b],{filter:{event:E,schema:T,table:S,filter:R}}=k,I=p&&p[b];if(I&&I.event===E&&I.schema===T&&I.table===S&&I.filter===R)P.push(Object.assign(Object.assign({},k),{id:I.id}));else{this.unsubscribe(),e==null||e(ri.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=P,e&&e(ri.SUBSCRIBED);return}}).receive("error",p=>{e==null||e(ri.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(ri.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){return this._on(e,n,r)}async send(e,n={}){var r,i;if(!this._canPush()&&e.type==="broadcast"){const{event:s,payload:a}=e,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:a,private:this.private}]})};try{const f=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=f.body)===null||i===void 0?void 0:i.cancel()),f.ok?"ok":"error"}catch(f){return f.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var a,l,c;const f=this._push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(l=(a=this.params)===null||a===void 0?void 0:a.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&s("ok"),f.receive("ok",()=>s("ok")),f.receive("error",()=>s("error")),f.receive("timeout",()=>s("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Tn.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(sr.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(r=>{const i=new Kp(this,sr.leave,{},e);i.receive("ok",()=>{n(),r("ok")}).receive("timeout",()=>{n(),r("timed out")}).receive("error",()=>{r("error")}),i.send(),this._canPush()||i.trigger("ok",{})})}async _fetchWithTimeout(e,n,r){const i=new AbortController,s=setTimeout(()=>i.abort(),r),a=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(s),a}_push(e,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new Kp(this,e,n,r);return this._canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}_onMessage(e,n,r){return n}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,n,r){var i,s;const a=e.toLocaleLowerCase(),{close:l,error:c,leave:f,join:p}=sr;if(r&&[l,c,f,p].indexOf(a)>=0&&r!==this._joinRef())return;let _=this._onMessage(a,n,r);if(n&&!_)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(x=>{var P,b,k;return((P=x.filter)===null||P===void 0?void 0:P.event)==="*"||((k=(b=x.filter)===null||b===void 0?void 0:b.event)===null||k===void 0?void 0:k.toLocaleLowerCase())===a}).map(x=>x.callback(_,r)):(s=this.bindings[a])===null||s===void 0||s.filter(x=>{var P,b,k,E,T,S;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in x){const R=x.id,I=(P=x.filter)===null||P===void 0?void 0:P.event;return R&&((b=n.ids)===null||b===void 0?void 0:b.includes(R))&&(I==="*"||(I==null?void 0:I.toLocaleLowerCase())===((k=n.data)===null||k===void 0?void 0:k.type.toLocaleLowerCase()))}else{const R=(T=(E=x==null?void 0:x.filter)===null||E===void 0?void 0:E.event)===null||T===void 0?void 0:T.toLocaleLowerCase();return R==="*"||R===((S=n==null?void 0:n.event)===null||S===void 0?void 0:S.toLocaleLowerCase())}else return x.type.toLocaleLowerCase()===a}).map(x=>
253{if(typeof _=="object"&&"ids"in _){const P=_.data,{schema:b,table:k,commit_timestamp:E,type:T,errors:S}=P;_=Object.assign(Object.assign({},{schema:b,table:k,commit_timestamp:E,eventType:T,new:{},old:{},errors:S}),this._getPayloadRecords(P))}x.callback(_,r)})}_isClosed(){return this.state===Tn.closed}_isJoined(){return this.state===Tn.joined}_isJoining(){return this.state===Tn.joining}_isLeaving(){return this.state===Tn.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,n,r){const i=e.toLocaleLowerCase(),s={type:i,filter:n,callback:r};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this}_off(e,n){const r=e.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(i=>{var s;return!(((s=i.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===r&&vy.isEqual(i.filter,n))}),this}static isEqual(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(sr.close,{},e)}_onError(e){this._on(sr.error,{},n=>e(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Tn.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=Nw(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=Nw(e.columns,e.old_record)),n}}const qD=()=>{},GD=typeof WebSocket<"u",KD=` 254 addEventListener("message", (e) => { 255 if (e.data.event === "start") { 256 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 257 } 258 });`;class YD{constructor(e,n){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=DD,this.params={},this.timeout=OE,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=qD,this.conn=null,this.sendBuffer=[],this.serializer=new zD,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=s=>{let a;return s?a=s:typeof fetch>"u"?a=(...l)=>Aa(async()=>{const{default:c}=await Promise.resolve().then(()=>Ga);return{default:c}},void 0).then(({default:c})=>c(...l)):a=fetch,(...l)=>a(...l)},this.endPoint=`${e}/${wg.websocket}`,this.httpEndpoint=FE(e),n!=null&&n.transport?this.transport=n.transport:this.transport=null,n!=null&&n.params&&(this.params=n.params),n!=null&&n.headers&&(this.headers=Object.assign(Object.assign({},this.headers),n.headers)),n!=null&&n.timeout&&(this.timeout=n.timeout),n!=null&&n.logger&&(this.logger=n.logger),n!=null&&n.heartbeatIntervalMs&&(this.heartbeatIntervalMs=n.heartbeatIntervalMs);const i=(r=n==null?void 0:n.params)===null||r===void 0?void 0:r.apikey;if(i&&(this.accessTokenValue=i,this.apiKey=i),this.reconnectAfterMs=n!=null&&n.reconnectAfterMs?n.reconnectAfterMs:s=>[1e3,2e3,5e3,1e4][s-1]||1e4,this.encode=n!=null&&n.encode?n.encode:(s,a)=>a(JSON.stringify(s)),this.decode=n!=null&&n.decode?n.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new jE(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(n==null?void 0:n.fetch),n!=null&&n.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(n==null?void 0:n.worker)||!1,this.workerUrl=n==null?void 0:n.workerUrl}this.accessToken=(n==null?void 0:n.accessToken)||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(GD){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new JD(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),Aa(async()=>{const{default:e}=await import("./browser-CDipft45.js").then(n=>n.b);return{default:e}},[]).then(({default:e})=>{this.conn=new e(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:FD}))}
258disconnect(e,n){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,n??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.disconnect(),e}log(e,n,r){this.logger(e,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case aa.connecting:return $s.Connecting;case aa.open:return $s.Open;case aa.closing:return $s.Closing;default:return $s.Closed}}isConnected(){return this.connectionState()===$s.Open}channel(e,n={config:{}}){const r=new vy(`realtime:${e}`,n,this);return this.channels.push(r),r}push(e){const{topic:n,event:r,payload:i,ref:s}=e,a=()=>{this.encode(e,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${n} ${r} (${s})`,i),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(e=null){let n=e||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(n){let r=null;try{r=JSON.parse(atob(n.split(".")[1]))}catch{}if(r&&r.exp&&!(Math.floor(Date.now()/1e3)-r.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${r.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${r.exp}`);this.accessTokenValue=n,this.channels.forEach(i=>{n&&i.updateJoinPayload({access_token:n}),i.joinedOnce&&i._isJoined()&&i._push(sr.access_token,{access_token:n})})}}async sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close($D,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let n=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${e}"`),n.unsubscribe())}_remove(e){this.channels=this.channels.filter(n=>n._joinRef()!==e._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",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))}_onConnMessage(e){this.decode(e.data,n=>{let{topic:r,event:i,payload:s,ref:a}=n;a&&a===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${s.status||""} ${r} ${i} ${a&&"("+a+")"||""}`,s),this.channels.filter(l=>l._isMember(r)).forEach(l=>l._trigger(i,s,a)),this.stateChangeCallbacks.message.forEach(l=>l(n))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{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=n=>{this.log("worker","worker error",n.message),this.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(n=>n(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(n=>n(e))}
258_triggerChanError(){this.channels.forEach(e=>e._trigger(sr.error))}_appendParams(e,n){if(Object.keys(n).length===0)return e;const r=e.match(/\?/)?"&":"?",i=new URLSearchParams(n);return`${e}${r}${i}`}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([KD],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}}class JD{constructor(e,n,r){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=aa.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=r.close}}class yy extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function At(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class QD extends yy{constructor(e,n){super(e),this.name="StorageApiError",this.status=n}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class Cg extends yy{constructor(e,n){super(e),this.name="StorageUnknownError",this.originalError=n}}var XD=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function l(p){try{f(r.next(p))}catch(m){a(m)}}function c(p){try{f(r.throw(p))}catch(m){a(m)}}function f(p){p.done?s(p.value):i(p.value).then(l,c)}f((r=r.apply(t,e||[])).next())})};const $E=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>Aa(async()=>{const{default:r}=await Promise.resolve().then(()=>Ga);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)},eF=()=>XD(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Aa(()=>Promise.resolve().then(()=>Ga),void 0)).Response:Response}),Sg=t=>{if(Array.isArray(t))return t.map(n=>Sg(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[i]=Sg(r)}),e};var ho=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function l(p){try{f(r.next(p))}catch(m){a(m)}}function c(p){try{f(r.throw(p))}catch(m){a(m)}}function f(p){p.done?s(p.value):i(p.value).then(l,c)}f((r=r.apply(t,e||[])).next())})};const Yp=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),tF=(t,e,n)=>ho(void 0,void 0,void 0,function*(){const r=yield eF();t instanceof r&&!(n!=null&&n.noResolveJson)?t.json().then(i=>{e(new QD(Yp(i),t.status||500))}).catch(i=>{e(new Cg(Yp(i),i))}):e(new Cg(Yp(t),t))}),nF=(t,e,n,r)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),r&&(i.body=JSON.stringify(r)),Object.assign(Object.assign({},i),n))};function Wu(t,e,n,r,i,s){return ho(this,void 0,void 0,function*(){return new Promise((a,l)=>{t(n,nF(e,r,i,s)).then(c=>{if(!c.ok)throw c;return r!=null&&r.noResolveJson?c:c.json()}).then(c=>a(c)).catch(c=>tF(c,l,r))})})}function sf(t,e,n,r){return ho(this,void 0,void 0,function*(){return Wu(t,"GET",e,n,r)})}function Di(t,e,n,r,i){return ho(this,void 0,void 0,function*(){return Wu(t,"POST",e,r,i,n)})}function rF(t,e,n,r,i){return ho(this,void 0,void 0,function*(){return Wu(t,"PUT",e,r,i,n)})}function iF(t,e,n,r){return ho(this,void 0,void 0,function*(){return Wu(t,"HEAD",e,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function zE(t,e,n,r,i){return ho(this,void 0,void 0,function*(){return Wu(t,"DELETE",e,r,i,n)})}var hn=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function l(p){try{f(r.next(p))}catch(m){a(m)}}function c(p){try{f(r.throw(p))}catch(m){a(m)}}function f(p){p.done?s(p.value):i(p.value).then(l,c)}f((r=r.apply(t,e||[])).next())})};const sF={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Mw={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class oF{constructor(e,n={},r,i){this.url=e,this.headers=n,this.bucketId=r,this.fetch=$E(i)}uploadOrUpdate(e,n,r,i){return hn(this,void 0,void 0,function*(){try{let s;const a=Object.assign(Object.assign({},Mw),i);let l=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const c=a.metadata;typeof Blob<"u"&&r instanceof Blob?(s=new FormData,s.append("cacheControl",a.cacheControl),c&&s.append("metadata",this.encodeMetadata(c)),s.append("",r)):typeof FormData<"u"&&r instanceof FormData?(s=r,s.append("cacheControl",a.cacheControl),c&&s.append("metadata",this.encodeMetadata(c))):(s=r,l["cache-control"]=`max-age=${a.cacheControl}`,l["content-type"]=a.contentType,c&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),i!=null&&i.headers&&(l=Object.assign(Object.assign({},l),i.headers));const f=this._removeEmptyFolders(n),p=this._getFinalPath(f),m=yield this.fetch(`${this.url}/object/${p}`,Object.assign({method:e,body:s,headers:l},a!=null&&a.duplex?{duplex:a.duplex}:{})),_=yield m.json();return m.ok?{data:{path:f,id:_.Id,fullPath:_.Key},error:null}:{data:null,error:_}}catch(s){if(At(s))return{data:null,error:s};throw s}})}upload(e,n,r){return hn(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,n,r)})}uploadToSignedUrl(e,n,r,i){return hn(this,void 0,void 0,function*(){const s=this._removeEmptyFolders(e),a=this._getFinalPath(s),l=new URL(this.url+`/object/upload/sign/${a}`);l.searchParams.set("token",n);try{let c;const f=Object.assign({upsert:Mw.upsert},i),p=Object.assign(Object.assign({},this.headers),{"x-upsert":String(f.upsert)});typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",f.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",f.cacheControl)):(c=r,p["cache-control"]=`max-age=${f.cac
258heControl}`,p["content-type"]=f.contentType);const m=yield this.fetch(l.toString(),{method:"PUT",body:c,headers:p}),_=yield m.json();return m.ok?{data:{path:s,fullPath:_.Key},error:null}:{data:null,error:_}}catch(c){if(At(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(e,n){return hn(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e);const i=Object.assign({},this.headers);n!=null&&n.upsert&&(i["x-upsert"]="true");const s=yield Di(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:i}),a=new URL(this.url+s.url),l=a.searchParams.get("token");if(!l)throw new yy("No token returned by API");return{data:{signedUrl:a.toString(),path:e,token:l},error:null}}catch(r){if(At(r))return{data:null,error:r};throw r}})}update(e,n,r){return hn(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,n,r)})}move(e,n,r){return hn(this,void 0,void 0,function*(){try{return{data:yield Di(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(i){if(At(i))return{data:null,error:i};throw i}})}copy(e,n,r){return hn(this,void 0,void 0,function*(){try{return{data:{path:(yield Di(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if(At(i))return{data:null,error:i};throw i}})}createSignedUrl(e,n,r){return hn(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),s=yield Di(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:n},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const a=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return s={signedUrl:encodeURI(`${this.url}${s.signedURL}${a}`)},{data:s,error:null}}catch(i){if(At(i))return{data:null,error:i};throw i}})}createSignedUrls(e,n,r){return hn(this,void 0,void 0,function*(){try{const i=yield Di(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:e},{headers:this.headers}),s=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:i.map(a=>Object.assign(Object.assign({},a),{signedUrl:a.signedURL?encodeURI(`${this.url}${a.signedURL}${s}`):null})),error:null}}catch(i){if(At(i))return{data:null,error:i};throw i}})}download(e,n){return hn(this,void 0,void 0,function*(){const i=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),a=s?`?${s}`:"";try{const l=this._getFinalPath(e);return{data:yield(yield sf(this.fetch,`${this.url}/${i}/${l}${a}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(l){if(At(l))return{data:null,error:l};throw l}})}info(e){return hn(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{const r=yield sf(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:Sg(r),error:null}}catch(r){if(At(r))return{data:null,error:r};throw r}})}exists(e){return hn(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{return yield iF(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(At(r)&&r instanceof Cg){const i=r.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:r}}throw r}})}getPublicUrl(e,n){const r=this._getFinalPath(e),i=[],s=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";s!==""&&i.push(s);const l=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});c!==""&&i.push(c);let f=i.join("&");return f!==""&&(f=`?${f}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${r}${f}`)}}}remove(e){return hn(this,void 0,void 0,function*(){try{return{data:yield zE(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(n){if(At(n))return{data:null,error:n};throw n}})}list(e,n,r){return hn(this,void 0,void 0,function*(){try{const i=Object.assign(Object.assign(Object.assign({},sF),n),{prefix:e||""});return{data:yield Di(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},r),error:null}}catch(i){if(At(i))return{data:null,error:i};throw i}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const n=[];return e.width&&n.push(`width=${e.width}`),e.height&&n.push(`height=${e.height}`),e.resize&&n.push(`resize=${e.resize}`),e.format&&n.push(`format=${e.format}`),e.quality&&n.push(`quality=${e.quality}`),n.join("&")}}const aF="2.7.1",lF={"X-Client-Info":`storage-js/${aF}`};var Po=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}
258return new(n||(n=Promise))(function(s,a){function l(p){try{f(r.next(p))}catch(m){a(m)}}function c(p){try{f(r.throw(p))}catch(m){a(m)}}function f(p){p.done?s(p.value):i(p.value).then(l,c)}f((r=r.apply(t,e||[])).next())})};class uF{constructor(e,n={},r){this.url=e,this.headers=Object.assign(Object.assign({},lF),n),this.fetch=$E(r)}listBuckets(){return Po(this,void 0,void 0,function*(){try{return{data:yield sf(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(At(e))return{data:null,error:e};throw e}})}getBucket(e){return Po(this,void 0,void 0,function*(){try{return{data:yield sf(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(n){if(At(n))return{data:null,error:n};throw n}})}createBucket(e,n={public:!1}){return Po(this,void 0,void 0,function*(){try{return{data:yield Di(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(At(r))return{data:null,error:r};throw r}})}updateBucket(e,n){return Po(this,void 0,void 0,function*(){try{return{data:yield rF(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(At(r))return{data:null,error:r};throw r}})}emptyBucket(e){return Po(this,void 0,void 0,function*(){try{return{data:yield Di(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(At(n))return{data:null,error:n};throw n}})}deleteBucket(e){return Po(this,void 0,void 0,function*(){try{return{data:yield zE(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(n){if(At(n))return{data:null,error:n};throw n}})}}class cF extends uF{constructor(e,n={},r){super(e,n,r)}from(e){return new oF(this.url,this.headers,e,this.fetch)}}const dF="2.49.4";let Nl="";typeof Deno<"u"?Nl="deno":typeof document<"u"?Nl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Nl="react-native":Nl="node";const fF={"X-Client-Info":`supabase-js-${Nl}/${dF}`},hF={headers:fF},pF={schema:"public"},mF={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},gF={};var vF=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function l(p){try{f(r.next(p))}catch(m){a(m)}}function c(p){try{f(r.throw(p))}catch(m){a(m)}}function f(p){p.done?s(p.value):i(p.value).then(l,c)}f((r=r.apply(t,e||[])).next())})};const yF=t=>{let e;return t?e=t:typeof fetch>"u"?e=SE:e=fetch,(...n)=>e(...n)},_F=()=>typeof Headers>"u"?TE:Headers,xF=(t,e,n)=>{const r=yF(n),i=_F();return(s,a)=>vF(void 0,void 0,void 0,function*(){var l;const c=(l=yield e())!==null&&l!==void 0?l:t;let f=new i(a==null?void 0:a.headers);return f.has("apikey")||f.set("apikey",t),f.has("Authorization")||f.set("Authorization",`Bearer ${c}`),r(s,Object.assign(Object.assign({},a),{headers:f}))})};var wF=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function l(p){try{f(r.next(p))}catch(m){a(m)}}function c(p){try{f(r.throw(p))}catch(m){a(m)}}function f(p){p.done?s(p.value):i(p.value).then(l,c)}f((r=r.apply(t,e||[])).next())})};function bF(t){return t.replace(/\/$/,"")}function CF(t,e){const{db:n,auth:r,realtime:i,global:s}=t,{db:a,auth:l,realtime:c,global:f}=e,p={db:Object.assign(Object.assign({},a),n),auth:Object.assign(Object.assign({},l),r),realtime:Object.assign(Object.assign({},c),i),global:Object.assign(Object.assign({},f),s),accessToken:()=>wF(this,void 0,void 0,function*(){return""})};return t.accessToken?p.accessToken=t.accessToken:delete p.accessToken,p}const BE="2.69.1",Oo=30*1e3,Tg=3,Jp=Tg*Oo,SF="http://localhost:9999",TF="supabase.auth.token",EF={"X-Client-Info":`gotrue-js/${BE}`},Eg="X-Supabase-Api-Version",UE={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},PF=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,kF=6e5;
258class _y extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function ke(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class NF extends _y{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function RF(t){return ke(t)&&t.name==="AuthApiError"}class VE extends _y{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class bs extends _y{constructor(e,n,r,i){super(e,r,i),this.name=n,this.status=r}}class Ai extends bs{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function IF(t){return ke(t)&&t.name==="AuthSessionMissingError"}class Qp extends bs{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Zc extends bs{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class qc extends bs{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function AF(t){return ke(t)&&t.name==="AuthImplicitGrantRedirectError"}class Lw extends bs{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Pg extends bs{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function Xp(t){return ke(t)&&t.name==="AuthRetryableFetchError"}class Ow extends bs{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class Hl extends bs{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const jw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Dw=` 259\r=`.split(""),MF=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<Dw.length;e+=1)t[Dw[e].charCodeAt(0)]=-2;for(let e=0;e<jw.length;e+=1)t[jw[e].charCodeAt(0)]=e;return t})();function HE(t,e,n){const r=MF[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function Fw(t){const e=[],n=a=>{e.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=a=>{jF(a,r,n)};for(let a=0;a<t.length;a+=1)HE(t.charCodeAt(a),i,s);return e.join("")}function LF(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 OF(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}LF(r,e)}}function jF(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if(!(t>>7-r&1)){e.utf8seq=r;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&&n(e.codepoint)}}function DF(t){const e=[],n={queue:0,queuedBits:0},r=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)HE(t.charCodeAt(i),n,r);return new Uint8Array(e)}function FF(t){const e=[];return OF(t,n=>e.push(n)),new Uint8Array(e)}function $F(t){return Math.round(Date.now()/1e3)+t}function zF(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}const Pr=()=>typeof window<"u"&&typeof document<"u",Ls={tested:!1,writable:!1},Wl=()=>{if(!Pr())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ls.tested)return Ls.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Ls.tested=!0,Ls.writable=!0}catch{Ls.tested=!0,Ls.writable=!1}return Ls.writable};function BF(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEac
259h((i,s)=>{e[s]=i})}catch{}return n.searchParams.forEach((r,i)=>{e[i]=r}),e}const WE=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>Aa(async()=>{const{default:r}=await Promise.resolve().then(()=>Ga);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)},UF=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",ZE=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},Gc=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Kc=async(t,e)=>{await t.removeItem(e)};class ch{constructor(){this.promise=new ch.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}ch.promiseConstructor=Promise;function em(t){const e=t.split(".");if(e.length!==3)throw new Hl("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!PF.test(e[r]))throw new Hl("JWT not in base64url format");return{header:JSON.parse(Fw(e[0])),payload:JSON.parse(Fw(e[1])),signature:DF(e[2]),raw:{header:e[0],payload:e[1]}}}async function VF(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function HF(t,e){return new Promise((r,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const a=await t(s);if(!e(s,null,a)){r(a);return}}catch(a){if(!e(s,a)){i(a);return}}})()})}function WF(t){return("0"+t.toString(16)).substr(-2)}function ZF(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let s=0;s<56;s++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(e),Array.from(e,WF).join("")}async function qF(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}async function GF(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 n=await qF(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ko(t,e,n=!1){const r=ZF();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await ZE(t,`${e}-code-verifier`,i);const s=await GF(r);return[s,r===s?"plain":"s256"]}const KF=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function YF(t){const e=t.headers.get(Eg);if(!e||!e.match(KF))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function JF(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 QF(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")}}var XF=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Ds=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),e$=[502,503,504];async function $w(t){var e;if(!UF(t))throw new Pg(Ds(t),0);if(e$.includes(t.status))throw new Pg(Ds(t),t.status);let n;try{n=await t.json()}catch(s){throw new VE(Ds(s),s)}let r;const i=YF(t);if(i&&i.getTime()>=UE["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new Ow(Ds(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new Ai}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((s,a)=>s&&typeof a=="string",!0))throw new Ow(Ds(n),t.status,n.weak_password.reasons);throw new NF(Ds(n),t.status||500,r)}const t$=(t,e,n,r)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function je(t,e,n,r){var i;const s=Object.assign({},r==null?void 0:r.headers);s[Eg]||(s[Eg]=UE["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const a=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(a.redirect_to=r.redirectTo);const l=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",c=await n$(t,e,n+l,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function n$(t,e,n,r,i,s){const a=t$(e,r,i,s);let l;try{l=await t(n,Object.assign({},a))}catch(c){throw console.error(c),new Pg(Ds(c),0)}if(l.ok||await $w(l),r!=null&&r.noResolveJson)return l;try{return await l.json()}catch(c){await $w(c)}}function Mi(t){var e;let n=null;o$(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=$F(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function zw(t){const e=Mi(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((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function zi(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function r$(t){return{data:t,error:null}}function i$(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s}=t,a=XF(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s},c=Object.assign({},a);return{data:{properties:l,user:c},error:null}}function s$(t){return t}function o$(t){return t.access_token&&t.refresh_token&&t.expires_in}var a$=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};class l${constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=WE(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,n="global"){try{return await je(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ke(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await je(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:zi})}catch(r){if(ke(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=a$(e,["options"]),i=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(i.new_email=r==null?void 0:r.newEmail,delete i.newEmail),await je(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:i$,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(ke(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await je(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:zi})}catch(n){if(ke(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,i,s,a,l,c;try{const f={nextPage:null,lastPage:0,total:0},p=await je(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:s$});if(p.error)throw p.error;const m=await p.json(),_=(a=p.headers.get("x-total-count"))!==null&&a!==void 0?a:0,x=(c=(l=p.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return x.length>
vendor: 16,384 bytes, line 259
2590&&(x.forEach(P=>{const b=parseInt(P.split(";")[0].split("=")[1].substring(0,1)),k=JSON.parse(P.split(";")[1].split("=")[1]);f[`${k}Page`]=b}),f.total=parseInt(_)),{data:Object.assign(Object.assign({},m),f),error:null}}catch(f){if(ke(f))return{data:{users:[]},error:f};throw f}}async getUserById(e){try{return await je(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:zi})}catch(n){if(ke(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){try{return await je(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:zi})}catch(r){if(ke(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){try{return await je(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:zi})}catch(r){if(ke(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){try{const{data:n,error:r}=await je(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _deleteFactor(e){try{return{data:await je(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(ke(n))return{data:null,error:n};throw n}}}const u$={getItem:t=>Wl()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{Wl()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{Wl()&&globalThis.localStorage.removeItem(t)}};function Bw(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}function c$(){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)}}const No={debug:!!(globalThis&&Wl()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class qE extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class d$ extends qE{}async function f$(t,e,n){No.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),No.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){No.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await n()}finally{No.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw No.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new d$(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(No.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}c$();const h$={url:SF,storageKey:TF,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:EF,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function Uw(t,e,n){return await n()}class mu{constructor(e){var n,r;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=mu.nextInstanceID,mu.nextInstanceID+=1,this.instanceID>0&&Pr()&&console.warn("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.");const i=Object.assign(Object.assign({},h$),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new l$({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=WE(i.fetch),this.lock=i.lock||Uw,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:Pr()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=f$:this.lock=Uw,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)},this.persistSession?i.storage?this.storage=i.storage:Wl()?this.storage=u$:(this.memoryStorage={},this.storage=Bw(this.memoryStorage)):(this.memoryStorage={},this.storage=Bw(this.memoryStorage)),Pr()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s),await this._notifyAllSubscribers(s.data.event,s.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${BE}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const n=BF(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),Pr()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),AF(s)){const c=(e=s.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:s}}return await this._removeSession(),{error:s}}const{session:a,redirectType:l}=i;return this._debug("#_initialize()","detected session in URL",a,"redirect type",l),await this._saveSession(a),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return ke(n)?{error:n}:{error:new VE("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,i;try{const s=await je(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=e==null?void 0:e.options)===null||i===void 0?void 0:i.captchaToken}},xform:Mi}),{data:a,error:l}=s;if(l||!a)return{data:{user:null,session:null},error:l};const c=a.session,f=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:f,session:c},error:null}}catch(s){if(ke(s))return{data:{user:null,session:null},error:s};throw s}}async signUp(e){var n,r,i;try{let s;if("email"in e){const{email:p,password:m,options:_}=e;let x=null,P=null;this.flowType==="pkce"&&([x,P]=await ko(this.storage,this.storageKey)),s=await je(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:_==null?void 0:_.emailRedirectTo,body:{email:p,password:m,data:(n=_==null?void 0:_.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:_==null?void 0:_.captchaToken},code_challenge:x,code_challenge_method:P},xform:Mi})}else if("phone"in e){const{phone:p,password:m,options:_}=e;s=await je(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:p,password:m,data:(r=_==null?void 0:_.data)!==null&&r!==void 0?r:{},channel:(i=_==null?void 0:_.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:_==null?void 0:_.captchaToken}},xform:Mi})}else throw new Zc("You must provide either an email or phone number and a password");const{data:a,error:l}=s;if(l||!a)return{data:{user:null,session:null},error:l};const c=a.session,f=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:f,session:c},error:null}}catch(s){if(ke(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithPassword(e){try{let n;if("email"in e){const{email:s,password:a,options:l}=e;n=await je(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:zw})}else if("phone"in e){const{phone:s,password:a,options:l}=e;n=await je(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:zw})}else throw new Zc("You must provide either an email or phone number and a password");const{data:r,error:i}=n;return i?{data:{user:null,session:null},error:i}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new Qp}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:i})}catch(n){if(ke(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(e){var n,r,i,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){const n=await Gc(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{const{data:s,error:a}=await je(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:Mi});if(await Kc(this.storage,`${this.storageKey}-code-verifier`),a)throw a;return!s||!s.session||!s.user?{data:{user:null,session:null,redirectType:null},error:new Qp}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:a})}catch(s){if(ke(s))return{data:{user:null,session:null,redirectType:null},error:s};throw s}}async signInWithIdToken(e){try{const{options:n,provider:r,token:i,access_token:s,nonce:a}=e,l=await je(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:s,nonce:a,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Mi}),{data:c,error:f}=l;return f?{data:{user:null,session:null},error:f}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new Qp}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:f})}catch(n){if(ke(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(e){var n,r,i,s,a;try{if("email"in e){const{email:l,options:c}=e;let f=null,p=null;this.flowType==="pkce"&&([f,p]=await ko(this.storage,this.storageKey));const{error:m}=await je(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:f,code_challenge_method:p},redirectTo:c==null?void 0:c.emailRedirectTo});return{data:{user:null,session:null},error:m}}if("phone"in e){const{phone:l,options:c}=e,{data:f,error:p}=await je(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(i=c==null?void 0:c.data)!==null&&i!==void 0?i:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(a=c==null?void 0:c.channel)!==null&&a!==void 0?a:"sms"}});return{data:{user:null,session:null,messageId:f==null?void 0:f.message_id},error:p}}throw new Zc("You must provide either an email or phone number.")}catch(l){if(ke(l))return{data:{user:null,session:null},error:l};throw l}}async verifyOtp(e){var n,r;try{let i,s;"options"in e&&(i=(n=e.options)===null||n===void 0?void 0:n.redirectTo,s=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:a,error:l}=await je(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:Mi});if(l)throw l;if(!a)throw new Error("An error occurred on token verification.");const c=a.session,f=a.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:f,session:c},error:null}}catch(i){if(ke(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var n,r,i;try{let s=null,a=null;return this.flowType==="pkce"&&([s,a]=await ko(this.storage,this.storageKey)),await je(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:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=e==null?void 0:e.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:s,code_challenge_method:a}),headers:this.headers,xform:r$})}catch(s){if(ke(s))return{data:null,error:s};throw s}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new Ai;const{error:i}=await je(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if(ke(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:i,options:s}=e,{error:a}=await je(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return{data:{user:null,session:null},error:a}}else if("phone"in e){const{phone:r,type:i,options:s}=e,{data:a,error:l}=await je(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return{data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:l}}throw new Zc("You must provide either an email or phone number and a type")}catch(n){if(ke(n))return{data:{user:null,session:null},error:n};throw n}}async getSession(){return await this.initiali
259zePromise,await this._acquireLock(-1,async()=>this._useSession(async n=>n))}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await e(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const n=await Gc(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<Jp:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.storage.isServer){let a=this.suppressGetSessionWarning;e=new Proxy(e,{get:(c,f,p)=>(!a&&f==="user"&&(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."),a=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,f,p))})}return{data:{session:e},error:null}}const{session:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?{data:{session:null},error:s}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await je(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:zi}):await this._useSession(async n=>{var r,i,s;const{data:a,error:l}=n;if(l)throw l;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ai}:await je(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=a.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:zi})})}catch(n){if(ke(n))return IF(n)&&(await this._removeSession(),await Kc(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:n};throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:i,error:s}=r;if(s)throw s;if(!i.session)throw new Ai;const a=i.session;let l=null,c=null;this.flowType==="pkce"&&e.email!=null&&([l,c]=await ko(this.storage,this.storageKey));const{data:f,error:p}=await je(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:l,code_challenge_method:c}),jwt:a.access_token,xform:zi});if(p)throw p;return a.user=f.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),{data:{user:a.user},error:null}})}catch(r){if(ke(r))return{data:{user:null},error:r};throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Ai;const n=Date.now()/1e3;let r=n,i=!0,s=null;const{payload:a}=em(e.access_token);if(a.exp&&(r=a.exp,i=r<=n),i){const{session:l,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return{data:{user:null,session:null},error:c};if(!l)return{data:{user:null,session:null},error:null};s=l}else{const{data:l,error:c}=await this._getUser(e.access_token);if(c)throw c;s={access_token:e.access_token,refresh_token:e.refresh_token,user:l.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return{data:{user:s.user,session:s},error:null}}catch(n){if(ke(n))return{data:{session:null,user:null},error:n};throw n}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){const{data:a,error:l}=n;if(l)throw l;e=(r=a.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new Ai;const{session:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?{data:{user:null,session:null},error:s}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(ke(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(e,n){try{if(!Pr())throw new qc("No browser detected.");
259if(e.error||e.error_description||e.error_code)throw new qc(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new Lw("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new qc("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new Lw("No code detected.");const{data:T,error:S}=await this._exchangeCodeForSession(e.code);if(S)throw S;const R=new URL(window.location.href);return R.searchParams.delete("code"),window.history.replaceState(window.history.state,"",R.toString()),{data:{session:T.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:s,refresh_token:a,expires_in:l,expires_at:c,token_type:f}=e;if(!s||!l||!a||!f)throw new qc("No session defined in URL");const p=Math.round(Date.now()/1e3),m=parseInt(l);let _=p+m;c&&(_=parseInt(c));const x=_-p;x*1e3<=Oo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${x}s, should have been closer to ${m}s`);const P=_-m;p-P>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",P,_,p):p-P<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",P,_,p);const{data:b,error:k}=await this._getUser(s);if(k)throw k;const E={provider_token:r,provider_refresh_token:i,access_token:s,expires_in:m,expires_at:_,refresh_token:a,token_type:f,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:E,redirectType:e.type},error:null}}catch(r){if(ke(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const n=await Gc(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return{error:s};const a=(r=i.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:l}=await this.admin.signOut(a,e);if(l&&!(RF(l)&&(l.status===404||l.status===401||l.status===403)))return{error:l}}return e!=="others"&&(await this._removeSession(),await Kc(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}
259onAuthStateChange(e){const n=zF(),r={id:n,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,i;try{const{data:{session:s},error:a}=n;if(a)throw a;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),console.error(s)}})}async resetPasswordForEmail(e,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await ko(this.storage,this.storageKey,!0));try{return await je(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(s){if(ke(s))return{data:null,error:s};throw s}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(n){if(ke(n))return{data:null,error:n};throw n}}async linkIdentity(e){var n;try{const{data:r,error:i}=await this._useSession(async s=>{var a,l,c,f,p;const{data:m,error:_}=s;if(_)throw _;const x=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(l=e.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await je(this.fetch,"GET",x,{headers:this.headers,jwt:(p=(f=m.session)===null||f===void 0?void 0:f.access_token)!==null&&p!==void 0?p:void 0})});if(i)throw i;return Pr()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),{data:{provider:e.provider,url:r==null?void 0:r.url},error:null}}catch(r){if(ke(r))return{data:{provider:e.provider,url:null},error:r};throw r}}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;if(a)throw a;return await je(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await HF(async i=>(i>0&&await VF(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await je(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Mi})),(i,s)=>{const a=200*Math.pow(2,i);return s&&Xp(s)&&Date.now()+a-r<Oo})}catch(r){if(this._debug(n,"error",r),ke(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),Pr()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const r=await Gc(this.storage,this.storageKey);if(this._debug(n,"session from storage",r),!this._isValidSession(r)){this._debug(n,"session is not valid"),r!==null&&await this._removeSession();return}const i=((e=r.expires_at)!==null&&e!==void 0?e:1/0)*1e3-Date.now()<Jp;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${Jp}
259s`),i){if(this.autoRefreshToken&&r.refresh_token){const{error:s}=await this._callRefreshToken(r.refresh_token);s&&(console.error(s),Xp(s)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",r)}catch(r){this._debug(n,"error",r),console.error(r);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new Ai;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new ch;const{data:s,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!s.session)throw new Ai;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);const l={session:s.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(s){if(this._debug(i,"error",s),ke(s)){const a={session:null,error:s};return Xp(s)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,n,r=!0){const i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const s=[],a=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(e,n)}catch(c){s.push(c)}});if(await Promise.all(a),s.length>0){for(let l=0;l<s.length;l+=1)console.error(s[l]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await ZE(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await Kc(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Pr()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Oo);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((r.expires_at*1e3-e)/Oo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Oo}ms, refresh threshold is ${Tg} ticks`),i<=Tg&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof qE)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Pr()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const n=`#_onVisibilityChanged(${e})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(
259await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,n,r){const i=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,a]=await ko(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(a)}`});i.push(l.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);i.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;return s?{data:null,error:s}:await je(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;if(a)return{data:null,error:a};const l=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:c,error:f}=await je(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return f?{data:null,error:f}:(e.factorType==="totp"&&(!((i=c==null?void 0:c.totp)===null||i===void 0)&&i.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return{data:null,error:s};const{data:a,error:l}=await je(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return l?{data:null,error:l}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),{data:a,error:l})})}catch(n){if(ke(n))return{data:null,error:n};throw n}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;return s?{data:null,error:s}:await je(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(ke(n))return{data:null,error:n};throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?{data:null,error:r}:await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){const{data:{user:e},error:n}=await this.getUser();if(n)return{data:null,error:n};const r=(e==null?void 0:e.factors)||[],i=r.filter(a=>a.factor_type==="totp"&&a.status==="verified"),s=r.filter(a=>a.factor_type==="phone"&&a.status==="verified");return{data:{all:r,totp:i,phone:s},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var n,r;const{data:{session:i},error:s}=e;if(s)return{data:null,error:s};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=em(i.access_token);let l=null;a.aal&&(l=a.aal);let c=l;((r=(n=i.user.factors)===null||n===void 0?void 0:n.filter(m=>m.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(c="aal2");const p=a.amr||[];return{data:{currentLevel:l,nextLevel:c,currentAuthenticationMethods:p},error:null}}))}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(a=>a.kid===e);if(r||(r=this.jwks.keys.find(a=>a.kid===e),r&&this.jwks_cached_at+kF>Date.now()))return r;const{data:i,error:s}=await je(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;if(!i.keys||i.keys.length===0)throw new Hl("JWKS is empty");if(this.jwks=i,this.jwks_cached_at=Date.now(),r=i.keys.find(a=>a.kid===e),!r)throw new Hl("No matching signing key found in JWKS");return r}async getClaims(e,n={keys:[]}){try{let r=e;if(!r){const{data:x,error:P}
259=await this.getSession();if(P||!x.session)return{data:null,error:P};r=x.session.access_token}const{header:i,payload:s,signature:a,raw:{header:l,payload:c}}=em(r);if(JF(s.exp),!i.kid||i.alg==="HS256"||!("crypto"in globalThis&&"subtle"in globalThis.crypto)){const{error:x}=await this.getUser(r);if(x)throw x;return{data:{claims:s,header:i,signature:a},error:null}}const f=QF(i.alg),p=await this.fetchJwk(i.kid,n),m=await crypto.subtle.importKey("jwk",p,f,!0,["verify"]);if(!await crypto.subtle.verify(f,m,a,FF(`${l}.${c}`)))throw new Hl("Invalid JWT signature");return{data:{claims:s,header:i,signature:a},error:null}}catch(r){if(ke(r))return{data:null,error:r};throw r}}}mu.nextInstanceID=0;const p$=mu;class m$ extends p${constructor(e){super(e)}}var g$=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function l(p){try{f(r.next(p))}catch(m){a(m)}}function c(p){try{f(r.throw(p))}catch(m){a(m)}}function f(p){p.done?s(p.value):i(p.value).then(l,c)}f((r=r.apply(t,e||[])).next())})};class v${constructor(e,n,r){var i,s,a;if(this.supabaseUrl=e,this.supabaseKey=n,!e)throw new Error("supabaseUrl is required.");if(!n)throw new Error("supabaseKey is required.");const l=bF(e);this.realtimeUrl=`${l}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${l}/auth/v1`,this.storageUrl=`${l}/storage/v1`,this.functionsUrl=`${l}/functions/v1`;const c=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,f={db:pF,realtime:gF,auth:Object.assign(Object.assign({},mF),{storageKey:c}),global:hF},p=CF(r??{},f);this.storageKey=(i=p.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(s=p.global.headers)!==null&&s!==void 0?s:{},p.accessToken?(this.accessToken=p.accessToken,this.auth=new Proxy({},{get:(m,_)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(_)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((a=p.auth)!==null&&a!==void 0?a:{},this.headers,p.global.fetch),this.fetch=xF(n,this._getAccessToken.bind(this),p.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},p.realtime)),this.rest=new OD(`${l}/rest/v1`,{headers:this.headers,schema:p.db.schema,fetch:this.fetch}),p.accessToken||this._listenForAuthEvents()}get functions(){return new dD(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new cF(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,n={},r={}){return this.rest.rpc(e,n,r)}channel(e,n={config:{}}){return this.realtime.channel(e,n)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,n;return g$(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:r}=yield this.auth.getSession();return(n=(e=r.session)===null||e===void 0?void 0:e.access_token)!==null&&n!==void 0?n:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:i,storageKey:s,flowType:a,lock:l,debug:c},f,p){const m={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new m$({url:this.authUrl,headers:Object.assign(Object.assign({},m),f),storageKey:s,autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:i,flowType:a,lock:l,debug:c,fetch:p,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new YD(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(e,n,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:e==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const y$=(t,e,n)=>new v$(t,e,n),_$="https://itxkdtnhgiajnwxdojhz.supabase.co",x$="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Iml0eGtkdG5oZ2lham53eGRvamh6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDQyMzgxMTYsImV4cCI6MjA1OTgxNDExNn0.JvdvfUUEl1rjDoPS4Td1YLZLzcQm0kzPO45aFWpouJk",Je=y$(_$,x$),w$=async()=>{const{data:t,error:e}=await Je.from("hospitals").select("*");if(e)throw console.error("Error fetching hospitals:",e),e;return t||[]},b$=async(t,e)=>{const{data:n,error:r}=await Je.from("hospitals").update(e).eq("id",t).select().single();if(r)throw console.error("Error updating hospital:",r),r;return n},C$=async t=>{const{data:e,error:n}=await Je.from("hospitals").insert(t).select().single();if(n)throw console.error("Error creating hospital:",n),n;return e},S$=async t=>{const{error:e}=await Je.from("hospitals").delete().eq("id",t);if(e)throw console.error("Error deleting hospital:",e),e;return!0},T$=async()=>{const{data:t,error:e}=await Je.from("events").select("*");if(e)throw console.error("Error fetching events:",e),e;return t||[]},E$=async()=>{const{data:t,error:e}=await Je.from("uploads").select("*").order("created_at",{ascending:!1}).limit(1);return e?(console.error("Error fetching event:",e),null):(t==null?void 0:t[0])||null},P$=async(t,e)=>{const{data:n,error:r}=await Je.from("events").update(e).eq("id",t).select().single();if(r)throw console.error("Error updating event:",r),r;return n},k$=async t=>{const{data:e,error:n}=await Je.from("events").insert(t).select().single();if(n)throw console.error("Error creating event:",n),n;return e},N$=async t=>{const{error:e}=await Je.from("events").delete().eq("id",t);if(e)throw console.error("Error deleting event:",e),e;return!0},R$=t=>({id:t.id,name:t.name,address:t.address,city:"Unknown",state:"Unknown",zipCode:"Unknown",phone:t.contact_phone||"",status:t.current_occupancy>=t.capacity?"full":"receiving",latitude:t.latitude,longitude:t.longitude,donationNeeds:[],patients:[]}),I$=async()=>{const{data:t,error:e}=await Je.from("hospital_events").select("*");if(e)return console.error("Error fetching hospital events:",e),{};const n={};return t==null||t.forEach(r=>{n[r.event_id]||(n[r.event_id]=[]),n[r.event_id].push(r.hospital_id)}),n},A$=async()=>{const{data:t,error:e}=await Je.from("victims").select(` 260 *, 261 uploads ( 262 * 263 ) 264 `).order("updated_at",{ascending:!1});if(console.log("data: ",t),e)throw console.error("Error fetching victims:",e),e;return t||[]},M$=t=>({id:t.id,name:t.full_name,condition:t.status==="stable"||t.status==="critical"||t.status==="deceased"?t.status:"unknown",dateAdmitted:t.created_at||new Date().toISOString(),hospitalId:t.hospital_id||"",upload:t.uploads,eventId:t.event_id||""}),L$=async t=>{let e=Je.from("donation_needs").select("*");const{data:n,error:r}=await e;if(r)throw console.error("Error fetching donation needs:",r),r;return n||[]},GE=w.createContext(void 0),O$=({children:t})=>{const[e,n]=w.useState([]),[r,i]=w.useState([]),[s,a]=w.useState([]),[l,c]=w.useState(null),[f,p]=w.useState(null),[m,_]=w.useState(!0),{toast:x}=_s(),P=(R,I)=>I.filter(M=>M.hospital_id===R).map(M=>({id:M.id,type:M.type,bloodType:M.blood_type,description:M.additional_info||"",urgency:M.urgency_level})),b=async()=>{_(!0);try{const[R,I,M,O,D,K]=await Promise.all([w$(),T$(),A$(),L$(),I$(),E$
264()]);p(K);const q=R.map($=>{const z=R$($);return z.donationNeeds=P($.id,O),z}),ne=M.map(M$);q.forEach($=>{$.patients=ne.filter(z=>z.hospitalId===$.id)});const W=I.map($=>({id:$.id,name:$.title,description:$.description||"",startDate:$.start_date,endDate:$.end_date||void 0,type:"natural_disaster",status:$.status==="active"?"active":"resolved",affectedHospitalIds:D[$.id]||[]}));n(q),i(W),a(ne),W.length>0&&!l&&c(W[0])}catch(R){console.error("Failed to load data:",R),x({title:"Error loading data",description:"Could not retrieve data from the server. Using mock data instead.",variant:"destructive"}),n(bE),i(Gp),a(CE),Gp.length>0&&c(Gp[0])}finally{_(!1)}};w.useEffect(()=>{b()},[]);const k=R=>{if(!R.trim())return[];const I=R.toLowerCase();return s.filter(M=>M.name.toLowerCase().includes(I))},E=R=>e.find(I=>I.id===R),T=R=>r.find(I=>I.id===R),S=async()=>{await b()};return d.jsx(GE.Provider,{value:{hospitals:e,events:r,patients:s,currentEvent:l,lastUpdate:f,setCurrentEvent:c,searchPatients:k,getHospital:E,getEvent:T,isLoading:m,refreshData:S},children:t})},Gn=()=>{const t=w.useContext(GE);if(t===void 0)throw new Error("useAppContext must be used within an AppProvider");return t},KE=w.createContext({language:"es",setLanguage:()=>console.warn("setLanguage called before I18nProvider mounted"),t:t=>t,translations:{}}),Nt=()=>w.useContext(KE),j$="appSettings",D$=({children:t})=>{const[e,n]=w.useState("es"),[r,i]=w.useState({}),[s,a]=w.useState(!0),l=w.useCallback(async p=>{a(!0);try{const m=await fetch(`/locales/${p}/translation.json`);if(!m.ok)throw new Error(`Failed to load translations for ${p}: ${m.statusText}`);const _=await m.json();i(_),console.log(`Loaded translations for: ${p}`)}catch(m){console.error(`Error loading translations for ${p}:`,m),p!=="es"?await l("es"):i({})}finally{a(!1)}},[]);w.useEffect(()=>{const p=localStorage.getItem(j$);let m="es";if(p)try{const _=JSON.parse(p);_.language&&["en","es"].includes(_.language)&&(m=_.language)}catch(_){console.error("Failed to parse language from localStorage:",_)}n(m),l(m)},[l]);const c=w.useCallback(p=>{["en","es"].includes(p)?(n(p),l(p)):console.warn(`Unsupported language selected: ${p}`)},[l]),f=w.useCallback((p,m)=>{const _=p.split(".");let x=r;for(const P of _)if(x&&typeof x=="object"&&P in x)x=x[P];else return console.warn(`Translation key not found: ${p}`),p;return typeof x=="string"?(m&&Object.keys(m).forEach(P=>{x=x.replace(`{{${P}}}`,String(m[P]))}),x):(console.warn(`Translation key did not resolve to a string: ${p}`),p)},[r]);return s?d.jsx("div",{children:"Loading language..."}):d.jsx(KE.Provider,{value:{language:e,setLanguage:c,t:f,translations:r},children:t})},YE=fo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Le=w.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},s)=>{const a=r?Ba:"button";return d.jsx(a,{className:X(YE({variant:e,size:n,className:t})),ref:s,...i})});Le.displayName="Button";const Et=w.forwardRef(({className:t,type:e,...n},r)=>d.jsx("input",{type:e,className:X("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));Et.displayName="Input";function F$(){const[t,e]=w.useState(""),[n,r]=w.useState(""),[i,s]=w.useState(!1),{toast:a}=_s(),l=qa(),c=async f=>{f.preventDefault(),s(!0);try{const{error:p}=await Je.auth.signInWithPassword({email:t,password:n});if(p)throw p;l("/dashboard")}catch(p){a({title:"Login failed",description:p instanceof Error?p.message:"Invalid credentials",variant:"destructive"})}finally{s(!1)}};return d.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:d.jsxs("div",{className:"w-full max-w-md p-8 space-y-8 bg-white rounded-lg shadow",children:[d.jsxs("div",{className:"text-center",children:[d.jsx("h1",{className:"text-3xl font-bold",children:"Emergency Re
264sponse Dashboard"}),d.jsx("p",{className:"mt-2 text-gray-600",children:"Sign in to access the dashboard"})]}),d.jsxs("form",{className:"mt-8 space-y-6",onSubmit:c,children:[d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700",children:"Email"}),d.jsx(Et,{id:"email",type:"email",required:!0,value:t,onChange:f=>e(f.target.value),className:"mt-1"})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700",children:"Password"}),d.jsx(Et,{id:"password",type:"password",required:!0,value:n,onChange:f=>r(f.target.value),className:"mt-1"})]})]}),d.jsx("div",{children:d.jsx(Le,{type:"submit",className:"w-full",disabled:i,children:i?"Signing in...":"Sign in"})})]})]})})}const He=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{ref:n,className:X("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));He.displayName="Card";const Ke=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{ref:n,className:X("flex flex-col space-y-1.5 p-6",t),...e}));Ke.displayName="CardHeader";const at=w.forwardRef(({className:t,...e},n)=>d.jsx("h3",{ref:n,className:X("text-2xl font-semibold leading-none tracking-tight",t),...e}));at.displayName="CardTitle";const kt=w.forwardRef(({className:t,...e},n)=>d.jsx("p",{ref:n,className:X("text-sm text-muted-foreground",t),...e}));kt.displayName="CardDescription";const We=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{ref:n,className:X("p-6 pt-0",t),...e}));We.displayName="CardContent";const kg=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{ref:n,className:X("flex items-center p-6 pt-0",t),...e}));kg.displayName="CardFooter";const $$=()=>{const{t}=Nt();return d.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-primary-50 to-white flex flex-col items-center justify-center p-4",children:[d.jsxs("div",{className:"text-center mb-8 flex flex-col items-center justify-center",children:[d.jsx("img",{src:"/logo.png",alt:"Logo",style:{width:150,height:"auto"}}),d.jsx("h1",{className:"text-4xl font-bold text-primary-900 mb-2",children:t("index.title")}),d.jsx("p",{className:"text-xl text-gray-600 max-w-lg mx-auto",children:t("index.subtitle")})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 max-w-4xl w-full",children:[d.jsxs(He,{className:"border-2 border-primary-100 hover:border-primary transition-all duration-300",children:[d.jsxs(Ke,{children:[d.jsxs(at,{className:"flex items-center text-2xl",children:[d.jsx(zM,{className:"mr-2 h-6 w-6"}),t("index.cards.mobile.title")]}),d.jsx(kt,{children:t("index.cards.mobile.description")})]}),d.jsx(We,{children:d.jsxs("ul",{className:"space-y-2 text-gray-600",children:[d.jsxs("li",{className:"flex items-center",children:[d.jsx("span",{className:"mr-2 bg-primary-100 text-primary rounded-full p-1 text-xs",children:"✓"}),t("index.cards.mobile.feature1")]}),d.jsxs("li",{className:"flex items-center",children:[d.jsx("span",{className:"mr-2 bg-primary-100 text-primary rounded-full p-1 text-xs",children:"✓"}),t("index.cards.mobile.feature2")]}),d.jsxs("li",{className:"flex items-center",children:[d.jsx("span",{className:"mr-2 bg-primary-100 text-primary rounded-full p-1 text-xs",children:"✓"}),t("index.cards.mobile.feature3")]}),d.jsxs("li",{className:"flex items-center",children:[d.jsx("span",{className:"mr-2 bg-primary-100 text-primary rounded-full p-1 text-xs",children:"✓"}),t("index.cards.mobile.feature4")]})]})}),d.jsx(kg,{children:d.jsx(Le,{asChild:!0,className:"w-full",children:d.jsx(fi,{to:"/hospitals",children:t("index.cards.mobile.button")})})})]}),d.jsxs(He,{className:"border-2 border-gray-100 hover:border-gray-300 transition-all duration-300",children:[d.jsxs(Ke,{children:[d.jsxs(at,{className:"flex items-center text-2xl",children:[d.jsx(LM,{className:"mr-2 h-6 w-6"}),t("index.cards.admin.title")]}),d.jsx(kt,{children:t("index.cards.admin.description")})]}),d.jsx(We,{children:d.jsxs("ul",{className:"space-y-2 text-gray-600",children:[d.jsxs("li",{className:"flex items-center",children:[d.jsx("span",{className:"mr-2 bg-gray-100 text-gray-700 rounded-full p-1 text-xs",children:"✓"}),t("index.cards.admin.feature1")]}),d.jsxs("li",{className:"flex items-center",children:[d.jsx("span",{className:"mr-2 bg-gray-100 text-gray-700 rounded-full p-1 text-xs",children:"✓"}),t("index.cards.admin.feature2")]}),d.jsxs("li",{className:"flex items-center",children:[d.jsx("span",{className:"mr-2 bg-gray-100 text-gray-700 rounded-full p-1 text-xs",children:"✓"}),t("index.cards.admin.feature3")]}),d.jsxs("li",{className:"flex items-center",children:[d.jsx("span",{className:"mr-2 bg-gray-100 text-gray-700 rounded-full p-1 text-xs",children:"✓"}),t("index.cards.admin.feature4")]})]})}),d.jsx(kg,{children:d.jsx(Le,{asChild:!0,variant:"outline",className:"w-full",children:d.jsx(fi,{to:"/dashboard",children:t("index.cards.admin.button")})})})]})]}),d.jsx("div",{className:"text-center mt-8",children:d.jsx(Le,{asChild:!0,children:d.jsx("a",{href:"/site.webmanifest",download:"manifest.webmanifest",children:t("index.downloadPWA")})})}),d.jsxs("footer",{className:"mt-12 text-center text-sm text-gray-500",children:[d.jsx("p",{children:t("index.footer.copyright")}),d.jsx("p",{className:"mt-1",children:t("index.footer.tagline")})]})]})};function JE(t,e){const n=w.useRef(e);w.useEffect(function(){e!==n.current&&t.attributionControl!=null&&(n.current!=null&&t.attributionControl.removeAttribution(n.current),e!=null&&t.attributionControl.addAttribution(e)),n.current=e},[t,e])}const z$=1;function B$(t){return Object.freeze({__version:z$,map:t})}function U$(t,e){return Object.freeze({...t,...e})}const QE=w.createContext(null),XE=QE.Provider;function eP(){const t=w.useContext(QE);if(t==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return t}function V$(t){function e(n,r){const{instance:i,context:s}=t(n).current;return w.useImperativeHandle(r,()=>i),n.children==null?null:te.createElement(XE,{value:s},n.children)}return w.forwardRef(e)}function H$(t){function e(n,r){const[i,s]=w.useState(!1),{instance:a}=t(n,s).current;w.useImperativeHandle(r,()=>a),w.useEffect(function(){i&&a.update()},[a,i,n.children]);const l=a._contentNode;return l?ys.createPortal(n.children,l):null}return w.forwardRef(e)}function W$(t){function e(n,r){const{instance:i}=t(n).current;return w.useImperativeHandle(r,()=>i),null}return w.forwardRef(e)}function tP(t,e){const n=w.useRef();w.useEffect(function(){return e!=null&&t.instance.on(e),n.current=e,function(){n.current!=null&&t.instance.off(n.current),n.current=null}},[t,e])}function xy(t,e){const n=t.pane??e.pane;return n?{...t,pane:n}:t}function Z$(t,e){return function(r,i){const s=eP(),a=t(xy(r,s),s);return JE(s.map,r.attribution),tP(a.current,r.eventHandlers),e(a.current,s,r,i),a}}var Ng={exports:{}};/* @preserve 265 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com 266 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade 267 */(function(t,e){(function(n,r){r(e)})(Mn,function(n){var r="1.9.4";function i(o){var u,h,y,C;for(h=1,y=arguments.length;h<y;h++){C=arguments[h];for(u in C)o[u]=C[u]}return o}var s=Object.create||function(){function o(){}return function(u){return o.prototype=u,new o}}();function a(o,u){var h=Array.prototype.slice;
267if(o.bind)return o.bind.apply(o,h.call(arguments,1));var y=h.call(arguments,2);return function(){return o.apply(u,y.length?y.concat(h.call(arguments)):arguments)}}var l=0;function c(o){return"_leaflet_id"in o||(o._leaflet_id=++l),o._leaflet_id}function f(o,u,h){var y,C,N,A;return A=function(){y=!1,C&&(N.apply(h,C),C=!1)},N=function(){y?C=arguments:(o.apply(h,arguments),setTimeout(A,u),y=!0)},N}function p(o,u,h){var y=u[1],C=u[0],N=y-C;return o===y&&h?o:((o-C)%N+N)%N+C}function m(){return!1}function _(o,u){if(u===!1)return o;var h=Math.pow(10,u===void 0?6:u);return Math.round(o*h)/h}function x(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function P(o){return x(o).split(/\s+/)}function b(o,u){Object.prototype.hasOwnProperty.call(o,"options")||(o.options=o.options?s(o.options):{});for(var h in u)o.options[h]=u[h];return o.options}function k(o,u,h){var y=[];for(var C in o)y.push(encodeURIComponent(h?C.toUpperCase():C)+"="+encodeURIComponent(o[C]));return(!u||u.indexOf("?")===-1?"?":"&")+y.join("&")}var E=/\{ *([\w_ -]+) *\}/g;function T(o,u){return o.replace(E,function(h,y){var C=u[y];if(C===void 0)throw new Error("No value provided for variable "+h);return typeof C=="function"&&(C=C(u)),C})}var S=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"};function R(o,u){for(var h=0;h<o.length;h++)if(o[h]===u)return h;return-1}var I="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function M(o){return window["webkit"+o]||window["moz"+o]||window["ms"+o]}var O=0;function D(o){var u=+new Date,h=Math.max(0,16-(u-O));return O=u+h,window.setTimeout(o,h)}var K=window.requestAnimationFrame||M("RequestAnimationFrame")||D,q=window.cancelAnimationFrame||M("CancelAnimationFrame")||M("CancelRequestAnimationFrame")||function(o){window.clearTimeout(o)};function ne(o,u,h){if(h&&K===D)o.call(u);else return K.call(window,a(o,u))}function W(o){o&&q.call(window,o)}var $={__proto__:null,extend:i,create:s,bind:a,get lastId(){return l},stamp:c,throttle:f,wrapNum:p,falseFn:m,formatNum:_,trim:x,splitWords:P,setOptions:b,getParamString:k,template:T,isArray:S,indexOf:R,emptyImageUrl:I,requestFn:K,cancelFn:q,requestAnimFrame:ne,cancelAnimFrame:W};function z(){}z.extend=function(o){var u=function(){b(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},h=u.__super__=this.prototype,y=s(h);y.constructor=u,u.prototype=y;for(var C in this)Object.prototype.hasOwnProperty.call(this,C)&&C!=="prototype"&&C!=="__super__"&&(u[C]=this[C]);return o.statics&&i(u,o.statics),o.includes&&(se(o.includes),i.apply(null,[y].concat(o.includes))),i(y,o),delete y.statics,delete y.includes,y.options&&(y.options=h.options?s(h.options):{},i(y.options,o.options)),y._initHooks=[],y.callInitHooks=function(){if(!this._initHooksCalled){h.callInitHooks&&h.callInitHooks.call(this),this._initHooksCalled=!0;for(var N=0,A=y._initHooks.length;N<A;N++)y._initHooks[N].call(this)}},u},z.include=function(o){var u=this.prototype.options;return i(this.prototype,o),o.options&&(this.prototype.options=u,this.mergeOptions(o.options)),this},z.mergeOptions=function(o){return i(this.prototype.options,o),this},z.addInitHook=function(o){var u=Array.prototype.slice.call(arguments,1),h=typeof o=="function"?o:function(){this[o].apply(this,u)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(h),this};function se(o){if(!(typeof L>"u"||!L||!L.Mixin)){o=S(o)?o:[o];for(var u=0;u<o.length;
267u++)o[u]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var G={on:function(o,u,h){if(typeof o=="object")for(var y in o)this._on(y,o[y],u);else{o=P(o);for(var C=0,N=o.length;C<N;C++)this._on(o[C],u,h)}return this},off:function(o,u,h){if(!arguments.length)delete this._events;else if(typeof o=="object")for(var y in o)this._off(y,o[y],u);else{o=P(o);for(var C=arguments.length===1,N=0,A=o.length;N<A;N++)C?this._off(o[N]):this._off(o[N],u,h)}return this},_on:function(o,u,h,y){if(typeof u!="function"){console.warn("wrong listener type: "+typeof u);return}if(this._listens(o,u,h)===!1){h===this&&(h=void 0);var C={fn:u,ctx:h};y&&(C.once=!0),this._events=this._events||{},this._events[o]=this._events[o]||[],this._events[o].push(C)}},_off:function(o,u,h){var y,C,N;if(this._events&&(y=this._events[o],!!y)){if(arguments.length===1){if(this._firingCount)for(C=0,N=y.length;C<N;C++)y[C].fn=m;delete this._events[o];return}if(typeof u!="function"){console.warn("wrong listener type: "+typeof u);return}var A=this._listens(o,u,h);if(A!==!1){var F=y[A];this._firingCount&&(F.fn=m,this._events[o]=y=y.slice()),y.splice(A,1)}}},fire:function(o,u,h){if(!this.listens(o,h))return this;var y=i({},u,{type:o,target:this,sourceTarget:u&&u.sourceTarget||this});if(this._events){var C=this._events[o];if(C){this._firingCount=this._firingCount+1||1;for(var N=0,A=C.length;N<A;N++){var F=C[N],B=F.fn;F.once&&this.off(o,B,F.ctx),B.call(F.ctx||this,y)}this._firingCount--}}return h&&this._propagateEvent(y),this},listens:function(o,u,h,y){typeof o!="string"&&console.warn('"string" type argument expected');var C=u;typeof u!="function"&&(y=!!u,C=void 0,h=void 0);var N=this._events&&this._events[o];if(N&&N.length&&this._listens(o,C,h)!==!1)return!0;if(y){for(var A in this._eventParents)if(this._eventParents[A].listens(o,u,h,y))return!0}return!1},_listens:function(o,u,h){if(!this._events)return!1;var y=this._events[o]||[];if(!u)return!!y.length;h===this&&(h=void 0);for(var C=0,N=y.length;C<N;C++)if(y[C].fn===u&&y[C].ctx===h)return C;return!1},once:function(o,u,h){if(typeof o=="object")for(var y in o)this._on(y,o[y],u,!0);else{o=P(o);for(var C=0,N=o.length;C<N;C++)this._on(o[C],u,h,!0)}return this},addEventParent:function(o){return this._eventParents=this._eventParents||{},this._eventParents[c(o)]=o,this},removeEventParent:function(o){return this._eventParents&&delete this._eventParents[c(o)],this},_propagateEvent:function(o){for(var u in this._eventParents)this._eventParents[u].fire(o.type,i({layer:o.target,propagatedFrom:o.target},o),!0)}};G.addEventListener=G.on,G.removeEventListener=G.clearAllEventListeners=G.off,G.addOneTimeEventListener=G.once,G.fireEvent=G.fire,G.hasEventListeners=G.listens;var ce=z.extend(G);function j(o,u,h){this.x=h?Math.round(o):o,this.y=h?Math.round(u):u}var U=Math.trunc||function(o){return o>0?Math.floor(o):Math.ceil(o)};j.prototype={clone:function(){return new j(this.x,this.y)},add:function(o){return this.clone()._add(V(o))},_add:function(o){return this.x+=o.x,this.y+=o.y,this},subtract:function(o){return this.clone()._subtract(V(o))},_subtract:function(o){return this.x-=o.x,this.y-=o.y,this},divideBy:function(o){return this.clone()._divideBy(o)},_divideBy:function(o){return this.x/=o,this.y/=o,this},multiplyBy:function(o){return this.clone()._multiplyBy(o)},_multiplyBy:function(o){return this.x*=o,this.y*=o,this},scaleBy:function(o){return new j(this.x*o.x,this.y*o.y)},unscaleBy:function(o){return new j(this.x/o.x,this.y/o.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=U(this.x),this.y=U(this.y),this},distanceTo:function(o){o=V(o);var u=o.x-this.x,h=o.y-this.y;return Math.sqrt(u*u+h*h)},equals:function(o){return o=V(o),o.x===this.x&&o.y===this.y},contains:function(o){return o=V(o),Math.abs(o.x)<=Math.abs(this.x)&&Math.abs(o.y)<=Math.abs(this.y)},toString:function(){return"Point("+_(this.x)+", "+_(this.y)+")"}};function V(o,u,h){return o instanceof j?o:S(o)?new j(o[0],o[1]):o==null?o:typeof o=="object"&&"x"in o&&"y"in o?new j(o.x,o.y):new j(o,u,h)}function re(o,u){if(o)for(var h=u?[o,u]:o,y=0,C=h.length;y<C;y++)this.extend(h[y])}re.prototype={extend:function(o){var u,h;if(!o)return this;if(o instanceof j||typeof o[0]=="number"||"x"in o)u=h=V(o);else if(o=Q(o),u=o.min,h=o.max,!u||!h)return this;return!this.min&&!this.max?(this.min=u.clone(),this.max=h.clone()):(this.min.x=Math.min(u.x,this.min.x),this.max.x=Math.max(h.x,this.max.x),this.min.y=Math.min(u.y,this.min.y),this.max.y=Math.max(h.y,this.max.y)),this},getCenter:function(o){return V((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,o)},getBottomLeft:function(){return V(this.min.x,this.max.y)},getTopRight:function(){return V(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(o){var u,h;return typeof o[0]=="number"||o instanceof j?o=V(o):o=Q(o),o instanceof re?(u=o.min,h=o.max):u=h=o,u.x>=this.min.x&&h.x<=this.max.x&&u.y>=this.min.y&&h.y<=this.max.y},intersects:function(o){o=Q(o);var u=this.min,h=this.max,y=o.min,C=o.max,N=C.x>=u.x&&y.x<=h.x,A=C.y>=u.y&&y.y<=h.y;return N&&A},overlaps:function(o){o=Q(o);var u=this.min,h=this.max,y=o.min,C=o.max,N=C.x>u.x&&y.x<h.x,A=C.y>u.y&&y.y<h.y;return N&&A},isValid:function(){return!!(this.min&&this.max)},pad:function(o){var u=this.min,h=this.max,y=Math.abs(u.x-h.x)*o,C=Math.abs(u.y-h.y)*o;return Q(V(u.x-y,u.y-C),V(h.x+y,h.y+C))},equals:function(o){return o?(o=Q(o),this.min.equals(o.getTopLeft())&&this.max.equals(o.getBottomRight())):!1}};function Q(o,u){return!o||o instanceof re?o:new re(o,u)}function oe(o,u){if(o)for(var h=u?[o,u]:o,y=0,C=h.length;y<C;y++)this.extend(h[y])}oe.prototype={extend:function(o){var u=this._southWest,h=this._northEast,y,C;if(o instanceof fe)y=o,C=o;else if(o instanceof oe){if(y=o._southWest,C=o._northEast,!y||!C)return this}else return o?this.extend(pe(o)||ae(o)):this;return!u&&!h?(this._southWest=new fe(y.lat,y.lng),this._northEast=new fe(C.lat,C.lng)):(u.lat=Math.min(y.lat,u.lat),u.lng=Math.min(y.lng,u.lng),h.lat=Math.max(C.lat,h.lat),h.lng=Math.max(C.lng,h.lng)),this},pad:function(o){var u=this._southWest,h=this._northEast,y=Math.abs(u.lat-h.lat)*o,C=Math.abs(u.lng-h.lng)*o;return new oe(new fe(u.lat-y,u.lng-C),new fe(h.lat+y,h.lng+C))},getCenter:function(){return new fe((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new fe(this.getNorth(),this.getWest())},getSouthEast:function(){return new fe(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat}
267,getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(o){typeof o[0]=="number"||o instanceof fe||"lat"in o?o=pe(o):o=ae(o);var u=this._southWest,h=this._northEast,y,C;return o instanceof oe?(y=o.getSouthWest(),C=o.getNorthEast()):y=C=o,y.lat>=u.lat&&C.lat<=h.lat&&y.lng>=u.lng&&C.lng<=h.lng},intersects:function(o){o=ae(o);var u=this._southWest,h=this._northEast,y=o.getSouthWest(),C=o.getNorthEast(),N=C.lat>=u.lat&&y.lat<=h.lat,A=C.lng>=u.lng&&y.lng<=h.lng;return N&&A},overlaps:function(o){o=ae(o);var u=this._southWest,h=this._northEast,y=o.getSouthWest(),C=o.getNorthEast(),N=C.lat>u.lat&&y.lat<h.lat,A=C.lng>u.lng&&y.lng<h.lng;return N&&A},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(o,u){return o?(o=ae(o),this._southWest.equals(o.getSouthWest(),u)&&this._northEast.equals(o.getNorthEast(),u)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function ae(o,u){return o instanceof oe?o:new oe(o,u)}function fe(o,u,h){if(isNaN(o)||isNaN(u))throw new Error("Invalid LatLng object: ("+o+", "+u+")");this.lat=+o,this.lng=+u,h!==void 0&&(this.alt=+h)}fe.prototype={equals:function(o,u){if(!o)return!1;o=pe(o);var h=Math.max(Math.abs(this.lat-o.lat),Math.abs(this.lng-o.lng));return h<=(u===void 0?1e-9:u)},toString:function(o){return"LatLng("+_(this.lat,o)+", "+_(this.lng,o)+")"},distanceTo:function(o){return Ce.distance(this,pe(o))},wrap:function(){return Ce.wrapLatLng(this)},toBounds:function(o){var u=180*o/40075017,h=u/Math.cos(Math.PI/180*this.lat);return ae([this.lat-u,this.lng-h],[this.lat+u,this.lng+h])},clone:function(){return new fe(this.lat,this.lng,this.alt)}};function pe(o,u,h){return o instanceof fe?o:S(o)&&typeof o[0]!="object"?o.length===3?new fe(o[0],o[1],o[2]):o.length===2?new fe(o[0],o[1]):null:o==null?o:typeof o=="object"&&"lat"in o?new fe(o.lat,"lng"in o?o.lng:o.lon,o.alt):u===void 0?null:new fe(o,u,h)}var ee={latLngToPoint:function(o,u){var h=this.projection.project(o),y=this.scale(u);return this.transformation._transform(h,y)},pointToLatLng:function(o,u){var h=this.scale(u),y=this.transformation.untransform(o,h);return this.projection.unproject(y)},project:function(o){return this.projection.project(o)},unproject:function(o){return this.projection.unproject(o)},scale:function(o){return 256*Math.pow(2,o)},zoom:function(o){return Math.log(o/256)/Math.LN2},getProjectedBounds:function(o){if(this.infinite)return null;var u=this.projection.bounds,h=this.scale(o),y=this.transformation.transform(u.min,h),C=this.transformation.transform(u.max,h);return new re(y,C)},infinite:!1,wrapLatLng:function(o){var u=this.wrapLng?p(o.lng,this.wrapLng,!0):o.lng,h=this.wrapLat?p(o.lat,this.wrapLat,!0):o.lat,y=o.alt;return new fe(h,u,y)},wrapLatLngBounds:function(o){var u=o.getCenter(),h=this.wrapLatLng(u),y=u.lat-h.lat,C=u.lng-h.lng;if(y===0&&C===0)return o;
267var N=o.getSouthWest(),A=o.getNorthEast(),F=new fe(N.lat-y,N.lng-C),B=new fe(A.lat-y,A.lng-C);return new oe(F,B)}},Ce=i({},ee,{wrapLng:[-180,180],R:6371e3,distance:function(o,u){var h=Math.PI/180,y=o.lat*h,C=u.lat*h,N=Math.sin((u.lat-o.lat)*h/2),A=Math.sin((u.lng-o.lng)*h/2),F=N*N+Math.cos(y)*Math.cos(C)*A*A,B=2*Math.atan2(Math.sqrt(F),Math.sqrt(1-F));return this.R*B}}),Ze=6378137,Ie={R:Ze,MAX_LATITUDE:85.0511287798,project:function(o){var u=Math.PI/180,h=this.MAX_LATITUDE,y=Math.max(Math.min(h,o.lat),-h),C=Math.sin(y*u);return new j(this.R*o.lng*u,this.R*Math.log((1+C)/(1-C))/2)},unproject:function(o){var u=180/Math.PI;return new fe((2*Math.atan(Math.exp(o.y/this.R))-Math.PI/2)*u,o.x*u/this.R)},bounds:function(){var o=Ze*Math.PI;return new re([-o,-o],[o,o])}()};function Ae(o,u,h,y){if(S(o)){this._a=o[0],this._b=o[1],this._c=o[2],this._d=o[3];return}this._a=o,this._b=u,this._c=h,this._d=y}Ae.prototype={transform:function(o,u){return this._transform(o.clone(),u)},_transform:function(o,u){return u=u||1,o.x=u*(this._a*o.x+this._b),o.y=u*(this._c*o.y+this._d),o},untransform:function(o,u){return u=u||1,new j((o.x/u-this._b)/this._a,(o.y/u-this._d)/this._c)}};function he(o,u,h,y){return new Ae(o,u,h,y)}var ut=i({},Ce,{code:"EPSG:3857",projection:Ie,transformation:function(){var o=.5/(Math.PI*Ie.R);return he(o,.5,-o,.5)}()}),Rt=i({},ut,{code:"EPSG:900913"});function Yt(o){return document.createElementNS("http://www.w3.org/2000/svg",o)}function cn(o,u){var h="",y,C,N,A,F,B;for(y=0,N=o.length;y<N;y++){for(F=o[y],C=0,A=F.length;C<A;C++)B=F[C],h+=(C?"L":"M")+B.x+" "+B.y;h+=u?ge.svg?"z":"x":""}return h||"M0 0"}var dn=document.documentElement.style,gr="ActiveXObject"in window,Ci=gr&&!document.addEventListener,Qa="msLaunchUri"in navigator&&!("documentMode"in document),Zr=br("webkit"),Xa=br("android"),vr=br("android 2")||br("android 3"),jh=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Dh=Xa&&br("Google")&&jh<537&&!("AudioNode"in window),zt=!!window.opera,qr=!Qa&&br("chrome"),ec=br("gecko")&&!Zr&&!zt&&!gr,Fh=!qr&&br("safari"),Ps=br("phantom"),tc="OTransition"in dn,nc=navigator.platform.indexOf("Win")===0,mo=gr&&"transition"in dn,yr="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!vr,el="MozPerspective"in dn,Si=!window.L_DISABLE_3D&&(mo||yr||el)&&!tc&&!Ps,ks=typeof orientation<"u"||br("mobile"),$h=ks&&Zr,rc=ks&&yr,tl=!window.PointerEvent&&window.MSPointerEvent,ic=!!(window.PointerEvent||tl),go="ontouchstart"in window||!!window.TouchEvent,_r=!window.L_NO_TOUCH&&(go||ic),zh=ks&&zt,we=ks&&ec,qe=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,et=function(){var o=!1;try{var u=Object.defineProperty({},"passive",{get:function(){o=!0}});window.addEventListener("testPassiveEventSupport",m,u),window.removeEventListener("testPassiveEventSupport",m,u)}catch{}return o}(),Cn=function(){return!!document.createElement("canvas").getContext}(),Jt=!!(document.createElementNS&&Yt("svg").createSVGRect),xr=!!Jt&&function(){var o=document.createElement("div");return o.innerHTML="<svg/>",(o.firstChild&&o.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Gr=!Jt&&function(){try{var o=document.createElement("div");o.innerHTML='<v:shape adj="1"/>';var u=o.firstChild;return u.style.behavior="url(#default#VML)",u&&typeof u.adj=="object"}catch{return!1}}(),Sn=navigator.platform.indexOf("Mac")===0,wr=navigator.platform.indexOf("Linux")===0;function br(o){return navigator.userAgent.toLowerCase().indexOf(o)>=0}var ge={ie:gr,ielt9:Ci,edge:Qa,webkit:Zr,android:Xa,android23:vr,androidStock:Dh,opera:zt,chrome:qr,gecko:ec,safari:Fh,phantom:Ps,opera12:tc,win:nc,ie3d:mo,webkit3d:yr,gecko3d:el,any3d:Si,mobile:ks,mobileWebkit:$h,mobileWebkit3d:rc,msPointer:tl,pointer:ic,touch:_r,touchNative:go,mobileOpera:zh,mobileGecko:we,retina:qe,passiveEvents:et,canvas:Cn,svg:Jt,vml:Gr,inlineSvg:xr,mac:Sn,linux:wr},By=ge.msPointer?"MSPointerDown":"pointerdown",Uy=ge.msPointer?"MSPointerMove":"pointermove",Vy=ge.msPointer?"MSPointerUp":"pointerup",Hy=ge.msPointer?"MSPointerCancel":"pointercancel",Bh={touchstart:By,touchmove:Uy,touchend:Vy,touchcancel:Hy},Wy={touchstart:tN,touchmove:sc,touchend:sc,touchcancel:sc},vo={},Zy=!1;function Yk(o,u,h){return u==="touchstart"&&eN(),Wy[u]?(h=Wy[u].bind(this,h),o.addEventListener(Bh[u],h,!1),h):(console.warn("wrong event specified:",u),m)}function Jk(o,u,h){if(!Bh[u]){console.warn("wrong event specified:",u);return}o.removeEventListener(Bh[u],h,!1)}function Qk(o){vo[o.pointerId]=o}function Xk(o){vo[o.pointerId]&&(vo[o.pointerId]=o)}function qy(o){delete vo[o.pointerId]}function eN(){Zy||(document.addEventListener(By,Qk,!0),document.addEventListener(Uy,Xk,!0),document.addEventListener(Vy,qy,!0),document.addEventListener(Hy,qy,!0),Zy=!0)}function sc(o,u){if(u.pointerType!==(u.MSPOINTER_TYPE_MOUSE||"mouse")){u.touches=[];for(var h in vo)u.touches.push(vo[h]);u.changedTouches=[u],o(u)}}function tN(o,u){u.MSPOINTER_TYPE_TOUCH&&u.pointerType===u.MSPOINTER_TYPE_TOUCH&&Ot(u),sc(o,u)}function nN(o){var u={},h,y;for(y in o)h=o[y],u[y]=h&&h.bind?h.bind(o):h;return o=u,u.type="dblclick",u.detail=2,u.isTrusted=!1,u._simulated=!0,u}var rN=200;function iN(o,u){o.addEventListener("dblclick",u);var h=0,y;function C(N){if(N.detail!==1){y=N.detail;return}if(!(N.pointerType==="mouse"||N.sourceCapabilities&&!N.sourceCapabilities.firesTouchEvents)){var A=Qy(N);if(!(A.some(function(B){return B instanceof HTMLLabelElement&&B.attributes.for})&&!A.some(function(B){return B instanceof HTMLInputElement||B instanceof HTMLSelectElement}))){var F=Date.now();F-h<=rN?(y++,y===2&&u(nN(N))):y=1,h=F}}}return o.addEventListener("click",C),{dblclick:u,simDblclick:C}}function sN(o,u){o.removeEventListener("dblclick",u.dblclick),o.removeEventListener("click",u.simDblclick)}var Uh=lc(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),nl=lc(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Gy=nl==="webkitTransition"||nl==="OTransition"?nl+"End":"transitionend";
267function Ky(o){return typeof o=="string"?document.getElementById(o):o}function rl(o,u){var h=o.style[u]||o.currentStyle&&o.currentStyle[u];if((!h||h==="auto")&&document.defaultView){var y=document.defaultView.getComputedStyle(o,null);h=y?y[u]:null}return h==="auto"?null:h}function Ue(o,u,h){var y=document.createElement(o);return y.className=u||"",h&&h.appendChild(y),y}function dt(o){var u=o.parentNode;u&&u.removeChild(o)}function oc(o){for(;o.firstChild;)o.removeChild(o.firstChild)}function yo(o){var u=o.parentNode;u&&u.lastChild!==o&&u.appendChild(o)}function _o(o){var u=o.parentNode;u&&u.firstChild!==o&&u.insertBefore(o,u.firstChild)}function Vh(o,u){if(o.classList!==void 0)return o.classList.contains(u);var h=ac(o);return h.length>0&&new RegExp("(^|\\s)"+u+"(\\s|$)").test(h)}function Ne(o,u){if(o.classList!==void 0)for(var h=P(u),y=0,C=h.length;y<C;y++)o.classList.add(h[y]);else if(!Vh(o,u)){var N=ac(o);Hh(o,(N?N+" ":"")+u)}}function xt(o,u){o.classList!==void 0?o.classList.remove(u):Hh(o,x((" "+ac(o)+" ").replace(" "+u+" "," ")))}function Hh(o,u){o.className.baseVal===void 0?o.className=u:o.className.baseVal=u}function ac(o){return o.correspondingElement&&(o=o.correspondingElement),o.className.baseVal===void 0?o.className:o.className.baseVal}function Dn(o,u){"opacity"in o.style?o.style.opacity=u:"filter"in o.style&&oN(o,u)}function oN(o,u){var h=!1,y="DXImageTransform.Microsoft.Alpha";try{h=o.filters.item(y)}catch{if(u===1)return}u=Math.round(u*100),h?(h.Enabled=u!==100,h.Opacity=u):o.style.filter+=" progid:"+y+"(opacity="+u+")"}function lc(o){for(var u=document.documentElement.style,h=0;h<o.length;h++)if(o[h]in u)return o[h];return!1}function Ns(o,u,h){var y=u||new j(0,0);o.style[Uh]=(ge.ie3d?"translate("+y.x+"px,"+y.y+"px)":"translate3d("+y.x+"px,"+y.y+"px,0)")+(h?" scale("+h+")":"")}function bt(o,u){o._leaflet_pos=u,ge.any3d?Ns(o,u):(o.style.left=u.x+"px",o.style.top=u.y+"px")}function Rs(o){return o._leaflet_pos||new j(0,0)}var il,sl,Wh;if("onselectstart"in document)il=function(){Se(window,"selectstart",Ot)},sl=function(){tt(window,"selectstart",Ot)};else{var ol=lc(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);il=function(){if(ol){var o=document.documentElement.style;Wh=o[ol],o[ol]="none"}},sl=function(){ol&&(document.documentElement.style[ol]=Wh,Wh=void 0)}}function Zh(){Se(window,"dragstart",Ot)}function qh(){tt(window,"dragstart",Ot)}var uc,Gh;function Kh(o){for(;o.tabIndex===-1;)o=o.parentNode;o.style&&(cc(),uc=o,Gh=o.style.outlineStyle,o.style.outlineStyle="none",Se(window,"keydown",cc))}function cc(){uc&&(uc.style.outlineStyle=Gh,uc=void 0,Gh=void 0,tt(window,"keydown",cc))}function Yy(o){do o=o.parentNode;while((!o.offsetWidth||!o.offsetHeight)&&o!==document.body);return o}function Yh(o){var u=o.getBoundingClientRect();return{x:u.width/o.offsetWidth||1,y:u.height/o.offsetHeight||1,boundingClientRect:u}}var aN={__proto__:null,TRANSFORM:Uh,TRANSITION:nl,TRANSITION_END:Gy,get:Ky,getStyle:rl,create:Ue,remove:dt,empty:oc,toFront:yo,toBack:_o,hasClass:Vh,addClass:Ne,removeClass:xt,setClass:Hh,getClass:ac,setOpacity:Dn,testProp:lc,setTransform:Ns,setPosition:bt,getPosition:Rs,get disableTextSelection(){return il},get enableTextSelection(){return sl},disableImageDrag:Zh,enableImageDrag:qh,preventOutline:Kh,restoreOutline:cc,getSizedParentNode:Yy,getScale:Yh};function Se(o,u,h,y){if(u&&typeof u=="object")for(var C in u)Qh(o,C,u[C],h);else{u=P(u);for(var N=0,A=u.length;N<A;N++)Qh(o,u[N],h,y)}return this}var Cr="_leaflet_events";function tt(o,u,h,y){if(arguments.length===1)Jy(o),delete o[Cr];else if(u&&typeof u=="object")for(var C in u)Xh(o,C,u[C],h);else if(u=P(u),arguments.length===2)Jy(o,function(F){return R(u,F)!==-1});else for(var N=0,A=u.length;N<A;N++)Xh(o,u[N],h,y);return this}function Jy(o,u){for(var h in o[Cr]){var y=h.split(/\d/)[0];(!u||u(y))&&Xh(o,y,null,null,h)}}
267var Jh={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Qh(o,u,h,y){var C=u+c(h)+(y?"_"+c(y):"");if(o[Cr]&&o[Cr][C])return this;var N=function(F){return h.call(y||o,F||window.event)},A=N;!ge.touchNative&&ge.pointer&&u.indexOf("touch")===0?N=Yk(o,u,N):ge.touch&&u==="dblclick"?N=iN(o,N):"addEventListener"in o?u==="touchstart"||u==="touchmove"||u==="wheel"||u==="mousewheel"?o.addEventListener(Jh[u]||u,N,ge.passiveEvents?{passive:!1}:!1):u==="mouseenter"||u==="mouseleave"?(N=function(F){F=F||window.event,tp(o,F)&&A(F)},o.addEventListener(Jh[u],N,!1)):o.addEventListener(u,A,!1):o.attachEvent("on"+u,N),o[Cr]=o[Cr]||{},o[Cr][C]=N}function Xh(o,u,h,y,C){C=C||u+c(h)+(y?"_"+c(y):"");var N=o[Cr]&&o[Cr][C];if(!N)return this;!ge.touchNative&&ge.pointer&&u.indexOf("touch")===0?Jk(o,u,N):ge.touch&&u==="dblclick"?sN(o,N):"removeEventListener"in o?o.removeEventListener(Jh[u]||u,N,!1):o.detachEvent("on"+u,N),o[Cr][C]=null}function Is(o){return o.stopPropagation?o.stopPropagation():o.originalEvent?o.originalEvent._stopped=!0:o.cancelBubble=!0,this}function ep(o){return Qh(o,"wheel",Is),this}function al(o){return Se(o,"mousedown touchstart dblclick contextmenu",Is),o._leaflet_disable_click=!0,this}function Ot(o){return o.preventDefault?o.preventDefault():o.returnValue=!1,this}function As(o){return Ot(o),Is(o),this}function Qy(o){if(o.composedPath)return o.composedPath();for(var u=[],h=o.target;h;)u.push(h),h=h.parentNode;return u}function Xy(o,u){if(!u)return new j(o.clientX,o.clientY);var h=Yh(u),y=h.boundingClientRect;return new j((o.clientX-y.left)/h.x-u.clientLeft,(o.clientY-y.top)/h.y-u.clientTop)}var lN=ge.linux&&ge.chrome?window.devicePixelRatio:ge.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function e_(o){return ge.edge?o.wheelDeltaY/2:o.deltaY&&o.deltaMode===0?-o.deltaY/lN:o.deltaY&&o.deltaMode===1?-o.deltaY*20:o.deltaY&&o.deltaMode===2?-o.deltaY*60:o.deltaX||o.deltaZ?0:o.wheelDelta?(o.wheelDeltaY||o.wheelDelta)/2:o.detail&&Math.abs(o.detail)<32765?-o.detail*20:o.detail?o.detail/-32765*60:0}function tp(o,u){var h=u.relatedTarget;if(!h)return!0;try{for(;h&&h!==o;)h=h.parentNode}catch{return!1}return h!==o}var uN={__proto__:null,on:Se,off:tt,stopPropagation:Is,disableScrollPropagation:ep,disableClickPropagation:al,preventDefault:Ot,stop:As,getPropagationPath:Qy,getMousePosition:Xy,getWheelDelta:e_,isExternalTarget:tp,addListener:Se,removeListener:tt},t_=ce.extend({run:function(o,u,h,y){this.stop(),this._el=o,this._inProgress=!0,this._duration=h||.25,this._easeOutPower=1/Math.max(y||.5,.2),this._startPos=Rs(o),this._offset=u.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=ne(this._animate,this),this._step()},_step:function(o){var u=+new Date-this._startTime,h=this._duration*1e3;u<h?this._runFrame(this._easeOut(u/h),o):(this._runFrame(1),this._complete())},_runFrame:function(o,u){var h=this._startPos.add(this._offset.multiplyBy(o));u&&h._round(),bt(this._el,h),this.fire("step")},_complete:function(){W(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(o){return 1-Math.pow(1-o,this._easeOutPower)}}),De=ce.extend({options:{crs:ut,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(o,u){u=b(this,u),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(o),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),u.maxBounds&&this.setMaxBounds(u.maxBounds),u.zoom!==void 0&&(this._zoom=this._limitZoom(u.zoom)),u.center&&u.zoom!==void 0&&this.setView(pe(u.center),u.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=nl&&ge.any3d&&!ge.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Se(this._proxy,Gy,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)}
vendor: 14,889 bytes, line 267
267,setView:function(o,u,h){if(u=u===void 0?this._zoom:this._limitZoom(u),o=this._limitCenter(pe(o),u,this.options.maxBounds),h=h||{},this._stop(),this._loaded&&!h.reset&&h!==!0){h.animate!==void 0&&(h.zoom=i({animate:h.animate},h.zoom),h.pan=i({animate:h.animate,duration:h.duration},h.pan));var y=this._zoom!==u?this._tryAnimatedZoom&&this._tryAnimatedZoom(o,u,h.zoom):this._tryAnimatedPan(o,h.pan);if(y)return clearTimeout(this._sizeTimer),this}return this._resetView(o,u,h.pan&&h.pan.noMoveStart),this},setZoom:function(o,u){return this._loaded?this.setView(this.getCenter(),o,{zoom:u}):(this._zoom=o,this)},zoomIn:function(o,u){return o=o||(ge.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+o,u)},zoomOut:function(o,u){return o=o||(ge.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-o,u)},setZoomAround:function(o,u,h){var y=this.getZoomScale(u),C=this.getSize().divideBy(2),N=o instanceof j?o:this.latLngToContainerPoint(o),A=N.subtract(C).multiplyBy(1-1/y),F=this.containerPointToLatLng(C.add(A));return this.setView(F,u,{zoom:h})},_getBoundsCenterZoom:function(o,u){u=u||{},o=o.getBounds?o.getBounds():ae(o);var h=V(u.paddingTopLeft||u.padding||[0,0]),y=V(u.paddingBottomRight||u.padding||[0,0]),C=this.getBoundsZoom(o,!1,h.add(y));if(C=typeof u.maxZoom=="number"?Math.min(u.maxZoom,C):C,C===1/0)return{center:o.getCenter(),zoom:C};var N=y.subtract(h).divideBy(2),A=this.project(o.getSouthWest(),C),F=this.project(o.getNorthEast(),C),B=this.unproject(A.add(F).divideBy(2).add(N),C);return{center:B,zoom:C}},fitBounds:function(o,u){if(o=ae(o),!o.isValid())throw new Error("Bounds are not valid.");var h=this._getBoundsCenterZoom(o,u);return this.setView(h.center,h.zoom,u)},fitWorld:function(o){return this.fitBounds([[-90,-180],[90,180]],o)},panTo:function(o,u){return this.setView(o,this._zoom,{pan:u})},panBy:function(o,u){if(o=V(o).round(),u=u||{},!o.x&&!o.y)return this.fire("moveend");if(u.animate!==!0&&!this.getSize().contains(o))return this._resetView(this.unproject(this.project(this.getCenter()).add(o)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new t_,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),u.noMoveStart||this.fire("movestart"),u.animate!==!1){Ne(this._mapPane,"leaflet-pan-anim");var h=this._getMapPanePos().subtract(o).round();this._panAnim.run(this._mapPane,h,u.duration||.25,u.easeLinearity)}else this._rawPanBy(o),this.fire("move").fire("moveend");return this},flyTo:function(o,u,h){if(h=h||{},h.animate===!1||!ge.any3d)return this.setView(o,u,h);this._stop();var y=this.project(this.getCenter()),C=this.project(o),N=this.getSize(),A=this._zoom;o=pe(o),u=u===void 0?A:u;var F=Math.max(N.x,N.y),B=F*this.getZoomScale(A,u),Z=C.distanceTo(y)||1,le=1.42,ye=le*le;function Me(Ct){var bc=Ct?-1:1,JN=Ct?B:F,QN=B*B-F*F+bc*ye*ye*Z*Z,XN=2*JN*ye*Z,fp=QN/XN,O_=Math.sqrt(fp*fp+1)-fp,eR=O_<1e-9?-18:Math.log(O_);return eR}function Qt(Ct){return(Math.exp(Ct)-Math.exp(-Ct))/2}function It(Ct){return(Math.exp(Ct)+Math.exp(-Ct))/2}function $n(Ct){return Qt(Ct)/It(Ct)}var fn=Me(0);function To(Ct){return F*(It(fn)/It(fn+le*Ct))}function qN(Ct){return F*(It(fn)*$n(fn+le*Ct)-Qt(fn))/ye}function GN(Ct){return 1-Math.pow(1-Ct,1.5)}var KN=Date.now(),M_=(Me(1)-fn)/le,YN=h.duration?1e3*h.duration:1e3*M_*.8;function L_(){var Ct=(Date.now()-KN)/YN,bc=GN(Ct)*M_;Ct<=1?(this._flyToFrame=ne(L_,this),this._move(this.unproject(y.add(C.subtract(y).multiplyBy(qN(bc)/Z)),A),this.getScaleZoom(F/To(bc),A),{flyTo:!0})):this._move(o,u)._moveEnd(!0)}return this._moveStart(!0,h.noMoveStart),L_.call(this),this},flyToBounds:function(o,u){var h=this._getBoundsCenterZoom(o,u);return this.flyTo(h.center,h.zoom,u)},setMaxBounds:function(o){return o=ae(o),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),o.isValid()?(this.options.maxBounds=o,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(o){var u=this.options.minZoom;return this.options.minZoom=o,this._loaded&&u!==o&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(o):this},setMaxZoom:function(o){var u=this.options.maxZoom;return this.options.maxZoom=o,this._loaded&&u!==o&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(o):this},panInsideBounds:function(o,u){this._enforcingBounds=!0;var h=this.getCenter(),y=this._limitCenter(h,this._zoom,ae(o));return h.equals(y)||this.panTo(y,u),this._enforcingBounds=!1,this},panInside:function(o,u){u=u||{};var h=V(u.paddingTopLeft||u.padding||[0,0]),y=V(u.paddingBottomRight||u.padding||[0,0]),C=this.project(this.getCenter()),N=this.project(o),A=this.getPixelBounds(),F=Q([A.min.add(h),A.max.subtract(y)]),B=F.getSize();if(!F.contains(N)){this._enforcingBounds=!0;var Z=N.subtract(F.getCenter()),le=F.extend(N).getSize().subtract(B);C.x+=Z.x<0?-le.x:le.x,C.y+=Z.y<0?-le.y:le.y,this.panTo(this.unproject(C),u),this._enforcingBounds=!1}return this},invalidateSize:function(o){if(!this._loaded)return this;o=i({animate:!1,pan:!0},o===!0?{animate:!0}:o);var u=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var h=this.getSize(),y=u.divideBy(2).round(),C=h.divideBy(2).round(),N=y.subtract(C);return!N.x&&!N.y?this:(o.animate&&o.pan?this.panBy(N):(o.pan&&this._rawPanBy(N),this.fire("move"),o.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:u,newSize:h}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(o){if(o=this._locateOptions=i({timeout:1e4,watch:!1},o),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var u=a(this._handleGeolocationResponse,this),h=a(this._handleGeolocationError,this);return o.watch?this._locationWatchId=navigator.geolocation.watchPosition(u,h,o):navigator.geolocation.getCurrentPosition(u,h,o),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(o){if(this._container._leaflet_id){var u=o.code,h=o.message||(u===1?"permission denied":u===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:u,message:"Geolocation error: "+h+"."})}},_handleGeolocationResponse:function(o){if(this._container._leaflet_id){var u=o.coords.latitude,h=o.coords.longitude,y=new fe(u,h),C=y.toBounds(o.coords.accuracy*2),N=this._locateOptions;if(N.setView){var A=this.getBoundsZoom(C);this.setView(y,N.maxZoom?Math.min(A,N.maxZoom):A)}var F={latlng:y,bounds:C,timestamp:o.timestamp};for(var B in o.coords)typeof o.coords[B]=="number"&&(F[B]=o.coords[B]);this.fire("locationfound",F)}},addHandler:function(o,u){if(!u)return this;var h=this[o]=new u(this);return this._handlers.push(h),this.options[o]&&h.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),dt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(W(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var o;for(o in this._layers)this._layers[o].remove();for(o in this._panes)dt(this._panes[o]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(o,u){var h="leaflet-pane"+(o?" leaflet-"+o.replace("Pane","")+"-pane":""),y=Ue("div",h,u||this._mapPane);return o&&(this._panes[o]=y),y},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var o=this.getPixelBounds(),u=this.unproject(o.getBottomLeft()),h=this.unproject(o.getTopRight());return new oe(u,h)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(o,u,h){o=ae(o),h=V(h||[0,0]);var y=this.getZoom()||0,C=this.getMinZoom(),N=this.getMaxZoom(),A=o.getNorthWest(),F=o.getSouthEast(),B=this.getSize().subtract(h),Z=Q(this.project(F,y),this.project(A,y)).getSize(),le=ge.any3d?this.options.zoomSnap:1,ye=B.x/Z.x,Me=B.y/Z.y,Qt=u?Math.max(ye,Me):Math.min(ye,Me);return y=this.getScaleZoom(Qt,y),le&&(y=Math.round(y/(le/100))*(le/100),y=u?Math.ceil(y/le)*le:Math.floor(y/le)*le),Math.max(C,Math.min(N,y))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new j(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(o,u){var h=this._getTopLeftPoint(o,u);return new re(h,h.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(o){return this.options.crs.getProjectedBounds(o===void 0?this.getZoom():o)},getPane:function(o){return typeof o=="string"?this._panes[o]:o},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(o,u){var h=this.options.crs;return u=u===void 0?this._zoom:u,h.scale(o)/h.scale(u)},getScaleZoom:function(o,u){var h=this.options.crs;u=u===void 0?this._zoom:u;var y=h.zoom(o*h.scale(u));return isNaN(y)?1/0:y},project:function(o,u){return u=u===void 0?this._zoom:u,this.options.crs.latLngToPoint(pe(o),u)},unproject:function(o,u){return u=u===void 0?this._zoom:u,this.options.crs.pointToLatLng(V(o),u)},layerPointToLatLng:function(o){var u=V(o).add(this.getPixelOrigin());return this.unproject(u)},latLngToLayerPoint:function(o){var u=this.project(pe(o))._round();return u._subtract(this.getPixelOrigin())},wrapLatLng:function(o){return this.options.crs.wrapLatLng(pe(o))},wrapLatLngBounds:function(o){return this.options.crs.wrapLatLngBounds(ae(o))},distance:function(o,u){return this.options.crs.distance(pe(o),pe(u))},containerPointToLayerPoint:function(o){return V(o).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(o){return V(o).add(this._getMapPanePos())},containerPointToLatLng:function(o){var u=this.containerPointToLayerPoint(V(o));return this.layerPointToLatLng(u)},latLngToContainerPoint:function(o){return this.layerPointToContainerPoint(this.latLngToLayerPoint(pe(o)))},mouseEventToContainerPoint:function(o){return Xy(o,this._container)},mouseEventToLayerPoint:function(o){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(o))},mouseEventToLatLng:function(o){return this.layerPointToLatLng(this.mouseEventToLayerPoint(o))},_initContainer:function(o){var u=this._container=Ky(o);if(u){if(u._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Se(u,"scroll",this._onScroll,this),this._containerId=c(u)},_initLayout:function(){var o=this._container;this._fadeAnimated=this.options.fadeAnimation&&ge.any3d,Ne(o,"leaflet-container"+(ge.touch?" leaflet-touch":"")+(ge.retina?" leaflet-retina":"")+(ge.ielt9?" leaflet-oldie":"")+(ge.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var u=rl(o,"position");u!=="absolute"&&u!=="relative"&&u!=="fixed"&&u!=="sticky"&&(o.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var o=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),bt(this._mapPane,new j(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Ne(o.markerPane,"leaflet-zoom-hide"),Ne(o.shadowPane,"leaflet-zoom-hide"))},_resetView:function(o,u,h){bt(this._mapPane,new j(0,0));var y=!this._loaded;this._loaded=!0,u=this._limitZoom(u),this.fire("viewprereset");var C=this._zoom!==u;this._moveStart(C,h)._move(o,u)._moveEnd(C),this.fire("viewreset"),y&&this.fire("load")},_moveStart:function(o,u){return o&&this.fire("zoomstart"),u||this.fire("movestart"),this},_move:function(o,u,h,y){u===void 0&&(u=this._zoom);var C=this._zoom!==u;return this._zoom=u,this._lastCenter=o,this._pixelOrigin=this._getNewPixelOrigin(o),y?h&&h.pinch&&this.fire("zoom",h):((C||h&&h.pinch)&&this.fire("zoom",h),this.fire("move",h)),this},_moveEnd:function(o){return o&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return W(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(o){bt(this._mapPane,this._getMapPanePos().subtract(o))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(o){this._targets={},this._targets[c(this._container)]=this;var u=o?tt:Se;u(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&u(window,"resize",this._onResize,this),ge.any3d&&this.options.transform3DLimit&&(o?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){W(this._resizeRequest),this._resizeRequest=ne(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var o=this._getMapPanePos();Math.max(Math.abs(o.x),Math.abs(o.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(o,u){for(var h=[],y,C=u==="mouseout"||u==="mouseover",N=o.target||o.srcElement,A=!1;N;){if(y=this._targets[c(N)],y&&(u==="click"||u==="preclick")&&this._draggableMoved(y)){A=!0;break}if(y&&y.listens(u,!0)&&(C&&!tp(N,o)||(h.push(y),C))||N===this._container)break;N=N.parentNode}return!h.length&&!A&&!C&&this.listens(u,!0)&&(h=[this]),h},_isClickDisabled:function(o){for(;o&&o!==this._container;){if(o._leaflet_disable_click)return!0;o=o.parentNode}},_handleDOMEvent:function(o){var u=o.target||o.srcElement;if(!(!this._loaded||u._leaflet_disable_events||o.type==="click"&&this._isCl
267ickDisabled(u))){var h=o.type;h==="mousedown"&&Kh(u),this._fireDOMEvent(o,h)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(o,u,h){if(o.type==="click"){var y=i({},o);y.type="preclick",this._fireDOMEvent(y,y.type,h)}var C=this._findEventTargets(o,u);if(h){for(var N=[],A=0;A<h.length;A++)h[A].listens(u,!0)&&N.push(h[A]);C=N.concat(C)}if(C.length){u==="contextmenu"&&Ot(o);var F=C[0],B={originalEvent:o};if(o.type!=="keypress"&&o.type!=="keydown"&&o.type!=="keyup"){var Z=F.getLatLng&&(!F._radius||F._radius<=10);B.containerPoint=Z?this.latLngToContainerPoint(F.getLatLng()):this.mouseEventToContainerPoint(o),B.layerPoint=this.containerPointToLayerPoint(B.containerPoint),B.latlng=Z?F.getLatLng():this.layerPointToLatLng(B.layerPoint)}for(A=0;A<C.length;A++)if(C[A].fire(u,B,!0),B.originalEvent._stopped||C[A].options.bubblingMouseEvents===!1&&R(this._mouseEvents,u)!==-1)return}},_draggableMoved:function(o){return o=o.dragging&&o.dragging.enabled()?o:this,o.dragging&&o.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var o=0,u=this._handlers.length;o<u;o++)this._handlers[o].disable()},whenReady:function(o,u){return this._loaded?o.call(u||this,{target:this}):this.on("load",o,u),this},_getMapPanePos:function(){return Rs(this._mapPane)||new j(0,0)},_moved:function(){var o=this._getMapPanePos();return o&&!o.equals([0,0])},_getTopLeftPoint:function(o,u){var h=o&&u!==void 0?this._getNewPixelOrigin(o,u):this.getPixelOrigin();return h.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(o,u){var h=this.getSize()._divideBy(2);return this.project(o,u)._subtract(h)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(o,u,h){var y=this._getNewPixelOrigin(h,u);return this.project(o,u)._subtract(y)},_latLngBoundsToNewLayerBounds:function(o,u,h){var y=this._getNewPixelOrigin(h,u);
vendor: 14,316 bytes, line 267
267return Q([this.project(o.getSouthWest(),u)._subtract(y),this.project(o.getNorthWest(),u)._subtract(y),this.project(o.getSouthEast(),u)._subtract(y),this.project(o.getNorthEast(),u)._subtract(y)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(o){return this.latLngToLayerPoint(o).subtract(this._getCenterLayerPoint())},_limitCenter:function(o,u,h){if(!h)return o;var y=this.project(o,u),C=this.getSize().divideBy(2),N=new re(y.subtract(C),y.add(C)),A=this._getBoundsOffset(N,h,u);return Math.abs(A.x)<=1&&Math.abs(A.y)<=1?o:this.unproject(y.add(A),u)},_limitOffset:function(o,u){if(!u)return o;var h=this.getPixelBounds(),y=new re(h.min.add(o),h.max.add(o));return o.add(this._getBoundsOffset(y,u))},_getBoundsOffset:function(o,u,h){var y=Q(this.project(u.getNorthEast(),h),this.project(u.getSouthWest(),h)),C=y.min.subtract(o.min),N=y.max.subtract(o.max),A=this._rebound(C.x,-N.x),F=this._rebound(C.y,-N.y);return new j(A,F)},_rebound:function(o,u){return o+u>0?Math.round(o-u)/2:Math.max(0,Math.ceil(o))-Math.max(0,Math.floor(u))},_limitZoom:function(o){var u=this.getMinZoom(),h=this.getMaxZoom(),y=ge.any3d?this.options.zoomSnap:1;return y&&(o=Math.round(o/y)*y),Math.max(u,Math.min(h,o))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){xt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(o,u){var h=this._getCenterOffset(o)._trunc();return(u&&u.animate)!==!0&&!this.getSize().contains(h)?!1:(this.panBy(h,u),!0)},_createAnimProxy:function(){var o=this._proxy=Ue("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(o),this.on("zoomanim",function(u){var h=Uh,y=this._proxy.style[h];Ns(this._proxy,this.project(u.center,u.zoom),this.getZoomScale(u.zoom,1)),y===this._proxy.style[h]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){dt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var o=this.getCenter(),u=this.getZoom();Ns(this._proxy,this.project(o,u),this.getZoomScale(u,1))},_catchTransitionEnd:function(o){this._animatingZoom&&o.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(o,u,h){if(this._animatingZoom)return!0;if(h=h||{},!this._zoomAnimated||h.animate===!1||this._nothingToAnimate()||Math.abs(u-this._zoom)>this.options.zoomAnimationThreshold)return!1;var y=this.getZoomScale(u),C=this._getCenterOffset(o)._divideBy(1-1/y);return h.animate!==!0&&!this.getSize().contains(C)?!1:(ne(function(){this._moveStart(!0,h.noMoveStart||!1)._animateZoom(o,u,!0)},this),!0)},_animateZoom:function(o,u,h,y){this._mapPane&&(h&&(this._animatingZoom=!0,this._animateToCenter=o,this._animateToZoom=u,Ne(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:o,zoom:u,noUpdate:y}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&xt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function cN(o,u){return new De(o,u)}var Kn=z.extend({options:{position:"topright"},initialize:function(o){b(this,o)},getPosition:function(){return this.options.position},setPosition:function(o){var u=this._map;return u&&u.removeControl(this),this.options.position=o,u&&u.addControl(this),this},getContainer:function(){return this._container},addTo:function(o){this.remove(),this._map=o;var u=this._container=this.onAdd(o),h=this.getPosition(),y=o._controlCorners[h];return Ne(u,"leaflet-control"),h.indexOf("bottom")!==-1?y.insertBefore(u,y.firstChild):y.appendChild(u),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(dt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(o){this._map&&o&&o.screenX>0&&o.screenY>0&&this._map.getContainer().focus()}}),ll=function(o){return new Kn(o)};De.include({addControl:function(o){return o.addTo(this),this},removeControl:function(o){return o.remove(),this},_initControlPos:function(){var o=this._controlCorners={},u="leaflet-",h=this._controlContainer=Ue("div",u+"control-container",this._container);function y(C,N){var A=u+C+" "+u+N;o[C+N]=Ue("div",A,h)}y("top","left"),y("top","right"),y("bottom","left"),y("bottom","right")},_clearControlPos:function(){for(var o in this._controlCorners)dt(this._controlCorners[o]);dt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var n_=Kn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(o,u,h,y){return h<y?-1:y<h?1:0}},initialize:function(o,u,h){b(this,h),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var y in o)this._addLayer(o[y],y);for(y in u)this._addLayer(u[y],y,!0)},onAdd:function(o){this._initLayout(),this._update(),this._map=o,o.on("zoomend",this._checkDisabledLayers,this);for(var u=0;u<this._layers.length;u++)this._layers[u].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(o){return Kn.prototype.addTo.call(this,o),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var o=0;o<this._layers.length;o++)this._layers[o].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(o,u){return this._addLayer(o,u),this._map?this._update():this},addOverlay:function(o,u){return this._addLayer(o,u,!0),this._map?this._update():this},removeLayer:function(o){o.off("add remove",this._onLayerChange,this);var u=this._getLayer(c(o));return u&&this._layers.splice(this._layers.indexOf(u),1),this._map?this._update():this},expand:function(){Ne(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var o=this._map.getSize().y-(this._container.offsetTop+50);return o<this._section.clientHeight?(Ne(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=o+"px"):xt(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return xt(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var o="leaflet-control-layers",u=this._container=Ue("div",o),h=this.options.collapsed;u.setAttribute("aria-haspopup",!0),al(u),ep(u);var y=this._section=Ue("section",o+"-list");h&&(this._map.on("click",this.collapse,this),Se(u,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var C=this._layersLink=Ue("a",o+"-toggle",u);C.href="#",C.title="Layers",C.setAttribute("role","button"),Se(C,{keydown:function(N){N.keyCode===13&&this._expandSafely()},click:function(N){Ot(N),this._expandSafely()}},this),h||this.expand(),this._baseLayersList=Ue("div",o+"-base",y),this._separator=Ue("div",o+"-separator",y),this._overlaysList=Ue("div",o+"-overlays",y),u.appendChild(y)},_getLayer:function(o){for(var u=0;u<this._layers.length;u++)if(this._layers[u]&&c(this._layers[u].layer)===o)return this._layers[u]},_addLayer:function(o,u,h){this._map&&o.on("add remove",this._onLayerChange,this),this._layers.push({layer:o,name:u,overlay:h}),this.options.sortLayers&&this._layers.sort(a(function(y,C){return this.options.sortFunction(y.layer,C.layer,y.name,C.name)},this)),this.options.autoZIndex&&o.setZIndex&&(this._lastZIndex++,o.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;oc(this._baseLayersList),oc(this._overlaysList),this._layerControlInputs=[];var o,u,h,y,C=0;for(h=0;h<this._layers.length;h++)y=this._layers[h],this._addItem(y),u=u||y.overlay,o=o||!y.overlay,C+=y.overlay?0:1;return this.options.hideSingleBase&&(o=o&&C>1,this._baseLayersList.style.display=o?"":"none"),this._separator.style.display=u&&o?"":"none",this},_onLayerChange:function(o){this._handlingClick||this._update();var u=this._getLayer(c(o.target)),h=u.overlay?o.type==="add"?"overlayadd":"overlayremove":o.type==="add"?"baselayerchange":null;h&&this._map.fire(h,u)},_createRadioElement:function(o,u){var h='<input type="radio" class="leaflet-control-layers-selector" name="'+o+'"'+(u?' checked="checked"':"")+"/>",y=document.createElement("div");return y.innerHTML=h,y.firstChild},_addItem:function(o){var u=document.createElement("label"),h=this._map.hasLayer(o.layer),y;o.overlay?(y=document.createElement("input"),y.type="checkbox",y.className="leaflet-control-layers-selector",y.defaultChecked=h):y=this._createRadioElement("leaflet-base-layers_"+c(this),h),this._layerControlInputs.push(y),y.layerId=c(o.layer),Se(y,"click",this._onInputClick,this);var C=document.createElement("span");C.innerHTML=" "+o.name;var N=document.createElement("span");u.appendChild(N),N.appendChild(y),N.appendChild(C);var A=o.overlay?this._overlaysList:this._baseLayersList;return A.appendChild(u),this._checkDisabledLayers(),u},_onInputClick:function(){if(!this._preventClick){var o=this._layerControlInputs,u,h,y=[],C=[];this._handlingClick=!0;for(var N=o.length-1;N>=0;N--)u=o[N],h=this._getLayer(u.layerId).layer,u.checked?y.push(h):u.checked||C.push(h);for(N=0;N<C.length;N++)this._map.hasLayer(C[N])&&this._map.removeLayer(C[N]);for(N=0;N<y.length;N++)this._map.hasLayer(y[N])||this._map.addLayer(y[N]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var o=this._layerControlInputs,u,h,y=this._map.getZoom(),C=o.length-1;C>=0;C--)u=o[C],h=this._getLayer(u.layerId).layer,u.disabled=h.options.minZoom!==void 0&&y<h.options.minZoom||h.options.maxZoom!==void 0&&y>h.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var o=this._section;this._preventClick=!0,Se(o,"click",Ot),this.expand();var u=this;setTimeout(function(){tt(o,"click",Ot),u._preventClick=!1})}}),dN=function(o,u,h){return new n_(o,u,h)},np=Kn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(o){var u="leaflet-control-zoom",h=Ue("div",u+" leaflet-bar"),y=this.options;return this._zoomInButton=this._createButton(y.zoomInText,y.zoomInTitle,u+"-in",h,this._zoomIn),this._zoomOutButton=this._createButton(y.zoomOutText,y.zoomOutTitle,u+"-out",h,this._zoomOut),this._updateDisabled(),o.on("zoomend zoomlevelschange",this._updateDisabled,this),h},onRemove:function(o){o.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(o){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(o.shiftKey?3:1))},_zoomOut:function(o){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(o.shiftKey?3:1))},_createButton:function(o,u,h,y,C){var N=Ue("a",h,y);return N.innerHTML=o,N.href="#",N.title=u,N.setAttribute("role","button"),N.setAttribute("aria-label",u),al(N),Se(N,"click",As),Se(N,"click",C,this),Se(N,"click",this._refocusOnMap,this),N},_updateDisabled:function(){var o=this._map,u="leaflet-disabled";xt(this._zoomInButton,u),xt(this._zoomOutButton,u),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||o._zoom===o.getMinZoom())&&(Ne(this._zoomOutButton,u),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||o._zoom===o.getMaxZoom())&&(Ne(this._zoomInButton,u),this._zoomInButton.setAttribute("aria-disabled","true"))}});De.mergeOptions({zoomControl:!0}),De.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new np,this.addControl(this.zoomControl))});var fN=function(o){return new np(o)},r_=Kn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(o){var u="leaflet-control-scale",h=Ue("div",u),y=this.options;return this._addScales(y,u+"-line",h),o.on(y.updateWhenIdle?"moveend":"move",this._update,this),o.whenReady(this._update,this),h},onRemove:function(o){o.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(o,u,h){o.metric&&(this._mScale=Ue("div",u,h)),o.imperial&&(this._iScale=Ue("div",u,h))},_update:function(){var o=this._map,u=o.getSize().y/2,h=o.distance(o.containerPointToLatLng([0,u]),o.containerPointToLatLng([this.options.maxWidth,u]));this._updateScales(h)},_updateScales:function(o){this.options.metric&&o&&this._updateMetric(o),this.options.imperial&&o&&this._updateImperial(o)},_updateMetric:function(o){var u=this._getRoundNum(o),h=u<1e3?u+" m":u/1e3+" km";this._updateScale(this._mScale,h,u/o)},_updateImperial:function(o){var u=o*3.2808399,h,y,C;u>5280?(h=u/5280,y=this._getRoundNum(h),this._updateScale(this._iScale,y+" mi",y/h)):(C=this._getRoundNum(u),this._updateScale(this._iScale,C+" ft",C/u))},_updateScale:function(o,u,h){o.style.width=Math.round(this.options.maxWidth*h)+"px",o.innerHTML=u},_getRoundNum:function(o){var u=Math.pow(10,(Math.floor(o)+"").length-1),h=o/u;return h=h>=10?10:h>=5?5:h>=3?3:h>=2?2:1,u*h}}),hN=function(o){return new r_(o)},pN='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',rp=Kn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(ge.inlineSvg?pN+" ":"")+"Leaflet</a>"},initialize:function(o){b(this,o),this._attributions={}}
267,onAdd:function(o){o.attributionControl=this,this._container=Ue("div","leaflet-control-attribution"),al(this._container);for(var u in o._layers)o._layers[u].getAttribution&&this.addAttribution(o._layers[u].getAttribution());return this._update(),o.on("layeradd",this._addAttribution,this),this._container},onRemove:function(o){o.off("layeradd",this._addAttribution,this)},_addAttribution:function(o){o.layer.getAttribution&&(this.addAttribution(o.layer.getAttribution()),o.layer.once("remove",function(){this.removeAttribution(o.layer.getAttribution())},this))},setPrefix:function(o){return this.options.prefix=o,this._update(),this},addAttribution:function(o){return o?(this._attributions[o]||(this._attributions[o]=0),this._attributions[o]++,this._update(),this):this},removeAttribution:function(o){return o?(this._attributions[o]&&(this._attributions[o]--,this._update()),this):this},_update:function(){if(this._map){var o=[];for(var u in this._attributions)this._attributions[u]&&o.push(u);var h=[];this.options.prefix&&h.push(this.options.prefix),o.length&&h.push(o.join(", ")),this._container.innerHTML=h.join(' <span aria-hidden="true">|</span> ')}}});De.mergeOptions({attributionControl:!0}),De.addInitHook(function(){this.options.attributionControl&&new rp().addTo(this)});var mN=function(o){return new rp(o)};Kn.Layers=n_,Kn.Zoom=np,Kn.Scale=r_,Kn.Attribution=rp,ll.layers=dN,ll.zoom=fN,ll.scale=hN,ll.attribution=mN;var Sr=z.extend({initialize:function(o){this._map=o},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Sr.addTo=function(o,u){return o.addHandler(u,this),this};var gN={Events:G},i_=ge.touch?"touchstart mousedown":"mousedown",Ti=ce.extend({options:{clickTolerance:3},initialize:function(o,u,h,y){b(this,y),this._element=o,this._dragStartTarget=u||o,this._preventOutline=h},enable:function(){this._enabled||(Se(this._dragStartTarget,i_,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ti._dragging===this&&this.finishDrag(!0),tt(this._dragStartTarget,i_,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(o){if(this._enabled&&(this._moved=!1,!Vh(this._element,"leaflet-zoom-anim"))){if(o.touches&&o.touches.length!==1){Ti._dragging===this&&this.finishDrag();return}if(!(Ti._dragging||o.shiftKey||o.which!==1&&o.button!==1&&!o.touches)&&(Ti._dragging=this,this._preventOutline&&Kh(this._element),Zh(),il(),!this._moving)){this.fire("down");var u=o.touches?o.touches[0]:o,h=Yy(this._element);this._startPoint=new j(u.clientX,u.clientY),this._startPos=Rs(this._element),this._parentScale=Yh(h);var y=o.type==="mousedown";Se(document,y?"mousemove":"touchmove",this._onMove,this),Se(document,y?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(o){if(this._enabled){if(o.touches&&o.touches.length>1){this._moved=!0;return}var u=o.touches&&o.touches.length===1?o.touches[0]:o,h=new j(u.clientX,u.clientY)._subtract(this._startPoint);!h.x&&!h.y||Math.abs(h.x)+Math.abs(h.y)<this.options.clickTolerance||(h.x/=this._parentScale.x,h.y/=this._parentScale.y,Ot(o),this._moved||(this.fire("dragstart"),this._moved=!0,Ne(document.body,"leaflet-dragging"),this._lastTarget=o.target||o.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Ne(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(h),this._moving=!0,this._lastEvent=o,this._updatePosition())}},_updatePosition:function(){var o={originalEvent:this._lastEvent};this.fire("predrag",o),bt(this._element,this._newPos),this.fire("drag",o)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(o){xt(document.body,"leaflet-dragging"),this._lastTarget&&(xt(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),tt(document,"mousemove touchmove",this._onMove,this),tt(document,"mouseup touchend touchcancel",this._onUp,this),qh(),sl();var u=this._moved&&this._moving;this._moving=!1,Ti._dragging=!1,u&&this.fire("dragend",{noInertia:o,distance:this._newPos.distanceTo(this._startPos)})}});function s_(o,u,h){var y,C=[1,4,2,8],N,A,F,B,Z,le,ye,Me;for(N=0,le=o.length;N<le;N++)o[N]._code=Ms(o[N],u);for(F=0;F<4;F++){for(ye=C[F],y=[],N=0,le=o.length,A=le-1;N<le;A=N++)B=o[N],Z=o[A],B._code&ye?Z._code&ye||(Me=dc(Z,B,ye,u,h),Me._code=Ms(Me,u),y.push(Me)):(Z._code&ye&&(Me=dc(Z,B,ye,u,h),Me._code=Ms(Me,u),y.push(Me)),y.push(B));o=y}return o}function o_(o,u){var h,y,C,N,A,F,B,Z,le;if(!o||o.length===0)throw new Error("latlngs not passed");Fn(o)||(console.warn("latlngs are not flat! Only the first ring will be used"),o=o[0]);var ye=pe([0,0]),Me=ae(o),Qt=Me.getNorthWest().distanceTo(Me.getSouthWest
267())*Me.getNorthEast().distanceTo(Me.getNorthWest());Qt<1700&&(ye=ip(o));var It=o.length,$n=[];for(h=0;h<It;h++){var fn=pe(o[h]);$n.push(u.project(pe([fn.lat-ye.lat,fn.lng-ye.lng])))}for(F=B=Z=0,h=0,y=It-1;h<It;y=h++)C=$n[h],N=$n[y],A=C.y*N.x-N.y*C.x,B+=(C.x+N.x)*A,Z+=(C.y+N.y)*A,F+=A*3;F===0?le=$n[0]:le=[B/F,Z/F];var To=u.unproject(V(le));return pe([To.lat+ye.lat,To.lng+ye.lng])}function ip(o){for(var u=0,h=0,y=0,C=0;C<o.length;C++){var N=pe(o[C]);u+=N.lat,h+=N.lng,y++}return pe([u/y,h/y])}var vN={__proto__:null,clipPolygon:s_,polygonCenter:o_,centroid:ip};function a_(o,u){if(!u||!o.length)return o.slice();var h=u*u;return o=xN(o,h),o=_N(o,h),o}function l_(o,u,h){return Math.sqrt(ul(o,u,h,!0))}function yN(o,u,h){return ul(o,u,h)}function _N(o,u){var h=o.length,y=typeof Uint8Array<"u"?Uint8Array:Array,C=new y(h);C[0]=C[h-1]=1,sp(o,C,u,0,h-1);var N,A=[];for(N=0;N<h;N++)C[N]&&A.push(o[N]);return A}function sp(o,u,h,y,C){var N=0,A,F,B;for(F=y+1;F<=C-1;F++)B=ul(o[F],o[y],o[C],!0),B>N&&(A=F,N=B);N>h&&(u[A]=1,sp(o,u,h,y,A),sp(o,u,h,A,C))}function xN(o,u){for(var h=[o[0]],y=1,C=0,N=o.length;y<N;y++)wN(o[y],o[C])>u&&(h.push(o[y]),C=y);return C<N-1&&h.push(o[N-1]),h}var u_;function c_(o,u,h,y,C){var N=y?u_:Ms(o,h),A=Ms(u,h),F,B,Z;for(u_=A;;){if(!(N|A))return[o,u];if(N&A)return!1;F=N||A,B=dc(o,u,F,h,C),Z=Ms(B,h),F===N?(o=B,N=Z):(u=B,A=Z)}}function dc(o,u,h,y,C){var N=u.x-o.x,A=u.y-o.y,F=y.min,B=y.max,Z,le;return h&8?(Z=o.x+N*(B.y-o.y)/A,le=B.y):h&4?(Z=o.x+N*(F.y-o.y)/A,le=F.y):h&2?(Z=B.x,le=o.y+A*(B.x-o.x)/N):h&1&&(Z=F.x,le=o.y+A*(F.x-o.x)/N),new j(Z,le,C)}function Ms(o,u){var h=0;return o.x<u.min.x?h|=1:o.x>u.max.x&&(h|=2),o.y<u.min.y?h|=4:o.y>u.max.y&&(h|=8),h}function wN(o,u){var h=u.x-o.x,y=u.y-o.y;return h*h+y*y}function ul(o,u,h,y){var C=u.x,N=u.y,A=h.x-C,F=h.y-N,B=A*A+F*F,Z;return B>0&&(Z=((o.x-C)*A+(o.y-N)*F)/B,Z>1?(C=h.x,N=h.y):Z>0&&(C+=A*Z,N+=F*Z)),A=o.x-C,F=o.y-N,y?A*A+F*F:new j(C,N)}function Fn(o){return!S(o[0])||typeof o[0][0]!="object"&&typeof o[0][0]<"u"}function d_(o){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Fn(o)}function f_(o,u){var h,y,C,N,A,F,B,Z;if(!o||o.length===0)throw new Error("latlngs not passed");Fn(o)||(console.warn("latlngs are not flat! Only the first ring will be used"),o=o[0]);var le=pe([0,0]),ye=ae(o),Me=ye.getNorthWest().distanceTo(ye.getSouthWest
vendor: 4,224 bytes, line 267
267())*ye.getNorthEast().distanceTo(ye.getNorthWest());Me<1700&&(le=ip(o));var Qt=o.length,It=[];for(h=0;h<Qt;h++){var $n=pe(o[h]);It.push(u.project(pe([$n.lat-le.lat,$n.lng-le.lng])))}for(h=0,y=0;h<Qt-1;h++)y+=It[h].distanceTo(It[h+1])/2;if(y===0)Z=It[0];else for(h=0,N=0;h<Qt-1;h++)if(A=It[h],F=It[h+1],C=A.distanceTo(F),N+=C,N>y){B=(N-y)/C,Z=[F.x-B*(F.x-A.x),F.y-B*(F.y-A.y)];break}var fn=u.unproject(V(Z));return pe([fn.lat+le.lat,fn.lng+le.lng])}var bN={__proto__:null,simplify:a_,pointToSegmentDistance:l_,closestPointOnSegment:yN,clipSegment:c_,_getEdgeIntersection:dc,_getBitCode:Ms,_sqClosestPointOnSegment:ul,isFlat:Fn,_flat:d_,polylineCenter:f_},op={project:function(o){return new j(o.lng,o.lat)},unproject:function(o){return new fe(o.y,o.x)},bounds:new re([-180,-90],[180,90])},ap={R:6378137,R_MINOR:6356752314245179e-9,bounds:new re([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(o){var u=Math.PI/180,h=this.R,y=o.lat*u,C=this.R_MINOR/h,N=Math.sqrt(1-C*C),A=N*Math.sin(y),F=Math.tan(Math.PI/4-y/2)/Math.pow((1-A)/(1+A),N/2);return y=-h*Math.log(Math.max(F,1e-10)),new j(o.lng*u*h,y)},unproject:function(o){for(var u=180/Math.PI,h=this.R,y=this.R_MINOR/h,C=Math.sqrt(1-y*y),N=Math.exp(-o.y/h),A=Math.PI/2-2*Math.atan(N),F=0,B=.1,Z;F<15&&Math.abs(B)>1e-7;F++)Z=C*Math.sin(A),Z=Math.pow((1-Z)/(1+Z),C/2),B=Math.PI/2-2*Math.atan(N*Z)-A,A+=B;return new fe(A*u,o.x*u/h)}},CN={__proto__:null,LonLat:op,Mercator:ap,SphericalMercator:Ie},SN=i({},Ce,{code:"EPSG:3395",projection:ap,transformation:function(){var o=.5/(Math.PI*ap.R);return he(o,.5,-o,.5)}()}),h_=i({},Ce,{code:"EPSG:4326",projection:op,transformation:he(1/180,1,-1/180,.5)}),TN=i({},ee,{projection:op,transformation:he(1,0,-1,0),scale:function(o){return Math.pow(2,o)},zoom:function(o){return Math.log(o)/Math.LN2},distance:function(o,u){var h=u.lng-o.lng,y=u.lat-o.lat;return Math.sqrt(h*h+y*y)},infinite:!0});ee.Earth=Ce,ee.EPSG3395=SN,ee.EPSG3857=ut,ee.EPSG900913=Rt,ee.EPSG4326=h_,ee.Simple=TN;var Yn=ce.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(o){return o.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(o){return o&&o.removeLayer(this),this},getPane:function(o){return this._map.getPane(o?this.options[o]||o:this.options.pane)},addInteractiveTarget:function(o){return this._map._targets[c(o)]=this,this},removeInteractiveTarget:function(o){return delete this._map._targets[c(o)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(o){var u=o.target;if(u.hasLayer(this)){if(this._map=u,this._zoomAnimated=u._zoomAnimated,this.getEvents){var h=this.getEvents();u.on(h,this),this.once("remove",function(){u.off(h,this)},this)}this.onAdd(u),this.fire("add"),u.fire("layeradd",{layer:this})}}});De.include({addLayer:function(o){if(!o._layerAdd)throw new Error("The provided object is not a Layer.");var u=c(o);return this._layers[u]?this:(this._layers[u]=o,o._mapToAdd=this,o.beforeAdd&&o.beforeAdd(this),this.whenReady(o._layerAdd,o),this)},removeLayer:function(o){var u=c(o);return this._layers[u]?(this._loaded&&o.onRemove(this),delete this._layers[u],this._loaded&&(this.fire("layerremove",{layer:o}),o.fire("remove")),o._map=o._mapToAdd=null,this):this},hasLayer:function(o){return c(o)in this._layers},eachLayer:function(o,u){for(var h in this._layers)o.call(u,this._layers[h]);return this},_addLayers:function(o){o=o?S(o)?o:[o]:[];for(var u=0,h=o.length;u<h;u++)this.addLayer(o[u])},_addZoomLimit:function(o){(!isNaN(o.options.maxZoom)||!isNaN(o.options.minZoom))&&(this._zoomBoundLayers[c(o)]=o,this._updateZoomLevels())},_removeZoomLimit:function(o){var u=c(o);this._zoomBoundLayers[u]&&(delete this._zoomBoundLayers[u],this._updateZoomLevels())},_updateZoomLevels:function(){var o=1/0,u=-1/0,h=this._getZoomSpan();for(var y in this._zoomBoundLayers){var C=this._zoomBoundLayers[y].options;o=C.minZoom===void 0?o:Math.min(o,C.minZoom),u=C.maxZoom===void 0?u:Math.max(u,C.maxZoom)}this._layersMaxZoom=u===-1/0?void 0:u,this._layersMinZoom=o===1/0?void 0:o,h!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZo
267om&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var xo=Yn.extend({initialize:function(o,u){b(this,u),this._layers={};var h,y;if(o)for(h=0,y=o.length;h<y;h++)this.addLayer(o[h])},addLayer:function(o){var u=this.getLayerId(o);return this._layers[u]=o,this._map&&this._map.addLayer(o),this},removeLayer:function(o){var u=o in this._layers?o:this.getLayerId(o);return this._map&&this._layers[u]&&this._map.removeLayer(this._layers[u]),delete this._layers[u],this},hasLayer:function(o){var u=typeof o=="number"?o:this.getLayerId(o);return u in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(o){var u=Array.prototype.slice.call(arguments,1),h,y;for(h in this._layers)y=this._layers[h],y[o]&&y[o].apply(y,u);return this},onAdd:function(o){this.eachLayer(o.addLayer,o)},onRemove:function(o){this.eachLayer(o.removeLayer,o)},eachLayer:function(o,u){for(var h in this._layers)o.call(u,this._layers[h]);return this},getLayer:function(o){return this._layers[o]},getLayers:function(){var o=[];return this.eachLayer(o.push,o),o},setZIndex:function(o){return this.invoke("setZIndex",o)},getLayerId:function(o){return c(o)}}),EN=function(o,u){return new xo(o,u)},Kr=xo.extend({addLayer:function(o){return this.hasLayer(o)?this:(o.addEventParent(this),xo.prototype.addLayer.call(this,o),this.fire("layeradd",{layer:o}))},removeLayer:function(o){return this.hasLayer(o)?(o in this._layers&&(o=this._layers[o]),o.removeEventParent(this),xo.prototype.removeLayer.call(this,o),this.fire("layerremove",{layer:o})):this},setStyle:function(o){return this.invoke("setStyle",o)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var o=new oe;for(var u in this._layers){var h=this._layers[u];o.extend(h.getBounds?h.getBounds():h.getLatLng())}return o}}),PN=function(o,u){return new Kr(o,u)},wo=z.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(o){b(this,o)},createIcon:function(o){return this._createIcon("icon",o)},createShadow:function(o){return this._createIcon("shadow",o)},_createIcon:function(o,u){var h=this._getIconUrl(o);if(!h){if(o==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var y=this._createImg(h,u&&u.tagName==="IMG"?u:null);return this._setIconStyles(y,o),(this.options.crossOrigin||this.options.crossOrigin==="")&&(y.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),y},_setIconStyles:function(o,u){var h=this.options,y=h[u+"Size"];typeof y=="number"&&(y=[y,y]);var C=V(y),N=V(u==="shadow"&&h.shadowAnchor||h.iconAnchor||C&&C.divideBy(2,!0));o.className="leaflet-marker-"+u+" "+(h.className||""),N&&(o.style.marginLeft=-N.x+"px",o.style.marginTop=-N.y+"px"),C&&(o.style.width=C.x+"px",o.style.height=C.y+"px")},_createImg:function(o,u){return u=u||document.createElement("img"),u.src=o,u},_getIconUrl:function(o){return ge.retina&&this.options[o+"RetinaUrl"]||this.options[o+"Url"]}});function kN(o){return new wo(o)}var cl=wo.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(o){return typeof cl.imagePath!="string"&&(cl.imagePath=this._detectIconPath()),(this.options.imagePath||cl.imagePath)+wo.prototype._getIconUrl.call(this,o)},_stripUrl:function(o){var u=function(h,y,C){var N=y.exec(h);return N&&N[C]};return o=u(o,/^url\((['"])?(.+)\1\)$/,2),o&&u(o,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var o=Ue("div","leaflet-default-icon-path",document.body),u=rl(o,"background-image")||rl(o,"backgroundImage");if(document.body.removeChild(o),u=this._stripUrl(u),u)return u;var h=document.querySelector('link[href$="leaflet.css"]');return h?h.href.substring(0,h.href.length-11-1):""}}
vendor: 4,225 bytes, line 267
267),p_=Sr.extend({initialize:function(o){this._marker=o},addHooks:function(){var o=this._marker._icon;this._draggable||(this._draggable=new Ti(o,o,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Ne(o,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&xt(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(o){var u=this._marker,h=u._map,y=this._marker.options.autoPanSpeed,C=this._marker.options.autoPanPadding,N=Rs(u._icon),A=h.getPixelBounds(),F=h.getPixelOrigin(),B=Q(A.min._subtract(F).add(C),A.max._subtract(F).subtract(C));if(!B.contains(N)){var Z=V((Math.max(B.max.x,N.x)-B.max.x)/(A.max.x-B.max.x)-(Math.min(B.min.x,N.x)-B.min.x)/(A.min.x-B.min.x),(Math.max(B.max.y,N.y)-B.max.y)/(A.max.y-B.max.y)-(Math.min(B.min.y,N.y)-B.min.y)/(A.min.y-B.min.y)).multiplyBy(y);h.panBy(Z,{animate:!1}),this._draggable._newPos._add(Z),this._draggable._startPos._add(Z),bt(u._icon,this._draggable._newPos),this._onDrag(o),this._panRequest=ne(this._adjustPan.bind(this,o))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(o){this._marker.options.autoPan&&(W(this._panRequest),this._panRequest=ne(this._adjustPan.bind(this,o)))},_onDrag:function(o){var u=this._marker,h=u._shadow,y=Rs(u._icon),C=u._map.layerPointToLatLng(y);h&&bt(h,y),u._latlng=C,o.latlng=C,o.oldLatLng=this._oldLatLng,u.fire("move",o).fire("drag",o)},_onDragEnd:function(o){W(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",o)}}),fc=Yn.extend({options:{icon:new cl,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(o,u){b(this,u),this._latlng=pe(o)},onAdd:function(o){this._zoomAnimated=this._zoomAnimated&&o.options.markerZoomAnimation,this._zoomAnimated&&o.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(o){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&o.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(o){var u=this._latlng;return this._latlng=pe(o),this.update(),this.fire("move",{oldLatLng:u,latlng:this._latlng})},setZIndexOffset:function(o){return this.options.zIndexOffset=o,this.update()},getIcon:function(){return this.options.icon},setIcon:function(o){return this.options.icon=o,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var o=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(o)}return this},_initIcon:function(){var o=this.options,u="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),h=o.icon.createIcon(this._icon),y=!1;h!==this._icon&&(this._icon&&this._removeIcon(),y=!0,o.title&&(h.title=o.title),h.tagName==="IMG"&&(h.alt=o.alt||"")),Ne(h,u),o.keyboard&&(h.tabIndex="0",h.setAttribute("role","button")),this._icon=h,o.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Se(h,"focus",this._panOnFocus,this);var C=o.icon.createShadow(this._shadow),N=!1;C!==this._shadow&&(this._removeShadow(),N=!0),C&&(Ne(C,u),C.alt=""),this._shadow=C,o.opacity<1&&this._updateOpacity(),y&&this.getPane().appendChild(this._icon),this._initInteraction(),C&&N&&this.getPane(o.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}
vendor: 4,476 bytes, line 267
267),this.options.autoPanOnFocus&&tt(this._icon,"focus",this._panOnFocus,this),dt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&dt(this._shadow),this._shadow=null},_setPos:function(o){this._icon&&bt(this._icon,o),this._shadow&&bt(this._shadow,o),this._zIndex=o.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(o){this._icon&&(this._icon.style.zIndex=this._zIndex+o)},_animateZoom:function(o){var u=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center).round();this._setPos(u)},_initInteraction:function(){if(this.options.interactive&&(Ne(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),p_)){var o=this.options.draggable;this.dragging&&(o=this.dragging.enabled(),this.dragging.disable()),this.dragging=new p_(this),o&&this.dragging.enable()}},setOpacity:function(o){return this.options.opacity=o,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var o=this.options.opacity;this._icon&&Dn(this._icon,o),this._shadow&&Dn(this._shadow,o)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var o=this._map;if(o){var u=this.options.icon.options,h=u.iconSize?V(u.iconSize):V(0,0),y=u.iconAnchor?V(u.iconAnchor):V(0,0);o.panInside(this._latlng,{paddingTopLeft:y,paddingBottomRight:h.subtract(y)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function NN(o,u){return new fc(o,u)}var Ei=Yn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(o){this._renderer=o.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(o){return b(this,o),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&o&&Object.prototype.hasOwnProperty.call(o,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),hc=Ei.extend({options:{fill:!0,radius:10},initialize:function(o,u){b(this,u),this._latlng=pe(o),this._radius=this.options.radius},setLatLng:function(o){var u=this._latlng;return this._latlng=pe(o),this.redraw(),this.fire("move",{oldLatLng:u,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(o){return this.options.radius=this._radius=o,this.redraw()},getRadius:function(){return this._radius},setStyle:function(o){var u=o&&o.radius||this._radius;return Ei.prototype.setStyle.call(this,o),this.setRadius(u),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var o=this._radius,u=this._radiusY||o,h=this._clickTolerance(),y=[o+h,u+h];this._pxBounds=new re(this._point.subtract(y),this._point.add(y))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(o){return o.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function RN(o,u){return new hc(o,u)}var lp=hc.extend({initialize:function(o,u,h){if(typeof u=="number"&&(u=i({},h,{radius:u})),b(this,u),this._latlng=pe(o),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(o){return this._mRadius=o,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var o=[this._radius,this._radiusY||this._radius];return new oe(this._map.layerPointToLatLng(this._point.subtract(o)),this._map.layerPointToLatLng(this._point.add(o)))},setStyle:Ei.prototype.setStyle,_project:function(){var o=this._latlng.lng,u=this._latlng.lat,h=this._map,y=h.options.crs;
267if(y.distance===Ce.distance){var C=Math.PI/180,N=this._mRadius/Ce.R/C,A=h.project([u+N,o]),F=h.project([u-N,o]),B=A.add(F).divideBy(2),Z=h.unproject(B).lat,le=Math.acos((Math.cos(N*C)-Math.sin(u*C)*Math.sin(Z*C))/(Math.cos(u*C)*Math.cos(Z*C)))/C;(isNaN(le)||le===0)&&(le=N/Math.cos(Math.PI/180*u)),this._point=B.subtract(h.getPixelOrigin()),this._radius=isNaN(le)?0:B.x-h.project([Z,o-le]).x,this._radiusY=B.y-A.y}else{var ye=y.unproject(y.project(this._latlng).subtract([this._mRadius,0]));this._point=h.latLngToLayerPoint(this._latlng),this._radius=this._point.x-h.latLngToLayerPoint(ye).x}this._updateBounds()}});function IN(o,u,h){return new lp(o,u,h)}var Yr=Ei.extend({options:{smoothFactor:1,noClip:!1},initialize:function(o,u){b(this,u),this._setLatLngs(o)},getLatLngs:function(){return this._latlngs},setLatLngs:function(o){return this._setLatLngs(o),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(o){for(var u=1/0,h=null,y=ul,C,N,A=0,F=this._parts.length;A<F;A++)for(var B=this._parts[A],Z=1,le=B.length;Z<le;Z++){C=B[Z-1],N=B[Z];var ye=y(o,C,N,!0);ye<u&&(u=ye,h=y(o,C,N))}return h&&(h.distance=Math.sqrt(u)),h}
267,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return f_(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(o,u){return u=u||this._defaultShape(),o=pe(o),u.push(o),this._bounds.extend(o),this.redraw()},_setLatLngs:function(o){this._bounds=new oe,this._latlngs=this._convertLatLngs(o)},_defaultShape:function(){return Fn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(o){for(var u=[],h=Fn(o),y=0,C=o.length;y<C;y++)h?(u[y]=pe(o[y]),this._bounds.extend(u[y])):u[y]=this._convertLatLngs(o[y]);return u},_project:function(){var o=new re;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,o),this._bounds.isValid()&&o.isValid()&&(this._rawPxBounds=o,this._updateBounds())},_updateBounds:function(){var o=this._clickTolerance(),u=new j(o,o);this._rawPxBounds&&(this._pxBounds=new re([this._rawPxBounds.min.subtract(u),this._rawPxBounds.max.add(u)]))},_projectLatlngs:function(o,u,h){var y=o[0]instanceof fe,C=o.length,N,A;if(y){for(A=[],N=0;N<C;N++)A[N]=this._map.latLngToLayerPoint(o[N]),h.extend(A[N]);u.push(A)}else for(N=0;N<C;N++)this._projectLatlngs(o[N],u,h)},_clipPoints:function(){var o=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(o))){if(this.options.noClip){this._parts=this._rings;return}var u=this._parts,h,y,C,N,A,F,B;for(h=0,C=0,N=this._rings.length;h<N;h++)for(B=this._rings[h],y=0,A=B.length;y<A-1;y++)F=c_(B[y],B[y+1],o,y,!0),F&&(u[C]=u[C]||[],u[C].push(F[0]),(F[1]!==B[y+1]||y===A-2)&&(u[C].push(F[1]),C++))}},_simplifyPoints:function(){for(var o=this._parts,u=this.options.smoothFactor,h=0,y=o.length;h<y;h++)o[h]=a_(o[h],u)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(o,u){var h,y,C,N,A,F,B=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(o))return!1;for(h=0,N=this._parts.length;h<N;h++)for(F=this._parts[h],y=0,A=F.length,C=A-1;y<A;C=y++)if(!(!u&&y===0)&&l_(o,F[C],F[y])<=B)return!0;return!1}});function AN(o,u){return new Yr(o,u)}Yr._flat=d_;var bo=Yr.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length}
267,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return o_(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(o){var u=Yr.prototype._convertLatLngs.call(this,o),h=u.length;return h>=2&&u[0]instanceof fe&&u[0].equals(u[h-1])&&u.pop(),u},_setLatLngs:function(o){Yr.prototype._setLatLngs.call(this,o),Fn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Fn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var o=this._renderer._bounds,u=this.options.weight,h=new j(u,u);if(o=new re(o.min.subtract(h),o.max.add(h)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(o))){if(this.options.noClip){this._parts=this._rings;return}for(var y=0,C=this._rings.length,N;y<C;y++)N=s_(this._rings[y],o,!0),N.length&&this._parts.push(N)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(o){var u=!1,h,y,C,N,A,F,B,Z;if(!this._pxBounds||!this._pxBounds.contains(o))return!1;for(N=0,B=this._parts.length;N<B;N++)for(h=this._parts[N],A=0,Z=h.length,F=Z-1;A<Z;F=A++)y=h[A],C=h[F],y.y>o.y!=C.y>o.y&&o.x<(C.x-y.x)*(o.y-y.y)/(C.y-y.y)+y.x&&(u=!u);return u||Yr.prototype._containsPoint.call(this,o,!0)}});function MN(o,u){return new bo(o,u)}var Jr=Kr.extend({initialize:function(o,u){b(this,u),this._layers={},o&&this.addData(o)},addData:function(o){var u=S(o)?o:o.features,h,y,C;if(u){for(h=0,y=u.length;h<y;h++)C=u[h],(C.geometries||C.geometry||C.features||C.coordinates)&&this.addData(C);return this}var N=this.options;if(N.filter&&!N.filter(o))return this;var A=pc(o,N);return A?(A.feature=vc(o),A.defaultOptions=A.options,this.resetStyle(A),N.onEachFeature&&N.onEachFeature(o,A),this.addLayer(A)):this},resetStyle:function(o){return o===void 0?this.eachLayer(this.resetStyle,this):(o.options=i({},o.defaultOptions),this._setLayerStyle(o,this.options.style),this)},setStyle:function(o){return this.eachLayer(function(u){this._setLayerStyle(u,o)},this)},_setLayerStyle:function(o,u){o.setStyle&&(typeof u=="function"&&(u=u(o.feature)),o.setStyle(u))}});function pc(o,u){var h=o.type==="Feature"?o.geometry:o,y=h?h.coordinates:null,C=[],N=u&&u.pointToLayer,A=u&&u.coordsToLatLng||up,F,B,Z,le;if(!y&&!h)return null;switch(h.type){case"Point":return F=A(y),m_(N,o,F,u);case"MultiPoint":for(Z=0,le=y.length;Z<le;Z++)F=A(y[Z]),C.push(m_(N,o,F,u));return new Kr(C);case"LineString":case"MultiLineString":return B=mc(y,h.type==="LineString"?0:1,A),new Yr(B,u);case"Polygon":case"MultiPolygon":return B=mc(y,h.type==="Polygon"?1:2,A),new bo(B,u);case"GeometryCollection":for(Z=0,le=h.geometries.length;Z<le;Z++){var ye=pc({geometry:h.geometries[Z],type:"Feature",properties:o.properties},u);ye&&C.push(ye)}return new Kr(C);case"FeatureCollection":for(Z=0,le=h.features.length;Z<le;Z++){var Me=pc(h.features[Z],u);Me&&C.push(Me)}return new Kr(C);default:throw new Error("Invalid GeoJSON object.")}}function m_(o,u,h,y){return o?o(u,h):new fc(h,y&&y.markersInheritOptions&&y)}function up(o){return new fe(o[1],o[0],o[2])}function mc(o,u,h){for(var y=[],C=0,N=o.length,A;C<N;C++)A=u?mc(o[C],u-1,h):(h||up)(o[C]),y.push(A);return y}function cp(o,u){return o=pe(o),o.alt!==void 0?[_(o.lng,u),_(o.lat,u),_(o.alt,u)]:[_(o.lng,u),_(o.lat,u)]}function gc(o,u,h,y){for(var C=[],N=0,A=o.length;N<A;N++)C.push(u?gc(o[N],Fn(o[N])?0:u-1,h,y):cp(o[N],y));return!u&&h&&C.length>0&&C.push(C[0].slice()),C}function Co(o,u){return o.feature?i({},o.feature,{geometry:u}):vc(u)}function vc(o){return o.type==="Feature"||o.type==="FeatureCollection"?o:{type:"Feature",properties:{},geometry:o}}var dp={toGeoJSON:function(o){return Co(this,{type:"Point",coordinates:cp(this.getLatLng(),o)})}};fc.include(dp),lp.include(dp),hc.include(dp),Yr.include({toGeoJSON:function(o){var u=!Fn(this._latlngs),h=gc(this._latlngs,u?1:0,!1,o);return Co(this,{type:(u?"Multi":"")+"LineString",coordinates:h})}}),bo.include({toGeoJSON:function(o){var u=!Fn(this._latlngs),h=u&&!Fn(this._latlngs[0]),y=gc(this._latlngs,h?2:u?1:0,!0,o);return u||(y=[y]),Co(this,{type:(h?"Multi":"")+"Polygon",coordinates:y})}}),xo.include({toMultiPoint:function(o){var u=[];return this.eachLayer(function(h){u.push(h.toGeoJSON(o).geometry.coordinates)}),Co(this,{type:"MultiPoint",coordinates:u})},toGeoJSON:function(o){var u=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(u==="MultiPoint")return this.toMultiPoint(o);var h=u==="GeometryCollection",y=[];return this.eachLayer(function(C){if(C.toGeoJSON){var N=C.toGeoJSON(o);if(h)y.push(N.geometry);else{var A=vc(N);A.type==="FeatureCollection"?y.push.apply(y,A.features):y.push(A)}}}),h?Co(this,{geometries:y,type:"GeometryCollection"}):{type:"FeatureCollection",features:y}}});function g_(o,u){return new Jr(o,u)}var LN=g_,yc=Yn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(o,u,h){this._url=o,this._bounds=ae(u),b(this,h)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Ne(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){dt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(o){return this.options.opacity=o,this._image&&this._updateOpacity(),this},setStyle:function(o){return o.opacity&&this.setOpacity(o.opacity),this},bringToFront:function(){return this._map&&yo(this._image),this},bringToBack:function(){return this._map&&_o(this._image),this},setUrl:function(o){return this._url=o,this._image&&(this._image.src=o),this},setBounds:function(o){return this._bounds=ae(o),this._map&&this._reset(),this},getEvents:function(){var o={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},setZIndex:function(o){return this.options.zIndex=o,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var o=this._url.tagName==="IMG",u=this._image=o?this._url:Ue("img");if(Ne(u,"leaflet-image-layer"),this._zoomAnimated&&Ne(u,"leaflet-zoom-animated"),this.options.className&&Ne(u,this.options.className),u.onselectstart=m,u.onmousemove=m,u.onload=a(this.fire,this,"load"),u.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(u.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),o){this._url=u.src;return}u.src=this._url,u.alt=this.options.alt},_animateZoom:function(o){var u=this._map.getZoomScale(o.zoom),h=this._map._latLngBoundsToNewLayerBounds(this._bounds,o.zoom,o.center).min;Ns(this._image,h,u)},_reset:function(){var o=this._image,u=new re(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),h=u.getSize();bt(o,u.min),o.style.width=h.x+"px",o.style.height=h.y+"px"},_updateOpacity:function(){Dn(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var o=this.options.errorOverlayUrl;o&&this._url!==o&&(this._url=o,this._image.src=o)},getCenter:function(){return this._bounds.getCenter()}}),ON=function(o,u,h){return new yc(o,u,h)},v_=yc.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInl
vendor: 5,696 bytes, line 267
267ine:!0},_initImage:function(){var o=this._url.tagName==="VIDEO",u=this._image=o?this._url:Ue("video");if(Ne(u,"leaflet-image-layer"),this._zoomAnimated&&Ne(u,"leaflet-zoom-animated"),this.options.className&&Ne(u,this.options.className),u.onselectstart=m,u.onmousemove=m,u.onloadeddata=a(this.fire,this,"load"),o){for(var h=u.getElementsByTagName("source"),y=[],C=0;C<h.length;C++)y.push(h[C].src);this._url=h.length>0?y:[u.src];return}S(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(u.style,"objectFit")&&(u.style.objectFit="fill"),u.autoplay=!!this.options.autoplay,u.loop=!!this.options.loop,u.muted=!!this.options.muted,u.playsInline=!!this.options.playsInline;for(var N=0;N<this._url.length;N++){var A=Ue("source");A.src=this._url[N],u.appendChild(A)}}});function jN(o,u,h){return new v_(o,u,h)}var y_=yc.extend({_initImage:function(){var o=this._image=this._url;Ne(o,"leaflet-image-layer"),this._zoomAnimated&&Ne(o,"leaflet-zoom-animated"),this.options.className&&Ne(o,this.options.className),o.onselectstart=m,o.onmousemove=m}});function DN(o,u,h){return new y_(o,u,h)}var Tr=Yn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(o,u){o&&(o instanceof fe||S(o))?(this._latlng=pe(o),b(this,u)):(b(this,o),this._source=u),this.options.content&&(this._content=this.options.content)},openOn:function(o){return o=arguments.length?o:this._source._map,o.hasLayer(this)||o.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(o){return this._map?this.close():(arguments.length?this._source=o:o=this._source,this._prepareOpen(),this.openOn(o._map)),this},onAdd:function(o){this._zoomAnimated=o._zoomAnimated,this._container||this._initLayout(),o._fadeAnimated&&Dn(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),o._fadeAnimated&&Dn(this._container,1),this.bringToFront(),this.options.interactive&&(Ne(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(o){o._fadeAnimated?(Dn(this._container,0),this._removeTimeout=setTimeout(a(dt,void 0,this._container),200)):dt(this._container),this.options.interactive&&(xt(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(o){return this._latlng=pe(o),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(o){return this._content=o,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var o={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&yo(this._container),this},bringToBack:function(){return this._map&&_o(this._container),this},_prepareOpen:function(o){var u=this._source;if(!u._map)return!1;if(u instanceof Kr){u=null;var h=this._source._layers;for(var y in h)if(h[y]._map){u=h[y];break}if(!u)return!1;this._source=u}if(!o)if(u.getCenter)o=u.getCenter();else if(u.getLatLng)o=u.getLatLng();else if(u.getBounds)o=u.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(o),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var o=this._contentNode,u=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof u=="string")o.innerHTML=u;else{for(;o.hasChildNodes();)o.removeChild(o.firstChild);o.appendChild(u)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var o=this._map.latLngToLayerPoint(this._latlng),u=V(this.options.offset),h=this._getAnchor();this._zoomAnimated?bt(this._container,o.add(h)):u=u.add(o).add(h);var y=this._containerBottom=-u.y,C=this._containerLeft=-Math.round(this._containerWidth/2)+u.x;this._container.style.bottom=y+"px",this._container.style.left=C+"px"}},_getAnchor:function(){return[0,0]}});De.include({_initOverlay:function(o,u,h,y){var C=u;return C instanceof o||(C=new o(y).setContent(u)),h&&C.setLatLng(h),C}}),Yn.include({_initOverlay:function(o,u,h,y){var C=h;return C instanceof o?(b(C,y),C._source=this):(C=u&&!y?u:new o(y,this),C.setContent(h)),C}});var _c=Tr.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(o){return o=arguments.length?o:this._source._map,!o.hasLayer(this)&&o._popup&&o._popup.options.autoClose&&o.removeLayer(o._popup),o._popup=this,Tr.prototype.openOn.call(this,o)},onAdd:function(o){Tr.prototype.onAdd.call(this,o),o.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Ei||this._source.on("preclick",Is))},onRemove:function(o){Tr.prototype.onRemove.call(this,o),o.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Ei||this._source.off("preclick",Is))},getEvents:function(){var o=Tr.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(o.preclick=this.close),this.options.keepInView&&
267(o.moveend=this._adjustPan),o},_initLayout:function(){var o="leaflet-popup",u=this._container=Ue("div",o+" "+(this.options.className||"")+" leaflet-zoom-animated"),h=this._wrapper=Ue("div",o+"-content-wrapper",u);if(this._contentNode=Ue("div",o+"-content",h),al(u),ep(this._contentNode),Se(u,"contextmenu",Is),this._tipContainer=Ue("div",o+"-tip-container",u),this._tip=Ue("div",o+"-tip",this._tipContainer),this.options.closeButton){var y=this._closeButton=Ue("a",o+"-close-button",u);y.setAttribute("role","button"),y.setAttribute("aria-label","Close popup"),y.href="#close",y.innerHTML='<span aria-hidden="true">×</span>',Se(y,"click",function(C){Ot(C),this.close()},this)}},_updateLayout:function(){var o=this._contentNode,u=o.style;u.width="",u.whiteSpace="nowrap";var h=o.offsetWidth;h=Math.min(h,this.options.maxWidth),h=Math.max(h,this.options.minWidth),u.width=h+1+"px",u.whiteSpace="",u.height="";var y=o.offsetHeight,C=this.options.maxHeight,N="leaflet-popup-scrolled";C&&y>C?(u.height=C+"px",Ne(o,N)):xt(o,N),this._containerWidth=this._container.offsetWidth},_animateZoom:function(o){var u=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center),h=this._getAnchor();bt(this._container,u.add(h))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var o=this._map,u=parseInt(rl(this._container,"marginBottom"),10)||0,h=this._container.offsetHeight+u,y=this._containerWidth,C=new j(this._containerLeft,-h-this._containerBottom);C._add(Rs(this._container));var N=o.layerPointToContainerPoint(C),A=V(this.options.autoPanPadding),F=V(this.options.autoPanPaddingTopLeft||A),B=V(this.options.autoPanPaddingBottomRight||A),Z=o.getSize(),le=0,ye=0;N.x+y+B.x>Z.x&&(le=N.x+y-Z.x+B.x),N.x-le-F.x<0&&(le=N.x-F.x),N.y+h+B.y>Z.y&&(ye=N.y+h-Z.y+B.y),N.y-ye-F.y<0&&(ye=N.y-F.y),(le||ye)&&(this.options.keepInView&&(this._autopanning=!0),o.fire("autopanstart").panBy([le,ye]))}},_getAnchor:function(){return V(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),FN=function(o,u){return new _c(o,u)};De.mergeOptions({closePopupOnClick:!0}),De.include({openPopup:function(o,u,h){return this._initOverlay(_c,o,u,h).openOn(this),this},closePopup:function(o){return o=arguments.length?o:this._popup,o&&o.close(),this}}),Yn.include({bindPopup:function(o,u){return this._popup=this._initOverlay(_c,this._popup,o,u),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(o){return this._popup&&(this instanceof Kr||(this._popup._source=this),this._popup._prepareOpen(o||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(o){return this._popup&&this._popup.setContent(o),this},getPopup:function(){return this._popup},_openPopup:function(o){if(!(!this._popup||!this._map)){As(o);var u=o.layer||o.target;if(this._popup._source===u&&!(u instanceof Ei)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(o.latlng);return}this._popup._source=u,this.openPopup(o.latlng)}},_movePopup:function(o){this._popup.setLatLng(o.latlng)},_onKeyPress:function(o){o.originalEvent.keyCode===13&&this._openPopup(o)}});var xc=Tr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(o){Tr.prototype.onAdd.call(this,o),this.setOpacity(this.options.opacity),o.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(o){Tr.prototype.onRemove.call(this,o),o.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var o=Tr.prototype.getEvents.call(this);return this.options.permanent||(o.preclick=this.close),o},_initLayout:function(){var o="leaflet-tooltip",u=o+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Ue("div",u),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(o){var u,h,y=this._map,C=this._container,N=y.latLngToContainerPoint(y.getCenter()),A=y.layerPointToContainerPoint(o),F=this.options.direction,B=C.offsetWidth,Z=C.offsetHeight,le=V(this.options.offset),ye=this._getAnchor();F==="top"?(u=B/2,h=Z):F==="bottom"?(u=B/2,h=0):F==="center"?(u=B/2,h=Z/2):F==="right"?(u=0,h=Z/2):F==="left"?
vendor: 7,257 bytes, line 267
267(u=B,h=Z/2):A.x<N.x?(F="right",u=0,h=Z/2):(F="left",u=B+(le.x+ye.x)*2,h=Z/2),o=o.subtract(V(u,h,!0)).add(le).add(ye),xt(C,"leaflet-tooltip-right"),xt(C,"leaflet-tooltip-left"),xt(C,"leaflet-tooltip-top"),xt(C,"leaflet-tooltip-bottom"),Ne(C,"leaflet-tooltip-"+F),bt(C,o)},_updatePosition:function(){var o=this._map.latLngToLayerPoint(this._latlng);this._setPosition(o)},setOpacity:function(o){this.options.opacity=o,this._container&&Dn(this._container,o)},_animateZoom:function(o){var u=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center);this._setPosition(u)},_getAnchor:function(){return V(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),$N=function(o,u){return new xc(o,u)};De.include({openTooltip:function(o,u,h){return this._initOverlay(xc,o,u,h).openOn(this),this},closeTooltip:function(o){return o.close(),this}}),Yn.include({bindTooltip:function(o,u){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(xc,this._tooltip,o,u),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(o){if(!(!o&&this._tooltipHandlersAdded)){var u=o?"off":"on",h={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?h.add=this._openTooltip:(h.mouseover=this._openTooltip,h.mouseout=this.closeTooltip,h.click=this._openTooltip,this._map?this._addFocusListeners():h.add=this._addFocusListeners),this._tooltip.options.sticky&&(h.mousemove=this._moveTooltip),this[u](h),this._tooltipHandlersAdded=!o}},openTooltip:function(o){return this._tooltip&&(this instanceof Kr||(this._tooltip._source=this),this._tooltip._prepareOpen(o)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(o){return this._tooltip&&this._tooltip.setContent(o),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(o){var u=typeof o.getElement=="function"&&o.getElement();u&&(Se(u,"focus",function(){this._tooltip._source=o,this.openTooltip()},this),Se(u,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(o){var u=typeof o.getElement=="function"&&o.getElement();u&&u.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(o){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var u=this;this._map.once("moveend",function(){u._openOnceFlag=!1,u._openTooltip(o)});return}this._tooltip._source=o.layer||o.target,this.openTooltip(this._tooltip.options.sticky?o.latlng:void 0)}},_moveTooltip:function(o){var u=o.latlng,h,y;this._tooltip.options.sticky&&o.originalEvent&&(h=this._map.mouseEventToContainerPoint(o.originalEvent),y=this._map.containerPointToLayerPoint(h),u=this._map.layerPointToLatLng(y)),this._tooltip.setLatLng(u)}});var __=wo.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(o){var u=o&&o.tagName==="DIV"?o:document.createElement("div"),h=this.options;if(h.html instanceof Element?(oc(u),u.appendChild(h.html)):u.innerHTML=h.html!==!1?h.html:"",h.bgPos){var y=V(h.bgPos);u.style.backgroundPosition=-y.x+"px "+-y.y+"px"}return this._setIconStyles(u,"icon"),u},createShadow:function(){return null}});function zN(o){return new __(o)}wo.Default=cl;var dl=Yn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:ge.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(o){b(this,o)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(o){o._addZoomLimit(this)},onRemove:function(o){this._removeAllTiles(),dt(this._container),o._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(yo(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(_o(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(o){return this.options.opacity=o,this._updateOpacity(),this},setZIndex:function(o){return this.options.zIndex=o,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var o=this._clampZoom(this._map.getZoom());o!==this._tileZoom&&(this._tileZoom=o,this._updateLevels()),this._update()}return this},getEvents:function(){var o={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=f(this._onMoveEnd,this.options.updateInterval,this)),o.move=this._onMove),this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},createTile:function(){return document.createElement("div")},getTileSize:function(){var o=this.options.tileSize;return o instanceof j?o:new j(o,o)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(o){for(var u=this.getPane().children,h=-o(-1/0,1/0),y=0,C=u.length,N;y<C;y++)N=u[y].style.zIndex,u[y]!==this._container&&N&&(h=o(h,+N));isFinite(h)&&(this.options.zIndex=h+o(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!ge.ielt9){Dn(this._container,this.options.opacity);var o=+new Date,u=!1,h=!1;for(var y in this._tiles){var C=this._tiles[y];if(!(!C.current||!C.loaded)){var N=Math.min(1,(o-C.loaded)/200);Dn(C.el,N),N<1?u=!0:(C.active?h=!0:this._onOpaqueTile(C),C.active=!0)}}h&&!this._noPrune&&this._pruneTiles(),u&&(W(this._fadeFrame),this._fadeFrame=ne(this._updateOpacity,this))}},_onOpaqueTile:m,_initContainer:function(){this._container||(this._container=Ue("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var o=this._tileZoom,u=this.options.maxZoom;if(o!==void 0){for(var h in this._levels)h=Number(h),this._levels[h].el.children.length||h===o?(this._levels[h].el.style.zIndex=u-Math.abs(o-h),this._onUpdateLevel(h)):(dt(this._levels[h].el),this._removeTilesAtZoom(h),this._onRemoveLevel(h),delete this._levels[h]);var y=this._levels[o],C=this._map;return y||(y=this._levels[o]={},y.el=Ue("div","leaflet-tile-container leaflet-zoom-animated",this._container),y.el.style.zIndex=u,y.origin=C.project(C.unproject(C.getPixelOrigin()),o).roun
vendor: 4,161 bytes, line 267
267d(),y.zoom=o,this._setZoomTransform(y,C.getCenter(),C.getZoom()),m(y.el.offsetWidth),this._onCreateLevel(y)),this._level=y,y}},_onUpdateLevel:m,_onRemoveLevel:m,_onCreateLevel:m,_pruneTiles:function(){if(this._map){var o,u,h=this._map.getZoom();if(h>this.options.maxZoom||h<this.options.minZoom){this._removeAllTiles();return}for(o in this._tiles)u=this._tiles[o],u.retain=u.current;for(o in this._tiles)if(u=this._tiles[o],u.current&&!u.active){var y=u.coords;this._retainParent(y.x,y.y,y.z,y.z-5)||this._retainChildren(y.x,y.y,y.z,y.z+2)}for(o in this._tiles)this._tiles[o].retain||this._removeTile(o)}},_removeTilesAtZoom:function(o){for(var u in this._tiles)this._tiles[u].coords.z===o&&this._removeTile(u)},_removeAllTiles:function(){for(var o in this._tiles)this._removeTile(o)},_invalidateAll:function(){for(var o in this._levels)dt(this._levels[o].el),this._onRemoveLevel(Number(o)),delete this._levels[o];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(o,u,h,y){var C=Math.floor(o/2),N=Math.floor(u/2),A=h-1,F=new j(+C,+N);F.z=+A;var B=this._tileCoordsToKey(F),Z=this._tiles[B];return Z&&Z.active?(Z.retain=!0,!0):(Z&&Z.loaded&&(Z.retain=!0),A>y?this._retainParent(C,N,A,y):!1)},_retainChildren:function(o,u,h,y){for(var C=2*o;C<2*o+2;C++)for(var N=2*u;N<2*u+2;N++){var A=new j(C,N);A.z=h+1;var F=this._tileCoordsToKey(A),B=this._tiles[F];if(B&&B.active){B.retain=!0;continue}else B&&B.loaded&&(B.retain=!0);h+1<y&&this._retainChildren(C,N,h+1,y)}},_resetView:function(o){var u=o&&(o.pinch||o.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),u,u)},_animateZoom:function(o){this._setView(o.center,o.zoom,!0,o.noUpdate)},_clampZoom:function(o){var u=this.options;return u.minNativeZoom!==void 0&&o<u.minNativeZoom?u.minNativeZoom:u.maxNativeZoom!==void 0&&u.maxNativeZoom<o?u.maxNativeZoom:o},_setView:function(o,u,h,y){var C=Math.round(u);this.options.maxZoom!==void 0&&C>this.options.maxZoom||this.options.minZoom!==void 0&&C<this.options.minZoom?C=void 0:C=this._clampZoom(C);var N=this.options.updateWhenZooming&&C!==this._tileZoom;(!y||N)&&(this._tileZoom=C,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),C!==void 0&&this._update(o),h||this._pruneTiles(),this._noPrune=!!h),this._setZoomTransforms(o,u)},_setZoomTransforms:function(o,u){for(var h in this._levels)this._setZoomTransform(this._levels[h],o,u)},_setZoomTransform:function(o,u,h){var y=this._map.getZoomScale(h,o.zoom),C=o.origin.multiplyBy(y).subtract(this._map._getNewPixelOrigin(u,h)).round();ge.any3d?Ns(o.el,C,y):bt(o.el,C)},_resetGrid:function(){var o=this._map,u=o.options.crs,h=this._tileSize=this.getTileSize(),y=this._tileZoom,C=this._map.getPixelWorldBounds(this._tileZoom);C&&(this._globalTileRange=this._pxBoundsToTileRange(C)),this._wrapX=u.wrapLng&&!this.options.noWrap&&[Math.floor(o.project([0,u.wrapLng[0]],y).x/h.x),Math.ceil(o.project([0,u.wrapLng[1]],y).x/h.y)],this._wrapY=u.wrapLat&&!this.options.noWrap&&[Math.floor(o.project([u.wrapLat[0],0],y).y/h.x),Math.ceil(o.project([u.wrapLat[1],0],y).y/h.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(o){var u=this._map,h=u._animatingZoom?Math.max(u._animateToZoom,u.getZoom()):u.getZoom(),y=u.getZoomScale(h,this._tileZoom),C=u.project(o,this._tileZoom).floor(),N=u.getSize().divideBy(y*2);return new re(C.subtract(N),C.add(N))},_update:function(o){var u=this._map;if(u){var h=this._clampZoom(u.getZoom());if(o===void 0&&(o=u.getCenter()),this._tileZoom!==void 0){var y=this._getTiledPixelBounds(o),C=this._pxBoundsToTileRange(y),N=C.getCenter(),A=[],F=this.options.keepBuffer,B=new re(C.getBottomLeft().subtract([F,-F]),C.getTopRight().add([F,-F]));if(!(isFinite(C.min.x)&&isFinite(C.min.y)&&isFinite(C.max.x)&&isFinite(C.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Z in this._tiles){var le=this._tiles[Z].coords;(le.z!==this._tileZoom||!B.contains(new j(le.x,le.y)))&&(this._tiles[Z].current=!1)}if(Math.abs(h-this._tileZoom)>1){this._setView(o,h);return}for(var ye=C.min.y;ye<=C.max.y;ye++)for(var Me=C.min.x;Me<=C.max.x;Me++){var Qt=new j(Me,ye);
vendor: 7,950 bytes, line 267
267if(Qt.z=this._tileZoom,!!this._isValidTile(Qt)){var It=this._tiles[this._tileCoordsToKey(Qt)];It?It.current=!0:A.push(Qt)}}if(A.sort(function(fn,To){return fn.distanceTo(N)-To.distanceTo(N)}),A.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var $n=document.createDocumentFragment();for(Me=0;Me<A.length;Me++)this._addTile(A[Me],$n);this._level.el.appendChild($n)}}}},_isValidTile:function(o){var u=this._map.options.crs;if(!u.infinite){var h=this._globalTileRange;if(!u.wrapLng&&(o.x<h.min.x||o.x>h.max.x)||!u.wrapLat&&(o.y<h.min.y||o.y>h.max.y))return!1}if(!this.options.bounds)return!0;var y=this._tileCoordsToBounds(o);return ae(this.options.bounds).overlaps(y)},_keyToBounds:function(o){return this._tileCoordsToBounds(this._keyToTileCoords(o))},_tileCoordsToNwSe:function(o){var u=this._map,h=this.getTileSize(),y=o.scaleBy(h),C=y.add(h),N=u.unproject(y,o.z),A=u.unproject(C,o.z);return[N,A]},_tileCoordsToBounds:function(o){var u=this._tileCoordsToNwSe(o),h=new oe(u[0],u[1]);return this.options.noWrap||(h=this._map.wrapLatLngBounds(h)),h},_tileCoordsToKey:function(o){return o.x+":"+o.y+":"+o.z},_keyToTileCoords:function(o){var u=o.split(":"),h=new j(+u[0],+u[1]);return h.z=+u[2],h},_removeTile:function(o){var u=this._tiles[o];u&&(dt(u.el),delete this._tiles[o],this.fire("tileunload",{tile:u.el,coords:this._keyToTileCoords(o)}))},_initTile:function(o){Ne(o,"leaflet-tile");var u=this.getTileSize();o.style.width=u.x+"px",o.style.height=u.y+"px",o.onselectstart=m,o.onmousemove=m,ge.ielt9&&this.options.opacity<1&&Dn(o,this.options.opacity)},_addTile:function(o,u){var h=this._getTilePos(o),y=this._tileCoordsToKey(o),C=this.createTile(this._wrapCoords(o),a(this._tileReady,this,o));this._initTile(C),this.createTile.length<2&&ne(a(this._tileReady,this,o,null,C)),bt(C,h),this._tiles[y]={el:C,coords:o,current:!0},u.appendChild(C),this.fire("tileloadstart",{tile:C,coords:o})},_tileReady:function(o,u,h){u&&this.fire("tileerror",{error:u,tile:h,coords:o});var y=this._tileCoordsToKey(o);h=this._tiles[y],h&&(h.loaded=+new Date,this._map._fadeAnimated?(Dn(h.el,0),W(this._fadeFrame),this._fadeFrame=ne(this._updateOpacity,this)):(h.active=!0,this._pruneTiles()),u||(Ne(h.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:h.el,coords:o})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ge.ielt9||!this._map._fadeAnimated?ne(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(o){return o.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(o){var u=new j(this._wrapX?p(o.x,this._wrapX):o.x,this._wrapY?p(o.y,this._wrapY):o.y);return u.z=o.z,u},_pxBoundsToTileRange:function(o){var u=this.getTileSize();return new re(o.min.unscaleBy(u).floor(),o.max.unscaleBy(u).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var o in this._tiles)if(!this._tiles[o].loaded)return!1;return!0}});function BN(o){return new dl(o)}var So=dl.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(o,u){this._url=o,u=b(this,u),u.detectRetina&&ge.retina&&u.maxZoom>0?(u.tileSize=Math.floor(u.tileSize/2),u.zoomReverse?(u.zoomOffset--,u.minZoom=Math.min(u.maxZoom,u.minZoom+1)):(u.zoomOffset++,u.maxZoom=Math.max(u.minZoom,u.maxZoom-1)),u.minZoom=Math.max(0,u.minZoom)):u.zoomReverse?u.minZoom=Math.min(u.maxZoom,u.minZoom):u.maxZoom=Math.max(u.minZoom,u.maxZoom),typeof u.subdomains=="string"&&(u.subdomains=u.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(o,u){return this._url===o&&u===void 0&&(u=!0),this._url=o,u||this.redraw(),this},createTile:function(o,u){var h=document.createElement("img");return Se(h,"load",a(this._tileOnLoad,this,u,h)),Se(h,"error",a(this._tileOnError,this,u,h)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(h.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(h.referrerPolicy=this.options.referrerPolicy),h.alt="",h.src=this.getTileUrl(o),h},getTileUrl:function(o){var u={r:ge.retina?"@2x":"",s:this._getSubdomain(o),x:o.x,y:o.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var h=this._globalTileRange.max.y-o.y;this.options.tms&&(u.y=h),u["-y"]=h}return T(this._url,i(u,this.options))},_tileOnLoad:function(o,u){ge.ielt9?setTimeout(a(o,this,null,u),0):o(null,u)},_tileOnError:function(o,u,h){var y=this.options.errorTileUrl;y&&u.getAttribute("src")!==y&&(u.src=y),o(h,u)},_onTileRemove:function(o){o.tile.onload=null},_getZoomForUrl:function(){var o=this._tileZoom,u=this.options.maxZoom,h=this.options.zoomReverse,y=this.options.zoomOffset;return h&&(o=u-o),o+y},_getSubdomain:function(o){var u=Math.abs(o.x+o.y)%this.options.subdomains.length;return this.options.subdomains[u]},_abortLoading:function(){var o,u;for(o in this._tiles)if(this._tiles[o].coords.z!==this._tileZoom&&(u=this._tiles[o].el,u.onload=m,u.onerror=m,!u.complete)){u.src=I;var h=this._tiles[o].coords;dt(u),delete this._tiles[o],this.fire("tileabort",{tile:u,coords:h})}},_removeTile:function(o){var u=this._tiles[o];if(u)return u.el.setAttribute("src",I),dl.prototype._removeTile.call(this,o)},_tileReady:function(o,u,h){if(!(!this._map||h&&h.getAttribute("src")===I))return dl.prototype._tileReady.call(this,o,u,h)}});function x_(o,u){return new So(o,u)}var w_=So.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(o,u){this._url=o;var h=i({},this.defaultWmsParams);for(var y in u)y in this.options||(h[y]=u[y]);u=b(this,u);var C=u.detectRetina&&ge.retina?2:1,N=this.getTileSize();h.width=N.x*C,h.height=N.y*C,this.wmsParams=h},onAdd:function(o){this._crs=this.options.crs||o.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var u=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[u]=this._crs.code,So.prototype.onAdd.call(this,o)},getTileUrl:function(o){var u=this._tileCoordsToNwSe(o),h=this._crs,y=Q(h.project(u[0]),h.project(u[1])),C=y.min,N=y.max,A=(this._wmsVersion>=1.3&&this._crs===h_?[C.y,C.x,N.y,N.x]:[C.x,C.y,N.x,N.y]).join(","),F=So.prototype.getTileUrl.call(this,o);return F+k(this.wmsParams,F,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+A},setParams:function(o,u){return i(this.wmsParams,o),u||this.redraw(),this}});function UN(o,u){return new w_(o,u)}So.WMS=w_,x_.wms=UN;var Qr=Yn.extend({options:{padding:.1},initialize:function(o){b(this,o),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Ne(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var o={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(o.zoomanim=this._onAnimZoom),o},_onAnimZoom:function(o){this._updateTransform(o.center,o.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(o,u){var h=this._map.getZoomScale(u,this._zoom),y=this._map.getSize().multiplyBy(.5+this.options.padding),C=this._map.project(this._center,u),N=y.multiplyBy(-h).add(C).subtract(this._map._getNewPixelOrigin(o,u));ge.any3d?Ns(this._container,N,h):bt(this._container,N)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var o in this._layers)this._layers[o]._reset()},_onZoomEnd:function(){for(var o in this._layers)this._layers[o]._project()},_updatePaths:function(){for(var o in this._layers)this._layers[o]._update()},_update:function(){var o=this.options.padding,u=this._map.getSize(),h=this._map.containerPointToLayerPoint(u.multiplyBy(-o)).round();
vendor: 3,980 bytes, line 267
267this._bounds=new re(h,h.add(u.multiplyBy(1+o*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),b_=Qr.extend({options:{tolerance:0},getEvents:function(){var o=Qr.prototype.getEvents.call(this);return o.viewprereset=this._onViewPreReset,o},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Qr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var o=this._container=document.createElement("canvas");Se(o,"mousemove",this._onMouseMove,this),Se(o,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Se(o,"mouseout",this._handleMouseOut,this),o._leaflet_disable_events=!0,this._ctx=o.getContext("2d")},_destroyContainer:function(){W(this._redrawRequest),delete this._ctx,dt(this._container),tt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var o;this._redrawBounds=null;for(var u in this._layers)o=this._layers[u],o._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Qr.prototype._update.call(this);var o=this._bounds,u=this._container,h=o.getSize(),y=ge.retina?2:1;bt(u,o.min),u.width=y*h.x,u.height=y*h.y,u.style.width=h.x+"px",u.style.height=h.y+"px",ge.retina&&this._ctx.scale(2,2),this._ctx.translate(-o.min.x,-o.min.y),this.fire("update")}},_reset:function(){Qr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(o){this._updateDashArray(o),this._layers[c(o)]=o;var u=o._order={layer:o,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=u),this._drawLast=u,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(o){this._requestRedraw(o)},_removePath:function(o){var u=o._order,h=u.next,y=u.prev;h?h.prev=y:this._drawLast=y,y?y.next=h:this._drawFirst=h,delete o._order,delete this._layers[c(o)],this._requestRedraw(o)},_updatePath:function(o){this._extendRedrawBounds(o),o._project(),o._update(),this._requestRedraw(o)},_updateStyle:function(o){this._updateDashArray(o),this._requestRedraw(o)},_updateDashArray:function(o){if(typeof o.options.dashArray=="string"){var u=o.options.dashArray.split(/[, ]+/),h=[],y,C;for(C=0;C<u.length;C++){if(y=Number(u[C]),isNaN(y))return;h.push(y)}o.options._dashArray=h}else o.options._dashArray=o.options.dashArray},_requestRedraw:function(o){this._map&&(this._extendRedrawBounds(o),this._redrawRequest=this._redrawRequest||ne(this._redraw,this))},_extendRedrawBounds:function(o){if(o._pxBounds){var u=(o.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new re,this._redrawBounds.extend(o._pxBounds.min.subtract([u,u])),this._redrawBounds.extend(o._pxBounds.max.add([u,u]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var o=this._redrawBounds;if(o){var u=o.getSize();this._ctx.clearRect(o.min.x,o.min.y,u.x,u.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var o,u=this._redrawBounds;if(this._ctx.save(),u){var h=u.getSize();this._ctx.beginPath(),this._ctx.rect(u.min.x,u.min.y,h.x,h.y),this._ctx.clip()}this._drawing=!0;for(var y=this._drawFirst;y;y=y.next)o=y.layer,(!u||o._pxBounds&&o._pxBounds.intersects(u))&&o._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(o,u){if(this._drawing){var h,y,C,N,A=o._parts,F=A.length,B=this._ctx;if(F){for(B.beginPath(),h=0;h<F;h++){for(y=0,C=A[h].length;y<C;y++)N=A[h][y],B[y?"lineTo":"moveTo"](N.x,N.y);u&&B.closePath()}this._fillStroke(B,o)}}},_updateCircle:function(o){if(!(!this._drawing||o._empty())){var u=o._point,h=this._ctx,y=Math.max(Math.round(o._radius),1),C=(Math.max(Math.round(o._radiusY),1)||y)/y;C!==1&&(h.save(),h.scale(1,C)),h.beginPath(),h.arc(u.x,u.y/C,y,0,Math.PI*2,!1),C!==1&&h.restore(
vendor: 6,422 bytes, line 267
267),this._fillStroke(h,o)}},_fillStroke:function(o,u){var h=u.options;h.fill&&(o.globalAlpha=h.fillOpacity,o.fillStyle=h.fillColor||h.color,o.fill(h.fillRule||"evenodd")),h.stroke&&h.weight!==0&&(o.setLineDash&&o.setLineDash(u.options&&u.options._dashArray||[]),o.globalAlpha=h.opacity,o.lineWidth=h.weight,o.strokeStyle=h.color,o.lineCap=h.lineCap,o.lineJoin=h.lineJoin,o.stroke())},_onClick:function(o){for(var u=this._map.mouseEventToLayerPoint(o),h,y,C=this._drawFirst;C;C=C.next)h=C.layer,h.options.interactive&&h._containsPoint(u)&&(!(o.type==="click"||o.type==="preclick")||!this._map._draggableMoved(h))&&(y=h);this._fireEvent(y?[y]:!1,o)},_onMouseMove:function(o){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var u=this._map.mouseEventToLayerPoint(o);this._handleMouseHover(o,u)}},_handleMouseOut:function(o){var u=this._hoveredLayer;u&&(xt(this._container,"leaflet-interactive"),this._fireEvent([u],o,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(o,u){if(!this._mouseHoverThrottled){for(var h,y,C=this._drawFirst;C;C=C.next)h=C.layer,h.options.interactive&&h._containsPoint(u)&&(y=h);y!==this._hoveredLayer&&(this._handleMouseOut(o),y&&(Ne(this._container,"leaflet-interactive"),this._fireEvent([y],o,"mouseover"),this._hoveredLayer=y)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,o),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(o,u,h){this._map._fireDOMEvent(u,h||u.type,o)},_bringToFront:function(o){var u=o._order;if(u){var h=u.next,y=u.prev;if(h)h.prev=y;else return;y?y.next=h:h&&(this._drawFirst=h),u.prev=this._drawLast,this._drawLast.next=u,u.next=null,this._drawLast=u,this._requestRedraw(o)}},_bringToBack:function(o){var u=o._order;if(u){var h=u.next,y=u.prev;if(y)y.next=h;else return;h?h.prev=y:y&&(this._drawLast=y),u.prev=null,u.next=this._drawFirst,this._drawFirst.prev=u,this._drawFirst=u,this._requestRedraw(o)}}});function C_(o){return ge.canvas?new b_(o):null}var fl=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(o){return document.createElement("<lvml:"+o+' class="lvml">')}}catch{}return function(o){return document.createElement("<"+o+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),VN={_initContainer:function(){this._container=Ue("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Qr.prototype._update.call(this),this.fire("update"))},_initPath:function(o){var u=o._container=fl("shape");Ne(u,"leaflet-vml-shape "+(this.options.className||"")),u.coordsize="1 1",o._path=fl("path"),u.appendChild(o._path),this._updateStyle(o),this._layers[c(o)]=o},_addPath:function(o){var u=o._container;this._container.appendChild(u),o.options.interactive&&o.addInteractiveTarget(u)},_removePath:function(o){var u=o._container;dt(u),o.removeInteractiveTarget(u),delete this._layers[c(o)]},_updateStyle:function(o){var u=o._stroke,h=o._fill,y=o.options,C=o._container;C.stroked=!!y.stroke,C.filled=!!y.fill,y.stroke?(u||(u=o._stroke=fl("stroke")),C.appendChild(u),u.weight=y.weight+"px",u.color=y.color,u.opacity=y.opacity,y.dashArray?u.dashStyle=S(y.dashArray)?y.dashArray.join(" "):y.dashArray.replace(/( *, *)/g," "):u.dashStyle="",u.endcap=y.lineCap.replace("butt","flat"),u.joinstyle=y.lineJoin):u&&(C.removeChild(u),o._stroke=null),y.fill?(h||(h=o._fill=fl("fill")),C.appendChild(h),h.color=y.fillColor||y.color,h.opacity=y.fillOpacity):h&&(C.removeChild(h),o._fill=null)},_updateCircle:function(o){var u=o._point.round(),h=Math.round(o._radius),y=Math.round(o._radiusY||h);this._setPath(o,o._empty()?"M0 0":"AL "+u.x+","+u.y+" "+h+","+y+" 0,"+65535*360)},_setPath:function(o,u){o._path.v=u},_bringToFront:function(o){yo(o._container)},_bringToBack:function(o){_o(o._container)}},wc=ge.vml?fl:Yt,hl=Qr.extend({_initContainer:function(){this._container=wc("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=wc("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){dt(this._container),tt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Qr.prototype._update.call(this);var o=this._bounds,u=o.getSize(),h=this._container;(!this._svgSize||!this._svgSize.equals(u))&&(this._svgSize=u,h.setAttribute("width",u.x),h.setAttribute("height",u.y)),bt(h,o.min),h.setAttribute("viewBox",[o.min.x,o.min.y,u.x,u.y].join(" ")),this.fire("update")}},_initPath:function(o){var u=o._path=wc("path");o.options.className&&Ne(u,o.options.className),o.options.interactive&&Ne(u,"leaflet-interactive"),this._updateStyle(o),this._layers[c(o)]=o},_addPath:function(o){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(o._path),o.addInteractiveTarget(o._path)},_removePath:function(o){dt(o._path),o.removeInteractiveTarget(o._path),delete this._layers[c(o)]},_updatePath:function(o){o._project(),o._update()},_updateStyle:function(o){var u=o._path,h=o.options;u&&(h.stroke?(u.setAttribute("stroke",h.color),u.setAttribute("stroke-opacity",h.opacity),u.setAttribute("stroke-width",h.weight),u.setAttribute("stroke-linecap",h.lineCap),u.setAttribute("stroke-linejoin",h.lineJoin),h.dashArray?u.setAttribute("stroke-dasharray",h.dashArray):u.removeAttribute("stroke-dasharray"),h.dashOffset?u.setAttribute("stroke-dashoffset",h.dashOffset):u.removeAttribute("stroke-dashoffset")):u.setAttribute("stroke","none"),h.fill?(u.setAttribute("fill",h.fillColor||h.color),u.setAttribute("fill-opacity",h.fillOpacity),u.setAttribute("fill-rule",h.fillRule||"evenodd")):u.setAttribute("fill","none"))},_updatePoly:function(o,u){this._setPath(o,cn(o._parts,u))},_updateCircle:function(o){var u=o._point,h=Math.max(Math.round(o._radius),1),y=Math.max(Math.round(o._radiusY),1)||h,C="a"+h+","+y+" 0 1,0 ",N=o._empty()?"M0 0":"M"+(u.x-h)+","+u.y+C+h*2+",0 "+C+-h*2+",0 ";this._setPath(o,N)},_setPath:function(o,u){o._path.setAttribute("d",u)},_bringToFront:function(o){yo(o._path)},_bringToBack:function(o){_o(o._path)}});ge.vml&&hl.include(VN);function S_(o){return ge.svg||ge.vml?new hl(o):null}De.include({getRenderer:function(o){var u=o.options.renderer||this._getPaneRenderer(o.options.pane)||this.options.renderer||this._renderer;return u||(u=this._renderer=this._createRenderer()),this.hasLayer(u)||this.addLayer(u),u}
267,_getPaneRenderer:function(o){if(o==="overlayPane"||o===void 0)return!1;var u=this._paneRenderers[o];return u===void 0&&(u=this._createRenderer({pane:o}),this._paneRenderers[o]=u),u},_createRenderer:function(o){return this.options.preferCanvas&&C_(o)||S_(o)}});var T_=bo.extend({initialize:function(o,u){bo.prototype.initialize.call(this,this._boundsToLatLngs(o),u)},setBounds:function(o){return this.setLatLngs(this._boundsToLatLngs(o))},_boundsToLatLngs:function(o){return o=ae(o),[o.getSouthWest(),o.getNorthWest(),o.getNorthEast(),o.getSouthEast()]}});function HN(o,u){return new T_(o,u)}hl.create=wc,hl.pointsToPath=cn,Jr.geometryToLayer=pc,Jr.coordsToLatLng=up,Jr.coordsToLatLngs=mc,Jr.latLngToCoords=cp,Jr.latLngsToCoords=gc,Jr.getFeature=Co,Jr.asFeature=vc,De.mergeOptions({boxZoom:!0});var E_=Sr.extend({initialize:function(o){this._map=o,this._container=o._container,this._pane=o._panes.overlayPane,this._resetStateTimeout=0,o.on("unload",this._destroy,this)},addHooks:function(){Se(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){tt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){dt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(o){if(!o.shiftKey||o.which!==1&&o.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),il(),Zh(),this._startPoint=this._map.mouseEventToContainerPoint(o),Se(document,{contextmenu:As,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(o){this._moved||(this._moved=!0,this._box=Ue("div","leaflet-zoom-box",this._container),Ne(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(o);var u=new re(this._point,this._startPoint),h=u.getSize();bt(this._box,u.min),this._box.style.width=h.x+"px",this._box.style.height=h.y+"px"},_finish:function(){this._moved&&(dt(this._box),xt(this._container,"leaflet-crosshair")),sl(),qh(),tt(document,{contextmenu:As,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(o){if(!(o.which!==1&&o.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var u=new oe(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(u).fire("boxzoomend",{boxZoomBounds:u})}},_onKeyDown:function(o){o.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});De.addInitHook("addHandler","boxZoom",E_),De.mergeOptions({doubleClickZoom:!0});var P_=Sr.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(o){var u=this._map,h=u.getZoom(),y=u.options.zoomDelta,C=o.originalEvent.shiftKey?h-y:h+y;u.options.doubleClickZoom==="center"?u.setZoom(C):u.setZoomAround(o.containerPoint,C)}});De.addInitHook("addHandler","doubleClickZoom",P_),De.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var k_=Sr.extend({addHooks:function(){if(!this._draggable){var o=this._map;this._draggable=new Ti(o._mapPane,o._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),o.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),o.on("zoomend",this._onZoomEnd,this),o.whenReady(this._onZoomEnd,this))}Ne(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){xt(this._map._container,"leaflet-grab"),xt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved}
vendor: 4,214 bytes, line 267
267,moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var o=this._map;if(o._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var u=ae(this._map.options.maxBounds);this._offsetLimit=Q(this._map.latLngToContainerPoint(u.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(u.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;o.fire("movestart").fire("dragstart"),o.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(o){if(this._map.options.inertia){var u=this._lastTime=+new Date,h=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(h),this._times.push(u),this._prunePositions(u)}this._map.fire("move",o).fire("drag",o)},_prunePositions:function(o){for(;this._positions.length>1&&o-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var o=this._map.getSize().divideBy(2),u=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=u.subtract(o).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(o,u){return o-(o-u)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var o=this._draggable._newPos.subtract(this._draggable._startPos),u=this._offsetLimit;o.x<u.min.x&&(o.x=this._viscousLimit(o.x,u.min.x)),o.y<u.min.y&&(o.y=this._viscousLimit(o.y,u.min.y)),o.x>u.max.x&&(o.x=this._viscousLimit(o.x,u.max.x)),o.y>u.max.y&&(o.y=this._viscousLimit(o.y,u.max.y)),this._draggable._newPos=this._draggable._startPos.add(o)}},_onPreDragWrap:function(){var o=this._worldWidth,u=Math.round(o/2),h=this._initialWorldOffset,y=this._draggable._newPos.x,C=(y-u+h)%o+u-h,N=(y+u+h)%o-u-h,A=Math.abs(C+h)<Math.abs(N+h)?C:N;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=A},_onDragEnd:function(o){var u=this._map,h=u.options,y=!h.inertia||o.noInertia||this._times.length<2;if(u.fire("dragend",o),y)u.fire("moveend");else{this._prunePositions(+new Date);var C=this._lastPos.subtract(this._positions[0]),N=(this._lastTime-this._times[0])/1e3,A=h.easeLinearity,F=C.multiplyBy(A/N),B=F.distanceTo([0,0]),Z=Math.min(h.inertiaMaxSpeed,B),le=F.multiplyBy(Z/B),ye=Z/(h.inertiaDeceleration*A),Me=le.multiplyBy(-ye/2).round();!Me.x&&!Me.y?u.fire("moveend"):(Me=u._limitOffset(Me,u.options.maxBounds),ne(function(){u.panBy(Me,{duration:ye,easeLinearity:A,noMoveStart:!0,animate:!0})}))}}});De.addInitHook("addHandler","dragging",k_),De.mergeOptions({keyboard:!0,keyboardPanDelta:80});var N_=Sr.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(o){this._map=o,this._setPanDelta(o.options.keyboardPanDelta),this._setZoomDelta(o.options.zoomDelta)},addHooks:function(){var o=this._map._container;o.tabIndex<=0&&(o.tabIndex="0"),Se(o,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),tt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var o=document.body,u=document.documentElement,h=o.scrollTop||u.scrollTop,y=o.scrollLeft||u.scrollLeft;this._map._container.focus(),window.scrollTo(y,h)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(o){var u=this._panKeys={},h=this.keyCodes,y,C;for(y=0,C=h.left.length;y<C;y++)u[h.left[y]]=[-1*o,0];for(y=0,C=h.right.length;y<C;y++)u[h.right[y]]=[o,0];for(y=0,C=h.down.length;y<C;y++)u[h.down[y]]=[0,o];for(y=0,C=h.up.length;y<C;y++)u[h.up[y]]=[0,-1*o]},_setZoomDelta:function(o){var u=this._zoomKeys={},h=this.keyCodes,y,C;for(y=0,C=h.zoomIn.length;y<C;y++)u[h.zoomIn[y]]=o;for(y=0,C=h.zoomOut.length;y<C;y++)u[h.zoomOut[y]]=-o},_addHooks:function(){Se(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){tt(document,"keydown",this._onKeyDown,this)}
267,_onKeyDown:function(o){if(!(o.altKey||o.ctrlKey||o.metaKey)){var u=o.keyCode,h=this._map,y;if(u in this._panKeys){if(!h._panAnim||!h._panAnim._inProgress)if(y=this._panKeys[u],o.shiftKey&&(y=V(y).multiplyBy(3)),h.options.maxBounds&&(y=h._limitOffset(V(y),h.options.maxBounds)),h.options.worldCopyJump){var C=h.wrapLatLng(h.unproject(h.project(h.getCenter()).add(y)));h.panTo(C)}else h.panBy(y)}else if(u in this._zoomKeys)h.setZoom(h.getZoom()+(o.shiftKey?3:1)*this._zoomKeys[u]);else if(u===27&&h._popup&&h._popup.options.closeOnEscapeKey)h.closePopup();else return;As(o)}}});De.addInitHook("addHandler","keyboard",N_),De.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var R_=Sr.extend({addHooks:function(){Se(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){tt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(o){var u=e_(o),h=this._map.options.wheelDebounceTime;this._delta+=u,this._lastMousePos=this._map.mouseEventToContainerPoint(o),this._startTime||(this._startTime=+new Date);var y=Math.max(h-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),y),As(o)},_performZoom:function(){var o=this._map,u=o.getZoom(),h=this._map.options.zoomSnap||0;o._stop();var y=this._delta/(this._map.options.wheelPxPerZoomLevel*4),C=4*Math.log(2/(1+Math.exp(-Math.abs(y))))/Math.LN2,N=h?Math.ceil(C/h)*h:C,A=o._limitZoom(u+(this._delta>0?N:-N))-u;this._delta=0,this._startTime=null,A&&(o.options.scrollWheelZoom==="center"?o.setZoom(u+A):o.setZoomAround(this._lastMousePos,u+A))}});De.addInitHook("addHandler","scrollWheelZoom",R_);var WN=600;De.mergeOptions({tapHold:ge.touchNative&&ge.safari&&ge.mobile,tapTolerance:15});var I_=Sr.extend({addHooks:function(){Se(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){tt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(o){if(clearTimeout(this._holdTimeout),o.touches.length===1){var u=o.touches[0];this._startPos=this._newPos=new j(u.clientX,u.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(Se(document,"touchend",Ot),Se(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",u))},this),WN),Se(document,"touchend touchcancel contextmenu",this._cancel,this),Se(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function o(){tt(document,"touchend",Ot),tt(document,"touchend touchcancel",o)},_cancel:function(){clearTimeout(this._holdTimeout),tt(document,"touchend touchcancel contextmenu",this._cancel,this),tt(document,"touchmove",this._onMove,this)},_onMove:function(o){var u=o.touches[0];this._newPos=new j(u.clientX,u.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(o,u){var h=new MouseEvent(o,{bubbles:!0,cancelable:!0,view:window,screenX:u.screenX,screenY:u.screenY,clientX:u.clientX,clientY:u.clientY});h._simulated=!0,u.target.dispatchEvent(h)}});De.addInitHook("addHandler","tapHold",I_),De.mergeOptions({touchZoom:ge.touch,bounceAtZoomLimits:!0});var A_=Sr.extend({addHooks:function(){Ne(this._map._container,"leaflet-touch-zoom"),Se(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){xt(this._map._container,"leaflet-touch-zoom"),tt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(o){var u=this._map;if(!(!o.touches||o.touches.length!==2||u._animatingZoom||this._zooming)){var h=u.mouseEventToContainerPoint(o.touches[0]),y=u.mouseEventToContainerPoint(o.touches[1]);this._centerPoint=u.getSize()._divideBy(2),this._startLatLng=u.containerPointToLatLng(this._centerPoint),u.options.touchZoom!=="center"&&(this._pinchStartLatLng=u.containerPointToLatLng(h.add(y)._divideBy(2))),this._startDist=h.distanceTo(y),this._startZoom=u.getZoom(),this._moved=!1,this._zooming=!0,u._stop(),Se(document,"touchmove",this._onTouchMove,this),Se(document,"touchend touchcancel",this._onTouchEnd,this),Ot(o)}}
267,_onTouchMove:function(o){if(!(!o.touches||o.touches.length!==2||!this._zooming)){var u=this._map,h=u.mouseEventToContainerPoint(o.touches[0]),y=u.mouseEventToContainerPoint(o.touches[1]),C=h.distanceTo(y)/this._startDist;if(this._zoom=u.getScaleZoom(C,this._startZoom),!u.options.bounceAtZoomLimits&&(this._zoom<u.getMinZoom()&&C<1||this._zoom>u.getMaxZoom()&&C>1)&&(this._zoom=u._limitZoom(this._zoom)),u.options.touchZoom==="center"){if(this._center=this._startLatLng,C===1)return}else{var N=h._add(y)._divideBy(2)._subtract(this._centerPoint);if(C===1&&N.x===0&&N.y===0)return;this._center=u.unproject(u.project(this._pinchStartLatLng,this._zoom).subtract(N),this._zoom)}this._moved||(u._moveStart(!0,!1),this._moved=!0),W(this._animRequest);var A=a(u._move,u,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=ne(A,this,!0),Ot(o)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,W(this._animRequest),tt(document,"touchmove",this._onTouchMove,this),tt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});De.addInitHook("addHandler","touchZoom",A_),De.BoxZoom=E_,De.DoubleClickZoom=P_,De.Drag=k_,De.Keyboard=N_,De.ScrollWheelZoom=R_,De.TapHold=I_,De.TouchZoom=A_,n.Bounds=re,n.Browser=ge,n.CRS=ee,n.Canvas=b_,n.Circle=lp,n.CircleMarker=hc,n.Class=z,n.Control=Kn,n.DivIcon=__,n.DivOverlay=Tr,n.DomEvent=uN,n.DomUtil=aN,n.Draggable=Ti,n.Evented=ce,n.FeatureGroup=Kr,n.GeoJSON=Jr,n.GridLayer=dl,n.Handler=Sr,n.Icon=wo,n.ImageOverlay=yc,n.LatLng=fe,n.LatLngBounds=oe,n.Layer=Yn,n.LayerGroup=xo,n.LineUtil=bN,n.Map=De,n.Marker=fc,n.Mixin=gN,n.Path=Ei,n.Point=j,n.PolyUtil=vN,n.Polygon=bo,n.Polyline=Yr,n.Popup=_c,n.PosAnimation=t_,n.Projection=CN,n.Rectangle=T_,n.Renderer=Qr,n.SVG=hl,n.SVGOverlay=y_,n.TileLayer=So,n.Tooltip=xc,n.Transformation=Ae,n.Util=$,n.VideoOverlay=v_,n.bind=a,n.bounds=Q,n.canvas=C_,n.circle=IN,n.circleMarker=RN,n.control=ll,n.divIcon=zN,n.extend=i,n.featureGroup=PN,n.geoJSON=g_,n.geoJson=LN,n.gridLayer=BN,n.icon=kN,n.imageOverlay=ON,n.latLng=pe,n.latLngBounds=ae,n.layerGroup=EN,n.map=cN,n.marker=NN,n.point=V,n.polygon=MN,n.polyline=AN,n.popup=FN,n.rectangle=HN,n.setOptions=b,n.stamp=c,n.svg=S_,n.svgOverlay=DN,n.tileLayer=x_,n.tooltip=$N,n.transformation=he,n.version=r,n.videoOverlay=jN;var ZN=window.L;n.noConflict=function(){return window.L=ZN,this},window.L=n})})(Ng,Ng.exports);var Zu=Ng.exports;const q$=Yg(Zu);function wy(t,e,n){return Object.freeze({instance:t,context:e,container:n})}function by(t,e){return e==null?function(r,i){const s=w.useRef();return s.current||(s.current=t(r,i)),s}:function(r,i){const s=w.useRef();s.current||(s.current=t(r,i));const a=w.useRef(r),{instance:l}=s.current;return w.useEffect(function(){a.current!==r&&(e(l,r,a.current),a.current=r)},[l,r,i]),s}}function G$(t,e){w.useEffect(function(){return(e.layerContainer??e.map).addLayer(t.instance),function(){var s;(s=e.layerContainer)==null||s.removeLayer(t.instance),e.map.removeLayer(t.instance)}},[e,t])}function nP(t){return function(n){const r=eP(),i=t(xy(n,r),r);return JE(r.map,n.attribution),tP(i.current,n.eventHandlers),G$(i.current,r),i}}function K$(t,e){const n=by(t,e),r=nP(n);return V$(r)}function Y$(t,e){const n=by(t),r=Z$(n,e);return H$(r)}function J$(t,e){const n=by(t,e),r=nP(n);return W$(r)}function Q$(t,e,n){const{opacity:r,zIndex:i}=e;r!=null&&r!==n.opacity&&t.setOpacity(r),i!=null&&i!==n.zIndex&&t.setZIndex(i)}function Rg(){return Rg=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Rg.apply(this,arguments)}function X$({bounds:t,boundsOptions:e,center:n,children:r,className:i,id:s,placeholder:a,style:l,whenReady:c,zoom:f,...p},m){const[_]=w.useState({className:i,id:s,style:l}),[x,P]=w.useState(null);w.useImperativeHandle(m,()=>(x==null?void 0:x.map)??null,[x]);const b=w.useCallback(E=>{if(E!==null&&x===null){const T=new Zu.Map(E,p);n!=null&&f!=null?T.setView(n,f):t!=null&&T.fitBounds(t,e),c!=null&&T.whenReady(c),P(B$(T))}},[]);w.useEffect(()=>()=>{x==null||x.map.remove()},[x]);const k=x?te.createElement(XE,{value:x},r):a??null;return te.createElement("div",Rg({},_,{ref:b}),k)}const ez=w.forwardRef(X$),tz=K$(function({position:e,...n},r){const i=new Zu.Marker(e,n);return wy(i,U$(r,{overlayContainer:i}))},function(e,n,r){n.position!==r.position&&e.setLatLng(n.position),n.icon!=null&&n.icon!==r.icon&&e.setIcon(n.icon),n.zIndexOffset!=null&&n.zIndexOffset!==r.zIndexOffset&&e.setZIndexOffset(n.zIndexOffset),n.opacity!=null&&n.opacity!==r.opacity&&e.setOpacity(n.opacity),e.dragging!=null&&n.draggable!==r.draggable&&(n.draggable===!0?e.dragging.enable():e.dragging.disable())}),nz=Y$(function(e,n){const r=new Zu.Popup(e,n.overlayContainer);return wy(r,n)},function(e,n,{position:r},i){w.useEffect(function(){const{instance:a}=e;function l(f){f.popup===a&&(a.update(),i(!0))}function c(f){f.popup===a&&i(!1)}return n.map.on({popupopen:l,popupclose:c}),n.overlayContainer==null?(r!=null&&a.setLatLng(r),a.openOn(n.map)):n.overlayContainer.bindPopup(a),function(){var p;n.map.off({popupopen:l,popupclose:c}),(p=n.overlayContainer)==null||p.unbindPopup(),n.map.removeLayer(a)}},[e,n,i,r])}),rz=J$(function({url:e,...n},r){const i=new Zu.TileLayer(e,xy(n,r));return wy(i,r)},function(e,n,r){Q$(e,n,r);const{url:i}=n;i!=null&&i!==r.url&&e.setUrl(i)}),iz=fo("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Ko=w.forwardRef(({className:t,variant:e,...n},r)=>d.jsx("div",{ref:r,role:"alert",className:X(iz({variant:e}),t),...n}));Ko.displayName="Alert";const Yo=w.forwardRef(({className:t,...e},n)=>d.jsx("h5",{ref:n,className:X("mb-1 font-medium leading-none tracking-tight",t),...e}));Yo.displayName="AlertTitle";const Jo=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{ref:n,className:X("text-sm [&_p]:leading-relaxed",t),...e}));Jo.displayName="AlertDescription";const sz=()=>{const{t}=Nt(),e=[{name:t("mapPage.title"),icon:jM,path:"/map"},{name:t("hospitalsPage.title"),icon:Vf,path:"/hospitals"},{name:t("searchPage.title"),icon:dT,path:"/search"},{name:t("donatePage.titleCta"),icon:MM,path:"/donate"}];return d.jsx("nav",{className:"fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 p-1 z-50",children:d.jsx("div",{className:"flex justify-around",children:e.map(n=>d.jsx(py,{to:n.path,className:({isActive:r})=>X("flex flex-col items-center py-2 px-3 text-xs rounded-md transition-colors",r?"text-primary font-medium":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:({isActive:r})=>d.jsxs(d.Fragment,{children:[d.jsx(n.icon,{size:20,className:X(r?"text-primary":"text-gray-500")}),d.jsx("span",{className:"mt-1",children:n.name})]})},n.name))})})},La=({children:t,hideNavigation:e=!1})=>(ws(),d.jsxs("div",{className:"flex flex-col min-h-screen bg-gray-50",children:[d.jsx("main",{className:"flex-1 pb-16",children:t}),!e&&d.jsx(sz,{})]}));function Vw(t,[e,n]){return Math.min(n,Math.max(e,t))}var oz=w.createContext(void 0);function dh(t){const e=w.useContext(oz);return t||e||"ltr"}var tm=0;function rP(){w.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Hw()),document.body.insertAdjacentElement("beforeend",t[1]??Hw()),tm++,()=>{tm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 4,220 bytes, line 267
267=>e.remove()),tm--}},[])}function Hw(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var nm="focusScope.autoFocusOnMount",rm="focusScope.autoFocusOnUnmount",Ww={bubbles:!1,cancelable:!0},az="FocusScope",Cy=w.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=t,[l,c]=w.useState(null),f=bn(i),p=bn(s),m=w.useRef(null),_=Qe(e,b=>c(b)),x=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let b=function(S){if(x.paused||!l)return;const R=S.target;l.contains(R)?m.current=R:Li(m.current,{select:!0})},k=function(S){if(x.paused||!l)return;const R=S.relatedTarget;R!==null&&(l.contains(R)||Li(m.current,{select:!0}))},E=function(S){if(document.activeElement===document.body)for(const I of S)I.removedNodes.length>0&&Li(l)};document.addEventListener("focusin",b),document.addEventListener("focusout",k);const T=new MutationObserver(E);return l&&T.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",k),T.disconnect()}}},[r,l,x.paused]),w.useEffect(()=>{if(l){qw.add(x);const b=document.activeElement;if(!l.contains(b)){const E=new CustomEvent(nm,Ww);l.addEventListener(nm,f),l.dispatchEvent(E),E.defaultPrevented||(lz(hz(iP(l)),{select:!0}),document.activeElement===b&&Li(l))}return()=>{l.removeEventListener(nm,f),setTimeout(()=>{const E=new CustomEvent(rm,Ww);l.addEventListener(rm,p),l.dispatchEvent(E),E.defaultPrevented||Li(b??document.body,{select:!0}),l.removeEventListener(rm,p),qw.remove(x)},0)}}},[l,f,p,x]);const P=w.useCallback(b=>{if(!n&&!r||x.paused)return;const k=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,E=document.activeElement;if(k&&E){const T=b.currentTarget,[S,R]=uz(T);S&&R?!b.shiftKey&&E===R?(b.preventDefault(),n&&Li(S,{select:!0})):b.shiftKey&&E===S&&(b.preventDefault(),n&&Li(R,{select:!0})):E===T&&b.preventDefault()}},[n,r,x.paused]);return d.jsx(be.div,{tabIndex:-1,...a,ref:_,onKeyDown:P})});Cy.displayName=az;function lz(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Li(r,{select:e}),document.activeElement!==n)return}function uz(t){const e=iP(t),n=Zw(e,t),r=Zw(e.reverse(),t);return[n,r]}function iP(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Zw(t,e){for(const n of t)if(!cz(n,{upTo:e}))return n}function cz(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function dz(t){return t instanceof HTMLInputElement&&"select"in t}function Li(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&dz(t)&&e&&t.select()}}var qw=fz();function fz(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Gw(t,e),t.unshift(e)},remove(e){var n;t=Gw(t,e),(n=t[0])==null||n.resume()}}}function Gw(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function hz(t){return t.filter(e=>e.tagName!=="A")}function sP(t){const e=w.useRef({value:t,previous:t});return w.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var pz=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ro=new WeakMap,Yc=new WeakMap,Jc={},im=0,oP=function(t){return t&&(t.host||oP(t.parentNode))},mz=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=oP(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},gz=function(t,e,n,r){var i=mz(e,Array.isArray(t)?t:[t]);Jc[n]||(Jc[n]=new WeakMap);var s=Jc[n],a=[],l=new Set,c=new Set(i),f=function(m){!m||l.has(m)||(l.add(m),f(m.parentNode))};
vendor: 6,421 bytes, lines 267-282
267i.forEach(f);var p=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(_){if(l.has(_))p(_);else try{var x=_.getAttribute(r),P=x!==null&&x!=="false",b=(Ro.get(_)||0)+1,k=(s.get(_)||0)+1;Ro.set(_,b),s.set(_,k),a.push(_),b===1&&P&&Yc.set(_,!0),k===1&&_.setAttribute(n,"true"),P||_.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",_,E)}})};return p(e),l.clear(),im++,function(){a.forEach(function(m){var _=Ro.get(m)-1,x=s.get(m)-1;Ro.set(m,_),s.set(m,x),_||(Yc.has(m)||m.removeAttribute(r),Yc.delete(m)),x||m.removeAttribute(n)}),im--,im||(Ro=new WeakMap,Ro=new WeakMap,Yc=new WeakMap,Jc={})}},aP=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=pz(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),gz(r,i,n,"aria-hidden")):function(){return null}},Lr=function(){return Lr=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Lr.apply(this,arguments)};function lP(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function vz(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var xd="right-scroll-bar-position",wd="width-before-scroll-bar",yz="with-scroll-bars-hidden",_z="--removed-body-scroll-bar-size";function sm(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function xz(t,e){var n=w.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var wz=typeof window<"u"?w.useLayoutEffect:w.useEffect,Kw=new WeakMap;function bz(t,e){var n=xz(null,function(r){return t.forEach(function(i){return sm(i,r)})});return wz(function(){var r=Kw.get(n);if(r){var i=new Set(r),s=new Set(t),a=n.current;i.forEach(function(l){s.has(l)||sm(l,null)}),s.forEach(function(l){i.has(l)||sm(l,a)})}Kw.set(n,t)},[t]),n}function Cz(t){return t}function Sz(t,e){e===void 0&&(e=Cz);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var a=e(s,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(s),a=n}var c=function(){var p=a;a=[],p.forEach(s)},f=function(){return Promise.resolve().then(c)};f(),n={push:function(p){a.push(p),f()},filter:function(p){return a=a.filter(p),n}}}};return i}function Tz(t){t===void 0&&(t={});var e=Sz(null);return e.options=Lr({async:!0,ssr:!1},t),e}var uP=function(t){var e=t.sideCar,n=lP(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Lr({},n))};uP.isSideCarExport=!0;function Ez(t,e){return t.useMedium(e),uP}var cP=Tz(),om=function(){},fh=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:om,onWheelCapture:om,onTouchMoveCapture:om}),i=r[0],s=r[1],a=t.forwardProps,l=t.children,c=t.className,f=t.removeScrollBar,p=t.enabled,m=t.shards,_=t.sideCar,x=t.noIsolation,P=t.inert,b=t.allowPinchZoom,k=t.as,E=k===void 0?"div":k,T=t.gapMode,S=lP(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=_,I=bz([n,e]),M=Lr(Lr({},S),i);return w.createElement(w.Fragment,null,p&&w.createElement(R,{sideCar:cP,removeScrollBar:f,shards:m,noIsolation:x,inert:P,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:T}),a?w.cloneElement(w.Children.only(l),Lr(Lr({},M),{ref:I})):w.createElement(E,Lr({},M,{className:c,ref:I}),l))});fh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};fh.classNames={fullWidth:wd,zeroRight:xd};var Pz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function kz(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Pz();return e&&t.setAttribute("nonce",e),t}function Nz(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Rz(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Iz=function(){var t=0,e=null;return{add:function(n){t==0&&(e=kz())&&(Nz(e,n),Rz(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Az=function(){var t=Iz();return function(e,n){w.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},dP=function(){var t=Az(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},Mz={left:0,top:0,right:0,gap:0},am=function(t){return parseInt(t||"",10)||0},Lz=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[am(n),am(r),am(i)]},Oz=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Mz;var e=Lz(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},jz=dP(),la="data-scroll-locked",Dz=function(t,e,n,r){var i=t.left,s=t.top,a=t.right,l=t.gap;return n===void 0&&(n="margin"),` 268 .`.concat(yz,` { 269 overflow: hidden `).concat(r,`; 270 padding-right: `).concat(l,"px ").concat(r,`; 271 } 272 body[`).concat(la,`] { 273 overflow: hidden `).concat(r,`; 274 overscroll-behavior: contain; 275 `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` 276 padding-left: `.concat(i,`px; 277 padding-top: `).concat(s,`px; 278 padding-right: `).concat(a,`px; 279 margin-left:0; 280 margin-top:0; 281 margin-right: `).concat(l,"px ").concat(r,`; 282 `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";
282")].filter(Boolean).join(""),` 283 } 284 285 .`).concat(xd,` { 286 right: `).concat(l,"px ").concat(r,`; 287 } 288 289 .`).concat(wd,` { 290 margin-right: `).concat(l,"px ").concat(r,`; 291 } 292 293 .`).concat(xd," .").concat(xd,` { 294 right: 0 `).concat(r,`; 295 } 296 297 .`).concat(wd," .").concat(wd,` { 298 margin-right: 0 `).concat(r,`; 299 } 300 301 body[`).concat(la,`] { 302 `).concat(_z,": ").concat(l,`px; 303 } 304`)},Yw=function(){var t=parseInt(document.body.getAttribute(la)||"0",10);return isFinite(t)?t:0},Fz=function(){w.useEffect(function(){return document.body.setAttribute(la,(Yw()+1).toString()),function(){var t=Yw()-1;t<=0?document.body.removeAttribute(la):document.body.setAttribute(la,t.toString())}},[])},$z=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;Fz();var s=w.useMemo(function(){return Oz(i)},[i]);return w.createElement(jz,{styles:Dz(s,!e,i,n?"":"!important")})},Ig=!1;if(typeof window<"u")try{var Qc=Object.defineProperty({},"passive",{get:function(){return Ig=!0,!0}});window.addEventListener("test",Qc,Qc),window.removeEventListener("test",Qc,Qc)}catch{Ig=!1}var Io=Ig?{passive:!1}:!1,zz=function(t){return t.tagName==="TEXTAREA"},fP=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!zz(t)&&n[e]==="visible")},Bz=function(t){return fP(t,"overflowY")},Uz=function(t){return fP(t,"overflowX")},Jw=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=hP(t,r);
vendor: 22,366 bytes, lines 304-307
304if(i){var s=pP(t,r),a=s[1],l=s[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Vz=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Hz=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},hP=function(t,e){return t==="v"?Bz(e):Uz(e)},pP=function(t,e){return t==="v"?Vz(e):Hz(e)},Wz=function(t,e){return t==="h"&&e==="rtl"?-1:1},Zz=function(t,e,n,r,i){var s=Wz(t,window.getComputedStyle(e).direction),a=s*r,l=n.target,c=e.contains(l),f=!1,p=a>0,m=0,_=0;do{var x=pP(t,l),P=x[0],b=x[1],k=x[2],E=b-k-s*P;(P||E)&&hP(t,l)&&(m+=E,_+=P),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(e.contains(l)||e===l));return(p&&Math.abs(m)<1||!p&&Math.abs(_)<1)&&(f=!0),f},Xc=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Qw=function(t){return[t.deltaX,t.deltaY]},Xw=function(t){return t&&"current"in t?t.current:t},qz=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Gz=function(t){return` 305 .block-interactivity-`.concat(t,` {pointer-events: none;} 306 .allow-interactivity-`).concat(t,` {pointer-events: all;} 307`)},Kz=0,Ao=[];function Yz(t){var e=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(Kz++)[0],s=w.useState(dP)[0],a=w.useRef(t);w.useEffect(function(){a.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var b=vz([t.lockRef.current],(t.shards||[]).map(Xw),!0).filter(Boolean);return b.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var l=w.useCallback(function(b,k){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!a.current.allowPinchZoom;var E=Xc(b),T=n.current,S="deltaX"in b?b.deltaX:T[0]-E[0],R="deltaY"in b?b.deltaY:T[1]-E[1],I,M=b.target,O=Math.abs(S)>Math.abs(R)?"h":"v";if("touches"in b&&O==="h"&&M.type==="range")return!1;var D=Jw(O,M);if(!D)return!0;if(D?I=O:(I=O==="v"?"h":"v",D=Jw(O,M)),!D)return!1;if(!r.current&&"changedTouches"in b&&(S||R)&&(r.current=I),!I)return!0;var K=r.current||I;return Zz(K,k,b,K==="h"?S:R)},[]),c=w.useCallback(function(b){var k=b;if(!(!Ao.length||Ao[Ao.length-1]!==s)){var E="deltaY"in k?Qw(k):Xc(k),T=e.current.filter(function(I){return I.name===k.type&&(I.target===k.target||k.target===I.shadowParent)&&qz(I.delta,E)})[0];if(T&&T.should){k.cancelable&&k.preventDefault();return}if(!T){var S=(a.current.shards||[]).map(Xw).filter(Boolean).filter(function(I){return I.contains(k.target)}),R=S.length>0?l(k,S[0]):!a.current.noIsolation;R&&k.cancelable&&k.preventDefault()}}},[]),f=w.useCallback(function(b,k,E,T){var S={name:b,delta:k,target:E,should:T,shadowParent:Jz(E)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(R){return R!==S})},1)},[]),p=w.useCallback(function(b){n.current=Xc(b),r.current=void 0},[]),m=w.useCallback(function(b){f(b.type,Qw(b),b.target,l(b,t.lockRef.current))},[]),_=w.useCallback(function(b){f(b.type,Xc(b),b.target,l(b,t.lockRef.current))},[]);w.useEffect(function(){return Ao.push(s),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:_}),document.addEventListener("wheel",c,Io),document.addEventListener("touchmove",c,Io),document.addEventListener("touchstart",p,Io),function(){Ao=Ao.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,Io),document.removeEventListener("touchmove",c,Io),document.removeEventListener("touchstart",p,Io)}},[]);var x=t.removeScrollBar,P=t.inert;return w.createElement(w.Fragment,null,P?w.createElement(s,{styles:Gz(i)}):null,x?w.createElement($z,{gapMode:t.gapMode}):null)}function Jz(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Qz=Ez(cP,Yz);var Sy=w.forwardRef(function(t,e){return w.createElement(fh,Lr({},t,{ref:e,sideCar:Qz}))});Sy.classNames=fh.classNames;var Xz=[" ","Enter","ArrowUp","ArrowDown"],e4=[" ","Enter"],qu="Select",[hh,ph,t4]=Wv(qu),[Ya,_8]=Hr(qu,[t4,Gf]),mh=Gf(),[n4,Cs]=Ya(qu),[r4,i4]=Ya(qu),mP=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:l,onValueChange:c,dir:f,name:p,autoComplete:m,disabled:_,required:x,form:P}=t,b=mh(e),[k,E]=w.useState(null),[T,S]=w.useState(null),[R,I]=w.useState(!1),M=dh(f),[O=!1,D]=os({prop:r,defaultProp:i,onChange:s}),[K,q]=os({prop:a,defaultProp:l,onChange:c}),ne=w.useRef(null),W=k?P||!!k.closest("form"):!0,[$,z]=w.useState(new Set),se=Array.from($).map(G=>G.props.value).join(";");return d.jsx(HT,{...b,children:d.jsxs(n4,{required:x,scope:e,trigger:k,onTriggerChange:E,valueNode:T,onValueNodeChange:S,valueNodeHasChildren:R,onValueNodeHasChildrenChange:I,contentId:di(),value:K,onValueChange:q,open:O,onOpenChange:D,dir:M,triggerPointerDownPosRef:ne,disabled:_,children:[d.jsx(hh.Provider,{scope:e,children:d.jsx(r4,{scope:t.__scopeSelect,onNativeOptionAdd:w.useCallback(G=>{z(ce=>new Set(ce).add(G))},[]),onNativeOptionRemove:w.useCallback(G=>{z(ce=>{const j=new Set(ce);return j.delete(G),j})},[]),children:n})}),W?d.jsxs(zP,{"aria-hidden":!0,required:x,tabIndex:-1,name:p,autoComplete:m,value:K,onChange:G=>q(G.target.value),disabled:_,form:P,children:[K===void 0?d.jsx("option",{value:""}):null,Array.from($)]},se):null]})})};mP.displayName=qu;var gP="SelectTrigger",vP=w.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,s=mh(n),a=Cs(gP,n),l=a.disabled||r,c=Qe(e,a.onTriggerChange),f=ph(n),p=w.useRef("touch"),[m,_,x]=BP(b=>{const k=f().filter(S=>!S.disabled),E=k.find(S=>S.value===a.value),T=UP(k,b,E);T!==void 0&&a.onValueChange(T.value)}),P=b=>{l||(a.onOpenChange(!0),x()),b&&(a.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return d.jsx(WT,{asChild:!0,...s,children:d.jsx(be.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":$P(a.value)?"":void 0,...i,ref:c,onClick:ve(i.onClick,b=>{b.currentTarget.focus(),p.current!=="mouse"&&P(b)}),onPointerDown:ve(i.onPointerDown,b=>{p.current=b.pointerType;const k=b.target;k.hasPointerCapture(b.pointerId)&&k.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(P(b),b.preventDefault())}),onKeyDown:ve(i.onKeyDown,b=>{const k=m.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&_(b.key),!(k&&b.key===" ")&&Xz.includes(b.key)&&(P(),b.preventDefault())})})})});vP.displayName=gP;var yP="SelectValue",_P=w.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...l}=t,c=Cs(yP,n),{onValueNodeHasChildrenChange:f}=c,p=s!==void 0,m=Qe(e,c.onValueNodeChange);return qt(()=>{f(p)},[f,p]),d.jsx(be.span,{...l,ref:m,style:{pointerEvents:"none"},children:$P(c.value)?d.jsx(d.Fragment,{children:a}):s})});_P.displayName=yP;var s4="SelectIcon",xP=w.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return d.jsx(be.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});xP.displayName=s4;var o4="SelectPortal",wP=t=>d.jsx($f,{asChild:!0,...t});wP.displayName=o4;var ro="SelectContent",bP=w.forwardRef((t,e)=>{const n=Cs(ro,t.__scopeSelect),[r,i]=w.useState();if(qt(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?ys.createPortal(d.jsx(CP,{scope:t.__scopeSelect,children:d.jsx(hh.Slot,{scope:t.__scopeSelect,children:d.jsx("div",{children:t.children})})}),s):null}return d.jsx(SP,{...t,ref:e})});bP.displayName=ro;var Xn=10,[CP,Ss]=Ya(ro),a4="SelectContentImpl",l4=ka("SelectContent.RemoveScroll"),SP=w.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:l,sideOffset:c,align:f,alignOffset:p,arrowPadding:m,collisionBoundary:_,collisionPadding:x,sticky:P,hideWhenDetached:b,avoidCollisions:k,...E}=t,T=Cs(ro,n),[S,R]=w.useState(null),[I,M]=w.useState(null),O=Qe(e,ee=>R(ee)),[D,K]=w.useState(null),[q,ne]=w.useState(null),W=ph(n),[$,z]=w.useState(!1),se=w.useRef(!1);w.useEffect(()=>{if(S)return aP(S)},[S]),rP();const G=w.useCallback(ee=>{const[Ce,...Ze]=W().map(he=>he.ref.current),[Ie]=Ze.slice(-1),Ae=document.activeElement;for(const he of ee)if(he===Ae||(he==null||he.scrollIntoView({block:"nearest"}),he===Ce&&I&&(I.scrollTop=0),he===Ie&&I&&(I.scrollTop=I.scrollHeight),he==null||he.focus(),document.activeElement!==Ae))return},[W,I]),ce=w.useCallback(()=>G([D,S]),[G,D,S]);w.useEffect(()=>{$&&ce()},[$,ce]);const{onOpenChange:j,triggerPointerDownPosRef:U}=T;w.useEffect(()=>{if(S){let ee={x:0,y:0};const Ce=Ie=>{var Ae,he;ee={x:Math.abs(Math.round(Ie.pageX)-(((Ae=U.current)==null?void 0:Ae.x)??0)),y:Math.abs(Math.round(Ie.pageY)-(((he=U.current)==null?void 0:he.y)??0))}},Ze=Ie=>{ee.x<=10&&ee.y<=10?Ie.preventDefault():S.contains(Ie.target)||j(!1),document.removeEventListener("pointermove",Ce),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",Ce),document.addEventListener("pointerup",Ze,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ce),document.removeEventListener("pointerup",Ze,{capture:!0})}}},[S,j,U]),w.useEffect(()=>{const ee=()=>j(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[j]);const[V,re]=BP(ee=>{const Ce=W().filter(Ae=>!Ae.disabled),Ze=Ce.find(Ae=>Ae.ref.current===document.activeElement),Ie=UP(Ce,ee,Ze);Ie&&setTimeout(()=>Ie.ref.current.focus())}),Q=w.useCallback((ee,Ce,Ze)=>{const Ie=!se.current&&!Ze;(T.value!==void 0&&T.value===Ce||Ie)&&(K(ee),Ie&&(se.current=!0))},[T.value]),oe=w.useCallback(()=>S==null?void 0:S.focus(),[S]),ae=w.useCallback((ee,Ce,Ze)=>{const Ie=!se.current&&!Ze;(T.value!==void 0&&T.value===Ce||Ie)&&ne(ee)},[T.value]),fe=r==="popper"?Ag:TP,pe=fe===Ag?{side:l,sideOffset:c,align:f,alignOffset:p,arrowPadding:m,collisionBoundary:_,collisionPadding:x,sticky:P,hideWhenDetached:b,avoidCollisions:k}:{};return d.jsx(CP,{scope:n,content:S,viewport:I,onViewportChange:M,itemRefCallback:Q,selectedItem:D,onItemLeave:oe,itemTextRefCallback:ae,focusSelectedItem:ce,selectedItemText:q,position:r,isPositioned:$,searchRef:V,children:d.jsx(Sy,{as:l4,allowPinchZoom:!0,children:d.jsx(Cy,{asChild:!0,trapped:T.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:ve(i,ee=>{var Ce;(Ce=T.trigger)==null||Ce.focus({preventScroll:!0}),ee.preventDefault()}),children:d.jsx(Bu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:d.jsx(fe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ee=>ee.preventDefault(),...E,...pe,onPlaced:()=>z(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:ve(E.onKeyDown,ee=>{const Ce=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!Ce&&ee.key.length===1&&re(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let Ie=W().filter(Ae=>!Ae.disabled).map(Ae=>Ae.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(Ie=Ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const Ae=ee.target,he=Ie.indexOf(Ae);Ie=Ie.slice(he+1)}setTimeout(()=>G(Ie)),ee.preventDefault()}})})})})})})});SP.displayName=a4;var u4="SelectItemAlignedPosition",TP=w.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,s=Cs(ro,n),a=Ss(ro,n),[l,c]=w.useState(null),[f,p]=w.useState(null),m=Qe(e,O=>p(O)),_=ph(n),x=w.useRef(!1),P=w.useRef(!0),{viewport:b,selectedItem:k,selectedItemText:E,focusSelectedItem:T}=a,S=w.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&f&&b&&k&&E){const O=s.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),K=s.valueNode.getBoundingClientRect(),q=E.getBoundingClientRect();if(s.dir!=="rtl"){const Ae=q.left-D.left,he=K.left-Ae,ut=O.left-he,Rt=O.width+ut,Yt=Math.max(Rt,D.width),cn=window.innerWidth-Xn,dn=Vw(he,[Xn,Math.max(Xn,cn-Yt)]);l.style.minWidth=Rt+"px",l.style.left=dn+"px"}else{const Ae=D.right-q.right,he=window.innerWidth-K.right-Ae,ut=window.innerWidth-O.right-he,Rt=O.width+ut,Yt=Math.max(Rt,D.width),cn=window.innerWidth-Xn,dn=Vw(he,[Xn,Math.max(Xn,cn-Yt)]);l.style.minWidth=Rt+"px",l.style.right=dn+"px"}const ne=_(),W=window.innerHeight-Xn*2,$=b.scrollHeight,z=window.getComputedStyle(f),se=parseInt(z.borderTopWidth,10),G=parseInt(z.paddingTop,10),ce=parseInt(z.borderBottomWidth,10),j=parseInt(z.paddingBottom,10),U=se+G+$+j+ce,V=Math.min(k.offsetHeight*5,U),re=window.getComputedStyle(b),Q=parseInt(re.paddingTop,10),oe=parseInt(re.paddingBottom,10),ae=O.top+O.height/2-Xn,fe=W-ae,pe=k.offsetHeight/2,ee=k.offsetTop+pe,Ce=se+G+ee,Ze=U-Ce;if(Ce<=ae){const Ae=ne.length>0&&k===ne[ne.length-1].ref.current;l.style.bottom="0px";const he=f.clientHeight-b.offsetTop-b.offsetHeight,ut=Math.max(fe,pe+(Ae?oe:0)+he+ce),Rt=Ce+ut;l.style.height=Rt+"px"}else{const Ae=ne.length>0&&k===ne[0].ref.current;l.style.top="0px";const ut=Math.max(ae,se+b.offsetTop+(Ae?Q:0)+pe)+Ze;l.style.height=ut+"px",b.scrollTop=Ce-ae+b.offsetTop}l.style.margin=`${Xn}px 0`,l.style.minHeight=V+"px",l.style.maxHeight=W+"px",r==null||r(),requestAnimationFrame(()=>x.current=!0)}},[_,s.trigger,s.valueNode,l,f,b,k,E,s.dir,r]);qt(()=>S(),[S]);const[R,I]=w.useState();qt(()=>{f&&I(window.getComputedStyle(f).zIndex)},[f]);const M=w.useCallback(O=>{O&&P.current===!0&&(S(),T==null||T(),P.current=!1)},[S,T]);return d.jsx(d4,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:x,onScrollButtonChange:M,children:d.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:d.jsx(be.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});TP.displayName=u4;var c4="SelectPopperPosition",Ag=w.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Xn,...s}=t,a=mh(n);return d.jsx(ZT,{...a,...s,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ag.displayName=c4;var[d4,Ty]=Ya(ro,{}),Mg="SelectViewport",EP=w.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,s=Ss(Mg,n),a=Ty(Mg,n),l=Qe(e,s.onViewportChange),c=w.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(hh.Slot,{scope:n,children:d.jsx(be.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ve(i.onScroll,f=>{const p=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:_}=a;if(_!=null&&_.current&&m){const x=Math.abs(c.current-p.scrollTop);if(x>0){const P=window.innerHeight-Xn*2,b=parseFloat(m.style.minHeight),k=parseFloat(m.style.height),E=Math.max(b,k);if(E<P){const T=E+x,S=Math.min(P,T),R=T-S;m.style.height=S+"px",m.style.bottom==="0px"&&(p.scrollTop=R>0?R:0,m.style.justifyContent="flex-end")}}}c.current=p.scrollTop})})})]})});EP.displayName=Mg;var PP="SelectGroup",[f4,h4]=Ya(PP),p4=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=di();return d.jsx(f4,{scope:n,id:i,children:d.jsx(be.div,{role:"group","aria-labelledby":i,...r,ref:e})})});p4.displayName=PP;var kP="SelectLabel",NP=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=h4(kP,n);return d.jsx(be.div,{id:i.id,...r,ref:e})});NP.displayName=kP;var of="SelectItem",[m4,RP]=Ya(of),IP=w.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=t,l=Cs(of,n),c=Ss(of,n),f=l.value===r,[p,m]=w.useState(s??""),[_,x]=w.useState(!1),P=Qe(e,T=>{var S;return(S=c.itemRefCallback)==null?void 0:S.call(c,T,r,i)}),b=di(),k=w.useRef("touch"),E=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(m4,{scope:n,value:r,disabled:i,textId:b,isSelected:f,onItemTextChange:w.useCallback(T=>{m(S=>S||((T==null?void 0:T.textContent)??"").trim())},[]),children:d.jsx(hh.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:d.jsx(be.div,{role:"option","aria-labelledby":b,"data-highlighted":_?"":void 0,"aria-selected":f&&_,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:P,onFocus:ve(a.onFocus,()=>x(!0)),onBlur:ve(a.onBlur,()=>x(!1)),onClick:ve(a.onClick,()=>{k.current!=="mouse"&&E()}),onPointerUp:ve(a.onPointerUp,()=>{k.current==="mouse"&&E()}),onPointerDown:ve(a.onPointerDown,T=>{k.current=T.pointerType}),onPointerMove:ve(a.onPointerMove,T=>{var S;k.current=T.pointerType,i?(S=c.onItemLeave)==null||S.call(c):k.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ve(a.onPointerLeave,T=>{var S;T.currentTarget===document.activeElement&&((S=c.onItemLeave)==null||S.call(c))}),onKeyDown:ve(a.onKeyDown,T=>{var R;((R=c.searchRef)==null?void 0:R.current)!==""&&T.key===" "||(e4.includes(T.key)&&E(),T.key===" "&&T.preventDefault())})})})})});IP.displayName=of;var Rl="SelectItemText",AP=w.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...s}=t,a=Cs(Rl,n),l=Ss(Rl,n),c=RP(Rl,n),f=i4(Rl,n),[p,m]=w.useState(null),_=Qe(e,E=>m(E),c.onItemTextChange,E=>{var T;return(T=l.itemTextRefCallback)==null?void 0:T.call(l,E,c.value,c.disabled)}),x=p==null?void 0:p.textContent,P=w.useMemo(()=>d.jsx("option",{value:c.value,disabled:c.disabled,children:x},c.value),[c.disabled,c.value,x]),{onNativeOptionAdd:b,onNativeOptionRemove:k}=f;return qt(()=>(b(P),()=>k(P)),[b,k,P]),d.jsxs(d.Fragment,{children:[d.jsx(be.span,{id:c.textId,...s,ref:_}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ys.createPortal(s.children,a.valueNode):null]})});AP.displayName=Rl;var MP="SelectItemIndicator",LP=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return RP(MP,n).isSelected?d.jsx(be.span,{"aria-hidden":!0,...r,ref:e}):null});LP.displayName=MP;var Lg="SelectScrollUpButton",OP=w.forwardRef((t,e)=>{const n=Ss(Lg,t.__scopeSelect),r=Ty(Lg,t.__scopeSelect),[i,s]=w.useState(!1),a=Qe(e,r.onScrollButtonChange);return qt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=c.scrollTop>0;s(f)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?d.jsx(DP,{...t,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});OP.displayName=Lg;var Og="SelectScrollDownButton",jP=w.forwardRef((t,e)=>{const n=Ss(Og,t.__scopeSelect),r=Ty(Og,t.__scopeSelect),[i,s]=w.useState(!1),a=Qe(e,r.onScrollButtonChange);return qt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=c.scrollHeight-c.clientHeight,p=Math.ceil(c.scrollTop)<f;s(p)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?d.jsx(DP,{...t,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});jP.displayName=Og;var DP=w.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,s=Ss("SelectScrollButton",n),a=w.useRef(null),l=ph(n),c=w.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return w.useEffect(()=>()=>c(),[c]),qt(()=>{var p;const f=l().find(m=>m.ref.current===document.activeElement);(p=f==null?void 0:f.ref.current)==null||p.scrollIntoView({block:"nearest"})},[l]),d.jsx(be.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:ve(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:ve(i.onPointerMove,()=>{var f;(f=s.onItemLeave)==null||f.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:ve(i.onPointerLeave,()=>{c()})})}),g4="SelectSeparator",FP=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return d.jsx(be.div,{"aria-hidden":!0,...r,ref:e})});FP.displayName=g4;var jg="SelectArrow",v4=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=mh(n),s=Cs(jg,n),a=Ss(jg,n);return s.open&&a.position==="popper"?d.jsx(qT,{...i,...r,ref:e}):null});v4.displayName=jg;function $P(t){return t===""||t===void 0}var zP=w.forwardRef((t,e)=>{const{value:n,...r}=t,i=w.useRef(null),s=Qe(e,i),a=sP(n);return w.useEffect(()=>{const l=i.current,c=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==n&&p){const m=new Event("change",{bubbles:!0});p.call(l,n),l.dispatchEvent(m)}},[a,n]),d.jsx(Uu,{asChild:!0,children:d.jsx("select",{...r,ref:s,defaultValue:n})})});zP.displayName="BubbleSelect";function BP(t){const e=bn(t),n=w.useRef(""),r=w.useRef(0),i=w.useCallback(a=>{const l=n.current+a;e(l),function c(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[e]),s=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function UP(t,e,n){const i=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let a=y4(t,Math.max(s,0));i.length===1&&(a=a.filter(f=>f!==n));const c=a.find(f=>f.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function y4(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var _4=mP,VP=vP,x4=_P,w4=xP,b4=wP,HP=bP,C4=EP,WP=NP,ZP=IP,S4=AP,T4=LP,qP=OP,GP=jP,KP=FP;const af=_4,lf=x4,gu=w.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(VP,{ref:r,className:X("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
307ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,d.jsx(w4,{asChild:!0,children:d.jsx(aT,{className:"h-4 w-4 opacity-50"})})]}));gu.displayName=VP.displayName;const YP=w.forwardRef(({className:t,...e},n)=>d.jsx(qP,{ref:n,className:X("flex cursor-default items-center justify-center py-1",t),...e,children:d.jsx(PM,{className:"h-4 w-4"})}));YP.displayName=qP.displayName;const JP=w.forwardRef(({className:t,...e},n)=>d.jsx(GP,{ref:n,className:X("flex cursor-default items-center justify-center py-1",t),...e,children:d.jsx(aT,{className:"h-4 w-4"})}));JP.displayName=GP.displayName;const vu=w.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>d.jsx(b4,{children:d.jsxs(HP,{ref:i,className:X("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[d.jsx(YP,{}),d.jsx(C4,{className:X("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),d.jsx(JP,{})]})}));vu.displayName=HP.displayName;const E4=w.forwardRef(({className:t,...e},n)=>d.jsx(WP,{ref:n,className:X("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));E4.displayName=WP.displayName;const Nr=w.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(ZP,{ref:r,className:X("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(T4,{children:d.jsx(TM,{className:"h-4 w-4"})})}),d.jsx(S4,{children:e})]}));Nr.displayName=ZP.displayName;const P4=w.forwardRef(({className:t,...e},n)=>d.jsx(KP,{ref:n,className:X("-mx-1 my-1 h-px bg-muted",t),...e}));P4.displayName=KP.displayName;const gh=()=>{const{events:t,currentEvent:e,setCurrentEvent:n}=Gn();return d.jsx("div",{className:"mb-4",children:d.jsxs(af,{value:e==null?void 0:e.id,onValueChange:r=>{const i=t.find(s=>s.id===r);i&&n(i)},children:[d.jsx(gu,{className:"w-full",children:d.jsx(lf,{placeholder:"Select an emergency event"})}),d.jsx(vu,{children:t.map(r=>d.jsx(Nr,{value:r.id,children:r.name},r.id))})]})})},k4=t=>q$.divIcon({html:`<div class="relative flex items-center justify-center bg-blue-500 text-white rounded-full w-8 h-8 border-2 border-white shadow-md"> 308 <span class="absolute text-xs font-bold">${t}</span> 309 </div>`,className:"",iconSize:[32,32],iconAnchor:[16,16]}),N4=()=>{const t=qa(),{currentEvent:e,refreshData:n,hospitals:r,patients:i}=Gn(),{t:s}=Nt(),a=w.useMemo(()=>{const l={};return i.filter(c=>c.eventId===(e==null?void 0:e.id)).forEach(c=>{c.hospitalId&&(l[c.hospitalId]=(l[c.hospitalId]||0)+1)}),r.map(c=>({...c,patientCount:l[c.id]||0}))},[r,i,e]);return w.useEffect(()=>{n()},[]),d.jsx(La,{children:d.jsxs("div",{className:"p-4",children:[d.jsx("h1",{className:"text-2xl font-bold mb-4",children:s("mapPage.title")}),d.jsx(gh,{}),d.jsx("div",{className:"mt-2 mb-6",children:d.jsxs(Ko,{variant:"default",className:"bg-primary-50 border-primary-200",children:[d.jsx(Uf,{className:"h-4 w-4 text-primary"}),d.jsx(Yo,{children:s("mapPage.eventActive.title")}),d.jsxs(Jo,{children:[e==null?void 0:e.name," - ",e==null?void 0:e.description.substring(0,100),(e==null?void 0:e.description.length)>100?"...":""]})]})}),d.jsxs("div",{className:"relative rounded-lg overflow-hidden h-[60vh] border border-gray-200",children:[d.jsxs(ez,{center:[18.7357,-70.1627],zoom:8,scrollWheelZoom:!0,style:{height:"100%",width:"100%"},children:[d.jsx(rz,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),a.map(l=>l.latitude&&l.longitude&&d.jsx(tz,{position:[l.latitude,l.longitude],icon:k4(l.patientCount),children:d.jsxs(nz,{children:[d.jsx("button",{className:"font-semibold text-blue-600 hover:underline text-left w-full",onClick:()=>t(`/hospitals/${l.id}`),children:l.name}),d.jsxs("div",{children:[s("mapPage.peopleRegistered"),": ",l.patientCount]}),d.jsx("div",{className:"text-xs text-gray-500",children:l.address})]})},l.id))]})," "]})]})})},R4=fo("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function QP({className:t,variant:e,...n}){return d.jsx("div",{className:X(R4({variant:e}),t),...n})}const XP=({status:t})=>{const{t:e}=Nt(),n=s=>
309{switch(s){case"receiving":return{label:e("hospitalsPage.hospitalStatus.receiving"),className:"bg-success text-white"};case"full":return{label:e("hospitalsPage.hospitalStatus.full"),className:"bg-warning text-white"};case"closed":return{label:e("hospitalsPage.hospitalStatus.closed"),className:"bg-destructive text-white"};default:return{label:e("hospitalsPage.hospitalStatus.unknown"),className:"bg-gray-400 text-white"}}},{label:r,className:i}=n(t);return d.jsx(QP,{variant:"outline",className:X("font-medium",i),children:r})},e1=({need:t})=>{const e=i=>{switch(i){case"critical":return{className:"bg-destructive text-white animate-pulse-gentle"};case"high":return{className:"bg-warning text-white"};case"medium":return{className:"bg-info text-white"};default:return{className:"bg-slate-400 text-white"}}},n=i=>i.type==="blood"&&i.bloodType?`Blood Type ${i.bloodType}`:{blood:"Blood",supplies:"Supplies",volunteers:"Volunteers"}[i.type]||i.type,{className:r}=e(t.urgency);return d.jsx(QP,{variant:"outline",className:X("font-medium",r),children:n(t)})},I4=({hospital:t})=>{const{t:e}=Nt();return d.jsxs(He,{className:"overflow-hidden",children:[d.jsx(Ke,{className:"p-4 bg-gray-50 border-b border-gray-100",children:d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-lg",children:t.name}),d.jsx("a",{href:`https://maps.google.com/maps?q=${t.name+", "+t.address}`,target:"_blank",rel:"noopener noreferrer",children:d.jsxs("div",{className:"flex items-center text-gray-500 text-sm mt-1",children:[d.jsx(lT,{size:14,className:"mr-1"}),d.jsx("span",{children:t.address})]})})]}),d.jsx(XP,{status:t.status})]})}),d.jsxs(We,{className:"p-4",children:[d.jsx("div",{className:"mb-3",children:d.jsx("a",{href:`tel:${t.phone}`,target:"_blank",rel:"noopener noreferrer",children:d.jsxs("div",{className:"flex items-center mb-2",children:[d.jsx(uT,{size:14,className:"text-gray-500 mr-1"}),d.jsx("span",{className:"text-sm",children:t.phone})]})})}),t.donationNeeds.length>0&&d.jsxs("div",{className:"mb-3",children:[d.jsx("h4",{className:"text-sm font-medium mb-1",children:"Donation Needs:"}),d.jsx("div",{className:"flex flex-wrap gap-2",children:t.donationNeeds.map(n=>d.jsx(e1,{need:n},n.id))})]}),d.jsx("div",{className:"pt-2",children:d.jsx(fi,{to:`/hospitals/${t.id}`,className:"text-primary hover:text-primary-600 text-sm font-medium",children:e("hospitalsPage.seeDetails")})})]})]})},A4=()=>{const{hospitals:t,currentEvent:e,refreshData:n}=Gn(),{t:r}=Nt(),i=e?t.filter(s=>e.affectedHospitalIds.includes(s.id)):t;return w.useEffect(()=>{n()},[]),d.jsx(La,{children:d.jsxs("div",{className:"p-4",children:[d.jsx("h1",{className:"text-2xl font-bold mb-4",children:r("hospitalsPage.title")}),d.jsx(gh,{}),d.jsx("div",{className:"space-y-4 mt-4",children:i.length>0?i.map(s=>d.jsx(I4,{hospital:s},s.id)):d.jsx("div",{className:"text-center p-6 bg-gray-50 rounded-lg border border-dashed border-gray-200",children:d.jsx("p",{className:"text-gray-500",children:r("hospitalsPage.noHospitals")})})})]})})};var lm="rovingFocusGroup.onEntryFocus",M4={bubbles:!1,cancelable:!0},vh="RovingFocusGroup",[Dg,t1,L4]=Wv(vh),[O4,yh]=Hr(vh,[L4]),[j4,D4]=O4(vh),n1=w.forwardRef((t,e)=>d.jsx(Dg.Provider,{scope:t.__scopeRovingFocusGroup,children:d.jsx(Dg.Slot,{scope:t.__scopeRovingFocusGroup,children:d.jsx(F4,{...t,ref:e})})}));n1.displayName=vh;var F4=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...m}=t,_=w.useRef(null),x=Qe(e,_),P=dh(s),[b=null,k]=os({prop:a,defaultProp:l,onChange:c}),[E,T]=w.useState(!1),S=bn(f),R=t1(n),I=w.useRef(!1),[M,O]=w.useState(0);return w.useEffect(()=>{const D=_.current;if(D)return D.addEventListener(lm,S),()=>D.removeEventListener(lm,S)},[S]),d.jsx(j4,{scope:n,orientation:r,dir:P,loop:i,currentTabStopId:b,onItemFocus:w.useCallback(D=>k(D),[k]),onItemShiftTab:w.useCallback(()=>T(!0),[]),onFocusableItemAdd:w.useCallback(()=>O(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>O(D=>D-1),[]),children:d.jsx(be.div,{tabIndex:E||M===0?-1:0,"data-orientation":r,...m,ref:x,style:{outline:"none",...t.style},onMouseDown:ve(t.onMouseDown,()=>
vendor: 9,109 bytes, line 309
309{I.current=!0}),onFocus:ve(t.onFocus,D=>{const K=!I.current;if(D.target===D.currentTarget&&K&&!E){const q=new CustomEvent(lm,M4);if(D.currentTarget.dispatchEvent(q),!q.defaultPrevented){const ne=R().filter(G=>G.focusable),W=ne.find(G=>G.active),$=ne.find(G=>G.id===b),se=[W,$,...ne].filter(Boolean).map(G=>G.ref.current);s1(se,p)}}I.current=!1}),onBlur:ve(t.onBlur,()=>T(!1))})})}),r1="RovingFocusGroupItem",i1=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...a}=t,l=di(),c=s||l,f=D4(r1,n),p=f.currentTabStopId===c,m=t1(n),{onFocusableItemAdd:_,onFocusableItemRemove:x}=f;return w.useEffect(()=>{if(r)return _(),()=>x()},[r,_,x]),d.jsx(Dg.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:d.jsx(be.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...a,ref:e,onMouseDown:ve(t.onMouseDown,P=>{r?f.onItemFocus(c):P.preventDefault()}),onFocus:ve(t.onFocus,()=>f.onItemFocus(c)),onKeyDown:ve(t.onKeyDown,P=>{if(P.key==="Tab"&&P.shiftKey){f.onItemShiftTab();return}if(P.target!==P.currentTarget)return;const b=B4(P,f.orientation,f.dir);if(b!==void 0){if(P.metaKey||P.ctrlKey||P.altKey||P.shiftKey)return;P.preventDefault();let E=m().filter(T=>T.focusable).map(T=>T.ref.current);if(b==="last")E.reverse();else if(b==="prev"||b==="next"){b==="prev"&&E.reverse();const T=E.indexOf(P.currentTarget);E=f.loop?U4(E,T+1):E.slice(T+1)}setTimeout(()=>s1(E))}})})})});i1.displayName=r1;var $4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function z4(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function B4(t,e,n){const r=z4(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return $4[r]}function s1(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function U4(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var o1=n1,a1=i1,Ey="Tabs",[V4,x8]=Hr(Ey,[yh]),l1=yh(),[H4,Py]=V4(Ey),u1=w.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:l,activationMode:c="automatic",...f}=t,p=dh(l),[m,_]=os({prop:r,onChange:i,defaultProp:s});return d.jsx(H4,{scope:n,baseId:di(),value:m,onValueChange:_,orientation:a,dir:p,activationMode:c,children:d.jsx(be.div,{dir:p,"data-orientation":a,...f,ref:e})})});u1.displayName=Ey;var c1="TabsList",d1=w.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,s=Py(c1,n),a=l1(n);return d.jsx(o1,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:d.jsx(be.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});d1.displayName=c1;var f1="TabsTrigger",h1=w.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=t,a=Py(f1,n),l=l1(n),c=g1(a.baseId,r),f=v1(a.baseId,r),p=r===a.value;return d.jsx(a1,{asChild:!0,...l,focusable:!i,active:p,children:d.jsx(be.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:e,onMouseDown:ve(t.onMouseDown,m=>{!i&&m.button===0&&m.ctrlKey===!1?a.onValueChange(r):m.preventDefault()}),onKeyDown:ve(t.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(r)}),onFocus:ve(t.onFocus,()=>{const m=a.activationMode!=="manual";!p&&!i&&m&&a.onValueChange(r)})})})});h1.displayName=f1;var p1="TabsContent",m1=w.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...a}=t,l=Py(p1,n),c=g1(l.baseId,r),f=v1(l.baseId,r),p=r===l.value,m=w.useRef(p);return w.useEffect(()=>{const _=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(_)},[]),d.jsx(xs,{present:i||p,children:({present:_})=>d.jsx(be.div,{"data-state":p?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!_,id:f,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:m.current?"0s":void 0},children:_&&s})})});m1.displayName=p1;function g1(t,e){return`${t}-trigger-${e}`}function v1(t,e){return`${t}-content-${e}`}var W4=u1,y1=d1,_1=h1,x1=m1;const Z4=W4,w1=w.forwardRef(({className:t,...e},n)=>d.jsx(y1,{ref:n,className:X("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));w1.displayName=y1.displayName;const Fg=w.forwardRef(({className:t,...e},n)=>d.jsx(_1,{ref:n,className:X("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...e}));Fg.displayName=_1.displayName;const $g=w.forwardRef(({className:t,...e},n)=>d.jsx(x1,{ref:n,className:X("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));$g.displayName=x1.displayName;function ua(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Or(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;i=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[l]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}function jr(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(i);if(!s)return null;const a=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?G4(l,m=>m.test(a)):q4(l,m=>m.test(a));let f;f=t.valueCallback?t.valueCallback(c):c,f=n.valueCallback?n.valueCallback(f):f;const p=e.slice(a.length);return{value:f,rest:p}}}function q4(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function G4(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function b1(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],s=e.match(t.parsePattern);if(!s)return null;let a=t.valueCallback?t.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(i.length);return{value:a,rest:l}}}function Xe(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}let K4={};function Gu(){return K4}function yu(t,e){var l,c,f,p;const n=Gu(),r=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,i=Xe(t),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}const Y4={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},J4=(t,e,n)=>{let r;const i=Y4[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},Q4={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},X4=(t,e,n,r)=>Q4[t],eB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nB={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},rB={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
309ay","Saturday"]},iB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},sB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},oB=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},aB={ordinalNumber:oB,era:Or({values:eB,defaultWidth:"wide"}),quarter:Or({values:tB,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Or({values:nB,defaultWidth:"wide"}),day:Or({values:rB,defaultWidth:"wide"}),dayPeriod:Or({values:iB,defaultWidth:"wide",formattingValues:sB,defaultFormattingWidth:"wide"})},lB=/^(\d+)(th|st|nd|rd)?/i,uB=/\d+/i,cB={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},dB={any:[/^b/i,/^(a|c)/i]},fB={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hB={any:[/1/i,/2/i,/3/i,/4/i]},pB={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},mB={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},gB={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},vB={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},yB={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},_B={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},xB={ordinalNumber:b1({matchPattern:lB,parsePattern:uB,valueCallback:t=>parseInt(t,10)}),era:jr({matchPatterns:cB,defaultMatchWidth:"wide",parsePatterns:dB,defaultParseWidth:"any"}),quarter:jr({matchPatterns:fB,defaultMatchWidth:"wide",parsePatterns:hB,defaultParseWidth:"any",valueCallback:t=>t+1}),month:jr({matchPatterns:pB,defaultMatchWidth:"wide",parsePatterns:mB,defaultParseWidth:"any"}),day:jr({matchPatterns:gB,defaultMatchWidth:"wide",parsePatterns:vB,defaultParseWidth:"any"}),dayPeriod:jr({matchPatterns:yB,defaultMatchWidth:"any",parsePatterns:_B,defaultParseWidth:"any"})},wB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},CB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},SB={date:ua({formats:wB,defaultWidth:"full"}),time:ua({formats:bB,defaultWidth:"full"}),dateTime:ua({formats:CB,defaultWidth:"full"})},_h={code:"en-US",formatDistance:J4,formatLong:SB,formatRelative:X4,localize:aB,match:xB,options:{weekStartsOn:0,firstWeekContainsDate:1}},TB={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dÃÂa",other:"{{count}} dÃÂas"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},EB=(t,e,n)=>{let r;const i=TB[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"en "+r:"hace "+r:r},PB={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},kB={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},NB={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},RB={date:ua({formats:PB,defaultWidth:"full"}),time:ua({formats:kB,defaultWidth:"full"}),dateTime:ua({formats:NB,defaultWidth:"full"})},IB={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},AB={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},MB=(t,e,n,r)=>e.getHours()!==1?AB[t]:IB[t],LB={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},OB={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},jB={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},DB={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},FB={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},$B={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},zB=(t,e)=>Number(t)+"º",BB={ordinalNumber:zB,era:Or({values:LB,defaultWidth:"wide"}),quarter:Or({values:OB,defaultWidth:"wide",argumentCallback:t=>Number(t)-1}),month:Or({values:jB,defaultWidth:"wide"}),day:Or({values:DB,defaultWidth:"wide"}),dayPeriod:Or({values:FB,defaultWidth:"wide",formattingValues:$B,defaultFormattingWidth:"wide"})},UB=/^(\d+)(º)?/i,VB=/\d+/i,HB={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|de
vendor: 10,645 bytes, line 309
309spu[eé]s de cristo|era com[uú]n)/i},WB={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},ZB={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},qB={any:[/1/i,/2/i,/3/i,/4/i]},GB={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},KB={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},YB={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},JB={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},QB={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},XB={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},eU={ordinalNumber:b1({matchPattern:UB,parsePattern:VB,valueCallback:function(t){return parseInt(t,10)}}),era:jr({matchPatterns:HB,defaultMatchWidth:"wide",parsePatterns:WB,defaultParseWidth:"any"}),quarter:jr({matchPatterns:ZB,defaultMatchWidth:"wide",parsePatterns:qB,defaultParseWidth:"any",valueCallback:t=>t+1}),month:jr({matchPatterns:GB,defaultMatchWidth:"wide",parsePatterns:KB,defaultParseWidth:"any"}),day:jr({matchPatterns:YB,defaultMatchWidth:"wide",parsePatterns:JB,defaultParseWidth:"any"}),dayPeriod:jr({matchPatterns:QB,defaultMatchWidth:"any",parsePatterns:XB,defaultParseWidth:"any"})},C1={code:"es",formatDistance:EB,formatLong:RB,formatRelative:MB,localize:BB,match:eU,options:{weekStartsOn:1,firstWeekContainsDate:1}};function cs(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const S1=6048e5,tU=864e5,ed=43200,e0=1440;function uf(t){return yu(t,{weekStartsOn:1})}function T1(t){const e=Xe(t),n=e.getFullYear(),r=cs(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=uf(r),s=cs(t,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=uf(s);return e.getTime()>=i.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function t0(t){const e=Xe(t);return e.setHours(0,0,0,0),e}function cf(t){const e=Xe(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function nU(t,e){const n=t0(t),r=t0(e),i=+n-cf(n),s=+r-cf(r);return Math.round((i-s)/tU)}function rU(t){const e=T1(t),n=cs(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),uf(n)}function bd(t,e){const n=Xe(t),r=Xe(e),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function iU(t){return cs(t,Date.now())}function sU(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function oU(t){if(!sU(t)&&typeof t!="number")return!1;const e=Xe(t);return!isNaN(Number(e))}function aU(t,e){const n=Xe(t),r=Xe(e),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function lU(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function uU(t,e){return+Xe(t)-+Xe(e)}function cU(t){const e=Xe(t);return e.setHours(23,59,59,999),e}function dU(t){const e=Xe(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function fU(t){const e=Xe(t);return+cU(e)==+dU(e)}function hU(t,e){const n=Xe(t),r=Xe(e),i=bd(n,r),s=Math.abs(aU(n,r));let a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);let l=bd(n,r)===-i;fU(Xe(t))&&s===1&&bd(t,r)===1&&(l=!1),a=i*(s-Number(l))}return a===0?0:a}function pU(t,e,n){const r=uU(t,e)/1e3;return lU(n==null?void 0:n.roundingMethod)(r)}function mU(t){const e=Xe(t),n=cs(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function gU(t){const e=Xe(t);return nU(e,mU(e))+1}function vU(t){const e=Xe(t),n=+uf(e)-+rU(e);return Math.round(n/S1)+1}function E1(t,e){var p,m,_,x;const n=Xe(t),r=n.getFullYear(),i=Gu(),s=(e==null?void 0:e.firstWeekContainsDate)??((m=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??i.firstWeekContainsDate??((x=(_=i.locale)==null?void 0:_.options)==null?void 0:x.firstWeekContainsDate)??1,a=cs(t,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const l=yu(a,e),c=cs(t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const f=yu(c,e);return n.getTime()>=l.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}function yU(t,e){var l,c,f,p;const n=Gu(),r=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,i=E1(t,e),s=cs(t,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),yu(s,e)}function _U(t,e){const n=Xe(t),r=+yu(n,e)-+yU(n,e);return Math.round(r/S1)+1}function Ge(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Ri={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Ge(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Ge(n+1,2)},d(t,e){return Ge(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return Ge(t.getHours()%12||12,e.length)},H(t,e){return Ge(t.getHours(),e.length)},m(t,e){return Ge(t.getMinutes(),e.length)},s(t,e){return Ge(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ge(i,e.length)}},Mo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},n0={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Ri.y(t,e)},Y:function(t,e,n,r){const i=E1(t,r),s=i>0?i:1-i;if(e==="YY"){const a=s%100;return Ge(a,2)}return e==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ge(s,e.length)},R:function(t,e){const n=T1(t);return Ge(n,e.length)},u:function(t,e){const n=t.getFullYear();return Ge(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Ge(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Ge(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Ri.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Ge(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const i=_U(t,r);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):Ge(i,e.length)},I:function(t,e,n){const r=vU(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Ge(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Ri.d(t,e)},D:function(t,e,n){const r=gU(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ge(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const i=t.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return Ge(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const i=t.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return Ge(s,e.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return Ge(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let i;switch(r===12?i=Mo.noon:r===0?i=Mo.midnight:i=r/12>
vendor: 4,402 bytes, line 309
309=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let i;switch(r>=17?i=Mo.evening:r>=12?i=Mo.afternoon:r>=4?i=Mo.morning:i=Mo.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ri.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Ri.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ri.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Ri.s(t,e)},S:function(t,e){return Ri.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return i0(r);case"XXXX":case"XX":return Fs(r);case"XXXXX":case"XXX":default:return Fs(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return i0(r);case"xxxx":case"xx":return Fs(r);case"xxxxx":case"xxx":default:return Fs(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+r0(r,":");case"OOOO":default:return"GMT"+Fs(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+r0(r,":");case"zzzz":default:return"GMT"+Fs(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return Ge(r,e.length)},T:function(t,e,n){const r=t.getTime();return Ge(r,e.length)}};function r0(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+e+Ge(s,2)}function i0(t,e){return t%60===0?(t>0?"-":"+")+Ge(Math.abs(t)/60,2):Fs(t,e)}function Fs(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Ge(Math.trunc(r/60),2),s=Ge(r%60,2);return n+i+e+s}const s0=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},P1=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},xU=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return s0(t,e);let s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",s0(r,e)).replace("{{time}}",P1(i,e))},wU={p:P1,P:xU},bU=/^D+$/,CU=/^Y+$/,SU=["D","DD","YY","YYYY"];function TU(t){return bU.test(t)}function EU(t){return CU.test(t)}function PU(t,e,n){const r=kU(t,e,n);if(console.warn(r),SU.includes(t))throw new RangeError(r)}function kU(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const NU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,RU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IU=/^'([^]*?)'?$/,AU=/''/g,MU=/[a-zA-Z]/;function k1(t,e,n){var p,m,_,x;const r=Gu(),i=r.locale??_h,s=r.firstWeekContainsDate??((m=(p=r.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,a=r.weekStartsOn??((x=(_=r.locale)==null?void 0:_.options)==null?void 0:x.weekStartsOn)??0,l=Xe(t);if(!oU(l))throw new RangeError("Invalid time value");let c=e.match(RU).map(P=>{const b=P[0];if(b==="p"||b==="P"){const k=wU[b];return k(P,i.formatLong)}return P}).join("").match(NU).map(P=>{if(P==="''")return{isToken:!1,value:"'"};const b=P[0];if(b==="'")return{isToken:!1,value:LU(P)};if(n0[b])return{isToken:!0,value:P};
309if(b.match(MU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:P}});i.localize.preprocessor&&(c=i.localize.preprocessor(l,c));const f={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return c.map(P=>{if(!P.isToken)return P.value;const b=P.value;(EU(b)||TU(b))&&PU(b,e,String(t));const k=n0[b[0]];return k(l,b,i.localize,f)}).join("")}function LU(t){const e=t.match(IU);return e?e[1].replace(AU,"'"):t}function OU(t,e,n){const r=Gu(),i=(n==null?void 0:n.locale)??r.locale??_h,s=2520,a=bd(t,e);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:a});let c,f;a>0?(c=Xe(e),f=Xe(t)):(c=Xe(t),f=Xe(e));const p=pU(f,c),m=(cf(f)-cf(c))/1e3,_=Math.round((p-m)/60);let x;if(_<2)return n!=null&&n.includeSeconds?p<5?i.formatDistance("lessThanXSeconds",5,l):p<10?i.formatDistance("lessThanXSeconds",10,l):p<20?i.formatDistance("lessThanXSeconds",20,l):p<40?i.formatDistance("halfAMinute",0,l):p<60?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",1,l):_===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",_,l);if(_<45)return i.formatDistance("xMinutes",_,l);if(_<90)return i.formatDistance("aboutXHours",1,l);if(_<e0){const P=Math.round(_/60);return i.formatDistance("aboutXHours",P,l)}else{if(_<s)return i.formatDistance("xDays",1,l);if(_<ed){const P=Math.round(_/e0);return i.formatDistance("xDays",P,l)}else if(_<ed*2)return x=Math.round(_/ed),i.formatDistance("aboutXMonths",x,l)}if(x=hU(f,c),x<12){const P=Math.round(_/ed);return i.formatDistance("xMonths",P,l)}else{const P=x%12,b=Math.trunc(x/12);return P<3?i.formatDistance("aboutXYears",b,l):P<9?i.formatDistance("overXYears",b,l):i.formatDistance("almostXYears",b+1,l)}}function N1(t,e){return OU(t,iU(t),e)}const jU="https://itxkdtnhgiajnwxdojhz.supabase.co/storage/v1/object/public/patient_lists",DU=()=>{const{hospitalId:t}=Pj(),{hospitals:e,lastUpdate:n}=Gn(),{t:r,language:i}=Nt(),s=e.find(a=>a.id===t);return s?d.jsx(La,{children:d.jsxs("div",{className:"p-4",children:[d.jsxs(fi,{to:"/hospitals",className:"flex items-center text-primary mb-4",children:[d.jsx(ag,{size:20,className:"mr-1"}),r("hospitalDetailsPage.backLink")]}),d.jsxs("div",{className:"mb-4",children:[d.jsxs("div",{className:"flex justify-between items-start mb-2",children:[d.jsx("h1",{className:"text-2xl font-bold",children:s.name}),d.jsx(XP,{status:s.status})]}),d.jsx("a",{href:`https://maps.google.com/maps?q=${s.name+", "+s.address}`,target:"_blank",rel:"noopener noreferrer",children:d.jsxs("div",{className:"flex items-center text-gray-600 mb-1",children:[d.jsx(lT,{size:16,className:"mr-1"}),d.jsx("span",{className:"text-sm",children:s.address})]})}),d.jsx("a",{href:`tel:${s.phone}`,target:"_blank",rel:"noopener noreferrer",children:d.jsxs("div",{className:"flex items-center text-gray-600",children:[d.jsx(uT,{size:16,className:"mr-1"}),d.jsx("span",{className:"text-sm",children:s.phone})]})})]}),d.jsxs(Z4,{defaultValue:"patients",className:"mt-6",children:[d.jsxs(w1,{className:"grid w-full grid-cols-2",children:[d.jsx(Fg,{value:"patients",children:r("hospitalDetailsPage.tabs.patients")}),d.jsx(Fg,{value:"donation",children:r("hospitalDetailsPage.tabs.donationNeeds")})]}),d.jsx($g,{value:"patients",children:d.jsx(He,{className:"mt-2",children:d.jsxs(We,{className:"p-4",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h3",{className:"font-medium",children:r("hospitalDetailsPage.patients.title")}),d.jsxs("div",{className:"flex items-center text-xs text-gray-500",children:[d.jsx(RM,{size:12,className:"mr-1"}),(n==null?void 0:n.created_at)&&N1(new Date(n.created_at),{addSuffix:!0,locale:i==="es"?C1:_h})]})]}),s.patients.length>0?d.jsx("div",{className:"divide-y divide-gray-100",children:s.patients.map(a=>d.jsxs("div",{className:"py-3",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("p",{className:"font-medium",children:a.name}),a.condition&&d.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${a.condition==="stable"?"bg-success/20 text-success":a.condition==="critical"||a.condition==="deceased"?"bg-destructive/20 text-destructive":"bg-gray-200 text-gray-700"}`,children:r(`patientCondition.${a.condition}`)}
309)]}),d.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[r("hospitalDetailsPage.patients.admitted"),": ",new Date(a.dateAdmitted).toLocaleString()]}),d.jsxs("div",{className:"flex text-xs text-gray-500 mt-1",children:[d.jsx(cT,{size:16,className:"mr-2 text-gray-500"}),d.jsxs("span",{children:[r("patientsPage.list.headers.upload")," - ",d.jsx("a",{href:`${jU}/${a.upload.file_path}`,target:"_blank",rel:"noopener noreferrer",children:"Ver imagen"})]})]})]},a.id))}):d.jsx("div",{className:"text-center py-8",children:d.jsx("p",{className:"text-gray-500",children:r("hospitalDetailsPage.patients.noRecords")})})]})})}),d.jsx($g,{value:"donation",children:d.jsx(He,{className:"mt-2",children:d.jsxs(We,{className:"p-4",children:[d.jsx("h3",{className:"font-medium mb-4",children:r("hospitalDetailsPage.donationNeeds.title")}),s.donationNeeds.length>0?d.jsxs("div",{className:"space-y-4",children:[s.donationNeeds.map(a=>d.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg",children:[d.jsxs("div",{className:"flex justify-between items-start mb-2",children:[d.jsx(e1,{need:a}),d.jsxs("span",{className:"text-xs bg-gray-200 px-2 py-1 rounded-full capitalize",children:[r("hospitalDetailsPage.donationNeeds.priority"),": ",r(`urgency.${a.urgency}`)]})]}),d.jsx("p",{className:"text-sm",children:a.description})]},a.id)),d.jsx("div",{className:"pt-4",children:d.jsx("a",{href:`tel:${s.phone}`,target:"_blank",className:"w-full",children:d.jsx(Le,{className:"w-full",children:r("hospitalDetailsPage.donationNeeds.button")})})})]}):d.jsx("div",{className:"text-center py-8",children:d.jsx("p",{className:"text-gray-500",children:r("hospitalDetailsPage.donationNeeds.noNeeds")})})]})})})]})]})}):d.jsx(La,{children:d.jsxs("div",{className:"p-4",children:[d.jsxs(fi,{to:"/hospitals",className:"flex items-center text-primary mb-4",children:[d.jsx(ag,{size:20,className:"mr-1"}),r("hospitalDetailsPage.backLink")]}),d.jsxs("div",{className:"text-center p-8",children:[d.jsx("p",{children:r("hospitalDetailsPage.notFound.message")}),d.jsx(fi,{to:"/hospitals",className:"text-primary mt-4 inline-block",children:r("hospitalDetailsPage.notFound.link")})]})]})})},ky=({className:t,...e})=>d.jsx("nav",{role:"navigation","aria-label":"pagination",className:X("mx-auto flex w-full justify-center",t),...e});ky.displayName="Pagination";const Ny=w.forwardRef(({className:t,...e},n)=>d.jsx("ul",{ref:n,className:X("flex flex-row items-center gap-1",t),...e}));Ny.displayName="PaginationContent";const ai=w.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,className:X("",t),...e}));ai.displayName="PaginationItem";const _u=({className:t,isActive:e,size:n="icon",...r})=>d.jsx("a",{"aria-current":e?"page":void 0,className:X(YE({variant:e?"outline":"ghost",size:n}),t),...r});_u.displayName="PaginationLink";const Ry=({className:t,...e})=>d.jsxs(_u,{"aria-label":"Go to previous page",size:"default",className:X("gap-1 pl-2.5",t),...e,children:[d.jsx(ag,{className:"h-4 w-4"}),d.jsx("span",{children:"Previous"})]});Ry.displayName="PaginationPrevious";const Iy=({className:t,...e})=>d.jsxs(_u,{"aria-label":"Go to next page",size:"default",className:X("gap-1 pr-2.5",t),...e,children:[d.jsx("span",{children:"Next"}),d.jsx(EM,{className:"h-4 w-4"})]});Iy.displayName="PaginationNext";const FU="https://itxkdtnhgiajnwxdojhz.supabase.co/storage/v1/object/public/patient_lists",$U=({patient:t})=>{const{getHospital:e,getEvent:n}=Gn(),{t:r}=Nt(),i=e(t.hospitalId),s=n(t.eventId),a=c=>new Date(c).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),l=c=>{switch(c){case"stable":return d.jsx("span",{className:"text-xs bg-success/20 text-success/80 py-1 px-2 rounded-full",children:r("patientCondition.stable")});case"critical":return d.jsx("span",{className:"text-xs bg-destructive/20 text-destructive/80 py-1 px-2 rounded-full",children:r("patientCondition.critical")});case"deceased":return d.jsx("span",{className:"text-xs bg-destructive/20 text-destructive/80 py-1 px-2 rounded-full",children:r("patientCondition.deceased")});default:return d.jsx("span",{className:"text-xs bg-gray-200 text-gray-700 py-1 px-2 rounded-full",children:r("patientCondition.unknown")})}};return d.jsx(He,{className:"overflow-hidden mb-4",children:d.jsxs(We,{className:"p-4",children:[d.jsxs("div",{className:"mb-3",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsx("h3",{className:"font-semibold text-lg",children:t.name}),l(t.condition)]}),s&&d.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[r("patientsPage.sheet.fields.event"),": ",s.name]})]}),d.jsxs("div",{className:"space-y-2",children:[i&&d.jsxs("div",{className:"flex items-center text-sm",children:[d.jsx(Vf,{size:16,className:"mr-2 text-gray-500"}),d.jsx(fi,{to:`/hospitals/${i.id}`,className:"text-primary hover:text-primary-600",children:i.name})]}),d.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[d.jsx(SM,{size:16,className:"mr-2 text-gray-500"}),d.jsxs("span",{children:[r("patientsPage.list.headers.admitted")," - ",a(t.dateAdmitted)]})]}),d.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[d.jsx(cT,{size:16,className:"mr-2 text-gray-500"}),d.jsxs("span",{children:[r("patientsPage.list.headers.upload")," - ",d.jsx("a",{href:`${FU}/${t.upload.file_path}`,target:"_blank",rel:"noopener noreferrer",children:"Ver imagen"})]})]})]})]})})},zU=()=>{const[t,e]=w.useState(""),[n,r]=w.useState([]),[i,s]=w.useState(!1),[a,l]=w.useState(1),c=10,{searchPatients:f,patients:p}=Gn(),{t:m}=Nt();w.useEffect(()=>{s(!0),r(p)},[]);const _=()=>{const E=f(t);r(t?E:p),s(!0),l(1)},x=w.useMemo(()=>Math.ceil(n.length/c),[n,c]),P=w.useMemo(()=>{const E=(a-1)*c,T=E+c;return n.slice(E,T)},[n,a,c]),b=()=>{l(E=>Math.max(E-1,1))},k=()=>
309{l(E=>Math.min(E+1,x))};return d.jsx(La,{children:d.jsxs("div",{className:"p-4",children:[d.jsx("h1",{className:"text-2xl font-bold mb-4",children:m("searchPage.title")}),d.jsx("div",{className:"mb-6",children:d.jsxs("div",{className:"flex space-x-2",children:[d.jsx(Et,{placeholder:m("searchPage.inputPlaceholder"),value:t,onChange:E=>{const T=E.target.value;e(T),T||r(p),l(1)},className:"flex-1",onKeyDown:E=>{E.key==="Enter"&&_()}}),d.jsxs(Le,{onClick:_,disabled:!t.trim(),children:[d.jsx(dT,{size:20,className:"mr-2"}),m("searchPage.buttonText")]})]})}),i&&d.jsx("div",{children:n.length>0?d.jsxs("div",{children:[d.jsxs("h2",{className:"text-lg font-medium mb-4",children:[m("searchPage.resultsTitle")," (",n.length,")"]}),P.map(E=>d.jsx($U,{patient:E},E.id)),x>1&&d.jsx(ky,{className:"mt-6",children:d.jsxs(Ny,{children:[d.jsx(ai,{children:d.jsx(Ry,{href:"#",onClick:E=>{E.preventDefault(),b()},className:a===1?"pointer-events-none opacity-50":""})}),d.jsx(ai,{children:d.jsxs("span",{className:"text-sm px-3",children:["Page ",a," of ",x]})}),d.jsx(ai,{children:d.jsx(Iy,{href:"#",onClick:E=>{E.preventDefault(),k()},className:a===x?"pointer-events-none opacity-50":""})})]})})]}):d.jsxs("div",{className:"text-center p-8 bg-gray-50 rounded-lg border border-dashed border-gray-200",children:[d.jsx("p",{className:"text-gray-600 mb-2",children:m("searchPage.noResults.message",{searchQuery:t})}),d.jsx("p",{className:"text-sm text-gray-500",children:m("searchPage.noResults.suggestion")})]})}),!i&&d.jsxs("div",{className:"text-center p-8 bg-gray-50 rounded-lg border border-dashed border-gray-200",children:[d.jsx("p",{className:"text-gray-600 mb-2",children:m("searchPage.default.message")}),d.jsx("p",{className:"text-sm text-gray-500",children:m("searchPage.default.suggestion")})]})]})})},BU=()=>{const{hospitals:t,currentEvent:e,refreshData:n}=Gn(),{t:r}=Nt(),i=e?t.filter(c=>e.affectedHospitalIds.includes(c.id)):t,s=i.flatMap(c=>c.donationNeeds.filter(f=>f.type==="blood")),a=i.flatMap(c=>c.donationNeeds.filter(f=>f.type==="supplies")),l=i.flatMap(c=>c.donationNeeds.filter(f=>f.type==="volunteers"));return w.useEffect(()=>{n()},[]),d.jsx(La,{children:d.jsxs("div",{className:"p-4",children:[d.jsx("h1",{className:"text-2xl font-bold mb-4",children:r("donatePage.title")}),d.jsx(gh,{}),d.jsxs("div",{className:"mt-6 space-y-6",children:[d.jsxs(He,{children:[d.jsxs(Ke,{className:"flex flex-row items-center space-x-3 pb-3 pt-4 px-4",children:[d.jsx(IM,{className:"h-6 w-6 text-primary"}),d.jsx("h2",{className:"font-semibold text-lg",children:r("donatePage.bloodDonations.title")})]}),d.jsx(We,{className:"px-4 pb-4",children:s.length>0?d.jsx("div",{className:"space-y-3",children:s.map((c,f)=>{const p=i.find(m=>m.donationNeeds.some(_=>_.id===c.id));return p?d.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg",children:[d.jsx("p",{className:"font-medium mb-1",children:p.name}),d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs("p",{className:"text-sm",children:[c.bloodType?`${r("donatePage.bloodDonations.type")} ${c.bloodType}`:r("donatePage.bloodDonations.allTypes")," - ",c.description]}),d.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${c.urgency==="critical"?"bg-destructive/20 text-destructive":c.urgency==="high"?"bg-warning/20 text-warning":"bg-info/20 text-info"}`,children:r(`urgency.${c.urgency}`)})]}),d.jsx("a",{href:`tel:${p.phone}`,target:"_blank",rel:"noopener noreferrer",children:d.jsx(Le,{className:"w-full mt-4",children:r("donatePage.bloodDonations.button")})})]},c.id):null})}):d.jsx("p",{className:"text-gray-500",children:r("donatePage.bloodDonations.noNeeds")})})]}),d.jsxs(He,{children:[d.jsxs(Ke,{className:"flex flex-row items-center space-x-3 pb-3 pt-4 px-4",children:[d.jsx(DM,{className:"h-6 w-6 text-primary"}),d.jsx("h2",{className:"font-semibold text-lg",children:r("donatePage.supplyDonations.title")})]}),d.jsx(We,{className:"px-4 pb-4",children:a.length>0?d.jsx("div",{className:"space-y-3",children:a.map((c,f)=>{const p=i.find(m=>m.donationNeeds.some(_=>_.id===c.id));return p?d.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg",children:[d.jsx("p",{className:"font-medium mb-1",children:p.name}),d.jsx("p",{className:"text-sm",children:c.description}),d.jsx("a",{href:`tel:${p.phone}`,target:"_blank",rel:"noopener noreferrer",children:d.jsx(Le,{className:"w-full mt-2",children:r("donatePage.supplyDonations.button")})})]},c.id):null})}):d.jsx("p",{className:"text-gray-500",children:r("donatePage.supplyDonations.noNeeds")})})]}),d.jsxs(He,{children:[d.jsxs(Ke,{className:"flex flex-row items-center space-x-3 pb-3 pt-4 px-4",children:[d.jsx(Qv,{className:"h-6 w-6 text-primary"}),d.jsx("h2",{className:"font-semibold text-lg",children:r("donatePage.volunteerHelp.title")})]}),d.jsx(We,{className:"px-4 pb-4",children:l.length>0?d.jsx("div",{className:"space-y-3",children:l.map((c,f)=>{const p=i.find(m=>m.donationNeeds.some(_=>_.id===c.id));return p?d.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg",children:[d.jsx("p",{className:"font-medium mb-1",children:p.name}),d.jsx("p",{className:"text-sm",children:c.description}),d.jsx("a",{href:`tel:${p.phone}`,target:"_blank",rel:"noopener noreferrer",children:d.jsx(Le,{className:"w-full mt-2",children:r("donatePage.volunteerHelp.button")})})]},c.id):null})}):d.jsx("p",{className:"text-gray-500",children:r("donatePage.volunteerHelp.noNeeds")})})]})]})]})})},um=768;function UU(){const[t,e]=w.useState(void 0);return w.useEffect(()=>{const n=window.matchMedia(`(max-width: ${um-1}px)`),r=()=>{e(window.innerWidth<um)};return n.addEventListener("change",r),e(window.innerWidth<um),()=>n.removeEventListener("change",r)},[]),!!t}var VU="Separator",o0="horizontal",HU=["horizontal","vertical"],R1=w.forwardRef((t,e)=>{const{decorative:n,orientation:r=o0,...i}=t,s=WU(r)?r:o0,l=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return d.jsx(be.div,{"data-orientation":s,...l,...i,ref:e})});R1.displayName=VU;function WU(t){return HU.includes(t)}var I1=R1;const A1=w.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},i)=>d.jsx(I1,{ref:i,decorative:n,orientation:e,className:X("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));A1.displayName=I1.displayName;var Ay="Dialog",[M1,w8]=Hr(Ay),[ZU,mr]=M1(Ay),L1=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:
vendor: 6,191 bytes, lines 309-313
309a=!0}=t,l=w.useRef(null),c=w.useRef(null),[f=!1,p]=os({prop:r,defaultProp:i,onChange:s});return d.jsx(ZU,{scope:e,triggerRef:l,contentRef:c,contentId:di(),titleId:di(),descriptionId:di(),open:f,onOpenChange:p,onOpenToggle:w.useCallback(()=>p(m=>!m),[p]),modal:a,children:n})};L1.displayName=Ay;var O1="DialogTrigger",qU=w.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=mr(O1,n),s=Qe(e,i.triggerRef);return d.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Oy(i.open),...r,ref:s,onClick:ve(t.onClick,i.onOpenToggle)})});qU.displayName=O1;var My="DialogPortal",[GU,j1]=M1(My,{forceMount:void 0}),D1=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=mr(My,e);return d.jsx(GU,{scope:e,forceMount:n,children:w.Children.map(r,a=>d.jsx(xs,{present:n||s.open,children:d.jsx($f,{asChild:!0,container:i,children:a})}))})};D1.displayName=My;var df="DialogOverlay",F1=w.forwardRef((t,e)=>{const n=j1(df,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=mr(df,t.__scopeDialog);return s.modal?d.jsx(xs,{present:r||s.open,children:d.jsx(YU,{...i,ref:e})}):null});F1.displayName=df;var KU=ka("DialogOverlay.RemoveScroll"),YU=w.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=mr(df,n);return d.jsx(Sy,{as:KU,allowPinchZoom:!0,shards:[i.contentRef],children:d.jsx(be.div,{"data-state":Oy(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),io="DialogContent",$1=w.forwardRef((t,e)=>{const n=j1(io,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=mr(io,t.__scopeDialog);return d.jsx(xs,{present:r||s.open,children:s.modal?d.jsx(JU,{...i,ref:e}):d.jsx(QU,{...i,ref:e})})});$1.displayName=io;var JU=w.forwardRef((t,e)=>{const n=mr(io,t.__scopeDialog),r=w.useRef(null),i=Qe(e,n.contentRef,r);return w.useEffect(()=>{const s=r.current;if(s)return aP(s)},[]),d.jsx(z1,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ve(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&s.preventDefault()}),onFocusOutside:ve(t.onFocusOutside,s=>s.preventDefault())})}),QU=w.forwardRef((t,e)=>{const n=mr(io,t.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return d.jsx(z1,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,l;(a=t.onCloseAutoFocus)==null||a.call(t,s),s.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,f;(c=t.onInteractOutside)==null||c.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),z1=w.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=t,l=mr(io,n),c=w.useRef(null),f=Qe(e,c);return rP(),d.jsxs(d.Fragment,{children:[d.jsx(Cy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:d.jsx(Bu,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Oy(l.open),...a,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(XU,{titleId:l.titleId}),d.jsx(t3,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Ly="DialogTitle",B1=w.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=mr(Ly,n);return d.jsx(be.h2,{id:i.titleId,...r,ref:e})});B1.displayName=Ly;var U1="DialogDescription",V1=w.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=mr(U1,n);return d.jsx(be.p,{id:i.descriptionId,...r,ref:e})});V1.displayName=U1;var H1="DialogClose",W1=w.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=mr(H1,n);return d.jsx(be.button,{type:"button",...r,ref:e,onClick:ve(t.onClick,()=>i.onOpenChange(!1))})});W1.displayName=H1;function Oy(t){return t?"open":"closed"}var Z1="DialogTitleWarning",[b8,q1]=MA(Z1,{contentName:io,titleName:Ly,docsSlug:"dialog"}),XU=({titleId:t})=>{const e=q1(Z1),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. 310 311If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. 312 313For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return w.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},e3="DialogDescriptionWarning",t3=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${q1(e3).contentName}}.`;return w.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},G1=L1,K1=D1,xh=F1,wh=$1,bh=B1,Ch=V1,Y1=W1;const Sh=G1,n3=K1,J1=w.forwardRef(({className:t,...e},n)=>d.jsx(xh,{className:X("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));J1.displayName=xh.displayName;const r3=fo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Ku=w.forwardRef(({side:t="right",className:e,children:n,...r},i)=>d.jsxs(n3,{children:[d.jsx(J1,{}),d.jsxs(wh,{ref:i,className:X(r3({side:t}),e),...r,children:[n,d.jsxs(Y1,{className:"absolute right-4 top-4 roun
313ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[d.jsx(Hf,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ku.displayName=wh.displayName;const Th=({className:t,...e})=>d.jsx("div",{className:X("flex flex-col space-y-2 text-center sm:text-left",t),...e});Th.displayName="SheetHeader";const Eh=w.forwardRef(({className:t,...e},n)=>d.jsx(bh,{ref:n,className:X("text-lg font-semibold text-foreground",t),...e}));Eh.displayName=bh.displayName;const i3=w.forwardRef(({className:t,...e},n)=>d.jsx(Ch,{ref:n,className:X("text-sm text-muted-foreground",t),...e}));i3.displayName=Ch.displayName;function a0({className:t,...e}){return d.jsx("div",{className:X("animate-pulse rounded-md bg-muted",t),...e})}const s3="sidebar:state",o3=60*60*24*7,a3="16rem",l3="18rem",u3="3rem",c3="b",Q1=w.createContext(null);function Yu(){const t=w.useContext(Q1);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const X1=w.forwardRef(({defaultOpen:t=!0,open:e,onOpenChange:n,className:r,style:i,children:s,...a},l)=>{const c=UU(),[f,p]=w.useState(!1),[m,_]=w.useState(t),x=e??m,P=w.useCallback(T=>{const S=typeof T=="function"?T(x):T;n?n(S):_(S),document.cookie=`${s3}=${S}; path=/; max-age=${o3}`},[n,x]),b=w.useCallback(()=>c?p(T=>!T):P(T=>!T),[c,P,p]);w.useEffect(()=>{const T=S=>{S.key===c3&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),b())};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[b]);const k=x?"expanded":"collapsed",E=w.useMemo(()=>({state:k,open:x,setOpen:P,isMobile:c,openMobile:f,setOpenMobile:p,toggleSidebar:b}),[k,x,P,c,f,p,b]);return d.jsx(Q1.Provider,{value:E,children:d.jsx(nE,{delayDuration:0,children:d.jsx("div",{style:{"--sidebar-width":a3,"--sidebar-width-icon":u3,...i},className:X("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:l,...a,children:s})})})});X1.displayName="SidebarProvider";const ek=w.forwardRef(({side:t="left",variant:e="sidebar",collapsible:n="offcanvas",className:r,children:i,...s},a)=>{const{isMobile:l,state:c,openMobile:f,setOpenMobile:p}=Yu();return n==="none"?d.jsx("div",{className:X("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:a,...s,children:i}):l?d.jsx(Sh,{open:f,onOpenChange:p,...s,children:d.jsx(Ku,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":l3},side:t,children:d.jsx("div",{className:"flex h-full w-full flex-col",children:i})})}):d.jsxs("div",{ref:a,className:"group peer hidden md:block text-sidebar-foreground","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":e,"data-side":t,children:[d.jsx("div",{className:X("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),d.jsx("div",{className:X("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...s,children:d.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});ek.displayName="Sidebar";const tk=w.forwardRef(({className:t,onClick:e,...n},r)=>{const{toggleSidebar:i}=Yu();return d.jsxs(Le,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:X("h-7 w-7",t),onClick:s=>{e==null||e(s),i()},...n,children:[d.jsx(FM,{}),d.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});tk.displayName="SidebarTrigger";const d3=w.forwardRef(({className:t,...e},n)=>{const{toggleSidebar:r}=Yu();return d.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:X("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...e})});d3.displayName="SidebarRail";const f3=w.forwardRef(({className:t,...e},n)=>d.jsx("main",{ref:n,className:X("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-
313h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...e}));f3.displayName="SidebarInset";const h3=w.forwardRef(({className:t,...e},n)=>d.jsx(Et,{ref:n,"data-sidebar":"input",className:X("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",t),...e}));h3.displayName="SidebarInput";const nk=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{ref:n,"data-sidebar":"header",className:X("flex flex-col gap-2 p-2",t),...e}));nk.displayName="SidebarHeader";const p3=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{ref:n,"data-sidebar":"footer",className:X("flex flex-col gap-2 p-2",t),...e}));p3.displayName="SidebarFooter";const m3=w.forwardRef(({className:t,...e},n)=>d.jsx(A1,{ref:n,"data-sidebar":"separator",className:X("mx-2 w-auto bg-sidebar-border",t),...e}));m3.displayName="SidebarSeparator";const rk=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{ref:n,"data-sidebar":"content",className:X("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e}));rk.displayName="SidebarContent";const zg=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{ref:n,"data-sidebar":"group",className:X("relative flex w-full min-w-0 flex-col p-2",t),...e}));zg.displayName="SidebarGroup";const ik=w.forwardRef(({className:t,asChild:e=!1,...n},r)=>{const i=e?Ba:"div";return d.jsx(i,{ref:r,"data-sidebar":"group-label",className:X("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})});ik.displayName="SidebarGroupLabel";const g3=w.forwardRef(({className:t,asChild:e=!1,...n},r)=>{const i=e?Ba:"button";return d.jsx(i,{ref:r,"data-sidebar":"group-action",className:X("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),...n})});g3.displayName="SidebarGroupAction";const Bg=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{ref:n,"data-sidebar":"group-content",className:X("w-full text-sm",t),...e}));Bg.displayName="SidebarGroupContent";const Ug=w.forwardRef(({className:t,...e},n)=>d.jsx("ul",{ref:n,"data-sidebar":"menu",className:X("flex w-full min-w-0 flex-col gap-1",t),...e}));Ug.displayName="SidebarMenu";const ff=w.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,"data-sidebar":"menu-item",className:X("group/menu-item relative",t),...e}));ff.displayName="SidebarMenuItem";const v3=fo("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),hf=w.forwardRef(({asChild:t=!1,isActive:e=!1,variant:n="default",size:r="default",tooltip:i,className:s,...a},l)=>{const c=t?Ba:"button",{isMobile:f,state:p}
313=Yu(),m=d.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":r,"data-active":e,className:X(v3({variant:n,size:r}),s),...a});return i?(typeof i=="string"&&(i={children:i}),d.jsxs(PO,{children:[d.jsx(kO,{asChild:!0,children:m}),d.jsx(rE,{side:"right",align:"center",hidden:p!=="collapsed"||f,...i})]})):m});hf.displayName="SidebarMenuButton";const y3=w.forwardRef(({className:t,asChild:e=!1,showOnHover:n=!1,...r},i)=>{const s=e?Ba:"button";return d.jsx(s,{ref:i,"data-sidebar":"menu-action",className:X("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",t),...r})});y3.displayName="SidebarMenuAction";const _3=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:X("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...e}));_3.displayName="SidebarMenuBadge";const x3=w.forwardRef(({className:t,showIcon:e=!1,...n},r)=>{const i=w.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return d.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:X("rounded-md h-8 flex gap-2 px-2 items-center",t),...n,children:[e&&d.jsx(a0,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),d.jsx(a0,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});x3.displayName="SidebarMenuSkeleton";const w3=w.forwardRef(({className:t,...e},n)=>d.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:X("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...e}));w3.displayName="SidebarMenuSub";const b3=w.forwardRef(({...t},e)=>d.jsx("li",{ref:e,...t}));b3.displayName="SidebarMenuSubItem";const C3=w.forwardRef(({asChild:t=!1,size:e="md",isActive:n,className:r,...i},s)=>{const a=t?Ba:"a";return d.jsx(a,{ref:s,"data-sidebar":"menu-sub-button","data-size":e,"data-active":n,className:X("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...i})});C3.displayName="SidebarMenuSubButton";const S3=()=>{const{t}=Nt(),{open:e}=Yu(),n=qa(),r=async()=>{const{error:i}=await Je.auth.signOut();n("/"),console.log("error logout: ",i)};return d.jsxs(d.Fragment,{children:[d.jsxs(ek,{className:"sidebar-container border-r border-gray-200 dark:border-gray-700 z-1",children:[d.jsx(nk,{className:"flex items-center px-4",children:d.jsx("div",{className:"flex items-center space-x-2",children:d.jsx(fi,{to:"/dashboard",className:"flex-row flex",children:d.jsx("img",{src:"/logo.png",alt:"Logo",style:{width:120,height:"auto"}})})})}
313),d.jsxs(rk,{children:[d.jsxs(zg,{children:[d.jsx(ik,{children:"Main"}),d.jsx(Bg,{children:d.jsx(Ug,{children:d.jsx(T3,{})})})]}),d.jsx(zg,{className:"mt-auto",children:d.jsx(Bg,{children:d.jsxs(Ug,{children:[d.jsx(ff,{children:d.jsx(hf,{asChild:!0,children:d.jsxs(py,{to:"/dashboard/settings",className:"flex items-center space-x-3",children:[d.jsx($M,{size:20}),d.jsx("span",{children:t("sidebar.settings")})," "]})})}),d.jsx(ff,{children:d.jsx(hf,{asChild:!0,children:d.jsxs("div",{onClick:r,className:"flex items-center space-x-3 cursor-pointer",style:{cursor:"pointer"},children:[d.jsx(OM,{size:20}),d.jsx("span",{children:t("sidebar.exitDashboard")})," "]})})})]})})})]})]}),d.jsx(tk,{className:"trigger-sidebar ml-auto hover:text-sidebar-foreground",style:{background:"#fafafa",border:"1px solid #fff",borderColor:"rgb(229 231 235 / var(--tw-border-opacity, 1))",position:"relative",left:e?"-10px":"15px",zIndex:3,top:"30px"}})]})},T3=()=>{const{t}=Nt(),e=[{key:"events",icon:Uf,path:"/dashboard/events"},{key:"hospitals",icon:Vf,path:"/dashboard/hospitals"},{key:"patients",icon:Qv,path:"/dashboard/patients"},{key:"uploadLists",icon:fT,path:"/dashboard/upload"}];return d.jsx(d.Fragment,{children:e.map(n=>d.jsx(ff,{children:d.jsx(hf,{asChild:!0,children:d.jsx(py,{to:n.path,className:({isActive:r})=>X("flex items-center space-x-3",r&&"text-primary font-medium"),children:({isActive:r})=>d.jsxs(d.Fragment,{children:[d.jsx(n.icon,{size:20,className:X(r?"text-primary":"")}),d.jsx("span",{children:t(`sidebar.${n.key}`)})]})})})},n.key))})},Ja=({children:t})=>d.jsx(X1,{children:d.jsxs("div",{className:"min-h-screen flex w-full",children:[d.jsx(S3,{}),d.jsx("main",{className:"flex-1 p-6 overflow-auto",children:t})]})}),E3=()=>{const{t}=Nt(),{language:e}=Nt(),{hospitals:n,patients:r,events:i,refreshData:s,lastUpdate:a}=Gn(),l=i.filter(f=>f.status==="active");w.useEffect(()=>{s()},[]);const c=f=>{let p=0;return f.affectedHospitalIds.map(m=>{n.map(_=>{m===_.id&&(p+=_.patients.length)})}),p};return i.map(f=>f.peopleAffected=c(f)),d.jsx(Ja,{children:d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold",children:t("dashboardHome.title")}),d.jsx("p",{className:"text-gray-500 mt-1",children:t("dashboardHome.description")})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[d.jsxs(He,{children:[d.jsx(Ke,{className:"pb-2",children:d.jsx(at,{className:"text-sm font-medium text-gray-500",children:t("dashboardHome.stats.activeEvents")})}),d.jsx(We,{children:d.jsxs("div",{className:"flex items-center",children:[d.jsx(Uf,{className:"h-6 w-6 text-red-500 mr-2"}),d.jsx("span",{className:"text-2xl font-bold",children:l.length})]})})]}),d.jsxs(He,{children:[d.jsx(Ke,{className:"pb-2",children:d.jsx(at,{className:"text-sm font-medium text-gray-500",children:t("dashboardHome.stats.hospitals")})}),d.jsx(We,{children:d.jsxs("div",{className:"flex items-center",children:[d.jsx(Vf,{className:"h-6 w-6 text-blue-500 mr-2"}),d.jsx("span",{className:"text-2xl font-bold",children:n.length})]})})]}),d.jsxs(He,{children:[d.jsx(Ke,{className:"pb-2",children:d.jsx(at,{className:"text-sm font-medium text-gray-500",children:t("dashboardHome.stats.registeredPatients")})}),d.jsx(We,{children:d.jsxs("div",{className:"flex items-center",children:[d.jsx(Qv,{className:"h-6 w-6 text-green-500 mr-2"}),d.jsx("span",{className:"text-2xl font-bold",children:r.length})]})})]}),d.jsxs(He,{children:[d.jsx(Ke,{className:"pb-2",children:d.jsx(at,{className:"text-sm font-medium text-gray-500",children:t("dashboardHome.stats.lastUpdate")})}),d.jsx(We,{children:d.jsx("div",{className:"flex items-center",children:d.jsxs("span",{className:"text-sm font-bold",children:[(a==null?void 0:a.created_at)&&N1(new Date(a.created_at),{addSuffix:!0,locale:e==="es"?C1:_h}),!a&&"Loading..."]})})})]})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs(He,{children:[d.jsx(Ke,{children:d.jsx(at,{children:t("dashboardHome.sections.activeEvents")})}),d.jsx(We,{children:l.length>0?d.jsx("div",{className:"space-y-4",children:l.map(f=>d.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg",children:[d.jsxs("div",{className:"flex justify-between items-start mb-1",children:[d.jsx("h3",{className:"font-medium",children:f.name}),d.jsx("span",{className:"text-xs bg-red-100 text-red-700 px-2 py-1 rounded-full",children:t("dashboardHome.sections.hospitalStatus.active")})]}),d.jsx("p",{className:"text-sm text-gray-600 mb-2",children:f.description}),d.jsxs("div",{className:"flex text-sm text-gray-500 justify-between",children:[d.jsxs("span",{className:"mr-4",children:[t("dashboardHome.sections.labels.hospitals"),": ",f.affectedHospitalIds.length]}),d.jsxs("span",{children:[t("dashboardHome.sections.labels.started"),": ",new Date(f.startDate).toLocaleDateString()]})]}),d.jsx("div",{className:"flex text-sm text-gray-500 justify-start",children:d.jsxs("span",{className:"",children:[t("dashboardHome.sections.labels.involved"),": ",f.peopleAffected]})})]},f.id))}):d.jsx("p",{className:"text-gray-500 text-center py-8",children:t("dashboardHome.sections.noActiveEvents")})})]}),d.jsxs(He,{children:[d.jsx(Ke,{children:d.jsx(at,{children:t("dashboardHome.sections.recentUpdates")})}),d.jsx(We,{children:d.jsx("div",{className:"space-y-4",children:n.slice(0,3).map(f=>d.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg",children:[d.jsx("h3",{className:"font-medium mb-1",children:f.name}),d.jsxs("div",{className:"flex justify-between text-sm",children:[d.jsxs("span",{className:`${f.status==="receiving"?"text-green-600":f.status==="full"?"text-amber-600":"text-red-600"}`,children:[t("dashboardHome.sections.labels.status"),": ",t(`dashboardHome.sections.hospitalStatus.${f.status}`)]}),d.jsxs("span",{className:"text-gray-500",children:[t("dashboardHome.sections.labels.involved"),": ",f.patients.length]})]})]},f.id))})})]})]})]})})};/** 314 * @license 315 * Copyright 2025 Google LLC 316 * SPDX-License-Identifier: Apache-2.0 317 */class Ph{}function $e(t,e){const n=/\{([^}]+)\}/g;return t.replace(n,(r,i)=>{if(Object.prototype.hasOwnProperty.call(e,i)){const s=e[i];return s!=null?String(s):""}else throw new Error(`Key '${i}' not found in valueMap.`)})}function g(t,e,n){for(let s=0;s<e.length-1;s++){const a=e[s];if(a.endsWith("[]")){const l=a.slice(0,-2);if(!(l in t))if(Array.isArray(n))t[l]=Array.from({length:n.length},()=>({}));else throw new Error(`Value must be a list given an array path ${a}`);if(Array.isArray(t[l])){const c=t[l];if(Array.isArray(n))for(let f=0;f<c.length;f++){const p=c[f];g(p,e.slice(s+1),n[f])}
317else for(const f of c)g(f,e.slice(s+1),n)}return}else if(a.endsWith("[0]")){const l=a.slice(0,-3);l in t||(t[l]=[{}]);const c=t[l];g(c[0],e.slice(s+1),n);return}(!t[a]||typeof t[a]!="object")&&(t[a]={}),t=t[a]}const r=e[e.length-1],i=t[r];if(i!==void 0){if(!n||typeof n=="object"&&Object.keys(n).length===0||n===i)return;if(typeof i=="object"&&typeof n=="object"&&i!==null&&n!==null)Object.assign(i,n);else throw new Error(`Cannot set value for an existing key. Key: ${r}`)}else t[r]=n}function v(t,e){try{if(e.length===1&&e[0]==="_self")return t;for(let n=0;n<e.length;n++){if(typeof t!="object"||t===null)return;const r=e[n];if(r.endsWith("[]")){const i=r.slice(0,-2);if(i in t){const s=t[i];return Array.isArray(s)?s.map(a=>v(a,e.slice(n+1))):void 0}else return}else t=t[r]}return t}catch(n){if(n instanceof TypeError)return;throw n}}/** 318 * @license 319 * Copyright 2025 Google LLC 320 * SPDX-License-Identifier: Apache-2.0 321 */function Gt(t,e){if(!e||typeof e!="string")throw new Error("model is required and must be a string");if(t.isVertexAI()){if(e.startsWith("publishers/")||e.startsWith("projects/")||e.startsWith("models/"))return e;if(e.indexOf("/")>=0){const n=e.split("/",2);return`publishers/${n[0]}/models/${n[1]}`}else return`publishers/google/models/${e}`}else return e.startsWith("models/")||e.startsWith("tunedModels/")?e:`models/${e}`}function sk(t,e){const n=Gt(t,e);return n?n.startsWith("publishers/")&&t.isVertexAI()?`projects/${t.getProject()}/locations/${t.getLocation()}/${n}`:n.startsWith("models/")&&t.isVertexAI()?`projects/${t.getProject()}/locations/${t.getLocation()}/publishers/google/${n}`:n:""}function l0(t,e){if(e==null)throw new Error("PartUnion is required");if(typeof e=="object")return e;if(typeof e=="string")return{text:e};throw new Error(`Unsupported part type: ${typeof e}`)}function xu(t,e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("PartListUnion is required");return Array.isArray(e)?e.map(n=>l0(t,n)):[l0(t,e)]}function ok(t){return t!=null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)}function P3(t){return t!=null&&typeof t=="object"&&"functionCall"in t}function jy(t){return!(t==null||P3(t))}function ak(t){return t==null||Array.isArray(t)&&t.length===0?!1:t.every(jy)}function Hn(t,e){if(e==null)throw new Error("ContentUnion is required");return ok(e)?e:jy(e)?{role:"user",parts:xu(t,e)}:{role:"model",parts:xu(t,e)}}function lk(t,e){if(!e)return[];if(t.isVertexAI()&&Array.isArray(e))return e.flatMap(n=>{const r=Hn(t,n);return r.parts&&r.parts.length>0&&r.parts[0].text!==void 0?[r.parts[0].text]:[]});if(t.isVertexAI()){const n=Hn(t,e);return n.parts&&n.parts.length>0&&n.parts[0].text!==void 0?[n.parts[0].text]:[]}return Array.isArray(e)?e.map(n=>Hn(t,n)):[Hn(t,e)]}function Cd(t,e,n){n.length!==0&&(ak(n)?e.push({role:"user",parts:xu(t,n)}):e.push({role:"model",parts:xu(t,n)}),n.length=0)}function k3(t,e,n,r){jy(r)===ak(n)||(Cd(t,e,n),n.length=0),n.push(r)}function _t(t,e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("contents are required");if(!Array.isArray(e))return[Hn(t,e)];const n=[],r=[];for(const i of e)if(ok(i))Cd(t,n,r),n.push(i);else if(typeof i=="string"||typeof i=="object"&&!Array.isArray(i))k3(t,n,r,i);else if(Array.isArray(i))Cd(t,n,r),n.push({role:"user",parts:xu(t,i)});else throw new Error(`Unsupported content type: ${typeof i}`);return Cd(t,n,r),n}function Sd(t,e){if(!t.isVertexAI()&&"default"in e)throw new Error("Default value is not supported in the response schema for the Gemini API.");if("anyOf"in e&&e.anyOf!==void 0)for(const n of e.anyOf)Sd(t,n);if("items"in e&&e.items!==void 0&&Sd(t,e.items),"properties"in e&&e.properties!==void 0)for(const n of Object.values(e.properties))Sd(t,n)}function uk(t,e){return Sd(t,e),e}function ck(t,e){if(typeof e=="object"&&"voiceConfig"in e)return e;if(typeof e=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:e}}};throw new Error(`Unsupported speechConfig type: ${typeof e}`)}function dk(t,e){return e}function ca(t,e){if(!Array.isArray(e))throw new Error("tool is required and must be an array of Tools");return e}function N3(t,e,n,r=1){const i=!e.startsWith(`${n}/`)&&e.split("/").length===r;return t.isVertexAI()?e.startsWith("projects/")?e:e.startsWith("locations/")?`projects/${t.getProject()}/${e}`:e.startsWith(`${n}/`)?`projects/${t.getProject()}/locations/${t.getLocation()}/${e}`:i?`projects/${t.getProject()}/locations/${t.getLocation()}/${n}/${e}`:e:i?`${n}/${e}`:e}function Ts(t,e){if(typeof e!="string")throw new Error("name must be a string");return N3(t,e,"cachedContents")}function Es(t,e){if(typeof e!="string")throw new Error("fromImageBytes must be a string");return e}function fk(t,e){if(typeof e!="string")throw new Error("fromName must be a string");return e.startsWith("files/")?e.split("files/")[1]:e}/** 322 * @license 323 * Copyright 2025 Google LLC 324 * SPDX-License-Identifier: Apache-2.0 325 */function R3(t,e){const n={};if(v(e,["videoMetadata"])!==void 0)throw new Error("videoMetadata parameter is not supported in Gemini API.");const r=v(e,["thought"]);r!=null&&g(n,["thought"],r);const i=v(e,["codeExecutionResult"]);i!=null&&g(n,["codeExecutionResult"],i);const s=v(e,["executableCode"]);s!=null&&g(n,["executableCode"],s);const a=v(e,["fileData"]);a!=null&&g(n,["fileData"],a);const l=v(e,["functionCall"]);l!=null&&g(n,["functionCall"],l);const c=v(e,["functionResponse"]);c!=null&&g(n,["functionResponse"],c);const f=v(e,["inlineData"]);f!=null&&g(n,["inlineData"],f);const p=v(e,["text"]);return p!=null&&g(n,["text"],p),n}function u0(t,e){const n={},r=v(e,["parts"]);r!=null&&(Array.isArray(r)?g(n,["parts"],r.map(s=>R3(t,s))):g(n,["parts"],r));const i=v(e,["role"]);return i!=null&&g(n,["role"],i),n}function I3(t,e){const n={};if(v(e,["response"])!==void 0)throw new Error("response parameter is not supported in Gemini API.");const r=v(e,["description"]);r!=null&&g(n,["description"],r);const i=v(e,["name"]);i!=null&&g(n,["name"],i);const s=v(e,["parameters"]);return s!=null&&g(n,["parameters"],s),n}function A3(){return{}}function M3(t,e){const n={},r=v(e,["mode"]);r!=null&&g(n,["mode"],r);const i=v(e,["dynamicThreshold"]);return i!=null&&g(n,["dynamicThreshold"],i),n}function L3(t,e){const n={},r=v(e,["dynamicRetrievalConfig"]);return r!=null&&g(n,["dynamicRetrievalConfig"],M3(t,r)),n}function O3(t,e){const n={},r=v(e,["functionDeclarations"]);if(r!=null&&(Array.isArray(r)?g(n,["functionDeclarations"],r.map(l=>I3(t,l))):g(n,["functionDeclarations"],r)),v(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");
325v(e,["googleSearch"])!=null&&g(n,["googleSearch"],A3());const s=v(e,["googleSearchRetrieval"]);s!=null&&g(n,["googleSearchRetrieval"],L3(t,s));const a=v(e,["codeExecution"]);return a!=null&&g(n,["codeExecution"],a),n}function j3(t,e){const n={},r=v(e,["mode"]);r!=null&&g(n,["mode"],r);const i=v(e,["allowedFunctionNames"]);return i!=null&&g(n,["allowedFunctionNames"],i),n}function D3(t,e){const n={},r=v(e,["functionCallingConfig"]);return r!=null&&g(n,["functionCallingConfig"],j3(t,r)),n}function F3(t,e,n){const r={},i=v(e,["ttl"]);n!==void 0&&i!=null&&g(n,["ttl"],i);const s=v(e,["expireTime"]);n!==void 0&&s!=null&&g(n,["expireTime"],s);const a=v(e,["displayName"]);n!==void 0&&a!=null&&g(n,["displayName"],a);const l=v(e,["contents"]);n!==void 0&&l!=null&&(Array.isArray(l)?g(n,["contents"],_t(t,_t(t,l).map(m=>u0(t,m)))):g(n,["contents"],_t(t,l)));const c=v(e,["systemInstruction"]);n!==void 0&&c!=null&&g(n,["systemInstruction"],u0(t,Hn(t,c)));const f=v(e,["tools"]);n!==void 0&&f!=null&&(Array.isArray(f)?g(n,["tools"],f.map(m=>O3(t,m))):g(n,["tools"],f));const p=v(e,["toolConfig"]);return n!==void 0&&p!=null&&g(n,["toolConfig"],D3(t,p)),r}function $3(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["model"],sk(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],F3(t,i,n)),n}function z3(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["_url","name"],Ts(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],i),n}function B3(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["_url","name"],Ts(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],i),n}function U3(t,e,n){const r={},i=v(e,["ttl"]);n!==void 0&&i!=null&&g(n,["ttl"],i);const s=v(e,["expireTime"]);return n!==void 0&&s!=null&&g(n,["expireTime"],s),r}function V3(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["_url","name"],Ts(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],U3(t,i,n)),n}function H3(t,e,n){const r={},i=v(e,["pageSize"]);n!==void 0&&i!=null&&g(n,["_query","pageSize"],i);const s=v(e,["pageToken"]);return n!==void 0&&s!=null&&g(n,["_query","pageToken"],s),r}function W3(t,e){const n={},r=v(e,["config"]);return r!=null&&g(n,["config"],H3(t,r,n)),n}function Z3(t,e){const n={},r=v(e,["videoMetadata"]);r!=null&&g(n,["videoMetadata"],r);const i=v(e,["thought"]);i!=null&&g(n,["thought"],i);const s=v(e,["codeExecutionResult"]);s!=null&&g(n,["codeExecutionResult"],s);const a=v(e,["executableCode"]);a!=null&&g(n,["executableCode"],a);const l=v(e,["fileData"]);l!=null&&g(n,["fileData"],l);const c=v(e,["functionCall"]);c!=null&&g(n,["functionCall"],c);const f=v(e,["functionResponse"]);f!=null&&g(n,["functionResponse"],f);const p=v(e,["inlineData"]);p!=null&&g(n,["inlineData"],p);const m=v(e,["text"]);return m!=null&&g(n,["text"],m),n}function c0(t,e){const n={},r=v(e,["parts"]);r!=null&&(Array.isArray(r)?g(n,["parts"],r.map(s=>Z3(t,s))):g(n,["parts"],r));const i=v(e,["role"]);return i!=null&&g(n,["role"],i),n}function q3(t,e){const n={},r=v(e,["example"]);r!=null&&g(n,["example"],r);const i=v(e,["pattern"]);i!=null&&g(n,["pattern"],i);const s=v(e,["default"]);s!=null&&g(n,["default"],s);const a=v(e,["maxLength"]);a!=null&&g(n,["maxLength"],a);const l=v(e,["minLength"]);l!=null&&g(n,["minLength"],l);const c=v(e,["minProperties"]);c!=null&&g(n,["minProperties"],c);const f=v(e,["maxProperties"]);f!=null&&g(n,["maxProperties"],f);const p=v(e,["anyOf"]);p!=null&&g(n,["anyOf"],p);const m=v(e,["description"]);m!=null&&g(n,["description"],m);const _=v(e,["enum"]);_!=null&&g(n,["enum"],_);const x=v(e,["format"]);x!=null&&g(n,["format"],x);const P=v(e,["items"]);P!=null&&g(n,["items"],P);const b=v(e,["maxItems"]);b!=null&&g(n,["maxItems"],b);const k=v(e,["maximum"]);k!=null&&g(n,["maximum"],k);const E=v(e,["minItems"]);E!=null&&g(n,["minItems"],E);const T=v(e,["minimum"]);T!=null&&g(n,["minimum"],T);const S=v(e,["nullable"]);S!=null&&g(n,["nullable"],S);const R=v(e,["properties"]);R!=null&&g(n,["properties"],R);const I=v(e,["propertyOrdering"]);I!=null&&g(n,["propertyOrdering"],I);const M=v(e,["required"]);M!=null&&g(n,["required"],M);const O=v(e,["title"]);O!=null&&g(n,["title"],O);const D=v(e,["type"]);return D!=null&&g(n,["type"],D),n}function G3(t,e){const n={},r=v(e,["response"]);r!=null&&g(n,["response"],q3(t,r));const i=v(e,["description"]);i!=null&&g(n,["description"],i);const s=v(e,["name"]);s!=null&&g(n,["name"],s);const a=v(e,["parameters"]);return a!=null&&g(n,["parameters"],a),n}function K3(){return{}}function Y3(t,e){const n={},r=v(e,["mode"]);r!=null&&g(n,["mode"],r);const i=v(e,["dynamicThreshold"]);return i!=null&&g(n,["dynamicThreshold"],i),n}function J3(t,e){const n={},r=v(e,["dynamicRetrievalConfig"]);return r!=null&&g(n,["dynamicRetrievalConfig"],Y3(t,r)),n}function Q3(t,e){const n={},r=v(e,["functionDeclarations"]);r!=null&&(Array.isArray(r)?g(n,["functionDeclarations"],r.map(c=>G3(t,c))):g(n,["functionDeclarations"],r));const i=v(e,["retrieval"]);i!=null&&g(n,["retrieval"],i),v(e,["googleSearch"])!=null&&g(n,["googleSearch"],K3());const a=v(e,["googleSearchRetrieval"]);a!=null&&g(n,["googleSearchRetrieval"],J3(t,a));const l=v(e,["codeExecution"]);return l!=null&&g(n,["codeExecution"],l),n}function X3(t,e){const n={},r=v(e,["mode"]);r!=null&&g(n,["mode"],r);const i=v(e,["allowedFunctionNames"]);return i!=null&&g(n,["allowedFunctionNames"],i),n}function e5(t,e){const n={},r=v(e,["functionCallingConfig"]);return r!=null&&g(n,["functionCallingConfig"],X3(t,r)),n}function t5(t,e,n){const r={},i=v(e,["ttl"]);n!==void 0&&i!=null&&g(n,["ttl"],i);const s=v(e,["expireTime"]);n!==void 0&&s!=null&&g(n,["expireTime"],s);const a=v(e,["displayName"]);n!==void 0&&a!=null&&g(n,["displayName"],a);const l=v(e,["contents"]);n!==void 0&&l!=null&&(Array.isArray(l)?g(n,["contents"],_t(t,_t(t,l).map(m=>c0(t,m)))):g(n,["contents"],_t(t,l)));const c=v(e,["systemInstruction"]);n!==void 0&&c!=null&&g(n,["systemInstruction"],c0(t,Hn(t,c)));const f=v(e,["tools"]);n!==void 0&&f!=null&&(Array.isArray(f)?g(n,["tools"],f.map(m=>Q3(t,m))):g(n,["tools"],f));const p=v(e,["toolConfig"]);return n!==void 0&&p!=null&&g(n,["toolConfig"],e5(t,p)),r}function n5(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["model"],sk(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],t5(t,i,n)),n}function r5(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["_url","name"],Ts(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],i),n}function i5(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["_url","name"],Ts(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],i),n}function s5(t,e,n){const r={},i=v(e,["ttl"]);n!==void 0&&i!=null&&g(n,["ttl"],i);const s=v(e,["expireTime"]);return n!==void 0&&s!=null&&g(n,["expireTime"],s),r}function o5(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["_url","name"],Ts(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],s5(t,i,n)),n}function a5(t,e,n){const r={},i=v(e,["pageSize"]);n!==void 0&&i!=null&&g(n,["_query","pageSize"],i);const s=v(e,["pageToken"]);return n!==void 0&&s!=null&&g(n,["_query","pageToken"],s),r}function l5(t,e){const n={},r=v(e,["config"]);return r!=null&&g(n,["config"],a5(t,r,n)),n}function Td(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["name"],r);const i=v(e,["displayName"]);i!=null&&g(n,["displayName"],i);const s=v(e,["model"]);s!=null&&g(n,["model"],s);const a=v(e,["createTime"]);a!=null&&g(n,["createTime"],a);const l=v(e,["updateTime"]);l!=null&&g(n,["updateTime"],l);const c=v(e,["expireTime"]);c!=null&&g(n,["expireTime"],c);const f=v(e,["usageMetadata"]);return f!=null&&g(n,["usageMetadata"],f),n}function u5(){return{}}function c5(t,e){const n={},r=v(e,["nextPageToken"]);r!=null&&g(n,["nextPageToken"],r);const i=v(e,["cachedContents"]);return i!=null&&(Array.isArray(i)?g(n,["cachedContents"],i.map(s=>Td(t,s))):g(n,["cachedContents"],i)),n}function Ed(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["name"],r);const i=v(e,["displayName"]);i!=null&&g(n,["displayName"],i);const s=v(e,["model"]);s!=null&&g(n,["model"],s);const a=v(e,["createTime"]);a!=null&&g(n,["createTime"],a);const l=v(e,["updateTime"]);l!=null&&g(n,["updateTime"],l);const c=v(e,["expireTime"]);c!=null&&g(n,["expireTime"],c);const f=v(e,["usageMetadata"]);return f!=null&&g(n,["usageMetadata"],f),n}function d5(){return{}}function f5(t,e){const n={},r=v(e,["nextPageToken"]);r!=null&&g(n,["nextPageToken"],r);const i=v(e,["cachedContents"]);return i!=null&&(Array.isArray(i)?g(n,["cachedContents"],i.map(s=>Ed(t,s))):g(n,["cachedContents"],i)),n}/** 326 * @license 327 * Copyright 2025 Google LLC 328 * SPDX-License-Identifier: Apache-2.0 329 */var pf;(function(t){t.PAGED_ITEM_BATCH_JOBS="batchJobs",t.PAGED_ITEM_MODELS="models",t.PAGED_ITEM_TUNING_JOBS="tuningJobs",t.PAGED_ITEM_FILES="files",t.PAGED_ITEM_CACHED_CONTENTS="cachedContents"})(pf||(pf={}));class hk{constructor(e,n,r,i){this.pageInternal=[],this.paramsInternal={},this.requestInternal=n,this.init(e,r,i)}init(e,n,r){var i,s;this.nameInternal=e,this.pageInternal=n[this.nameInternal]||[],this.idxInternal=0;let a={config:{}};r?typeof r=="object"?a=Object.assign({},r):a=r:a={config:{}},a.config&&(a.config.pageToken=n.nextPageToken),this.paramsInternal=a,this.pageInternalSize=(s=(i=a.config)===null||i===void 0?void 0:i.pageSize)!==null&&s!==void 0?s:this.pageInternal.length}initNextPage(e){this.init(this.nameInternal,e,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(e){return this.pageInternal[e]}[Symbol.asyncIterator](){return{next:async()=>
329{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};const e=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:e,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");const e=await this.requestInternal(this.params);return this.initNextPage(e),this.page}hasNextPage(){var e;return((e=this.params.config)===null||e===void 0?void 0:e.pageToken)!==void 0}}/** 330 * @license 331 * Copyright 2025 Google LLC 332 * SPDX-License-Identifier: Apache-2.0 333 */var d0;(function(t){t.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",t.OUTCOME_OK="OUTCOME_OK",t.OUTCOME_FAILED="OUTCOME_FAILED",t.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(d0||(d0={}));var f0;(function(t){t.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",t.PYTHON="PYTHON"})(f0||(f0={}));var h0;(function(t){t.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",t.STRING="STRING",t.NUMBER="NUMBER",t.INTEGER="INTEGER",t.BOOLEAN="BOOLEAN",t.ARRAY="ARRAY",t.OBJECT="OBJECT"})(h0||(h0={}));var p0;(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY"})(p0||(p0={}));var m0;(function(t){t.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",t.SEVERITY="SEVERITY",t.PROBABILITY="PROBABILITY"})(m0||(m0={}));var g0;(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE",t.OFF="OFF"})(g0||(g0={}));var v0;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(v0||(v0={}));var y0;(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.OTHER="OTHER",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.IMAGE_SAFETY="IMAGE_SAFETY"})(y0||(y0={}));var _0;(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(_0||(_0={}));var x0;(function(t){t.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",t.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",t.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",t.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",t.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(x0||(x0={}));var w0;(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT"})(w0||(w0={}));var b0;(function(t){t.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",t.ON_DEMAND="ON_DEMAND",t.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(b0||(b0={}));var C0;(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.AUDIO="AUDIO"})(C0||(C0={}));var S0;(function(t){t.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",t.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",t.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",t.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(S0||(S0={}));var T0;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(T0||(T0={}));var E0;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE"})(E0||(E0={}));var P0;(function(t){t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(P0||(P0={}));var k0;(function(t){t.DONT_ALLOW="DONT_ALLOW",t.ALLOW_ADULT="ALLOW_ADULT",t.ALLOW_ALL="ALLOW_ALL"})(k0||(k0={}));var N0;(function(t){t.auto="auto",t.en="en",t.ja="ja",t.ko="ko",t.hi="hi"})(N0||(N0={}));var R0;(function(t){t.STATE_UNSPECIFIED="STATE_UNSPECIFIED",t.PROCESSING="PROCESSING",t.ACTIVE="ACTIVE",t.FAILED="FAILED"})(R0||(R0={}));var I0;(function(t){t.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",t.UPLOADED="UPLOADED",t.GENERATED="GENERATED"})(I0||(I0={}));var A0;(function(t){t.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",t.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",t.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",t.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",t.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(A0||(A0={}));var M0;(function(t){t.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",t.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",t.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",t.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(M0||(M0={}));var L0;(function(t){t.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",t.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",t.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",t.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(L0||(L0={}));var O0;(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.VIDEO="VIDEO",t.AUDIO="AUDIO",t.DOCUMENT="DOCUMENT"})(O0||(O0={}));var j0;(function(t){t.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",t.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",t.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(j0||(j0={}));var D0;(function(t){t.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",t.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",t.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(D0||(D0={}));var F0;(function(t){t.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",t.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",t.NO_INTERRUPTION="NO_INTERRUPTION"})(F0||(F0={}));var $0;
333(function(t){t.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",t.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",t.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})($0||($0={}));class td{get text(){var e,n,r,i,s,a,l,c;if(((i=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let f="",p=!1;const m=[];for(const _ of(c=(l=(a=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||a===void 0?void 0:a.content)===null||l===void 0?void 0:l.parts)!==null&&c!==void 0?c:[]){for(const[x,P]of Object.entries(_))x!=="text"&&x!=="thought"&&(P!==null||P!==void 0)&&m.push(x);if(typeof _.text=="string"){if(typeof _.thought=="boolean"&&_.thought)continue;p=!0,f+=_.text}}return m.length>0&&console.warn(`there are non-text parts ${m} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),p?f:void 0}get functionCalls(){var e,n,r,i,s,a,l,c;if(((i=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");const f=(c=(l=(a=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||a===void 0?void 0:a.content)===null||l===void 0?void 0:l.parts)===null||c===void 0?void 0:c.filter(p=>p.functionCall).map(p=>p.functionCall).filter(p=>p!==void 0);if((f==null?void 0:f.length)!==0)return f}get executableCode(){var e,n,r,i,s,a,l,c,f;if(((i=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");const p=(c=(l=(a=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||a===void 0?void 0:a.content)===null||l===void 0?void 0:l.parts)===null||c===void 0?void 0:c.filter(m=>m.executableCode).map(m=>m.executableCode).filter(m=>m!==void 0);if((p==null?void 0:p.length)!==0)return(f=p==null?void 0:p[0])===null||f===void 0?void 0:f.code}get codeExecutionResult(){var e,n,r,i,s,a,l,c,f;if(((i=(r=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||i===void 0?void 0:i.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");const p=(c=(l=(a=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||a===void 0?void 0:a.content)===null||l===void 0?void 0:l.parts)===null||c===void 0?void 0:c.filter(m=>m.codeExecutionResult).map(m=>m.codeExecutionResult).filter(m=>m!==void 0);if((p==null?void 0:p.length)!==0)return(f=p==null?void 0:p[0])===null||f===void 0?void 0:f.output}}class z0{}class B0{}class U0{}class h5{}class V0{}class H0{}class p5{}class pk{constructor(e){const n={};for(const r of e.headers.entries())n[r[0]]=r[1];this.headers=n,this.responseInternal=e}json(){return this.responseInternal.json()}}class m5{}class g5{}/** 334 * @license 335 * Copyright 2025 Google LLC 336 * SPDX-License-Identifier: Apache-2.0 337 */class v5 extends Ph{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new hk(pf.PAGED_ITEM_CACHED_CONTENTS,r=>this.listInternal(r),await this.listInternal(n),n)}async create(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=n5(this.apiClient,e);return s=$e("cachedContents",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(c=>Ed(this.apiClient,c))}else{const l=$3(this.apiClient,e);return s=$e("cachedContents",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(c=>Td(this.apiClient,c))}}async get(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=r5(this.apiClient,e);return s=$e("{name}",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(c=>Ed(this.apiClient,c))}else{const l=z3(this.apiClient,e);return s=$e("{name}",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(c=>Td(this.apiClient,c))}}async delete(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=i5(this.apiClient,e);return s=$e("{name}",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(()=>{const c=d5(),f=new V0;return Object.assign(f,c),f})}else{const l=B3(this.apiClient,e);return s=$e("{name}",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(()=>{const c=u5(),f=new V0;return Object.assign(f,c),f})}}async update(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=o5(this.apiClient,e);return s=$e("{name}",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"PATCH",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(c=>Ed(this.apiClient,c))}else{const l=V3(this.apiClient,e);return s=$e("{name}",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"PATCH",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(c=>Td(this.apiClient,c))}}async listInternal(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=l5(this.apiClient,e);return s=$e("cachedContents",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(c=>{const f=f5(this.apiClient,c),p=new H0;return Object.assign(p,f),p})}else{const l=W3(this.apiClient,e);return s=$e("cachedContents",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(c=>{const f=c5(this.apiClient,c),p=new H0;return Object.assign(p,f),p})}}}function W0(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function vn(t){return this instanceof vn?(this.v=t,this):new vn(t)}function mf(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(x){return function(P){return Promise.resolve(P).then(x,m)}}function l(x,P){r[x]&&(i[x]=function(b){return new Promise(function(k,E){s.push([x,b,k,E])>1||c(x,b)})},P&&(i[x]=P(i[x])))}function c(x,P){try{f(r[x](P))}catch(b){_(s[0][3],b)}}function f(x){x.value instanceof vn?Promise.resolve(x.value.v).then(p,m):_(s[0][2],x)}function p(x){c("next",x)}function m(x){c("throw",x)}function _(x,P){x(P),s.shift(),s.length&&c(s[0][0],s[0][1])}}function Vg(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof W0=="function"?W0(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(a){return new Promise(function(l,c){a=t[s](a),i(l,c,a.done,a.value)})}}function i(s,a,l,c){Promise.resolve(c).then(function(f){s({value:f,done:l})},a)}}/** 338 * @license 339 * Copyright 2025 Google LLC 340 * SPDX-License-Identifier: Apache-2.0 341 */function y5(t){var e;if(t.candidates==null||t.candidates.length===0)return!1;const n=(e=t.candidates[0])===null||e===void 0?void 0:e.content;return n===void 0?!1:mk(n)}function mk(t){if(t.parts===void 0||t.parts.length===0)return!1;for(const e of t.parts)if(e===void 0||Object.keys(e).length===0||e.text!==void 0&&e.text==="")return!1;return!0}function _5(t){if(t.length!==0){if(t[0].role!=="user")throw new Error("History must start with a user turn.");for(const e of t)if(e.role!=="user"&&e.role!=="model")throw new Error(`Role must be user or model, but got ${e.role}.`)}}function x5(t){if(t===void 0||t.length===0)return[];const e=[],n=t.length;let r=0,i=t[0];for(;r<n;)if(t[r].role==="user")i=t[r],r++;else{const s=[];let a=!0;for(;r<n&&t[r].role==="model";)s.push(t[r]),a&&!mk(t[r])&&(a=!1),r++;a&&(e.push(i),e.push(...s))}return e}class w5{constructor(e,n){this.modelsModule=e,this.apiClient=n}create(e){return new b5(this.apiClient,this.modelsModule,e.model,e.config,e.history)}}class b5{constructor(e,n,r,i={},s=[]){this.apiClient=e,this.modelsModule=n,this.model=r,this.config=i,this.history=s,this.sendPromise=Promise.resolve(),_5(s)}async sendMessage(e){var n;await this.sendPromise;const r=Hn(this.apiClient,e.message),i=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(r),config:(n=e.config)!==null&&n!==void 0?n:this.config});return this.sendPromise=(async()=>{var s,a;const c=(a=(s=(await i).candidates)===null||s===void 0?void 0:s[0])===null||a===void 0?void 0:a.content,f=c?[c]:[];this.recordHistory(r,f)})(),await this.sendPromise,i}async sendMessageStream(e){var n;await this.sendPromise;const r=Hn(this.apiClient,e.message),i=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(r),config:(n=e.config)!==null&&n!==void 0?n:this.config});this.sendPromise=i.then(()=>{});const s=await i;return this.processStreamResponse(s,r)}getHistory(e=!1){return e?x5(this.history):this.history}processStreamResponse(e,n){var r,i;return mf(this,arguments,function*(){var a,l,c,f;const p=[];try{for(var m=!0,_=Vg(e),x;x=yield vn(_.next()),a=x.done,!a;m=!0){f=x.value,m=!1;const P=f;if(y5(P)){const b=(i=(r=P.candidates)===null||r===void 0?void 0:r[0])===null||i===void 0?void 0:i.content;b!==void 0&&p.push(b)}yield yield vn(P)}}catch(P){l={error:P}}finally{try{!m&&!a&&(c=_.return)&&(yield vn(c.call(_)))}finally{if(l)throw l.error}}this.recordHistory(n,p)})}recordHistory(e,n){let r=[];n.length>0&&n.every(i=>i.role==="model")?r=n:r.push({role:"model",parts:[]}),this.history.push(e),this.history.push(...r)}}/** 342 * @license 343 * Copyright 2025 Google LLC 344 * SPDX-License-Identifier: Apache-2.0 345 */function C5(t,e,n){const r={},i=v(e,["pageSize"]);n!==void 0&&i!=null&&g(n,["_query","pageSize"],i);const s=v(e,["pageToken"]);return n!==void 0&&s!=null&&g(n,["_query","pageToken"],s),r}function S5(t,e){const n={},r=v(e,["config"]);return r!=null&&g(n,["config"],C5(t,r,n)),n}function T5(t,e){const n={},r=v(e,["details"]);r!=null&&g(n,["details"],r);const i=v(e,["message"]);i!=null&&g(n,["message"],i);const s=v(e,["code"]);return s!=null&&g(n,["code"],s),n}function E5(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["name"],r);const i=v(e,["displayName"]);i!=null&&g(n,["displayName"],i);const s=v(e,["mimeType"]);s!=null&&g(n,["mimeType"],s);const a=v(e,["sizeBytes"]);a!=null&&g(n,["sizeBytes"],a);const l=v(e,["createTime"]);l!=null&&g(n,["createTime"],l);const c=v(e,["expirationTime"]);c!=null&&g(n,["expirationTime"],c);const f=v(e,["updateTime"]);f!=null&&g(n,["updateTime"],f);const p=v(e,["sha256Hash"]);p!=null&&g(n,["sha256Hash"],p);const m=v(e,["uri"]);
345m!=null&&g(n,["uri"],m);const _=v(e,["downloadUri"]);_!=null&&g(n,["downloadUri"],_);const x=v(e,["state"]);x!=null&&g(n,["state"],x);const P=v(e,["source"]);P!=null&&g(n,["source"],P);const b=v(e,["videoMetadata"]);b!=null&&g(n,["videoMetadata"],b);const k=v(e,["error"]);return k!=null&&g(n,["error"],T5(t,k)),n}function P5(t,e){const n={},r=v(e,["file"]);r!=null&&g(n,["file"],E5(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],i),n}function k5(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["_url","file"],fk(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],i),n}function N5(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["_url","file"],fk(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],i),n}function R5(t,e){const n={},r=v(e,["details"]);r!=null&&g(n,["details"],r);const i=v(e,["message"]);i!=null&&g(n,["message"],i);const s=v(e,["code"]);return s!=null&&g(n,["code"],s),n}function Hg(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["name"],r);const i=v(e,["displayName"]);i!=null&&g(n,["displayName"],i);const s=v(e,["mimeType"]);s!=null&&g(n,["mimeType"],s);const a=v(e,["sizeBytes"]);a!=null&&g(n,["sizeBytes"],a);const l=v(e,["createTime"]);l!=null&&g(n,["createTime"],l);const c=v(e,["expirationTime"]);c!=null&&g(n,["expirationTime"],c);const f=v(e,["updateTime"]);f!=null&&g(n,["updateTime"],f);const p=v(e,["sha256Hash"]);p!=null&&g(n,["sha256Hash"],p);const m=v(e,["uri"]);m!=null&&g(n,["uri"],m);const _=v(e,["downloadUri"]);_!=null&&g(n,["downloadUri"],_);const x=v(e,["state"]);x!=null&&g(n,["state"],x);const P=v(e,["source"]);P!=null&&g(n,["source"],P);const b=v(e,["videoMetadata"]);b!=null&&g(n,["videoMetadata"],b);const k=v(e,["error"]);return k!=null&&g(n,["error"],R5(t,k)),n}function I5(t,e){const n={},r=v(e,["nextPageToken"]);r!=null&&g(n,["nextPageToken"],r);const i=v(e,["files"]);return i!=null&&(Array.isArray(i)?g(n,["files"],i.map(s=>Hg(t,s))):g(n,["files"],i)),n}function A5(t,e){const n={},r=v(e,["httpHeaders"]);return r!=null&&g(n,["httpHeaders"],r),n}function M5(){return{}}/** 346 * @license 347 * Copyright 2025 Google LLC 348 * SPDX-License-Identifier: Apache-2.0 349 */class L5 extends Ph{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new hk(pf.PAGED_ITEM_FILES,r=>this.listInternal(r),await this.listInternal(n),n)}async upload(e){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(e.file,e.config).then(n=>Hg(this.apiClient,n))}async listInternal(e){var n;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=S5(this.apiClient,e);return i=$e("files",a._url),s=a._query,delete a.config,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(l=>l.json()),r.then(l=>{const c=I5(this.apiClient,l),f=new p5;return Object.assign(f,c),f})}}async createInternal(e){var n;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=P5(this.apiClient,e);return i=$e("upload/v1beta/files",a._url),s=a._query,delete a.config,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(l=>l.json()),r.then(l=>{const c=A5(this.apiClient,l),f=new m5;return Object.assign(f,c),f})}}async get(e){var n;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=k5(this.apiClient,e);return i=$e("files/{file}",a._url),s=a._query,delete a.config,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(l=>l.json()),r.then(l=>Hg(this.apiClient,l))}}async delete(e){var n;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=N5(this.apiClient,e);return i=$e("files/{file}",a._url),s=a._query,delete a.config,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(l=>l.json()),r.then(()=>{const l=M5(),c=new g5;return Object.assign(c,l),c})}}}/** 350 * @license 351 * Copyright 2025 Google LLC 352 * SPDX-License-Identifier: Apache-2.0 353 */function O5(t,e){const n={};if(v(e,["videoMetadata"])!==void 0)throw new Error("videoMetadata parameter is not supported in Gemini API.");const r=v(e,["thought"]);r!=null&&g(n,["thought"],r);const i=v(e,["codeExecutionResult"]);i!=null&&g(n,["codeExecutionResult"],i);const s=v(e,["executableCode"]);s!=null&&g(n,["executableCode"],s);const a=v(e,["fileData"]);a!=null&&g(n,["fileData"],a);const l=v(e,["functionCall"]);l!=null&&g(n,["functionCall"],l);const c=v(e,["functionResponse"]);c!=null&&g(n,["functionResponse"],c);const f=v(e,["inlineData"]);f!=null&&g(n,["inlineData"],f);const p=v(e,["text"]);return p!=null&&g(n,["text"],p),n}function Ju(t,e){const n={},r=v(e,["parts"]);r!=null&&(Array.isArray(r)?g(n,["parts"],r.map(s=>O5(t,s))):g(n,["parts"],r));const i=v(e,["role"]);return i!=null&&g(n,["role"],i),n}function j5(t,e){const n={};if(v(e,["example"])!==void 0)throw new Error("example parameter is not supported in Gemini API.");if(v(e,["pattern"])!==void 0)throw new Error("pattern parameter is not supported in Gemini API.");if(v(e,["default"])!==void 0)throw new Error("default parameter is not supported in Gemini API.");if(v(e,["maxLength"])!==void 0)throw new Error("maxLength parameter is not supported in Gemini API.");if(v(e,["minLength"])!==void 0)throw new Error("minLength parameter is not supported in Gemini API.");if(v(e,["minProperties"])!==void 0)throw new Error("minProperties parameter is not supported in Gemini API.");if(v(e,["maxProperties"])!==void 0)throw new Error("maxProperties parameter is not supported in Gemini API.");const r=v(e,["anyOf"]);r!=null&&g(n,["anyOf"],r);const i=v(e,["description"]);i!=null&&g(n,["description"],i);const s=v(e,["enum"]);s!=null&&g(n,["enum"],s);const a=v(e,["format"]);a!=null&&g(n,["format"],a);const l=v(e,["items"]);l!=null&&g(n,["items"],l);const c=v(e,["maxItems"]);c!=null&&g(n,["maxItems"],c);const f=v(e,["maximum"]);f!=null&&g(n,["maximum"],f);const p=v(e,["minItems"]);p!=null&&g(n,["minItems"],p);const m=v(e,["minimum"]);m!=null&&g(n,["minimum"],m);const _=v(e,["nullable"]);_!=null&&g(n,["nullable"],_);const x=v(e,["properties"]);x!=null&&g(n,["properties"],x);const P=v(e,["propertyOrdering"]);P!=null&&g(n,["propertyOrdering"],P);const b=v(e,["required"]);b!=null&&g(n,["required"],b);const k=v(e,["title"]);k!=null&&g(n,["title"],k);const E=v(e,["type"]);return E!=null&&g(n,["type"],E),n}function D5(t,e){const n={};if(v(e,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const r=v(e,["category"]);r!=null&&g(n,["category"],r);const i=v(e,["threshold"]);return i!=null&&g(n,["threshold"],i),n}function F5(t,e){const n={};if(v(e,["response"])!==void 0)throw new Error("response parameter is not supported in Gemini API.");const r=v(e,["description"]);r!=null&&g(n,["description"],r);const i=v(e,["name"]);i!=null&&g(n,["name"],i);const s=v(e,["parameters"]);return s!=null&&g(n,["parameters"],s),n}function $5(){return{}}function z5(t,e){const n={},r=v(e,["mode"]);r!=null&&g(n,["mode"],r);const i=v(e,["dynamicThreshold"]);return i!=null&&g(n,["dynamicThreshold"],i),n}function B5(t,e){const n={},r=v(e,["dynamicRetrievalConfig"]);return r!=null&&g(n,["dynamicRetrievalConfig"],z5(t,r)),n}function gk(t,e){const n={},r=v(e,["functionDeclarations"]);if(r!=null&&(Array.isArray(r)?g(n,["functionDeclarations"],r.map(l=>F5(t,l))):g(n,["functionDeclarations"],r)),v(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");
353v(e,["googleSearch"])!=null&&g(n,["googleSearch"],$5());const s=v(e,["googleSearchRetrieval"]);s!=null&&g(n,["googleSearchRetrieval"],B5(t,s));const a=v(e,["codeExecution"]);return a!=null&&g(n,["codeExecution"],a),n}function U5(t,e){const n={},r=v(e,["mode"]);r!=null&&g(n,["mode"],r);const i=v(e,["allowedFunctionNames"]);return i!=null&&g(n,["allowedFunctionNames"],i),n}function V5(t,e){const n={},r=v(e,["functionCallingConfig"]);return r!=null&&g(n,["functionCallingConfig"],U5(t,r)),n}function H5(t,e){const n={},r=v(e,["voiceName"]);return r!=null&&g(n,["voiceName"],r),n}function W5(t,e){const n={},r=v(e,["prebuiltVoiceConfig"]);return r!=null&&g(n,["prebuiltVoiceConfig"],H5(t,r)),n}function Z5(t,e){const n={},r=v(e,["voiceConfig"]);return r!=null&&g(n,["voiceConfig"],W5(t,r)),n}function q5(t,e){const n={},r=v(e,["includeThoughts"]);r!=null&&g(n,["includeThoughts"],r);const i=v(e,["thinkingBudget"]);return i!=null&&g(n,["thinkingBudget"],i),n}function G5(t,e,n){const r={},i=v(e,["systemInstruction"]);n!==void 0&&i!=null&&g(n,["systemInstruction"],Ju(t,Hn(t,i)));const s=v(e,["temperature"]);s!=null&&g(r,["temperature"],s);const a=v(e,["topP"]);a!=null&&g(r,["topP"],a);const l=v(e,["topK"]);l!=null&&g(r,["topK"],l);const c=v(e,["candidateCount"]);c!=null&&g(r,["candidateCount"],c);const f=v(e,["maxOutputTokens"]);f!=null&&g(r,["maxOutputTokens"],f);const p=v(e,["stopSequences"]);p!=null&&g(r,["stopSequences"],p);const m=v(e,["responseLogprobs"]);m!=null&&g(r,["responseLogprobs"],m);const _=v(e,["logprobs"]);_!=null&&g(r,["logprobs"],_);const x=v(e,["presencePenalty"]);x!=null&&g(r,["presencePenalty"],x);const P=v(e,["frequencyPenalty"]);P!=null&&g(r,["frequencyPenalty"],P);const b=v(e,["seed"]);b!=null&&g(r,["seed"],b);const k=v(e,["responseMimeType"]);k!=null&&g(r,["responseMimeType"],k);const E=v(e,["responseSchema"]);if(E!=null&&g(r,["responseSchema"],j5(t,uk(t,E))),v(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");const T=v(e,["safetySettings"]);n!==void 0&&T!=null&&(Array.isArray(T)?g(n,["safetySettings"],T.map(q=>D5(t,q))):g(n,["safetySettings"],T));const S=v(e,["tools"]);n!==void 0&&S!=null&&(Array.isArray(S)?g(n,["tools"],ca(t,ca(t,S).map(q=>gk(t,dk(t,q))))):g(n,["tools"],ca(t,S)));const R=v(e,["toolConfig"]);if(n!==void 0&&R!=null&&g(n,["toolConfig"],V5(t,R)),v(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const I=v(e,["cachedContent"]);n!==void 0&&I!=null&&g(n,["cachedContent"],Ts(t,I));const M=v(e,["responseModalities"]);M!=null&&g(r,["responseModalities"],M);const O=v(e,["mediaResolution"]);O!=null&&g(r,["mediaResolution"],O);const D=v(e,["speechConfig"]);if(D!=null&&g(r,["speechConfig"],Z5(t,ck(t,D))),v(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const K=v(e,["thinkingConfig"]);return K!=null&&g(r,["thinkingConfig"],q5(t,K)),r}function Z0(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","model"],Gt(t,r));const i=v(e,["contents"]);i!=null&&(Array.isArray(i)?g(n,["contents"],_t(t,_t(t,i).map(a=>Ju(t,a)))):g(n,["contents"],_t(t,i)));const s=v(e,["config"]);return s!=null&&g(n,["generationConfig"],G5(t,s,n)),n}function K5(t,e,n){const r={},i=v(e,["taskType"]);n!==void 0&&i!=null&&g(n,["requests[]","taskType"],i);const s=v(e,["title"]);n!==void 0&&s!=null&&g(n,["requests[]","title"],s);const a=v(e,["outputDimensionality"]);if(n!==void 0&&a!=null&&g(n,["requests[]","outputDimensionality"],a),v(e,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(v(e,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return r}function Y5(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","model"],Gt(t,r));const i=v(e,["contents"]);i!=null&&g(n,["requests[]","content"],lk(t,i));const s=v(e,["config"]);s!=null&&g(n,["config"],K5(t,s,n));const a=v(e,["model"]);return a!==void 0&&g(n,["requests[]","model"],Gt(t,a)),n}function J5(t,e,n){const r={};if(v(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(v(e,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const i=v(e,["numberOfImages"]);
353n!==void 0&&i!=null&&g(n,["parameters","sampleCount"],i);const s=v(e,["aspectRatio"]);n!==void 0&&s!=null&&g(n,["parameters","aspectRatio"],s);const a=v(e,["guidanceScale"]);if(n!==void 0&&a!=null&&g(n,["parameters","guidanceScale"],a),v(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const l=v(e,["safetyFilterLevel"]);n!==void 0&&l!=null&&g(n,["parameters","safetySetting"],l);const c=v(e,["personGeneration"]);n!==void 0&&c!=null&&g(n,["parameters","personGeneration"],c);const f=v(e,["includeSafetyAttributes"]);n!==void 0&&f!=null&&g(n,["parameters","includeSafetyAttributes"],f);const p=v(e,["includeRaiReason"]);n!==void 0&&p!=null&&g(n,["parameters","includeRaiReason"],p);const m=v(e,["language"]);n!==void 0&&m!=null&&g(n,["parameters","language"],m);const _=v(e,["outputMimeType"]);n!==void 0&&_!=null&&g(n,["parameters","outputOptions","mimeType"],_);const x=v(e,["outputCompressionQuality"]);if(n!==void 0&&x!=null&&g(n,["parameters","outputOptions","compressionQuality"],x),v(e,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(v(e,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return r}function Q5(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","model"],Gt(t,r));const i=v(e,["prompt"]);i!=null&&g(n,["instances[0]","prompt"],i);const s=v(e,["config"]);return s!=null&&g(n,["config"],J5(t,s,n)),n}function X5(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","name"],Gt(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],i),n}function eV(t,e){const n={};if(v(e,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(v(e,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(v(e,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return n}function tV(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","model"],Gt(t,r));const i=v(e,["contents"]);i!=null&&(Array.isArray(i)?g(n,["contents"],_t(t,_t(t,i).map(a=>Ju(t,a)))):g(n,["contents"],_t(t,i)));const s=v(e,["config"]);return s!=null&&g(n,["config"],eV(t,s)),n}function nV(t,e){const n={};if(v(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const r=v(e,["imageBytes"]);r!=null&&g(n,["bytesBase64Encoded"],Es(t,r));const i=v(e,["mimeType"]);return i!=null&&g(n,["mimeType"],i),n}function rV(t,e,n){const r={},i=v(e,["numberOfVideos"]);if(n!==void 0&&i!=null&&g(n,["parameters","sampleCount"],i),v(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(v(e,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const s=v(e,["durationSeconds"]);if(n!==void 0&&s!=null&&g(n,["parameters","durationSeconds"],s),v(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const a=v(e,["aspectRatio"]);if(n!==void 0&&a!=null&&g(n,["parameters","aspectRatio"],a),v(e,["resolution"])!==void 0)throw new Error("resolution parameter is not supported in Gemini API.");const l=v(e,["personGeneration"]);if(n!==void 0&&l!=null&&g(n,["parameters","personGeneration"],l),v(e,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const c=v(e,["negativePrompt"]);if(n!==void 0&&c!=null&&g(n,["parameters","negativePrompt"],c),v(e,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return r}function iV(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","model"],Gt(t,r));const i=v(e,["prompt"]);i!=null&&g(n,["instances[0]","prompt"],i);const s=v(e,["image"]);s!=null&&g(n,["instances[0]","image"],nV(t,s));const a=v(e,["config"]);return a!=null&&g(n,["config"],rV(t,a,n)),n}function sV(t,e){const n={},r=v(e,["videoMetadata"]);r!=null&&g(n,["videoMetadata"],r);const i=v(e,["thought"]);i!=null&&g(n,["thought"],i);const s=v(e,["codeExecutionResult"]);s!=null&&g(n,["codeExecutionResult"],s);const a=v(e,["executableCode"]);a!=null&&g(n,["executableCode"],a);const l=v(e,["fileData"]);l!=null&&g(n,["fileData"],l);const c=v(e,["functionCall"]);c!=null&&g(n,["functionCall"],c);const f=v(e,["functionResponse"]);f!=null&&g(n,["functionResponse"],f);const p=v(e,["inlineData"]);p!=null&&g(n,["inlineData"],p);const m=v(e,["text"]);return m!=null&&g(n,["text"],m),n}function po(t,e){const n={},r=v(e,["parts"]);r!=null&&(Array.isArray(r)?g(n,["parts"],r.map(s=>sV(t,s))):g(n,["parts"],r));const i=v(e,["role"]);return i!=null&&g(n,["role"],i),n}function vk(t,e){const n={},r=v(e,["example"]);r!=null&&g(n,["example"],r);const i=v(e,["pattern"]);i!=null&&g(n,["pattern"],i);const s=v(e,["default"]);s!=null&&g(n,["default"],s);const a=v(e,["maxLength"]);a!=null&&g(n,["maxLength"],a);const l=v(e,["minLength"]);l!=null&&g(n,["minLength"],l);const c=v(e,["minProperties"]);c!=null&&g(n,["minProperties"],c);const f=v(e,["maxProperties"]);f!=null&&g(n,["maxProperties"],f);const p=v(e,["anyOf"]);p!=null&&g(n,["anyOf"],p);const m=v(e,["description"]);m!=null&&g(n,["description"],m);const _=v(e,["enum"]);_!=null&&g(n,["enum"],_);const x=v(e,["format"]);x!=null&&g(n,["format"],x);const P=v(e,["items"]);P!=null&&g(n,["items"],P);const b=v(e,["maxItems"]);b!=null&&g(n,["maxItems"],b);const k=v(e,["maximum"]);k!=null&&g(n,["maximum"],k);const E=v(e,["minItems"]);E!=null&&g(n,["minItems"],E);const T=v(e,["minimum"]);T!=null&&g(n,["minimum"],T);const S=v(e,["nullable"]);S!=null&&g(n,["nullable"],S);const R=v(e,["properties"]);R!=null&&g(n,["properties"],R);const I=v(e,["propertyOrdering"]);I!=null&&g(n,["propertyOrdering"],I);const M=v(e,["required"]);M!=null&&g(n,["required"],M);const O=v(e,["title"]);O!=null&&g(n,["title"],O);const D=v(e,["type"]);return D!=null&&g(n,["type"],D),n}function oV(t,e){const n={},r=v(e,["method"]);r!=null&&g(n,["method"],r);const i=v(e,["category"]);i!=null&&g(n,["category"],i);const s=v(e,["threshold"]);return s!=null&&g(n,["threshold"],s),n}function aV(t,e){const n={},r=v(e,["response"]);r!=null&&g(n,["response"],vk(t,r));const i=v(e,["description"]);i!=null&&g(n,["description"],i);const s=v(e,["name"]);s!=null&&g(n,["name"],s);const a=v(e,["parameters"]);return a!=null&&g(n,["parameters"],a),n}function lV(){return{}}function uV(t,e){const n={},r=v(e,["mode"]);r!=null&&g(n,["mode"],r);const i=v(e,["dynamicThreshold"]);return i!=null&&g(n,["dynamicThreshold"],i),n}function cV(t,e){const n={},r=v(e,["dynamicRetrievalConfig"]);return r!=null&&g(n,["dynamicRetrievalConfig"],uV(t,r)),n}function Dy(t,e){const n={},r=v(e,["functionDeclarations"]);r!=null&&(Array.isArray(r)?g(n,["functionDeclarations"],r.map(c=>aV(t,c))):g(n,["functionDeclarations"],r));const i=v(e,["retrieval"]);i!=null&&g(n,["retrieval"],i),v(e,["googleSearch"])!=null&&g(n,["googleSearch"],lV());const a=v(e,["googleSearchRetrieval"]);a!=null&&g(n,["googleSearchRetrieval"],cV(t,a));const l=v(e,["codeExecution"]);return l!=null&&g(n,["codeExecution"],l),n}function dV(t,e){const n={},r=v(e,["mode"]);r!=null&&g(n,["mode"],r);const i=v(e,["allowedFunctionNames"]);return i!=null&&g(n,["allowedFunctionNames"],i),n}function fV(t,e){const n={},r=v(e,["functionCallingConfig"]);return r!=null&&g(n,["functionCallingConfig"],dV(t,r)),n}function hV(t,e){const n={},r=v(e,["voiceName"]);return r!=null&&g(n,["voiceName"],r),n}function pV(t,e){const n={},r=v(e,["prebuiltVoiceConfig"]);return r!=null&&g(n,["prebuiltVoiceConfig"],hV(t,r)),n}function mV(t,e){const n={},r=v(e,["voiceConfig"]);return r!=null&&g(n,["voiceConfig"],pV(t,r)),n}function gV(t,e){const n={},r=v(e,["includeThoughts"]);r!=null&&g(n,["includeThoughts"],r);const i=v(e,["thinkingBudget"]);return i!=null&&g(n,["thinkingBudget"],i),n}function vV(t,e,n){const r={},i=v(e,["systemInstruction"]);n!==void 0&&i!=null&&g(n,["systemInstruction"],po(t,Hn(t,i)));const s=v(e,["temperature"]);s!=null&&g(r,["temperature"],s);const a=v(e,["topP"]);a!=null&&g(r,["topP"],a);const l=v(e,["topK"]);l!=null&&g(r,["topK"],l);const c=v(e,["candidateCount"]);c!=null&&g(r,["candidateCount"],c);const f=v(e,["maxOutputTokens"]);f!=null&&g(r,["maxOutputTokens"],f);const p=v(e,["stopSequences"]);p!=null&&g(r,["stopSequences"],p);const m=v(e,["responseLogprobs"]);m!=null&&g(r,["responseLogprobs"],m);const _=v(e,["logprobs"]);_!=null&&g(r,["logprobs"],_);const x=v(e,["presencePenalty"]);x!=null&&g(r,["presencePenalty"],x);const P=v(e,["frequencyPenalty"]);P!=null&&g(r,["frequencyPenalty"],P);const b=v(e,["seed"]);b!=null&&g(r,["seed"],b);const k=v(e,["responseMimeType"]);k!=null&&g(r,["responseMimeType"],k);const E=v(e,["responseSchema"]);E!=null&&g(r,["responseSchema"],vk(t,uk(t,E)));const T=v(e,["routingConfig"]);T!=null&&g(r,["routingConfig"],T);const S=v(e,["safetySettings"]);n!==void 0&&S!=null&&(Array.isArray(S)?g(n,["safetySettings"],S.map($=>oV(t,$))):g(n,["safetySettings"],S));const R=v(e,["tools"]);n!==void 0&&R!=null&&(Array.isArray(R)?g(n,["tools"],ca(t,ca(t,R).map($=>Dy(t,dk(t,$))))):g(n,["tools"],ca(t,R)));const I=v(e,["toolConfig"]);n!==void 0&&I!=null&&g(n,["toolConfig"],fV(t,I));const M=v(e,["labels"]);n!==void 0&&M!=null&&g(n,["labels"],M);const O=v(e,["cachedContent"]);n!==void 0&&O!=null&&g(n,["cachedContent"],Ts(t,O));const D=v(e,["responseModalities"]);D!=null&&g(r,["responseModalities"],D);const K=v(e,["mediaResolution"]);K!=null&&g(r,["mediaResolution"],K);const q=v(e,["speechConfig"]);q!=null&&g(r,["speechConfig"],mV(t,ck(t,q)));const ne=v(e,["audioTimestamp"]);ne!=null&&g(r,["audioTimestamp"],ne);const W=v(e,["thinkingConfig"]);return W!=null&&g(r,["thinkingConfig"],gV(t,W)),r}function q0(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","model"],Gt(t,r));const i=v(e,["contents"]);i!=null&&(Array.isArray(i)?g(n,["contents"],_t(t,_t(t,i).map(a=>po(t,a)))):g(n,["contents"],_t(t,i)));const s=v(e,["config"]);return s!=null&&g(n,["generationConfig"],vV(t,s,n)),n}function yV(t,e,n){const r={},i=v(e,["taskType"]);n!==void 0&&i!=null&&g(n,["instances[]","task_type"],i);const s=v(e,["title"]);n!==void 0&&s!=null&&g(n,["instances[]","title"],s);const a=v(e,["outputDimensionality"]);n!==void 0&&a!=null&&g(n,["parameters","outputDimensionality"],a);const l=v(e,["mimeType"]);n!==void 0&&l!=null&&g(n,["instances[]","mimeType"],l);const c=v(e,["autoTruncate"]);return n!==void 0&&c!=null&&g(n,["parameters","autoTruncate"],c),r}function _V(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","model"],Gt(t,r));const i=v(e,["contents"]);i!=null&&g(n,["instances[]","content"],lk(t,i));const s=v(e,["config"]);return s!=null&&g(n,["config"],yV(t,s,n)),n}function xV(t,e,n){const r={},i=v(e,["outputGcsUri"]);n!==void 0&&i!=null&&g(n,["parameters","storageUri"],i);const s=v(e,["negativePrompt"]);n!==void 0&&s!=null&&g(n,["parameters","negativePrompt"],s);const a=v(e,["numberOfImages"]);
353n!==void 0&&a!=null&&g(n,["parameters","sampleCount"],a);const l=v(e,["aspectRatio"]);n!==void 0&&l!=null&&g(n,["parameters","aspectRatio"],l);const c=v(e,["guidanceScale"]);n!==void 0&&c!=null&&g(n,["parameters","guidanceScale"],c);const f=v(e,["seed"]);n!==void 0&&f!=null&&g(n,["parameters","seed"],f);const p=v(e,["safetyFilterLevel"]);n!==void 0&&p!=null&&g(n,["parameters","safetySetting"],p);const m=v(e,["personGeneration"]);n!==void 0&&m!=null&&g(n,["parameters","personGeneration"],m);const _=v(e,["includeSafetyAttributes"]);n!==void 0&&_!=null&&g(n,["parameters","includeSafetyAttributes"],_);const x=v(e,["includeRaiReason"]);n!==void 0&&x!=null&&g(n,["parameters","includeRaiReason"],x);const P=v(e,["language"]);n!==void 0&&P!=null&&g(n,["parameters","language"],P);const b=v(e,["outputMimeType"]);n!==void 0&&b!=null&&g(n,["parameters","outputOptions","mimeType"],b);const k=v(e,["outputCompressionQuality"]);n!==void 0&&k!=null&&g(n,["parameters","outputOptions","compressionQuality"],k);const E=v(e,["addWatermark"]);n!==void 0&&E!=null&&g(n,["parameters","addWatermark"],E);const T=v(e,["enhancePrompt"]);return n!==void 0&&T!=null&&g(n,["parameters","enhancePrompt"],T),r}function wV(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","model"],Gt(t,r));const i=v(e,["prompt"]);i!=null&&g(n,["instances[0]","prompt"],i);const s=v(e,["config"]);return s!=null&&g(n,["config"],xV(t,s,n)),n}function bV(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","name"],Gt(t,r));const i=v(e,["config"]);return i!=null&&g(n,["config"],i),n}function CV(t,e,n){const r={},i=v(e,["systemInstruction"]);n!==void 0&&i!=null&&g(n,["systemInstruction"],po(t,Hn(t,i)));const s=v(e,["tools"]);n!==void 0&&s!=null&&(Array.isArray(s)?g(n,["tools"],s.map(l=>Dy(t,l))):g(n,["tools"],s));const a=v(e,["generationConfig"]);return n!==void 0&&a!=null&&g(n,["generationConfig"],a),r}function SV(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","model"],Gt(t,r));const i=v(e,["contents"]);i!=null&&(Array.isArray(i)?g(n,["contents"],_t(t,_t(t,i).map(a=>po(t,a)))):g(n,["contents"],_t(t,i)));const s=v(e,["config"]);return s!=null&&g(n,["config"],CV(t,s,n)),n}function TV(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","model"],Gt(t,r));const i=v(e,["contents"]);i!=null&&(Array.isArray(i)?g(n,["contents"],_t(t,_t(t,i).map(a=>po(t,a)))):g(n,["contents"],_t(t,i)));const s=v(e,["config"]);return s!=null&&g(n,["config"],s),n}function EV(t,e){const n={},r=v(e,["gcsUri"]);r!=null&&g(n,["gcsUri"],r);const i=v(e,["imageBytes"]);i!=null&&g(n,["bytesBase64Encoded"],Es(t,i));const s=v(e,["mimeType"]);return s!=null&&g(n,["mimeType"],s),n}function PV(t,e,n){const r={},i=v(e,["numberOfVideos"]);n!==void 0&&i!=null&&g(n,["parameters","sampleCount"],i);const s=v(e,["outputGcsUri"]);n!==void 0&&s!=null&&g(n,["parameters","storageUri"],s);const a=v(e,["fps"]);n!==void 0&&a!=null&&g(n,["parameters","fps"],a);const l=v(e,["durationSeconds"]);n!==void 0&&l!=null&&g(n,["parameters","durationSeconds"],l);const c=v(e,["seed"]);n!==void 0&&c!=null&&g(n,["parameters","seed"],c);const f=v(e,["aspectRatio"]);n!==void 0&&f!=null&&g(n,["parameters","aspectRatio"],f);const p=v(e,["resolution"]);n!==void 0&&p!=null&&g(n,["parameters","resolution"],p);const m=v(e,["personGeneration"]);n!==void 0&&m!=null&&g(n,["parameters","personGeneration"],m);const _=v(e,["pubsubTopic"]);n!==void 0&&_!=null&&g(n,["parameters","pubsubTopic"],_);const x=v(e,["negativePrompt"]);n!==void 0&&x!=null&&g(n,["parameters","negativePrompt"],x);const P=v(e,["enhancePrompt"]);return n!==void 0&&P!=null&&g(n,["parameters","enhancePrompt"],P),r}function kV(t,e){const n={},r=v(e,["model"]);r!=null&&g(n,["_url","model"],Gt(t,r));const i=v(e,["prompt"]);i!=null&&g(n,["instances[0]","prompt"],i);const s=v(e,["image"]);s!=null&&g(n,["instances[0]","image"],EV(t,s));const a=v(e,["config"]);return a!=null&&g(n,["config"],PV(t,a,n)),n}function NV(t,e){const n={},r=v(e,["thought"]);r!=null&&g(n,["thought"],r);const i=v(e,["codeExecutionResult"]);i!=null&&g(n,["codeExecutionResult"],i);const s=v(e,["executableCode"]);s!=null&&g(n,["executableCode"],s);const a=v(e,["fileData"]);a!=null&&g(n,["fileData"],a);const l=v(e,["functionCall"]);l!=null&&g(n,["functionCall"],l);const c=v(e,["functionResponse"]);c!=null&&g(n,["functionResponse"],c);const f=v(e,["inlineData"]);f!=null&&g(n,["inlineData"],f);const p=v(e,["text"]);return p!=null&&g(n,["text"],p),n}function yk(t,e){const n={},r=v(e,["parts"]);r!=null&&(Array.isArray(r)?g(n,["parts"],r.map(s=>NV(t,s))):g(n,["parts"],r));const i=v(e,["role"]);return i!=null&&g(n,["role"],i),n}function RV(t,e){const n={},r=v(e,["citationSources"]);return r!=null&&g(n,["citations"],r),n}function IV(t,e){const n={},r=v(e,["content"]);r!=null&&g(n,["content"],yk(t,r));const i=v(e,["citationMetadata"]);i!=null&&g(n,["citationMetadata"],RV(t,i));const s=v(e,["tokenCount"]);s!=null&&g(n,["tokenCount"],s);const a=v(e,["finishReason"]);a!=null&&g(n,["finishReason"],a);const l=v(e,["avgLogprobs"]);l!=null&&g(n,["avgLogprobs"],l);const c=v(e,["groundingMetadata"]);c!=null&&g(n,["groundingMetadata"],c);const f=v(e,["index"]);f!=null&&g(n,["index"],f);const p=v(e,["logprobsResult"]);p!=null&&g(n,["logprobsResult"],p);const m=v(e,["safetyRatings"]);return m!=null&&g(n,["safetyRatings"],m),n}function G0(t,e){const n={},r=v(e,["candidates"]);r!=null&&(Array.isArray(r)?g(n,["candidates"],r.map(l=>IV(t,l))):g(n,["candidates"],r));const i=v(e,["modelVersion"]);i!=null&&g(n,["modelVersion"],i);const s=v(e,["promptFeedback"]);s!=null&&g(n,["promptFeedback"],s);const a=v(e,["usageMetadata"]);return a!=null&&g(n,["usageMetadata"],a),n}function AV(t,e){const n={},r=v(e,["values"]);return r!=null&&g(n,["values"],r),n}function MV(){return{}}function LV(t,e){const n={},r=v(e,["embeddings"]);return r!=null&&(Array.isArray(r)?g(n,["embeddings"],r.map(s=>AV(t,s))):g(n,["embeddings"],r)),v(e,["metadata"])!=null&&g(n,["metadata"],MV()),n}function OV(t,e){const n={}
353,r=v(e,["bytesBase64Encoded"]);r!=null&&g(n,["imageBytes"],Es(t,r));const i=v(e,["mimeType"]);return i!=null&&g(n,["mimeType"],i),n}function _k(t,e){const n={},r=v(e,["safetyAttributes","categories"]);r!=null&&g(n,["categories"],r);const i=v(e,["safetyAttributes","scores"]);i!=null&&g(n,["scores"],i);const s=v(e,["contentType"]);return s!=null&&g(n,["contentType"],s),n}function jV(t,e){const n={},r=v(e,["_self"]);r!=null&&g(n,["image"],OV(t,r));const i=v(e,["raiFilteredReason"]);i!=null&&g(n,["raiFilteredReason"],i);const s=v(e,["_self"]);return s!=null&&g(n,["safetyAttributes"],_k(t,s)),n}function DV(t,e){const n={},r=v(e,["predictions"]);r!=null&&(Array.isArray(r)?g(n,["generatedImages"],r.map(s=>jV(t,s))):g(n,["generatedImages"],r));const i=v(e,["positivePromptSafetyAttributes"]);return i!=null&&g(n,["positivePromptSafetyAttributes"],_k(t,i)),n}function FV(t,e){const n={},r=v(e,["baseModel"]);r!=null&&g(n,["baseModel"],r);const i=v(e,["createTime"]);i!=null&&g(n,["createTime"],i);const s=v(e,["updateTime"]);return s!=null&&g(n,["updateTime"],s),n}function $V(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["name"],r);const i=v(e,["displayName"]);i!=null&&g(n,["displayName"],i);const s=v(e,["description"]);s!=null&&g(n,["description"],s);const a=v(e,["version"]);a!=null&&g(n,["version"],a);const l=v(e,["_self"]);l!=null&&g(n,["tunedModelInfo"],FV(t,l));const c=v(e,["inputTokenLimit"]);c!=null&&g(n,["inputTokenLimit"],c);const f=v(e,["outputTokenLimit"]);f!=null&&g(n,["outputTokenLimit"],f);const p=v(e,["supportedGenerationMethods"]);return p!=null&&g(n,["supportedActions"],p),n}function zV(t,e){const n={},r=v(e,["totalTokens"]);r!=null&&g(n,["totalTokens"],r);const i=v(e,["cachedContentTokenCount"]);return i!=null&&g(n,["cachedContentTokenCount"],i),n}function BV(t,e){const n={},r=v(e,["video","uri"]);r!=null&&g(n,["uri"],r);const i=v(e,["video","encodedVideo"]);i!=null&&g(n,["videoBytes"],Es(t,i));const s=v(e,["encoding"]);return s!=null&&g(n,["mimeType"],s),n}function UV(t,e){const n={},r=v(e,["_self"]);return r!=null&&g(n,["video"],BV(t,r)),n}function K0(t,e){const n={},r=v(e,["generatedSamples"]);r!=null&&(Array.isArray(r)?g(n,["generatedVideos"],r.map(a=>UV(t,a))):g(n,["generatedVideos"],r));const i=v(e,["raiMediaFilteredCount"]);i!=null&&g(n,["raiMediaFilteredCount"],i);const s=v(e,["raiMediaFilteredReasons"]);return s!=null&&g(n,["raiMediaFilteredReasons"],s),n}function VV(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["name"],r);const i=v(e,["metadata"]);i!=null&&g(n,["metadata"],i);const s=v(e,["done"]);s!=null&&g(n,["done"],s);const a=v(e,["error"]);a!=null&&g(n,["error"],a);const l=v(e,["response","generateVideoResponse"]);l!=null&&g(n,["response"],K0(t,l));const c=v(e,["response","generateVideoResponse"]);return c!=null&&g(n,["result"],K0(t,c)),n}function HV(t,e){const n={},r=v(e,["videoMetadata"]);r!=null&&g(n,["videoMetadata"],r);const i=v(e,["thought"]);i!=null&&g(n,["thought"],i);const s=v(e,["codeExecutionResult"]);s!=null&&g(n,["codeExecutionResult"],s);const a=v(e,["executableCode"]);a!=null&&g(n,["executableCode"],a);const l=v(e,["fileData"]);l!=null&&g(n,["fileData"],l);const c=v(e,["functionCall"]);c!=null&&g(n,["functionCall"],c);const f=v(e,["functionResponse"]);f!=null&&g(n,["functionResponse"],f);const p=v(e,["inlineData"]);p!=null&&g(n,["inlineData"],p);const m=v(e,["text"]);return m!=null&&g(n,["text"],m),n}function xk(t,e){const n={},r=v(e,["parts"]);r!=null&&(Array.isArray(r)?g(n,["parts"],r.map(s=>HV(t,s))):g(n,["parts"],r));const i=v(e,["role"]);return i!=null&&g(n,["role"],i),n}function WV(t,e){const n={},r=v(e,["citations"]);return r!=null&&g(n,["citations"],r),n}function ZV(t,e){const n={},r=v(e,["content"]);r!=null&&g(n,["content"],xk(t,r));const i=v(e,["citationMetadata"]);i!=null&&g(n,["citationMetadata"],WV(t,i));const s=v(e,["finishMessage"]);s!=null&&g(n,["finishMessage"],s);const a=v(e,["finishReason"]);a!=null&&g(n,["finishReason"],a);const l=v(e,["avgLogprobs"]);l!=null&&g(n,["avgLogprobs"],l);const c=v(e,["groundingMetadata"]);c!=null&&g(n,["groundingMetadata"],c);const f=v(e,["index"]);f!=null&&g(n,["index"],f);const p=v(e,["logprobsResult"]);p!=null&&g(n,["logprobsResult"],p);const m=v(e,["safetyRatings"]);return m!=null&&g(n,["safetyRatings"],m),n}function Y0(t,e){const n={},r=v(e,["candidates"]);r!=null&&(Array.isArray(r)?g(n,["candidates"],r.map(f=>ZV(t,f))):g(n,["candidates"],r));const i=v(e,["createTime"]);i!=null&&g(n,["createTime"],i);const s=v(e,["responseId"]);s!=null&&g(n,["responseId"],s);const a=v(e,["modelVersion"]);a!=null&&g(n,["modelVersion"],a);const l=v(e,["promptFeedback"]);l!=null&&g(n,["promptFeedback"],l);const c=v(e,["usageMetadata"]);return c!=null&&g(n,["usageMetadata"],c),n}function qV(t,e){const n={},r=v(e,["truncated"]);r!=null&&g(n,["truncated"],r);const i=v(e,["token_count"]);return i!=null&&g(n,["tokenCount"],i),n}function GV(t,e){const n={},r=v(e,["values"]);r!=null&&g(n,["values"],r);const i=v(e,["statistics"]);return i!=null&&g(n,["statistics"],qV(t,i)),n}function KV(t,e){const n={},r=v(e,["billableCharacterCount"]);return r!=null&&g(n,["billableCharacterCount"],r),n}function YV(t,e){const n={},r=v(e,["predictions[]","embeddings"]);r!=null&&(Array.isArray(r)?g(n,["embeddings"],r.map(s=>
353GV(t,s))):g(n,["embeddings"],r));const i=v(e,["metadata"]);return i!=null&&g(n,["metadata"],KV(t,i)),n}function JV(t,e){const n={},r=v(e,["gcsUri"]);r!=null&&g(n,["gcsUri"],r);const i=v(e,["bytesBase64Encoded"]);i!=null&&g(n,["imageBytes"],Es(t,i));const s=v(e,["mimeType"]);return s!=null&&g(n,["mimeType"],s),n}function wk(t,e){const n={},r=v(e,["safetyAttributes","categories"]);r!=null&&g(n,["categories"],r);const i=v(e,["safetyAttributes","scores"]);i!=null&&g(n,["scores"],i);const s=v(e,["contentType"]);return s!=null&&g(n,["contentType"],s),n}function QV(t,e){const n={},r=v(e,["_self"]);r!=null&&g(n,["image"],JV(t,r));const i=v(e,["raiFilteredReason"]);i!=null&&g(n,["raiFilteredReason"],i);const s=v(e,["_self"]);s!=null&&g(n,["safetyAttributes"],wk(t,s));const a=v(e,["prompt"]);return a!=null&&g(n,["enhancedPrompt"],a),n}function XV(t,e){const n={},r=v(e,["predictions"]);r!=null&&(Array.isArray(r)?g(n,["generatedImages"],r.map(s=>QV(t,s))):g(n,["generatedImages"],r));const i=v(e,["positivePromptSafetyAttributes"]);return i!=null&&g(n,["positivePromptSafetyAttributes"],wk(t,i)),n}function eH(t,e){const n={},r=v(e,["endpoint"]);r!=null&&g(n,["name"],r);const i=v(e,["deployedModelId"]);return i!=null&&g(n,["deployedModelId"],i),n}function tH(t,e){const n={},r=v(e,["labels","google-vertex-llm-tuning-base-model-id"]);r!=null&&g(n,["baseModel"],r);const i=v(e,["createTime"]);i!=null&&g(n,["createTime"],i);const s=v(e,["updateTime"]);return s!=null&&g(n,["updateTime"],s),n}function nH(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["name"],r);const i=v(e,["displayName"]);i!=null&&g(n,["displayName"],i);const s=v(e,["description"]);s!=null&&g(n,["description"],s);const a=v(e,["versionId"]);a!=null&&g(n,["version"],a);const l=v(e,["deployedModels"]);l!=null&&(Array.isArray(l)?g(n,["endpoints"],l.map(p=>eH(t,p))):g(n,["endpoints"],l));const c=v(e,["labels"]);c!=null&&g(n,["labels"],c);const f=v(e,["_self"]);return f!=null&&g(n,["tunedModelInfo"],tH(t,f)),n}function rH(t,e){const n={},r=v(e,["totalTokens"]);return r!=null&&g(n,["totalTokens"],r),n}function iH(t,e){const n={},r=v(e,["tokensInfo"]);return r!=null&&g(n,["tokensInfo"],r),n}function sH(t,e){const n={},r=v(e,["gcsUri"]);r!=null&&g(n,["uri"],r);const i=v(e,["bytesBase64Encoded"]);i!=null&&g(n,["videoBytes"],Es(t,i));const s=v(e,["mimeType"]);return s!=null&&g(n,["mimeType"],s),n}function oH(t,e){const n={},r=v(e,["_self"]);return r!=null&&g(n,["video"],sH(t,r)),n}function J0(t,e){const n={},r=v(e,["videos"]);r!=null&&(Array.isArray(r)?g(n,["generatedVideos"],r.map(a=>oH(t,a))):g(n,["generatedVideos"],r));const i=v(e,["raiMediaFilteredCount"]);i!=null&&g(n,["raiMediaFilteredCount"],i);const s=v(e,["raiMediaFilteredReasons"]);return s!=null&&g(n,["raiMediaFilteredReasons"],s),n}function aH(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["name"],r);const i=v(e,["metadata"]);i!=null&&g(n,["metadata"],i);const s=v(e,["done"]);s!=null&&g(n,["done"],s);const a=v(e,["error"]);a!=null&&g(n,["error"],a);const l=v(e,["response"]);l!=null&&g(n,["response"],J0(t,l));const c=v(e,["response"]);return c!=null&&g(n,["result"],J0(t,c)),n}/** 354 * @license 355 * Copyright 2025 Google LLC 356 * SPDX-License-Identifier: Apache-2.0 357 */function lH(t,e){const n={},r=v(e,["config"]);r!=null&&g(n,["setup"],xH(t,r));const i=v(e,["model"]);return i!==void 0&&g(n,["setup","model"],i),n}function uH(t,e){const n={},r=v(e,["config"]);r!=null&&g(n,["setup"],wH(t,r));const i=v(e,["model"]);return i!==void 0&&g(n,["setup","model"],i),n}function cH(t,e){const n={},r=v(e,["setupComplete"]);r!==void 0&&g(n,["setupComplete"],r);const i=v(e,["serverContent"]);i!=null&&g(n,["serverContent"],bH(t,i));const s=v(e,["toolCall"]);s!=null&&g(n,["toolCall"],EH(t,s));const a=v(e,["toolCallCancellation"]);a!=null&&g(n,["toolCallCancellation"],kH(t,a));const l=v(e,["usageMetadata"]);l!=null&&l!=null&&g(n,["usageMetadata"],jH(t,l));const c=v(e,["goAway"]);c!=null&&g(n,["goAway"],RH(c));const f=v(e,["sessionResumptionUpdate"]);return f!=null&&g(n,["sessionResumptionUpdate"],AH(f)),n}function dH(t,e){const n={},r=v(e,["setupComplete"]);r!==void 0&&g(n,["setupComplete"],r);const i=v(e,["serverContent"]);i!=null&&g(n,["serverContent"],CH(t,i));const s=v(e,["toolCall"]);s!=null&&g(n,["toolCall"],PH(t,s));const a=v(e,["toolCallCancellation"]);a!=null&&g(n,["toolCallCancellation"],NH(t,a));const l=v(e,["goAway"]);l!=null&&g(n,["goAway"],IH(l));const c=v(e,["sessionResumptionUpdate"]);c!=null&&g(n,["sessionResumptionUpdate"],MH(c));const f=v(e,["usageMetadata"]);return f!=null&&f!=null&&g(n,["usageMetadata"],DH(t,f)),n}function fH(t){const e={},n=v(t,["targetTokens"]);return n!=null&&g(e,["targetTokens"],n),e}function hH(t){const e={},n=v(t,["targetTokens"]);return n!=null&&g(e,["targetTokens"],n),e}function pH(t){const e={},n=v(t,["triggerTokens"]);n!=null&&g(e,["triggerTokens"],n);const r=v(t,["slidingWindow"]);return r!=null&&g(e,["slidingWindow"],fH(r)),e}function mH(t){const e={},n=v(t,["triggerTokens"]);n!=null&&g(e,["triggerTokens"],n);const r=v(t,["slidingWindow"]);return r!=null&&g(e,["slidingWindow"],hH(r)),e}function gH(t){const e={},n=v(t,["disabled"]);n!=null&&g(e,["disabled"],n);const r=v(t,["startOfSpeechSensitivity"]);r!=null&&g(e,["startOfSpeechSensitivity"],r);const i=v(t,["endOfSpeechSensitivity"]);i!=null&&g(e,["endOfSpeechSensitivity"],i);const s=v(t,["prefixPaddingMs"]);s!=null&&g(e,["prefixPaddingMs"],s);const a=v(t,["silenceDurationMs"]);return a!=null&&g(e,["silenceDurationMs"],a),e}function vH(t){const e={},n=v(t,["disabled"]);n!=null&&g(e,["disabled"],n);const r=v(t,["startOfSpeechSensitivity"]);r!=null&&g(e,["startOfSpeechSensitivity"],r);const i=v(t,["endOfSpeechSensitivity"]);i!=null&&g(e,["endOfSpeechSensitivity"],i);const s=v(t,["prefixPaddingMs"]);s!=null&&g(e,["prefixPaddingMs"],s);const a=v(t,["silenceDurationMs"]);return a!=null&&g(e,["silenceDurationMs"],a),e}function yH(t){const e={},n=v(t,["automaticActivityDetection"]);n!=null&&g(e,["automaticActivityDetection"],gH(n));const r=v(t,["activityHandling"]);r!=null&&g(e,["activityHandling"],r);const i=v(t,["turnCoverage"]);return i!=null&&g(e,["turnCoverage"],i),e}function _H(t){const e={},n=v(t,["automaticActivityDetection"]);n!=null&&g(e,["automaticActivityDetection"],vH(n));const r=v(t,["activityHandling"]);r!=null&&g(e,["activityHandling"],r);const i=v(t,["turnCoverage"]);return i!=null&&g(e,["turnCoverage"],i),e}function xH(t,e){const n={},r=v(e,["generationConfig"]);r!==void 0&&g(n,["generationConfig"],r);const i=v(e,["responseModalities"]);i!==void 0&&g(n,["generationConfig","responseModalities"],i);const s=v(e,["speechConfig"]);s!==void 0&&g(n,["generationConfig","speechConfig"],s);const a=v(e,["systemInstruction"]);a!=null&&g(n,["systemInstruction"],Ju(t,a));const l=v(e,["tools"]);l!=null&&Array.isArray(l)&&g(n,["tools"],l.map(m=>gk(t,m)));const c=v(e,["sessionResumption"]);c!=null&&g(n,["sessionResumption"],LH(c));const f=v(e,["contextWindowCompression"]);
357f!=null&&g(n,["contextWindowCompression"],pH(f));const p=v(e,["realtimeInputConfig"]);return p!=null&&g(n,["realtimeInputConfig"],yH(p)),n}function wH(t,e){const n={},r=v(e,["generationConfig"]);r!==void 0&&g(n,["generationConfig"],r);const i=v(e,["responseModalities"]);i!==void 0?g(n,["generationConfig","responseModalities"],i):g(n,["generationConfig","responseModalities"],["AUDIO"]);const s=v(e,["speechConfig"]);s!==void 0&&g(n,["generationConfig","speechConfig"],s);const a=v(e,["systemInstruction"]);a!=null&&g(n,["systemInstruction"],po(t,a));const l=v(e,["tools"]);l!=null&&Array.isArray(l)&&g(n,["tools"],l.map(m=>Dy(t,m)));const c=v(e,["sessionResumption"]);c!=null&&g(n,["sessionResumption"],OH(c));const f=v(e,["contextWindowCompression"]);f!=null&&g(n,["contextWindowCompression"],mH(f));const p=v(e,["realtimeInputConfig"]);return p!=null&&g(n,["realtimeInputConfig"],_H(p)),n}function bH(t,e){const n={},r=v(e,["modelTurn"]);r!=null&&g(n,["modelTurn"],yk(t,r));const i=v(e,["turnComplete"]);i!==void 0&&g(n,["turnComplete"],i);const s=v(e,["interrupted"]);s!==void 0&&g(n,["interrupted"],s);const a=v(e,["generationComplete"]);return a!=null&&g(n,["generationComplete"],a),n}function CH(t,e){const n={},r=v(e,["modelTurn"]);r!=null&&g(n,["modelTurn"],xk(t,r));const i=v(e,["turnComplete"]);i!==void 0&&g(n,["turnComplete"],i);const s=v(e,["interrupted"]);s!==void 0&&g(n,["interrupted"],s);const a=v(e,["generationComplete"]);return a!=null&&g(n,["generationComplete"],a),n}function SH(t,e){const n={},r=v(e,["id"]);r!==void 0&&g(n,["id"],r);const i=v(e,["args"]);i!==void 0&&g(n,["args"],i);const s=v(e,["name"]);return s!==void 0&&g(n,["name"],s),n}function TH(t,e){const n={},r=v(e,["args"]);r!==void 0&&g(n,["args"],r);const i=v(e,["name"]);return i!==void 0&&g(n,["name"],i),n}function EH(t,e){const n={},r=v(e,["functionCalls"]);return r!=null&&Array.isArray(r)&&g(n,["functionCalls"],r.map(i=>SH(t,i))),n}function PH(t,e){const n={},r=v(e,["functionCalls"]);return r!=null&&Array.isArray(r)&&g(n,["functionCalls"],r.map(i=>TH(t,i))),n}function kH(t,e){const n={},r=v(e,["ids"]);return r!==void 0&&g(n,["ids"],r),n}function NH(t,e){const n={},r=v(e,["ids"]);return r!==void 0&&g(n,["ids"],r),n}function RH(t){const e={},n=v(t,["timeLeft"]);return n!==void 0&&g(e,["timeLeft"],n),e}function IH(t){const e={},n=v(t,["timeLeft"]);return n!==void 0&&g(e,["timeLeft"],n),e}function AH(t){const e={},n=v(t,["newHandle"]);n!==void 0&&g(e,["newHandle"],n);const r=v(t,["resumable"]);r!==void 0&&g(e,["resumable"],r);const i=v(t,["lastConsumedClientMessageIndex"]);return i!==void 0&&g(e,["lastConsumedClientMessageIndex"],i),e}function MH(t){const e={},n=v(t,["newHandle"]);n!==void 0&&g(e,["newHandle"],n);const r=v(t,["resumable"]);r!==void 0&&g(e,["resumable"],r);const i=v(t,["lastConsumedClientMessageIndex"]);return i!==void 0&&g(e,["lastConsumedClientMessageIndex"],i),e}function LH(t){const e={},n=v(t,["handle"]);if(n!==void 0&&g(e,["handle"],n),v(t,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return e}function OH(t){const e={},n=v(t,["handle"]);n!==void 0&&g(e,["handle"],n);const r=v(t,["transparent"]);return r!==void 0&&g(e,["transparent"],r),e}function nd(t,e){const n={},r=v(e,["modality"]);r!=null&&g(n,["modality"],r);const i=v(e,["tokenCount"]);return i!=null&&g(n,["tokenCount"],i),n}function jH(t,e){const n={},r=v(e,["promptTokenCount"]);r!=null&&g(n,["promptTokenCount"],r);const i=v(e,["cachedContentTokenCount"]);i!=null&&g(n,["cachedContentTokenCount"],i);const s=v(e,["responseTokenCount"]);s!=null&&g(n,["responseTokenCount"],s);const a=v(e,["toolUsePromptTokenCount"]);a!=null&&g(n,["toolUsePromptTokenCount"],a);const l=v(e,["thoughtsTokenCount"]);l!=null&&g(n,["thoughtsTokenCount"],l);const c=v(e,["totalTokenCount"]);c!=null&&g(n,["totalTokenCount"],c);const f=v(e,["promptTokensDetails"]);f!=null&&(Array.isArray(f)?g(n,["promptTokensDetails"],f.map(x=>nd(t,x))):g(n,["promptTokensDetails"],f));const p=v(e,["cacheTokensDetails"]);p!=null&&(Array.isArray(p)?g(n,["cacheTokensDetails"],p.map(x=>
357nd(t,x))):g(n,["cacheTokensDetails"],p));const m=v(e,["responseTokensDetails"]);m!=null&&(Array.isArray(m)?g(n,["responseTokensDetails"],m.map(x=>nd(t,x))):g(n,["responseTokensDetails"],m));const _=v(e,["toolUsePromptTokensDetails"]);return _!=null&&(Array.isArray(_)?g(n,["toolUsePromptTokensDetails"],_.map(x=>nd(t,x))):g(n,["toolUsePromptTokensDetails"],_)),n}function rd(t,e){const n={},r=v(e,["modality"]);r!=null&&g(n,["modality"],r);const i=v(e,["tokenCount"]);return i!=null&&g(n,["tokenCount"],i),n}function DH(t,e){const n={},r=v(e,["promptTokenCount"]);r!=null&&g(n,["promptTokenCount"],r);const i=v(e,["cachedContentTokenCount"]);i!=null&&g(n,["cachedContentTokenCount"],i);const s=v(e,["candidatesTokenCount"]);s!=null&&g(n,["responseTokenCount"],s);const a=v(e,["toolUsePromptTokenCount"]);a!=null&&g(n,["toolUsePromptTokenCount"],a);const l=v(e,["thoughtsTokenCount"]);l!=null&&g(n,["thoughtsTokenCount"],l);const c=v(e,["totalTokenCount"]);c!=null&&g(n,["totalTokenCount"],c);const f=v(e,["promptTokensDetails"]);f!=null&&(Array.isArray(f)?g(n,["promptTokensDetails"],f.map(P=>rd(t,P))):g(n,["promptTokensDetails"],f));const p=v(e,["cacheTokensDetails"]);p!=null&&(Array.isArray(p)?g(n,["cacheTokensDetails"],p.map(P=>rd(t,P))):g(n,["cacheTokensDetails"],p));const m=v(e,["toolUsePromptTokensDetails"]);m!=null&&(Array.isArray(m)?g(n,["toolUsePromptTokensDetails"],m.map(P=>rd(t,P))):g(n,["toolUsePromptTokensDetails"],m));
357const _=v(e,["candidatesTokensDetails"]);_!=null&&(Array.isArray(_)?g(n,["responseTokensDetails"],_.map(P=>rd(t,P))):g(n,["responseTokensDetails"],_));const x=v(e,["trafficType"]);return x!=null&&g(n,["trafficType"],x),n}/** 358 * @license 359 * Copyright 2025 Google LLC 360 * SPDX-License-Identifier: Apache-2.0 361 */const FH="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function $H(t,e,n){let r,i;n.data instanceof Blob?i=JSON.parse(await n.data.text()):i=JSON.parse(n.data),t.isVertexAI()?r=dH(t,i):r=cH(t,i),e(r)}class zH{constructor(e,n,r){this.apiClient=e,this.auth=n,this.webSocketFactory=r}async connect(e){var n,r;const i=this.apiClient.getWebsocketBaseUrl(),s=this.apiClient.getApiVersion();let a;const l=HH(this.apiClient.getDefaultHeaders());if(this.apiClient.isVertexAI())a=`${i}/ws/google.cloud.aiplatform.${s}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(l);else{const T=this.apiClient.getApiKey();a=`${i}/ws/google.ai.generativelanguage.${s}.GenerativeService.BidiGenerateContent?key=${T}`}let c=()=>{};const f=new Promise(T=>{c=T}),p=e.callbacks,m=function(){var T;(T=p==null?void 0:p.onopen)===null||T===void 0||T.call(p),c({})},_=this.apiClient,x={onopen:m,onmessage:T=>{$H(_,p.onmessage,T)},onerror:(n=p==null?void 0:p.onerror)!==null&&n!==void 0?n:function(T){},onclose:(r=p==null?void 0:p.onclose)!==null&&r!==void 0?r:function(T){}},P=this.webSocketFactory.create(a,VH(l),x);P.connect(),await f;let b=Gt(this.apiClient,e.model);if(this.apiClient.isVertexAI()&&b.startsWith("publishers/")){const T=this.apiClient.getProject(),S=this.apiClient.getLocation();b=`projects/${T}/locations/${S}/`+b}let k={};const E={model:b,config:e.config,callbacks:e.callbacks};return this.apiClient.isVertexAI()?k=uH(this.apiClient,E):k=lH(this.apiClient,E),P.send(JSON.stringify(k)),new UH(P,this.apiClient)}}const BH={turnComplete:!0};class UH{constructor(e,n){this.conn=e,this.apiClient=n}tLiveClientContent(e,n){if(n.turns!==null&&n.turns!==void 0){let r=[];try{r=_t(e,n.turns),e.isVertexAI()?r=r.map(i=>po(e,i)):r=r.map(i=>Ju(e,i))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof n.turns}'`)}return{clientContent:{turns:r,turnComplete:n.turnComplete}}}return{clientContent:{turnComplete:n.turnComplete}}}tLiveClientRealtimeInput(e,n){let r={};if(!("media"in n)||!n.media)throw new Error(`Failed to convert realtime input "media", type: '${typeof n.media}'`);return r={realtimeInput:{mediaChunks:[n.media],activityStart:n.activityStart,activityEnd:n.activityEnd}},r}tLiveClienttToolResponse(e,n){let r=[];if(n.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(n.functionResponses)?r=n.functionResponses:r=[n.functionResponses],r.length===0)throw new Error("functionResponses is required.");for(const s of r){if(typeof s!="object"||s===null||!("name"in s)||!("response"in s))throw new Error(`Could not parse function response, type '${typeof s}'.`);if(!e.isVertexAI()&&!("id"in s))throw new Error(FH)}return{toolResponse:{functionResponses:r}}}sendClientContent(e){e=Object.assign(Object.assign({},BH),e);const n=this.tLiveClientContent(this.apiClient,e);this.conn.send(JSON.stringify(n))}sendRealtimeInput(e){if(e.media==null)throw new Error("Media is required.");const n=this.tLiveClientRealtimeInput(this.apiClient,e);this.conn.send(JSON.stringify(n))}sendToolResponse(e){if(e.functionResponses==null)throw new Error("Tool response parameters are required.");const n=this.tLiveClienttToolResponse(this.apiClient,e);this.conn.send(JSON.stringify(n))}close(){this.conn.close()}}function VH(t){const e={};return t.forEach((n,r)=>{e[r]=n}),e}function HH(t){const e=new Headers;for(const[n,r]of Object.entries(t))e.append(n,r);return e}/** 362 * @license 363 * Copyright 2025 Google LLC 364 * SPDX-License-Identifier: Apache-2.0 365 */class WH extends Ph{constructor(e){super(),this.apiClient=e,this.generateContent=async n=>await this.generateContentInternal(n),this.generateContentStream=async n=>await this.generateContentStreamInternal(n),this.generateImages=async n=>await this.generateImagesInternal(n).then(r=>{var i;let s;const a=[];if(r!=null&&r.generatedImages)for(const c of r.generatedImages)c&&(c!=null&&c.safetyAttributes)&&((i=c==null?void 0:c.safetyAttributes)===null||i===void 0?void 0:i.contentType)==="Positive Prompt"?s=c==null?void 0:c.safetyAttributes:a.push(c);let l;return s?l={generatedImages:a,positivePromptSafetyAttributes:s}:l={generatedImages:a},l})}async generateContentInternal(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=q0(this.apiClient,e);return s=$e("{model}:generateContent",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(c=>{const f=Y0(this.apiClient,c),p=new td;return Object.assign(p,f),p})}else{const l=Z0(this.apiClient,e);return s=$e("{model}:generateContent",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(c=>{const f=G0(this.apiClient,c),p=new td;return Object.assign(p,f),p})}}async generateContentStreamInternal(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=q0(this.apiClient,e);s=$e("{model}:streamGenerateContent?alt=sse",l._url),a=l._query,delete l.config,delete l._url,delete l._query;const c=this.apiClient;return i=c.requestStream({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}),i.then(function(f){return mf(this,arguments,function*(){var p,m,_,x;try{for(var P=!0,b=Vg(f),k;k=yield vn(b.next()),p=k.done,!p;P=!0){x=k.value,P=!1;const T=Y0(c,x),S=new td;Object.assign(S,T),yield yield vn(S)}}catch(E){m={error:E}}finally{try{!P&&!p&&(_=b.return)&&(yield vn(_.call(b)))}finally{if(m)throw m.error}}})})}else{const l=Z0(this.apiClient,e);s=$e("{model}:streamGenerateContent?alt=sse",l._url),a=l._query,delete l.config,delete l._url,delete l._query;const c=this.apiClient;return i=c.requestStream({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}),i.then(function(f){return mf(this,arguments,function*(){var p,m,_,x;try{for(var P=!0,b=Vg(f),k;k=yield vn(b.next()),p=k.done,!p;P=!0){x=k.value,P=!1;const T=G0(c,x),S=new td;Object.assign(S,T),yield yield vn(S)}}catch(E){m={error:E}}finally{try{!P&&!p&&(_=b.return)&&(yield vn(_.call(b)))}finally{if(m)throw m.error}}})})}}async embedContent(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=_V(this.apiClient,e);return s=$e("{model}:predict",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(c=>{const f=YV(this.apiClient,c),p=new z0;return Object.assign(p,f),p})}else{const l=Y5(this.apiClient,e);return s=$e("{model}:batchEmbedContents",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(c=>{const f=LV(this.apiClient,c),p=new z0;return Object.assign(p,f),p})}}async generateImagesInternal(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=wV(this.apiClient,e);return s=$e("{model}:predict",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(c=>{const f=XV(this.apiClient,c),p=new B0;return Object.assign(p,f),p})}else{const l=Q5(this.apiClient,e);return s=$e("{model}:predict",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(c=>{const f=DV(this.apiClient,c),p=new B0;return Object.assign(p,f),p})}}async get(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=bV(this.apiClient,e);return s=$e("{name}",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(c=>nH(this.apiClient,c))}else{const l=X5(this.apiClient,e);return s=$e("{name}",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(c=>$V(this.apiClient,c))}}async countTokens(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=SV(this.apiClient,e);return s=$e("{model}:countTokens",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(c=>{const f=rH(this.apiClient,c),p=new U0;return Object.assign(p,f),p})}else{const l=tV(this.apiClient,e);return s=$e("{model}:countTokens",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(c=>{const f=zV(this.apiClient,c),p=new U0;return Object.assign(p,f),p})}}async computeTokens(e){var n;let r,i="",s={};if(this.apiClient.isVertexAI()){const a=TV(this.apiClient,e);return i=$e("{model}:computeTokens",a._url),s=a._query,delete a.config,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(l=>l.json()),r.then(l=>{const c=iH(this.apiClient,l),f=new h5;return Object.assign(f,c),f})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideos(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=kV(this.apiClient,e);return s=$e("{model}:predictLongRunning",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(c=>aH(this.apiClient,c))}else{const l=iV(this.apiClient,e);return s=$e("{model}:predictLongRunning",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(c=>VV(this.apiClient,c))}}}/** 366 * @license 367 * Copyright 2025 Google LLC 368 * SPDX-License-Identifier: Apache-2.0 369 */function ZH(t,e){const n={},r=v(e,["operationName"]);r!=null&&g(n,["_url","operationName"],r);const i=v(e,["config"]);return i!=null&&g(n,["config"],i),n}function qH(t,e){const n={},r=v(e,["operationName"]);r!=null&&g(n,["_url","operationName"],r);const i=v(e,["config"]);return i!=null&&g(n,["config"],i),n}function GH(t,e){const n={},r=v(e,["operationName"]);
369r!=null&&g(n,["operationName"],r);const i=v(e,["resourceName"]);i!=null&&g(n,["_url","resourceName"],i);const s=v(e,["config"]);return s!=null&&g(n,["config"],s),n}function KH(t,e){const n={},r=v(e,["video","uri"]);r!=null&&g(n,["uri"],r);const i=v(e,["video","encodedVideo"]);i!=null&&g(n,["videoBytes"],Es(t,i));const s=v(e,["encoding"]);return s!=null&&g(n,["mimeType"],s),n}function YH(t,e){const n={},r=v(e,["_self"]);return r!=null&&g(n,["video"],KH(t,r)),n}function Q0(t,e){const n={},r=v(e,["generatedSamples"]);r!=null&&(Array.isArray(r)?g(n,["generatedVideos"],r.map(a=>YH(t,a))):g(n,["generatedVideos"],r));const i=v(e,["raiMediaFilteredCount"]);i!=null&&g(n,["raiMediaFilteredCount"],i);const s=v(e,["raiMediaFilteredReasons"]);return s!=null&&g(n,["raiMediaFilteredReasons"],s),n}function JH(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["name"],r);const i=v(e,["metadata"]);i!=null&&g(n,["metadata"],i);const s=v(e,["done"]);s!=null&&g(n,["done"],s);const a=v(e,["error"]);a!=null&&g(n,["error"],a);const l=v(e,["response","generateVideoResponse"]);l!=null&&g(n,["response"],Q0(t,l));const c=v(e,["response","generateVideoResponse"]);return c!=null&&g(n,["result"],Q0(t,c)),n}function QH(t,e){const n={},r=v(e,["gcsUri"]);r!=null&&g(n,["uri"],r);const i=v(e,["bytesBase64Encoded"]);i!=null&&g(n,["videoBytes"],Es(t,i));const s=v(e,["mimeType"]);return s!=null&&g(n,["mimeType"],s),n}function XH(t,e){const n={},r=v(e,["_self"]);return r!=null&&g(n,["video"],QH(t,r)),n}function X0(t,e){const n={},r=v(e,["videos"]);r!=null&&(Array.isArray(r)?g(n,["generatedVideos"],r.map(a=>XH(t,a))):g(n,["generatedVideos"],r));const i=v(e,["raiMediaFilteredCount"]);i!=null&&g(n,["raiMediaFilteredCount"],i);const s=v(e,["raiMediaFilteredReasons"]);return s!=null&&g(n,["raiMediaFilteredReasons"],s),n}function eb(t,e){const n={},r=v(e,["name"]);r!=null&&g(n,["name"],r);const i=v(e,["metadata"]);i!=null&&g(n,["metadata"],i);const s=v(e,["done"]);s!=null&&g(n,["done"],s);const a=v(e,["error"]);a!=null&&g(n,["error"],a);const l=v(e,["response"]);l!=null&&g(n,["response"],X0(t,l));const c=v(e,["response"]);return c!=null&&g(n,["result"],X0(t,c)),n}/** 370 * @license 371 * Copyright 2025 Google LLC 372 * SPDX-License-Identifier: Apache-2.0 373 */class eW extends Ph{constructor(e){super(),this.apiClient=e}async getVideosOperation(e){const n=e.operation,r=e.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const s=n.name.split("/operations/")[0];var i=void 0;return r&&"httpOptions"in r&&(i=r.httpOptions),this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:s,config:{httpOptions:i}})}else return this.getVideosOperationInternal({operationName:n.name,config:r})}async getVideosOperationInternal(e){var n,r;let i,s="",a={};if(this.apiClient.isVertexAI()){const l=qH(this.apiClient,e);return s=$e("{operationName}",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(c=>c.json()),i.then(c=>eb(this.apiClient,c))}else{const l=ZH(this.apiClient,e);return s=$e("{operationName}",l._url),a=l._query,delete l.config,delete l._url,delete l._query,i=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions}).then(c=>c.json()),i.then(c=>JH(this.apiClient,c))}}async fetchPredictVideosOperationInternal(e){var n;let r,i="",s={};if(this.apiClient.isVertexAI()){const a=GH(this.apiClient,e);return i=$e("{resourceName}:fetchPredictOperation",a._url),s=a._query,delete a.config,delete a._url,delete a._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(a),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions}).then(l=>l.json()),r.then(l=>eb(this.apiClient,l))}else throw new Error("This method is only supported by the Vertex AI.")}}/** 374 * @license 375 * Copyright 2025 Google LLC 376 * SPDX-License-Identifier: Apache-2.0 377 */const tW="Content-Type",nW="X-Server-Timeout",rW="User-Agent",iW="x-goog-api-client",sW="0.8.0",oW=`google-genai-sdk/${sW}`,aW="v1beta1",lW="v1beta",tb=/^data: (.*)(?:\n\n|\r\r|\r\n\r\n)/;
377class uW extends Error{constructor(e,n){n?super(e,{cause:n}):super(e,{cause:new Error().stack}),this.message=e,this.name="ClientError"}}class nb extends Error{constructor(e,n){n?super(e,{cause:n}):super(e,{cause:new Error().stack}),this.message=e,this.name="ServerError"}}class cW{constructor(e){var n,r;this.clientOptions=Object.assign(Object.assign({},e),{project:e.project,location:e.location,apiKey:e.apiKey,vertexai:e.vertexai});const i={};this.clientOptions.vertexai?(i.apiVersion=(n=this.clientOptions.apiVersion)!==null&&n!==void 0?n:aW,this.getProject()||this.getLocation()?(i.baseUrl=`https://${this.clientOptions.location}-aiplatform.googleapis.com/`,this.clientOptions.apiKey=void 0):(i.baseUrl="https://aiplatform.googleapis.com/",this.clientOptions.project=void 0,this.clientOptions.location=void 0)):(i.apiVersion=(r=this.clientOptions.apiVersion)!==null&&r!==void 0?r:lW,i.baseUrl="https://generativelanguage.googleapis.com/"),i.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=i,e.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(i,e.httpOptions))}isVertexAI(){var e;return(e=this.clientOptions.vertexai)!==null&&e!==void 0?e:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(e){if(!e||e.baseUrl===void 0||e.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");const r=[e.baseUrl.endsWith("/")?e.baseUrl.slice(0,-1):e.baseUrl];return e.apiVersion&&e.apiVersion!==""&&r.push(e.apiVersion),r.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){const e=this.getBaseUrl(),n=new URL(e);return n.protocol="wss",n.toString()}setBaseUrl(e){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=e;else throw new Error("HTTP options are not correctly set.")}constructUrl(e,n,r){const i=[this.getRequestUrlInternal(n)];return r&&i.push(this.getBaseResourcePath()),e!==""&&i.push(e),new URL(`${i.join("/")}`)}shouldPrependVertexProjectPath(e){return!(this.clientOptions.apiKey||!this.clientOptions.vertexai||e.path.startsWith("projects/")||e.httpMethod==="GET"&&e.path.startsWith("publishers/google/models"))}async request(e){let n=this.clientOptions.httpOptions;e.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const r=this.shouldPrependVertexProjectPath(e),i=this.constructUrl(e.path,n,r);if(e.queryParams)for(const[a,l]of Object.entries(e.queryParams))i.searchParams.append(a,String(l));let s={};if(e.httpMethod==="GET"){if(e.body&&e.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else s.body=e.body;return s=await this.includeExtraHttpOptionsToRequestInit(s,n),this.unaryApiCall(i,s,e.httpMethod)}patchHttpOptions(e,n){const r=JSON.parse(JSON.stringify(e));for(const[i,s]of Object.entries(n))typeof s=="object"?r[i]=Object.assign(Object.assign({},r[i]),s):s!==void 0&&(r[i]=s);return r}async requestStream(e){let n=this.clientOptions.httpOptions;e.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const r=this.shouldPrependVertexProjectPath(e),i=this.constructUrl(e.path,n,r);(!i.searchParams.has("alt")||i.searchParams.get("alt")!=="sse")&&i.searchParams.set("alt","sse");let s={};return s.body=e.body,s=await this.includeExtraHttpOptionsToRequestInit(s,n),this.streamApiCall(i,s,e.httpMethod)}async includeExtraHttpOptionsToRequestInit(e,n){if(n&&n.timeout&&n.timeout>0){const r=new AbortController,i=r.signal;setTimeout(()=>r.abort(),n.timeout),e.signal=i}return e.headers=await this.getHeadersInternal(n),e}async unaryApiCall(e,n,r){return this.apiCall(e.toString(),Object.assign(Object.assign({},n),{method:r})).then(async i=>(await rb(i),new pk(i))).catch(i=>{throw i instanceof Error?i:new Error(JSON.stringify(i))})}async streamApiCall(e,n,r){return this.apiCall(e.toString(),Object.assign(Object.assign({},n),{method:r})).then(async i=>(await rb(i),this.processStreamResponse(i))).catch(i=>{throw i instanceof Error?i:new Error(JSON.stringify(i))})}processStreamResponse(e){var n;return mf(this,arguments,function*(){const i=(n=e==null?void 0:e.body)===null||n===void 0?void 0:n.getReader(),s=new TextDecoder("utf-8");if(!i)throw new Error("Response body is empty");try{let a="";for(;;){const{done:l,value:c}=yield vn(i.read());if(l){if(a.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const f=s.decode(c);a+=f;let p=a.match(tb);for(;p;){const m=p[1];try{const _=JSON.parse(m);yield yield vn(_),a=a.slice(p[0].length),p=a.match(tb)}catch(_){throw new Error(`exception parsing stream chunk ${m}. ${_}`)}}}}finally{i.releaseLock()}})}
377async apiCall(e,n){return fetch(e,n).catch(r=>{throw new Error(`exception ${r} sending request`)})}getDefaultHeaders(){const e={},n=oW+" "+this.clientOptions.userAgentExtra;return e[rW]=n,e[iW]=n,e[tW]="application/json",e}async getHeadersInternal(e){const n=new Headers;if(e&&e.headers){for(const[r,i]of Object.entries(e.headers))n.append(r,i);e.timeout&&e.timeout>0&&n.append(nW,String(Math.ceil(e.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(n),n}async uploadFile(e,n){var r;const i={};n!=null&&(i.mimeType=n.mimeType,i.name=n.name,i.displayName=n.displayName),i.name&&!i.name.startsWith("files/")&&(i.name=`files/${i.name}`);const s=this.clientOptions.uploader,a=await s.stat(e);i.sizeBytes=String(a.size);const l=(r=n==null?void 0:n.mimeType)!==null&&r!==void 0?r:a.type;if(l===void 0||l==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");i.mimeType=l;const c=await this.fetchUploadUrl(i,n);return s.upload(e,c,this)}async fetchUploadUrl(e,n){var r;let i={};n!=null&&n.httpOptions?i=n.httpOptions:i={apiVersion:"",headers:{"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${e.sizeBytes}`,"X-Goog-Upload-Header-Content-Type":`${e.mimeType}`}};const s={file:e},a=await this.request({path:$e("upload/v1beta/files",s._url),body:JSON.stringify(s),httpMethod:"POST",httpOptions:i});if(!a||!(a!=null&&a.headers))throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const l=(r=a==null?void 0:a.headers)===null||r===void 0?void 0:r["x-goog-upload-url"];if(l===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return l}}async function rb(t){var e;if(t===void 0)throw new nb("response is undefined");if(!t.ok){const n=t.status,r=t.statusText;let i;!((e=t.headers.get("content-type"))===null||e===void 0)&&e.includes("application/json")?i=await t.json():i={error:{message:"exception parsing response",code:t.status,status:t.statusText}};const s=`got status: ${n} ${r}. ${JSON.stringify(i)}`;throw n>=400&&n<500?new uW(s):n>=500&&n<600?new nb(s):new Error(s)}}const dW=1024*1024*8;async function fW(t,e,n){var r,i;let s=0,a=0,l=new pk(new Response),c="upload";for(s=t.size;a<s;){const p=Math.min(dW,s-a),m=t.slice(a,a+p);if(a+p>=s&&(c+=", finalize"),l=await n.request({path:"",body:m,httpMethod:"POST",httpOptions:{apiVersion:"",baseUrl:e,headers:{"X-Goog-Upload-Command":c,"X-Goog-Upload-Offset":String(a),"Content-Length":String(p)}}}),a+=p,((r=l==null?void 0:l.headers)===null||r===void 0?void 0:r["x-goog-upload-status"])!=="active")break;if(s<=a)throw new Error("All content has been uploaded, but the upload status is not finalized.")}const f=await(l==null?void 0:l.json());if(((i=l==null?void 0:l.headers)===null||i===void 0?void 0:i["x-goog-upload-status"])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return f.file}async function hW(t){return{size:t.size,type:t.type}}class pW{async upload(e,n,r){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await fW(e,n,r)}async stat(e){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await hW(e)}}/** 378 * @license 379 * Copyright 2025 Google LLC 380 * SPDX-License-Identifier: Apache-2.0 381 */class mW{create(e,n,r){return new gW(e,n,r)}}class gW{constructor(e,n,r){this.url=e,this.headers=n,this.callbacks=r}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(e){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(e)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}}/** 382 * @license 383 * Copyright 2025 Google LLC 384 * SPDX-License-Identifier: Apache-2.0 385 */const ib="x-goog-api-key";class vW{constructor(e){this.apiKey=e}async addAuthHeaders(e){e.get(ib)===null&&e.append(ib,this.apiKey)}}/** 386 * @license 387 * Copyright 2025 Google LLC 388 * SPDX-License-Identifier: Apache-2.0 389 */const yW="gl-node/";class _W{constructor(e){var n;if(e.apiKey==null)throw new Error("An API Key must be set when running in a browser");if(e.project||e.location)throw new Error("Vertex AI project based authentication is not supported on browser runtimes. Please do not provide a project or location.");this.vertexai=(n=e.vertexai)!==null&&n!==void 0?n:!1,this.apiKey=e.apiKey,this.apiVersion=e.apiVersion;const r=new vW(this.apiKey);this.apiClient=new cW({auth:r,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:e.httpOptions,userAgentExtra:yW+"web",uploader:new pW}),this.models=new WH(this.apiClient),this.live=new zH(this.apiClient,r,new mW),this.chats=new w5(this.models,this.apiClient),this.caches=new v5(this.apiClient),this.files=new L5(this.apiClient),this.operations=new eW(this.apiClient)}}var Fe;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),a={};for(const l of s)a[l]=i[l];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},t.find=(i,s)=>{for(const a of i)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(a=>
vendor: 53,182 bytes, line 389
389typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Fe||(Fe={}));var Wg;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Wg||(Wg={}));const ue=Fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),si=t=>{switch(typeof t){case"undefined":return ue.undefined;case"string":return ue.string;case"number":return isNaN(t)?ue.nan:ue.number;case"boolean":return ue.boolean;case"function":return ue.function;case"bigint":return ue.bigint;case"symbol":return ue.symbol;case"object":return Array.isArray(t)?ue.array:t===null?ue.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ue.promise:typeof Map<"u"&&t instanceof Map?ue.map:typeof Set<"u"&&t instanceof Set?ue.set:typeof Date<"u"&&t instanceof Date?ue.date:ue.object;default:return ue.unknown}},Y=Fe.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"]),xW=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class An extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let l=r,c=0;for(;c<a.path.length;){const f=a.path[c];c===a.path.length-1?(l[f]=l[f]||{_errors:[]},l[f]._errors.push(n(a))):l[f]=l[f]||{_errors:[]},l=l[f],c++}}};return i(this),r}static assert(e){if(!(e instanceof An))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}An.create=t=>new An(t);const Oa=(t,e)=>{let n;switch(t.code){case Y.invalid_type:t.received===ue.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Y.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Fe.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:n=`Unrecognized key(s) in object: ${Fe.joinValues(t.keys,", ")}`;break;case Y.invalid_union:n="Invalid input";break;case Y.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Fe.joinValues(t.options)}`;break;case Y.invalid_enum_value:n=`Invalid enum value. Expected ${Fe.joinValues(t.options)}, received '${t.received}'`;break;case Y.invalid_arguments:n="Invalid function arguments";break;case Y.invalid_return_type:n="Invalid function return type";break;case Y.invalid_date:n="Invalid date";break;case Y.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Fe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Y.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Y.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Y.custom:n="Invalid input";break;case Y.invalid_intersection_types:n="Intersection results could not be merged";break;case Y.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Y.not_finite:n="Number must be finite";break;default:n=e.defaultError,Fe.assertNever(t)}return{message:n}};let bk=Oa;function wW(t){bk=t}function gf(){return bk}const vf=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let l="";const c=r.filter(f=>!!f).slice().reverse();for(const f of c)l=f(a,{data:e,defaultError:l}).message;return{...i,path:s,message:l}},bW=[];function ie(t,e){const n=gf(),r=vf({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Oa?void 0:Oa].filter(i=>!!i)});t.common.issues.push(r)}class Kt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return xe;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,a=await i.value;r.push({key:s,value:a})}return Kt.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return xe;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[s.value]=a.value)}return{status:e.value,value:r}}}const xe=Object.freeze({status:"aborted"}),Qo=t=>({status:"dirty",value:t}),an=t=>({status:"valid",value:t}),Zg=t=>t.status==="aborted",qg=t=>t.status==="dirty",so=t=>t.status==="valid",wu=t=>typeof Promise<"u"&&t instanceof Promise;function yf(t,e,n,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Ck(t,e,n,r,i){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(me||(me={}));var Il,Al;class Ur{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const sb=(t,e)=>{if(so(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 n=new An(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,l)=>{var c,f;const{message:p}=t;return a.code==="invalid_enum_value"?{message:p??l.defaultError}:typeof l.data>"u"?{message:(c=p??r)!==null&&c!==void 0?c:l.defaultError}:a.code!=="invalid_type"?{message:l.defaultError}:{message:(f=p??n)!==null&&f!==void 0?f:l.defaultError}},description:i}}class Re{get description(){return this._def.description}_getType(e){return si(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:si(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Kt,ctx:{common:e.parent.common,data:e.data,parsedType:si(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(wu(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:si(e)},s=this._parseSync({data:e,path:i.path,parent:i});return sb(i,s)}"~validate"(e){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:si(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:i});return so(s)?{value:s.value}:{issues:i.common.issues}}catch(s){!((r=(n=s==null?void 0:s.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(s=>so(s)?{value:s.value}:{issues:i.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:si(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(wu(i)?i:Promise.resolve(i));return sb(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const a=e(i),l=()=>s.addIssue({code:Y.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(l(),!1)):a?!0:(l(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new pr({schema:this,typeName:_e.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:n=>this["~validate"](n)}}optional(){return zr.create(this,this._def)}nullable(){return ps.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cr.create(this)}promise(){return Da.create(this,this._def)}or(e){return Tu.create([this,e],this._def)}and(e){return Eu.create(this,e,this._def)}transform(e){return new pr({...Ee(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Iu({...Ee(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new Fy({typeName:_e.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Au({...Ee(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Qu.create(this,e)}readonly(){return Mu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const CW=/^c[^\s-]{8,}$/i,SW=/^[0-9a-z]+$/,TW=/^[0-9A-HJKMNP-TV-Z]{26}$/i,EW=/^[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,PW=/^[a-z0-9_-]{21}$/i,kW=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,NW=/^[-+]?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)?)??$/,RW=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,IW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let cm;const AW=/^(?:(?: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])$/,MW=/^(?:(?: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])$/,LW=/^(([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]))$/,OW=/^(([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])$/,jW=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,DW=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Sk="((\\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])))",FW=new RegExp(`^${Sk}$`);function Tk(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function $W(t){return new RegExp(`^${Tk(t)}$`)}function Ek(t){let e=`${Sk}T${Tk(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function zW(t,e){return!!((e==="v4"||!e)&&AW.test(t)||(e==="v6"||!e)&&LW.test(t))}function BW(t,e){if(!kW.test(t))return!1;try{const[n]=t.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function UW(t,e){return!!((e==="v4"||!e)&&MW.test(t)||(e==="v6"||!e)&&OW.test(t))}class ar extends Re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ue.string){const s=this._getOrReturnCtx(e);return ie(s,{code:Y.invalid_type,expected:ue.string,received:s.parsedType}),xe}const r=new Kt;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:Y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:Y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,l=e.data.length<s.value;(a||l)&&(i=this._getOrReturnCtx(e,i),a?ie(i,{code:Y.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&ie(i,{code:Y.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")RW.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:Y.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")cm||(cm=new RegExp(IW,"u")),cm.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:Y.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")EW.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:Y.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")PW.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:Y.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")CW.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:Y.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")SW.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:Y.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")TW.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:Y.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:Y.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:Y.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ie(i,{code:Y.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:Y.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:Y.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Ek(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:Y.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?FW.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:Y.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?$W(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:Y.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?NW.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:Y.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?zW(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:Y.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?BW(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"jwt",code:Y.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?UW(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cidr",code:Y.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?jW.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:Y.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?DW.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64url",code:Y.invalid_string,message:s.message}),r.dirty()):Fe.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Y.invalid_string,...me.errToObj(r)})}_addCheck(e){return new ar({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...me.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...me.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...me.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...me.errToObj(e)})}datetime(e){var n,r;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:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...me.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,...me.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...me.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...me.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...me.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...me.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...me.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...me.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...me.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...me.errToObj(n)})}nonempty(e){return this.min(1,me.errToObj(e))}trim(){return new ar({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ar({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ar({...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 n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ar.create=t=>{var e;return new ar({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function VW(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return s%a/Math.pow(10,i)}class ds extends Re{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)!==ue.number){const s=this._getOrReturnCtx(e);return ie(s,{code:Y.invalid_type,expected:ue.number,received:s.parsedType}),xe}let r;const i=new Kt;for(const s of this._def.checks)s.kind==="int"?Fe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{code:Y.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:Y.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:Y.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?VW(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),ie(r,{code:Y.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{code:Y.not_finite,message:s.message}),i.dirty()):Fe.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,me.toString(n))}setLimit(e,n,r,i){return new ds({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:me.toString(i)}]})}_addCheck(e){return new ds({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Fe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}ds.create=t=>new ds({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class fs extends Re{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)!==ue.bigint)return this._getInvalidInput(e);let r;const i=new Kt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:Y.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:Y.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:Y.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Fe.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return ie(n,{code:Y.invalid_type,expected:ue.bigint,received:n.parsedType}),xe}gte(e,n){return this.setLimit("min",e,!0,me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,me.toString(n))}setLimit(e,n,r,i){return new fs({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:me.toString(i)}]})}_addCheck(e){return new fs({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}fs.create=t=>{var e;return new fs({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};class bu extends Re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ue.boolean){const r=this._getOrReturnCtx(e);return ie(r,{code:Y.invalid_type,expected:ue.boolean,received:r.parsedType}),xe}return an(e.data)}}bu.create=t=>new bu({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class oo extends Re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ue.date){const s=this._getOrReturnCtx(e);return ie(s,{code:Y.invalid_type,expected:ue.date,received:s.parsedType}),xe}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ie(s,{code:Y.invalid_date}),xe}const r=new Kt;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:Y.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:Y.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Fe.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new oo({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:me.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:me.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}oo.create=t=>new oo({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Ee(t)});class _f extends Re{_parse(e){if(this._getType(e)!==ue.symbol){const r=this._getOrReturnCtx(e);return ie(r,{code:Y.invalid_type,expected:ue.symbol,received:r.parsedType}),xe}return an(e.data)}}_f.create=t=>new _f({typeName:_e.ZodSymbol,...Ee(t)});class Cu extends Re{_parse(e){if(this._getType(e)!==ue.undefined){const r=this._getOrReturnCtx(e);return ie(r,{code:Y.invalid_type,expected:ue.undefined,received:r.parsedType}),xe}return an(e.data)}}Cu.create=t=>new Cu({typeName:_e.ZodUndefined,...Ee(t)});class Su extends Re{_parse(e){if(this._getType(e)!==ue.null){const r=this._getOrReturnCtx(e);return ie(r,{code:Y.invalid_type,expected:ue.null,received:r.parsedType}),xe}return an(e.data)}}Su.create=t=>new Su({typeName:_e.ZodNull,...Ee(t)});class ja extends Re{constructor(){super(...arguments),this._any=!0}_parse(e){return an(e.data)}}ja.create=t=>new ja({typeName:_e.ZodAny,...Ee(t)});class Ys extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return an(e.data)}}Ys.create=t=>new Ys({typeName:_e.ZodUnknown,...Ee(t)});class _i extends Re{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:Y.invalid_type,expected:ue.never,received:n.parsedType}),xe}}_i.create=t=>new _i({typeName:_e.ZodNever,...Ee(t)});class xf extends Re{_parse(e){if(this._getType(e)!==ue.undefined){const r=this._getOrReturnCtx(e);return ie(r,{code:Y.invalid_type,expected:ue.void,received:r.parsedType}),xe}return an(e.data)}}xf.create=t=>new xf({typeName:_e.ZodVoid,...Ee(t)});class cr extends Re{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==ue.array)return ie(n,{code:Y.invalid_type,expected:ue.array,received:n.parsedType}),xe;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,l=n.data.length<i.exactLength.value;(a||l)&&(ie(n,{code:a?Y.too_big:Y.too_small,minimum:l?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ie(n,{code:Y.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ie(n,{code:Y.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,l)=>i.type._parseAsync(new Ur(n,a,n.path,l)))).then(a=>Kt.mergeArray(r,a));const s=[...n.data].map((a,l)=>i.type._parseSync(new Ur(n,a,n.path,l)));return Kt.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new cr({...this._def,minLength:{value:e,message:me.toString(n)}})}max(e,n){return new cr({...this._def,maxLength:{value:e,message:me.toString(n)}})}length(e,n){return new cr({...this._def,exactLength:{value:e,message:me.toString(n)}})}nonempty(e){return this.min(1,e)}}cr.create=(t,e)=>new cr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Ee(e)});function jo(t){if(t instanceof ft){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=zr.create(jo(r))}return new ft({...t._def,shape:()=>e})}else return t instanceof cr?new cr({...t._def,type:jo(t.element)}):t instanceof zr?zr.create(jo(t.unwrap())):t instanceof ps?ps.create(jo(t.unwrap())):t instanceof Vr?Vr.create(t.items.map(e=>jo(e))):t}class ft extends Re{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(),n=Fe.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ue.object){const f=this._getOrReturnCtx(e);return ie(f,{code:Y.invalid_type,expected:ue.object,received:f.parsedType}),xe}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),l=[];if(!(this._def.catchall instanceof _i&&this._def.unknownKeys==="strip"))for(const f in i.data)a.includes(f)||l.push(f);const c=[];for(const f of a){const p=s[f],m=i.data[f];c.push({key:{status:"valid",value:f},value:p._parse(new Ur(i,m,i.path,f)),alwaysSet:f in i.data})}if(this._def.catchall instanceof _i){const f=this._def.unknownKeys;if(f==="passthrough")for(const p of l)c.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(f==="strict")l.length>0&&(ie(i,{code:Y.unrecognized_keys,keys:l}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const p of l){const m=i.data[p];c.push({key:{status:"valid",value:p},value:f._parse(new Ur(i,m,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const f=[];for(const p of c){const m=await p.key,_=await p.value;f.push({key:m,value:_,alwaysSet:p.alwaysSet})}return f}).then(f=>Kt.mergeObjectSync(r,f)):Kt.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return me.errToObj,new ft({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,a,l;const c=(a=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(l=me.errToObj(e).message)!==null&&l!==void 0?l:c}:{message:c}}}:{}})}strip(){return new ft({...this._def,unknownKeys:"strip"})}passthrough(){return new ft({...this._def,unknownKeys:"passthrough"})}extend(e){return new ft({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ft({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ft({...this._def,catchall:e})}pick(e){const n={};return Fe.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ft({...this._def,shape:()=>n})}omit(e){const n={};return Fe.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new ft({...this._def,shape:()=>n})}deepPartial(){return jo(this)}partial(e){const n={};return Fe.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new ft({...this._def,shape:()=>n})}required(e){const n={};return Fe.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof zr;)s=s._def.innerType;n[r]=s}}),new ft({...this._def,shape:()=>n})}keyof(){return Pk(Fe.objectKeys(this.shape))}}ft.create=(t,e)=>new ft({shape:()=>t,unknownKeys:"strip",catchall:_i.create(),typeName:_e.ZodObject,...Ee(e)});ft.strictCreate=(t,e)=>new ft({shape:()=>t,unknownKeys:"strict",catchall:_i.create(),typeName:_e.ZodObject,...Ee(e)});ft.lazycreate=(t,e)=>new ft({shape:t,unknownKeys:"strip",catchall:_i.create(),typeName:_e.ZodObject,...Ee(e)});class Tu extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const a=s.map(l=>new An(l.ctx.common.issues));return ie(n,{code:Y.invalid_union,unionErrors:a}),xe}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const c of r){const f={...n,common:{...n.common,issues:[]},parent:null},p=c._parseSync({data:n.data,path:n.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:f}),f.common.issues.length&&a.push(f.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const l=a.map(c=>new An(c));return ie(n,{code:Y.invalid_union,unionErrors:l}),xe}}get options(){return this._def.options}}Tu.create=(t,e)=>new Tu({options:t,typeName:_e.ZodUnion,...Ee(e)});const ti=t=>t instanceof ku?ti(t.schema):t instanceof pr?ti(t.innerType()):t instanceof Nu?[t.value]:t instanceof hs?t.options:t instanceof Ru?Fe.objectValues(t.enum):t instanceof Iu?ti(t._def.innerType):t instanceof Cu?[void 0]:t instanceof Su?[null]:t instanceof zr?[void 0,...ti(t.unwrap())]:t instanceof ps?[null,...ti(t.unwrap())]:t instanceof Fy||t instanceof Mu?ti(t.unwrap()):t instanceof Au?ti(t._def.innerType):[];class kh extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ue.object)return ie(n,{code:Y.invalid_type,expected:ue.object,received:n.parsedType}),xe;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),xe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const a=ti(s.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of a){if(i.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);i.set(l,s)}}return new kh({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ee(r)})}}function Gg(t,e){const n=si(t),r=si(e);if(t===e)return{valid:!0,data:t};if(n===ue.object&&r===ue.object){const i=Fe.objectKeys(e),s=Fe.objectKeys(t).filter(l=>i.indexOf(l)!==-1),a={...t,...e};for(const l of s){const c=Gg(t[l],e[l]);if(!c.valid)return{valid:!1};a[l]=c.data}return{valid:!0,data:a}}else if(n===ue.array&&r===ue.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const a=t[s],l=e[s],c=Gg(a,l);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===ue.date&&r===ue.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Eu extends Re{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,a)=>{if(Zg(s)||Zg(a))return xe;const l=Gg(s.value,a.value);return l.valid?((qg(s)||qg(a))&&n.dirty(),{status:n.value,value:l.data}):(ie(r,{code:Y.invalid_intersection_types}),xe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Eu.create=(t,e,n)=>new Eu({left:t,right:e,typeName:_e.ZodIntersection,...Ee(n)});class Vr extends Re{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ue.array)return ie(r,{code:Y.invalid_type,expected:ue.array,received:r.parsedType}),xe;if(r.data.length<this._def.items.length)return ie(r,{code:Y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&r.data.length>this._def.items.length&&(ie(r,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Ur(r,a,r.path,l)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>Kt.mergeArray(n,a)):Kt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Vr({...this._def,rest:e})}}Vr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vr({items:t,typeName:_e.ZodTuple,rest:null,...Ee(e)})};class Pu extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ue.object)return ie(r,{code:Y.invalid_type,expected:ue.object,received:r.parsedType}),xe;const i=[],s=this._def.keyType,a=this._def.valueType;for(const l in r.data)i.push({key:s._parse(new Ur(r,l,r.path,l)),value:a._parse(new Ur(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?Kt.mergeObjectAsync(n,i):Kt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Re?new Pu({keyType:e,valueType:n,typeName:_e.ZodRecord,...Ee(r)}):new Pu({keyType:ar.create(),valueType:e,typeName:_e.ZodRecord,...Ee(n)})}}class wf extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ue.map)return ie(r,{code:Y.invalid_type,expected:ue.map,received:r.parsedType}),xe;const i=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([l,c],f)=>({key:i._parse(new Ur(r,l,r.path,[f,"key"])),value:s._parse(new Ur(r,c,r.path,[f,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of a){const f=await c.key,p=await c.value;if(f.status==="aborted"||p.status==="aborted")return xe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),l.set(f.value,p.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of a){const f=c.key,p=c.value;if(f.status==="aborted"||p.status==="aborted")return xe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),l.set(f.value,p.value)}return{status:n.value,value:l}}}}wf.create=(t,e,n)=>new wf({valueType:e,keyType:t,typeName:_e.ZodMap,...Ee(n)});class ao extends Re{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ue.set)return ie(r,{code:Y.invalid_type,expected:ue.set,received:r.parsedType}),xe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ie(r,{code:Y.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ie(r,{code:Y.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function a(c){const f=new Set;for(const p of c){if(p.status==="aborted")return xe;p.status==="dirty"&&n.dirty(),f.add(p.value)}return{status:n.value,value:f}}const l=[...r.data.values()].map((c,f)=>s._parse(new Ur(r,c,r.path,f)));return r.common.async?Promise.all(l).then(c=>a(c)):a(l)}min(e,n){return new ao({...this._def,minSize:{value:e,message:me.toString(n)}})}max(e,n){return new ao({...this._def,maxSize:{value:e,message:me.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}ao.create=(t,e)=>new ao({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Ee(e)});class da extends Re{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ue.function)return ie(n,{code:Y.invalid_type,expected:ue.function,received:n.parsedType}),xe;function r(l,c){return vf({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,gf(),Oa].filter(f=>!!f),issueData:{code:Y.invalid_arguments,argumentsError:c}})}function i(l,c){return vf({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,gf(),Oa].filter(f=>!!f),issueData:{code:Y.invalid_return_type,returnTypeError:c}})}const s={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Da){const l=this;return an(async function(...c){const f=new An([]),p=await l._def.args.parseAsync(c,s).catch(x=>{throw f.addIssue(r(c,x)),f}),m=await Reflect.apply(a,this,p);return await l._def.returns._def.type.parseAsync(m,s).catch(x=>{throw f.addIssue(i(m,x)),f})})}else{const l=this;return an(function(...c){const f=l._def.args.safeParse(c,s);if(!f.success)throw new An([r(c,f.error)]);const p=Reflect.apply(a,this,f.data),m=l._def.returns.safeParse(p,s);if(!m.success)throw new An([i(p,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new da({...this._def,args:Vr.create(e).rest(Ys.create())})}returns(e){return new da({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new da({args:e||Vr.create([]).rest(Ys.create()),returns:n||Ys.create(),typeName:_e.ZodFunction,...Ee(r)})}}class ku extends Re{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ku.create=(t,e)=>new ku({getter:t,typeName:_e.ZodLazy,...Ee(e)});class Nu extends Re{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:Y.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:e.data}}get value(){return this._def.value}}Nu.create=(t,e)=>new Nu({value:t,typeName:_e.ZodLiteral,...Ee(e)});function Pk(t,e){return new hs({values:t,typeName:_e.ZodEnum,...Ee(e)})}class hs extends Re{constructor(){super(...arguments),Il.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ie(n,{expected:Fe.joinValues(r),received:n.parsedType,code:Y.invalid_type}),xe}if(yf(this,Il)||Ck(this,Il,new Set(this._def.values)),!yf(this,Il).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return ie(n,{received:n.data,code:Y.invalid_enum_value,options:r}),xe}return an(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return hs.create(e,{...this._def,...n})}exclude(e,n=this._def){return hs.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Il=new WeakMap;hs.create=Pk;class Ru extends Re{constructor(){super(...arguments),Al.set(this,void 0)}_parse(e){const n=Fe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ue.string&&r.parsedType!==ue.number){const i=Fe.objectValues(n);return ie(r,{expected:Fe.joinValues(i),received:r.parsedType,code:Y.invalid_type}),xe}if(yf(this,Al)||Ck(this,Al,new Set(Fe.getValidEnumValues(this._def.values))),!yf(this,Al).has(e.data)){const i=Fe.objectValues(n);return ie(r,{received:r.data,code:Y.invalid_enum_value,options:i}),xe}return an(e.data)}get enum(){return this._def.values}}Al=new WeakMap;Ru.create=(t,e)=>new Ru({values:t,typeName:_e.ZodNativeEnum,...Ee(e)});class Da extends Re{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ue.promise&&n.common.async===!1)return ie(n,{code:Y.invalid_type,expected:ue.promise,received:n.parsedType}),xe;const r=n.parsedType===ue.promise?n.data:Promise.resolve(n.data);return an(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Da.create=(t,e)=>new Da({type:t,typeName:_e.ZodPromise,...Ee(e)});class pr extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{ie(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(r.data,s);if(r.common.async)return Promise.resolve(a).then(async l=>{if(n.value==="aborted")return xe;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?xe:c.status==="dirty"||n.value==="dirty"?Qo(c.value):c});{if(n.value==="aborted")return xe;const l=this._def.schema._parseSync({data:a,path:r.path,parent:r});return l.status==="aborted"?xe:l.status==="dirty"||n.value==="dirty"?Qo(l.value):l}}if(i.type==="refinement"){const a=l=>{const c=i.refinement(l,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?xe:(l.status==="dirty"&&n.dirty(),a(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?xe:(l.status==="dirty"&&n.dirty(),a(l.value).then(()=>({status:n.value,value:l.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});
vendor: 4,121 bytes, line 389
389if(!so(a))return a;const l=i.transform(a.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>so(a)?Promise.resolve(i.transform(a.value,s)).then(l=>({status:n.value,value:l})):a);Fe.assertNever(i)}}pr.create=(t,e,n)=>new pr({schema:t,typeName:_e.ZodEffects,effect:e,...Ee(n)});pr.createWithPreprocess=(t,e,n)=>new pr({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Ee(n)});class zr extends Re{_parse(e){return this._getType(e)===ue.undefined?an(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}zr.create=(t,e)=>new zr({innerType:t,typeName:_e.ZodOptional,...Ee(e)});class ps extends Re{_parse(e){return this._getType(e)===ue.null?an(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ps.create=(t,e)=>new ps({innerType:t,typeName:_e.ZodNullable,...Ee(e)});class Iu extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ue.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Iu.create=(t,e)=>new Iu({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class Au extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return wu(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new An(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new An(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Au.create=(t,e)=>new Au({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class bf extends Re{_parse(e){if(this._getType(e)!==ue.nan){const r=this._getOrReturnCtx(e);return ie(r,{code:Y.invalid_type,expected:ue.nan,received:r.parsedType}),xe}return{status:"valid",value:e.data}}}bf.create=t=>new bf({typeName:_e.ZodNaN,...Ee(t)});const HW=Symbol("zod_brand");class Fy extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Qu extends Re{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?xe:s.status==="dirty"?(n.dirty(),Qo(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Qu({in:e,out:n,typeName:_e.ZodPipeline})}}class Mu extends Re{_parse(e){const n=this._def.innerType._parse(e),r=i=>(so(i)&&(i.value=Object.freeze(i.value)),i);return wu(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Mu.create=(t,e)=>new Mu({innerType:t,typeName:_e.ZodReadonly,...Ee(e)});function ob(t,e){const n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function kk(t,e={},n){return t?ja.create().superRefine((r,i)=>{var s,a;const l=t(r);if(l instanceof Promise)return l.then(c=>{var f,p;if(!c){const m=ob(e,r),_=(p=(f=m.fatal)!==null&&f!==void 0?f:n)!==null&&p!==void 0?p:!0;i.addIssue({code:"custom",...m,fatal:_})}});if(!l){const c=ob(e,r),f=(a=(s=c.fatal)!==null&&s!==void 0?s:n)!==null&&a!==void 0?a:!0;i.addIssue({code:"custom",...c,fatal:f})}}):ja.create()}const WW={object:ft.lazycreate};var _e;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodD
389ate="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"})(_e||(_e={}));const ZW=(t,e={message:`Input not instance of ${t.name}`})=>kk(n=>n instanceof t,e),Nk=ar.create,Rk=ds.create,qW=bf.create,GW=fs.create,Ik=bu.create,KW=oo.create,YW=_f.create,JW=Cu.create,QW=Su.create,XW=ja.create,e6=Ys.create,t6=_i.create,n6=xf.create,r6=cr.create,i6=ft.create,s6=ft.strictCreate,o6=Tu.create,a6=kh.create,l6=Eu.create,u6=Vr.create,c6=Pu.create,d6=wf.create,f6=ao.create,h6=da.create,p6=ku.create,m6=Nu.create,g6=hs.create,v6=Ru.create,y6=Da.create,ab=pr.create,_6=zr.create,x6=ps.create,w6=pr.createWithPreprocess,b6=Qu.create,C6=()=>Nk().optional(),S6=()=>Rk().optional(),T6=()=>Ik().optional(),E6={string:t=>ar.create({...t,coerce:!0}),number:t=>ds.create({...t,coerce:!0}),boolean:t=>bu.create({...t,coerce:!0}),bigint:t=>fs.create({...t,coerce:!0}),date:t=>oo.create({...t,coerce:!0})},P6=xe;var Pn=Object.freeze({__proto__:null,defaultErrorMap:Oa,setErrorMap:wW,getErrorMap:gf,makeIssue:vf,EMPTY_PATH:bW,addIssueToContext:ie,ParseStatus:Kt,INVALID:xe,DIRTY:Qo,OK:an,isAborted:Zg,isDirty:qg,isValid:so,isAsync:wu,get util(){return Fe},get objectUtil(){return Wg},ZodParsedType:ue,getParsedType:si,ZodType:Re,datetimeRegex:Ek,ZodString:ar,ZodNumber:ds,ZodBigInt:fs,ZodBoolean:bu,ZodDate:oo,ZodSymbol:_f,ZodUndefined:Cu,ZodNull:Su,ZodAny:ja,ZodUnknown:Ys,ZodNever:_i,ZodVoid:xf,ZodArray:cr,ZodObject:ft,ZodUnion:Tu,ZodDiscriminatedUnion:kh,ZodIntersection:Eu,ZodTuple:Vr,ZodRecord:Pu,ZodMap:wf,ZodSet:ao,ZodFunction:da,ZodLazy:ku,ZodLiteral:Nu,ZodEnum:hs,ZodNativeEnum:Ru,ZodPromise:Da,ZodEffects:pr,ZodTransformer:pr,ZodOptional:zr,ZodNullable:ps,ZodDefault:Iu,ZodCatch:Au,ZodNaN:bf,BRAND:HW,ZodBranded:Fy,ZodPipeline:Qu,ZodReadonly:Mu,custom:kk,Schema:Re,ZodSchema:Re,late:WW,get ZodFirstPartyTypeKind(){return _e},coerce:E6,any:XW,array:r6,bigint:GW,boolean:Ik,date:KW,discriminatedUnion:a6,effect:ab,enum:g6,function:h6,instanceof:ZW,intersection:l6,lazy:p6,literal:m6,map:d6,nan:qW,nativeEnum:v6,never:t6,null:QW,nullable:x6,number:Rk,object:i6,oboolean:T6,onumber:S6,optional:_6,ostring:C6,pipeline:b6,preprocess:w6,promise:y6,record:c6,set:f6,strictObject:s6,string:Nk,symbol:YW,transformer:ab,tuple:u6,undefined:JW,union:o6,unknown:e6,void:n6,NEVER:P6,ZodIssueCode:Y,quotelessJson:xW,ZodError:An});const Nh=G1,k6=K1,Ak=w.forwardRef(({className:t,...e},n)=>d.jsx(xh,{ref:n,className:X("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));Ak.displayName=xh.displayName;const Xu=w.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(k6,{children:[d.jsx(Ak,{}),d.jsxs(wh,{ref:r,className:X("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,d.jsxs(Y1,{className:"absolute right-4 top-4 roun
389ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[d.jsx(Hf,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xu.displayName=wh.displayName;const Rh=({className:t,...e})=>d.jsx("div",{className:X("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Rh.displayName="DialogHeader";const Ih=({className:t,...e})=>d.jsx("div",{className:X("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Ih.displayName="DialogFooter";const Ah=w.forwardRef(({className:t,...e},n)=>d.jsx(bh,{ref:n,className:X("text-lg font-semibold leading-none tracking-tight",t),...e}));Ah.displayName=bh.displayName;const N6=w.forwardRef(({className:t,...e},n)=>d.jsx(Ch,{ref:n,className:X("text-sm text-muted-foreground",t),...e}));N6.displayName=Ch.displayName;var R6="Label",Mk=w.forwardRef((t,e)=>d.jsx(be.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Mk.displayName=R6;var Lk=Mk;const I6=fo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),rt=w.forwardRef(({className:t,...e},n)=>d.jsx(Lk,{ref:n,className:X(I6(),t),...e}));rt.displayName=Lk.displayName;let id;const A6=new Uint8Array(16);function M6(){if(!id&&(id=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!id))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return id(A6)}const jt=[];for(let t=0;t<256;++t)jt.push((t+256).toString(16).slice(1));function L6(t,e=0){return jt[t[e+0]]+jt[t[e+1]]+jt[t[e+2]]+jt[t[e+3]]+"-"+jt[t[e+4]]+jt[t[e+5]]+"-"+jt[t[e+6]]+jt[t[e+7]]+"-"+jt[t[e+8]]+jt[t[e+9]]+"-"+jt[t[e+10]]+jt[t[e+11]]+jt[t[e+12]]+jt[t[e+13]]+jt[t[e+14]]+jt[t[e+15]]}const O6=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lb={randomUUID:O6};function j6(t,e,n){if(lb.randomUUID&&!t)return lb.randomUUID();t=t||{};const r=t.random||(t.rng||M6)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,L6(r)}const D6="appSettings";Pn.object({full_name:Pn.string().min(1),status:Pn.enum(["stable","critical","deceased","unknown"]),additional_info:Pn.object({age:Pn.number().int().min(0).max(130).nullable().optional()}).optional()});const F6=()=>{const[t,e]=w.useState(null),[n,r]=w.useState(null),[i,s]=w.useState(!1),[a,l]=w.useState(!1),[c,f]=w.useState("idle"),[p,m]=w.useState(null),[_,x]=w.useState(null),[P,b]=w.useState([]),[k,E]=w.useState(!1),{toast:T}=_s(),{t:S}=Nt(),{hospitals:R,currentEvent:I}=Gn(),[M,O]=w.useState(null);w.useEffect(()=>{const $=localStorage.getItem(D6);if($)try{const z=JSON.parse($);O({aiProvider:z.aiProvider,aiModel:z.aiModel,apiKey:z.apiKey})}catch(z){console.error("Failed to parse AI settings:",z)}},[]);const D=async $=>{try{const z=M==null?void 0:M.apiKey;if(!z)throw new Error("API key not configured in settings");if(!M.aiModel)throw new Error("Missing AI provider");if(M.aiProvider!=="Google")throw new Error("Only Google provider is currently supported");const se=Pn.object({full_name:Pn.string().min(1).describe("Patient's full name"),status:Pn.enum(["stable","critical","deceased","unknown"]).describe("Patient's condition"),additional_info:Pn.object({age:Pn.number().int().min(0).max(130).nullable().optional().describe("Patient's age (optional)")}).catchall(Pn.unknown()).optional().describe("Optional additional patient info")}).describe("Schema for a single patient"),G=Pn.array(se).describe("Array of patients"),ce=new _W({apiKey:z}),j=await $.arrayBuffer(),U=new Uint8Array(j);let V="";const re=32768;for(let he=0;he<U.length;he+=re)V+=String.fromCharCode.apply(null,Array.from(U.subarray(he,he+re)));const Q=btoa(V);let oe="image/png";const ae=U.subarray(0,4),fe=Array.from(ae).map(he=>he.toString(16).padStart(2,"0")).join("");fe.startsWith("ffd8ff")?oe="image/jpeg":fe.startsWith("89504e47")?oe="image/png":fe.startsWith("47494638")?oe="image/gif":fe.startsWith("52494646")&&U.length>11&&String.fromCharCode(...U.subarray(8,12))==="WEBP"&&(oe="image/webp");const pe=` 390 Extract patient information precisely from the provided hospital document image. 391 Return ONLY a valid JSON array conforming to this structure: 392 [ 393 { 394 "full_name": "string (patient's full name)", 395 "status": "string (must be 'stable', 'critical', 'deceased', or 'unknown')", // if there's nothing use 'unknown' 396 "additional_info": {
397 "age": number (integer age, or null if not found/readable), 398 ...(other info) 399 } 400 }, 401 ... 402 ] 403 If no patients are found or the document is unreadable, return an empty array []. 404 Do not include any explanatory text, markdown formatting, or anything other than the JSON array itself. 405 `;console.log("Making GenAI request",{mimeType:oe,promptLength:pe.length,base64DataLength:Q.length,model:M.aiModel});const ee=await ce.models.generateContent({model:M.aiModel,contents:[{text:pe},{inlineData:{mimeType:oe,data:Q}}]});let Ce;if(console.log("Received GenAI response:",Ce),ee.candidates&&ee.candidates[0]&&ee.candidates[0].content&&ee.candidates[0].content.parts)for(const he of ee.candidates[0].content.parts)he.text&&(Ce+=he.text);const Ze=Ce;let Ie;try{console.log("Attempting to parse GenAI response...");let he=Ze;const ut=Ze.match(/```(?:json)?([\s\S]*?)```/);if(ut&&ut[1])he=ut[1].trim(),console.log("Extracted JSON from markdown block.");else{const cn=he.indexOf("["),dn=he.lastIndexOf("]");if(cn!==-1&&dn!==-1)he=he.substring(cn,dn+1),console.log("Extracted JSON array directly.");else throw new Error("Could not find valid JSON array in the response.")}if(!he)throw new Error("Extracted JSON string is empty after cleaning.");console.log("Cleaned JSON string (first 200 chars):",he.slice(0,200));const Rt=JSON.parse(he);console.log(`Parsed ${Rt.length} raw patient objects.`);const Yt=G.safeParse(Rt);if(!Yt.success)throw console.error("Zod validation failed:",Yt.error.errors),console.error("Raw data (truncated):",JSON.stringify(Rt).slice(0,500)),new Error(`Invalid patient data structure received from AI: ${Yt.error.message}`);Ie=Yt.data,console.log(`Successfully parsed and validated ${Ie.length} patients`)}catch(he){throw console.error("Error parsing/validating GenAI response",{errorMessage:he instanceof Error?he.message:String(he),responseSnippet:Ze.slice(0,500)+(Ze.length>500?"...":"")}),new Error(`Failed to parse/validate patient data from document: ${he instanceof Error?he.message:String(he)}`)}return Pn.array(se).parse(Ie)}catch(z){throw console.error("Extraction error:",z),z}},K=async $=>{if($.target.files&&$.target.files[0]){const z=$.target.files[0];e(z);const se=new FileReader;se.onload=()=>{r(se.result)},se.readAsDataURL(z),l(!1),f("idle")}},q=async()=>{s(!0),f("processing");try{const $=await D(t);b($),E(!0),s(!1)}catch{s(!1),f("error"),T({title:"Extraction failed",description:"Could not extract patient data from image",variant:"destructive"})}},ne=async()=>{if(!t||!_||!I||!P.length){T({title:S("uploadPage.errors.missingInfo"),description:S("uploadPage.errors.missingInfoDescription"),variant:"destructive"});return}s(!0),f("uploading");try{const $=t.name.split(".").pop(),z=`${j6()}.${$}`,{data:se,error:G}=await Je.storage.from("patient_lists").upload(z,t);if(G)throw new Error(`Storage error: ${G.message}`);f("saving");const{data:ce,error:j}=await Je.from("uploads").insert({file_path:z,file_type:t.type,hospital_id:_,event_id:I.id,processed:!0,ocr_status:"completed",ocr_data:{patients:P},processing_results:{status:"success",extracted_count:P.length,inserted_count:P.length}}).select().single();if(j)throw f("error"),new Error(`Upload record error: ${j.message}`);let U=0;const V=[];for(const Q of P)try{const{data:oe,error:ae}=await Je.from("victims").select("id").eq("full_name",Q.full_name).eq("hospital_id",_).eq("event_id",I.id).maybeSingle();if(ae)throw ae;if(oe){const fe={additional_info:Q.additional_info,upload_id:ce.id,updated_at:new Date().toISOString()};(Q==null?void 0:Q.status)!=="unknown"&&(fe.status=Q.status);const{error:pe}=await Je.from("victims").update(fe).eq("id",oe.id);if(pe)throw pe}else{const{error:fe}=await Je.from("victims").insert({full_name:Q.full_name,status:Q.status,hospital_id:_,event_id:I.id,additional_info:Q.additional_info,upload_id:ce.id});if(fe)throw fe;U++}}catch(oe){V.push({name:Q.full_name,error:oe instanceof Error?oe.message:"Unknown error"}),console.error(`Error processing patient ${Q.full_name}:`,oe)}try{const{data:Q,error:oe}=await Je.from("hospital_events").select("*").eq("hospital_id",_).eq("event_id",I.id).maybeSingle();if(oe)throw oe;if(!Q){const{error:ae}=await Je.from("hospital_events").insert({hospital_id:_,event_id:I.id});if(ae)throw ae}}catch(Q){V.push({name:"relation event/hospital",error:Q instanceof Error?Q.message:"Unknown error"}),console.error("Error processing relation event/hospital:",Q)}const{error:re}=await Je.from("uploads").update({processing_results:{status:V.length>0?"partial_failure":"success",extracted_count:P.length,inserted_count:U,errors:V}}).eq("id",ce.id);re&&console.error("Failed to update upload processing results:",re),l(!0),m(ce.id),s(!1),T({title:S("uploadPage.errors.uploadSuccess"),description:`${P.length} patient records were extracted and added to the database.`}),f("complete")}catch($){console.error("Upload error:",$),s(!1),f("error"),l(!0),T({title:S("uploadPage.errors.uploadFailed"),description:$ instanceof Error?$.message:S("uploadPage.errors.uploadFailedDescription"),variant:"destructive"})}},W=()=>{E(!1),ne()};return d.jsxs(Ja,{children:[d.jsx(Nh,{open:k,onOpenChange:E,children:d.jsxs(Xu,{className:"max-w-4xl max-h-[80vh] overflow-auto",children:[d.jsxs("div",{className:"flex justify-between items-center mb-4",children:[d.jsx("h2",{className:"text-xl font-bold",children:"Extracted Patient Data"}),d.jsx("button",{onClick:()=>E(!1),children:d.jsx(Hf,{className:"h-5 w-5"})})]}),d.jsx("div",{className:"border rounded-md p-4 overflow-auto",children:d.jsxs("table",{className:"w-full",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b",children:[d.jsx("th",{className:"text-left p-2",children:"Name"}),d.jsx("th",{className:"text-left p-2",children:"Status"}),P.flatMap($=>$.additional_info?Object.keys($.additional_info):[]).filter(($,z,se)=>se.indexOf($)===z).map($=>d.jsx("th",{className:"text-left p-2 capitalize",children:$},$))]})}),d.jsx("tbody",{children:P.map(($,z)=>d.jsxs("tr",{className:"border-b",children:[d.jsx("td",{className:"p-2",children:d.jsx("input",{type:"text",value:$.full_name,onChange:se=>{const G=[...P];G[z].full_name=se.target.value,b(G)},className:"w-full bg-transparent border-none focus:ring-1 focus:ring-primary"})}),d.jsx("td",{className:"p-2",children:d.jsxs("select",{value:$.status,onChange:se=>{const G=[...P];G[z].status=se.target.value,b(G)},className:"bg-transparent border-none focus:ring-1 focus:ring-primary",children:[d.jsx("option",{value:"stable",children:"Stable"}),d.jsx("option",{value:"critical",children:"Critical"}),d.jsx("option",{value:"deceased",children:"Deceased"}),d.jsx("option",{value:"unknown",children:"Unknown"})]})}),$.additional_info&&Object.entries($.additional_info).map(([se,G])=>d.jsx("td",{className:"p-2",children:d.jsx("input",{type:typeof G=="number"?"number":"text",value:G||"",onChange:ce=>{const j=[...P];j[z].additional_info||(j[z].additional_info={}),j[z].additional_info[se]=typeof G=="number"?parseInt(ce.target.value):ce.target.value,b(j)},className:"w-full bg-transparent border-none focus:ring-1 focus:ring-primary"})},se))]},z))})]})}),d.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[d.jsx(Le,{variant:"outline",onClick:()=>E(!1),children:"Cancel"}),d.jsx(Le,{onClick:W,disabled:i,children:i?d.jsxs(d.Fragment,{children:[d.jsx(ew,{className:"mr-2 h-4 w-4 animate-spin"}),"Uploading..."]}):"Confirm & Upload"})]})]})}),d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold",children:S("uploadPage.title")}),d.jsx("p",{className:"text-gray-500 mt-1",children:S("uploadPage.description")})]}),d.jsx(gh,{}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:S("uploadPage.uploadCard.title")}),d.jsx(kt,{children:S("uploadPage.uploadCard.description")})]}),d.jsx(We,{children:d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"grid gap-4",children:[d.jsxs("div",{children:[d.jsx(rt,{htmlFor:"hospital",children:S("uploadPage.uploadCard.hospitalSelect")}),d.jsxs(af,{value:_||"",onValueChange:x,children:[d.jsx(gu,{className:"w-full",children:d.jsx(lf,{placeholder:S("uploadPage.uploadCard.hospitalPlaceholder")})}),d.jsx(vu,{children:R.map($=>d.jsx(Nr,{value:$.id,children:$.name},$.id))})]})]}),d.jsxs("div",{className:"grid w-full items-center gap-1.5",children:[d.jsx(rt,{htmlFor:"picture",children:S("uploadPage.uploadCard.fileInput")}),d.jsx("input",{id:"picture",type:"file",accept:"image/*",className:"hidden",onChange:K}),d.jsx("div",{onClick:()=>{var $;return($=document.getElementById("picture"))==null?void 0:$.click()},className:`border-2 border-dashed rounded-md p-6 cursor-pointer text-center transition-colors 406 ${t?"border-primary/40 bg-primary/5":"border-gray-300 hover:border-primary/30 hover:bg-gray-50"} 407 `,children:n?d.jsxs("div",{className:"space-y-3",children:[d.jsx("img",{src:n,alt:"Preview",className:"max-h-[200px] mx-auto object-contain rounded-md"}),d.jsx("p",{className:"text-sm text-gray-500",children:t==null?void 0:t.name})]}):d.jsxs("div",{className:"space-y-3",children:[d.jsx(fT,{className:"mx-auto h-12 w-12 text-gray-400"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium",children:S("uploadPage.uploadCard.filePrompt")}),d.jsx("p",{className:"text-xs text-gray-500",children:S("uploadPage.uploadCard.fileTypes")})]})]})})]})]}),a&&c==="processing"&&d.jsxs(Ko,{variant:"default",className:"bg-blue-50 border-blue-200",children:[d.jsx(ew,{className:"h-4 w-4 animate-spin text-blue-600"}
407),d.jsx(Yo,{children:S("uploadPage.uploadCard.processing.title")}),d.jsx(Jo,{children:S("uploadPage.uploadCard.processing.description")})]}),c==="complete"&&d.jsxs(Ko,{variant:"default",className:"bg-success/20 border-success/40",children:[d.jsx(kM,{className:"h-4 w-4 text-success"}),d.jsx(Yo,{children:S("uploadPage.uploadCard.complete.title")}),d.jsx(Jo,{children:S("uploadPage.uploadCard.complete.description")})]}),c==="error"&&d.jsxs(Ko,{variant:"destructive",children:[d.jsx(Uf,{className:"h-4 w-4"}),d.jsx(Yo,{children:S("uploadPage.uploadCard.error.title")}),d.jsx(Jo,{children:S("uploadPage.uploadCard.error.description")})]}),d.jsxs(Ko,{variant:"default",className:"bg-amber-50 border-amber-200",children:[d.jsx(AM,{className:"h-4 w-4 text-amber-600"}),d.jsx(Yo,{children:S("uploadPage.uploadCard.info.title")}),d.jsx(Jo,{children:d.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[d.jsx("li",{children:S("uploadPage.uploadCard.info.point1")}),d.jsx("li",{children:S("uploadPage.uploadCard.info.point2")}),d.jsx("li",{children:S("uploadPage.uploadCard.info.point3")})]})})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Le,{onClick:q,disabled:!t||i||!_||c==="processing"||c==="complete",className:"ml-auto",children:S(c==="uploading"?"uploadPage.uploadCard.uploadButton.uploading":c==="saving"?"uploadPage.uploadCard.uploadButton.saving":c==="processing"?"uploadPage.uploadCard.uploadButton.processing":c==="complete"?"uploadPage.uploadCard.uploadButton.complete":"uploadPage.uploadCard.uploadButton.default")})})]})})]})]})]})},Mh=w.forwardRef(({className:t,...e},n)=>d.jsx("div",{className:"relative w-full overflow-auto",children:d.jsx("table",{ref:n,className:X("w-full caption-bottom text-sm",t),...e})}));Mh.displayName="Table";const Lh=w.forwardRef(({className:t,...e},n)=>d.jsx("thead",{ref:n,className:X("[&_tr]:border-b",t),...e}));Lh.displayName="TableHeader";const Oh=w.forwardRef(({className:t,...e},n)=>d.jsx("tbody",{ref:n,className:X("[&_tr:last-child]:border-0",t),...e}));Oh.displayName="TableBody";const $6=w.forwardRef(({className:t,...e},n)=>d.jsx("tfoot",{ref:n,className:X("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));$6.displayName="TableFooter";const lo=w.forwardRef(({className:t,...e},n)=>d.jsx("tr",{ref:n,className:X("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));lo.displayName="TableRow";const rn=w.forwardRef(({className:t,...e},n)=>d.jsx("th",{ref:n,className:X("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));rn.displayName="TableHead";const sn=w.forwardRef(({className:t,...e},n)=>d.jsx("td",{ref:n,className:X("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));sn.displayName="TableCell";const z6=w.forwardRef(({className:t,...e},n)=>d.jsx("caption",{ref:n,className:X("mt-4 text-sm text-muted-foreground",t),...e}));z6.displayName="TableCaption";const B6=()=>{const{hospitals:t,isLoading:e,refreshData:n}=Gn(),{toast:r}=_s(),{t:i}=Nt(),[s,a]=w.useState(!1),[l,c]=w.useState(!1),[f,p]=w.useState(null),[m,_]=w.useState({name:"",address:"",latitude:0,longitude:0,capacity:0,current_occupancy:0,contact_phone:"",contact_email:""});w.useEffect(()=>{n()},[]);const x=()=>{_({name:"",address:"",latitude:0,longitude:0,capacity:0,current_occupancy:0,contact_phone:"",contact_email:""})},P=S=>{p(S),_({name:S.name,address:S.address,latitude:S.latitude,longitude:S.longitude,capacity:S.capacity,current_occupancy:S.current_occupancy,contact_phone:S.phone||"",contact_email:S.contact_email||""}),c(!0)},b=async S=>{a(!1);try{await S$(S),await n(),r({title:i("hospitalsPage.toast.deleteSuccess.title"),description:i("hospitalsPage.toast.deleteSuccess.description")})}catch(R){console.error("Failed to delete hospital:",R),r({title:i("hospitalsPage.toast.error.title"),description:i("hospitalsPage.toast.error.description"),variant:"destructive"})}},k=async S=>{S.preventDefault();try{f?(await b$(f.id,m),r({title:i("hospitalsPage.toasts.updateSuccess.title"),description:i("hospitalsPage.toasts.updateSuccess.description")})):(await C$(m),r({title:i("hospitalsPage.toasts.created.title"),description:i("hospitalsPage.toasts.created.description")})),c(!1),x(),await n()}catch(R){console.error("Failed to save hospital:",R),r({title:i("hospitalsPage.toasts.saveError.title"),description:i("hospitalsPage.toasts.saveError.description"),variant:"destructive"})}},E=t.filter(S=>S.status==="full").length,T=t.reduce((S,R)=>{var O;const M=((O=R.patients)==null?void 0:O.length)||0;return S+Math.max(0,50-M)}
407,0);return d.jsxs(Ja,{children:[d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:i("hospitalsPage.title")}),d.jsxs(Le,{onClick:()=>{p(null),x(),c(!0)},children:[d.jsx(Kv,{className:"mr-2 h-4 w-4"})," ",i("hospitalsPage.addHospitalButton")]})]}),d.jsx("p",{className:"text-muted-foreground",children:i("hospitalsPage.description")}),d.jsxs("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:[d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:i("hospitalsPage.stats.total")}),d.jsx(kt,{children:i("hospitalsPage.stats.totalDesc")})]}),d.jsx(We,{children:d.jsx("p",{className:"text-2xl font-bold",children:t.length})})]}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:i("hospitalsPage.stats.atCapacity")}),d.jsx(kt,{children:i("hospitalsPage.stats.atCapacityDesc")})]}),d.jsx(We,{children:d.jsx("p",{className:"text-2xl font-bold",children:E})})]}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:i("hospitalsPage.stats.availableBeds")}),d.jsx(kt,{children:i("hospitalsPage.stats.availableBedsDesc")})]}),d.jsx(We,{children:d.jsx("p",{className:"text-2xl font-bold",children:T})})]})]}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:i("hospitalsPage.network.title")}),d.jsx(kt,{children:i("hospitalsPage.network.description")})]}),d.jsx(We,{children:e?d.jsx("div",{className:"flex items-center justify-center p-4",children:d.jsx("p",{children:i("hospitalsPage.network.loading")})}):d.jsxs(Mh,{children:[d.jsx(Lh,{children:d.jsxs(lo,{children:[d.jsx(rn,{children:i("hospitalsPage.network.headers.name")}),d.jsx(rn,{children:i("hospitalsPage.network.headers.location")}),d.jsx(rn,{className:"text-center",children:i("hospitalsPage.network.headers.status")}),d.jsx(rn,{className:"text-center",children:i("hospitalsPage.network.headers.patientsCount")}),d.jsx(rn,{className:"text-right",children:i("hospitalsPage.network.headers.actions")})]})}),d.jsx(Oh,{children:t.map(S=>d.jsxs(lo,{children:[d.jsx(sn,{className:"font-medium",children:S.name}),d.jsx(sn,{children:d.jsx("a",{href:`https://maps.google.com/maps?q=${S.name+", "+S.address}`,target:"_blank",rel:"noopener noreferrer",children:S.address})}),d.jsx(sn,{className:"text-center",children:d.jsxs("div",{className:"flex items-center justify-center",children:[d.jsx("span",{className:`inline-block w-2 h-2 mr-2 rounded-full ${S.status==="full"?"bg-red-500":S.status==="receiving"?"bg-green-500":"bg-amber-500"}`}),d.jsx("span",{children:i(`hospitalsPage.network.status.${S.status}`)})]})}),d.jsx(sn,{children:S.patients&&S.patients.length>0?S.patients.length:0}),d.jsx(sn,{className:"text-right",children:d.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[d.jsx(Le,{variant:"ghost",size:"icon",onClick:()=>P(S),children:d.jsx(Yv,{className:"h-4 w-4"})}),d.jsx(Le,{variant:"ghost",size:"icon",onClick:()=>{p(S),a(!0)},children:d.jsx(Jv,{className:"h-4 w-4"})})]})})]},S.id))})]})})]})]}),d.jsx(Sh,{open:l,onOpenChange:c,children:d.jsxs(Ku,{className:"sm:max-w-md",children:[d.jsx(Th,{children:d.jsx(Eh,{children:i(f?"hospitalsPage.sheet.editTitle":"hospitalsPage.sheet.addTitle")})}),d.jsxs("form",{onSubmit:k,className:"space-y-4 mt-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"name",children:i("hospitalsPage.sheet.fields.name")}),d.jsx(Et,{id:"name",value:m.name,onChange:S=>_({...m,name:S.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"address",children:i("hospitalsPage.sheet.fields.address")}),d.jsx(Et,{id:"address",value:m.address,onChange:S=>_({...m,address:S.target.value}),required:!0})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"latitude",children:i("hospitalsPage.sheet.fields.latitude")}),d.jsx(Et,{id:"latitude",type:"number",step:"0.000001",value:m.latitude,onChange:S=>_({...m,latitude:parseFloat(S.target.value)}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"longitude",children:i("hospitalsPage.sheet.fields.longitude")}),d.jsx(Et,{id:"longitude",type:"number",step:"0.000001",value:m.longitude,onChange:S=>_({...m,longitude:parseFloat(S.target.value)}),required:!0})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"capacity",children:i("hospitalsPage.sheet.fields.capacity")}),d.jsx(Et,{id:"capacity",type:"number",value:m.capacity,onChange:S=>_({...m,capacity:parseInt(S.target.value)}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"current_occupancy",children:i("hospitalsPage.sheet.fields.currentOccupancy")}),d.jsx(Et,{id:"current_occupancy",type:"number",value:m.current_occupancy,onChange:S=>_({...m,current_occupancy:parseInt(S.target.value)}),required:!0})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"contact_phone",children:i("hospitalsPage.sheet.fields.phone")}),d.jsx(Et,{id:"contact_phone",value:m.contact_phone||"",onChange:S=>_({...m,contact_phone:S.target.value})})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"contact_email",children:i("hospitalsPage.sheet.fields.email")}),d.jsx(Et,{id:"contact_email",type:"email",value:m.contact_email||"",onChange:S=>_({...m,contact_email:S.target.value})})]}),d.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[d.jsx(Le,{type:"button",variant:"outline",onClick:()=>c(!1),children:i("hospitalsPage.sheet.cancelButton")}),d.jsx(Le,{type:"submit",children:i(f?"hospitalsPage.sheet.updateButton":"hospitalsPage.sheet.createButton")})]})]})]})}),d.jsx(Nh,{open:s,onOpenChange:a,children:d.jsxs(Xu,{children:[d.jsx(Rh,{children:d.jsx(Ah,{children:i("hospitalsPage.dialog.title")})}),d.jsx("p",{children:i("hospitalsPage.dialog.description",{name:f==null?void 0:f.name})}),d.jsxs(Ih,{children:[d.jsx(Le,{variant:"outline",onClick:()=>a(!1),children:i("hospitalsPage.dialog.cancelButton")}),d.jsx(Le,{variant:"destructive",onClick:()=>f&&b(f.id),children:i("hospitalsPage.dialog.deleteButton")})]})]})})]})},Ok=w.forwardRef(({className:t,...e},n)=>d.jsx("textarea",{className:X("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
407ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));Ok.displayName="Textarea";const U6=()=>{const{events:t,patients:e,isLoading:n,refreshData:r}=Gn(),{toast:i}=_s(),{t:s}=Nt(),[a,l]=w.useState(!1),[c,f]=w.useState(!1),[p,m]=w.useState(null),[_,x]=w.useState({title:"",description:"",start_date:new Date().toISOString(),end_date:null,status:"active"});w.useEffect(()=>{r()},[]);const P=()=>{x({title:"",description:"",start_date:new Date().toISOString(),end_date:null,status:"active"})},b=I=>{m({id:I.id,title:I.name,description:I.description,start_date:I.startDate,end_date:I.endDate||null,status:I.status,is_public:!0,created_at:null,updated_at:null}),x({title:I.name,description:I.description||"",start_date:I.startDate,end_date:I.endDate||null,status:I.status}),f(!0)},k=async I=>{l(!1);try{await N$(I),await r(),i({title:s("eventsPage.toasts.deleted.title"),description:s("eventsPage.toasts.deleted.description")})}catch(M){console.error("Failed to delete event:",M),i({title:s("eventsPage.toasts.deleteError.title"),description:s("eventsPage.toasts.deleteError.description"),variant:"destructive"})}},E=async I=>{I.preventDefault();try{p?(await P$(p.id,_),i({title:s("eventsPage.toasts.updated.title"),description:s("eventsPage.toasts.updated.description")})):(await k$({title:_.title,description:_.description,start_date:_.start_date,end_date:_.end_date,status:_.status,is_public:!0}),i({title:s("eventsPage.toasts.created.title"),description:s("eventsPage.toasts.created.description")})),f(!1),P(),await r()}catch(M){console.error("Failed to save event:",M),i({title:s("eventsPage.toasts.saveError.title"),description:s("eventsPage.toasts.saveError.description"),variant:"destructive"})}},T=t.filter(I=>I.status==="active").length,S=t.filter(I=>{const M=new Date(I.startDate),O=new Date;return O.setDate(O.getDate()-30),M>=O}).length,R=e.filter(I=>t.some(M=>M.status==="active"&&M.id===I.eventId)).length;return d.jsxs(Ja,{children:[d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:s("eventsPage.title")}),d.jsxs(Le,{onClick:()=>{m(null),P(),f(!0)},children:[d.jsx(Kv,{className:"mr-2 h-4 w-4"})," ",s("eventsPage.addEventButton")]})]}),d.jsx("p",{className:"text-muted-foreground",children:s("eventsPage.description")}),d.jsxs("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:[d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:s("eventsPage.stats.active")}),d.jsx(kt,{children:s("eventsPage.stats.activeDesc")})]}),d.jsx(We,{children:d.jsx("p",{className:"text-2xl font-bold",children:T})})]}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:s("eventsPage.stats.recent")}),d.jsx(kt,{children:s("eventsPage.stats.recentDesc")})]}),d.jsx(We,{children:d.jsx("p",{className:"text-2xl font-bold",children:S})})]}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:s("eventsPage.stats.affected")}),d.jsx(kt,{children:s("eventsPage.stats.affectedDesc")})]}),d.jsx(We,{children:d.jsx("p",{className:"text-2xl font-bold",children:R.toLocaleString()})})]})]}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:s("eventsPage.timeline.title")}),d.jsx(kt,{children:s("eventsPage.timeline.description")})]}),d.jsx(We,{children:n?d.jsx("div",{className:"flex items-center justify-center p-4",children:d.jsx("p",{children:s("eventsPage.timeline.loading")})}):d.jsxs(Mh,{children:[d.jsx(Lh,{children:d.jsxs(lo,{children:[d.jsx(rn,{children:s("eventsPage.timeline.headers.name")}),d.jsx(rn,{children:s("eventsPage.timeline.headers.startDate")}),d.jsx(rn,{className:"text-center",children:s("eventsPage.timeline.headers.status")}),d.jsx(rn,{className:"text-right",children:s("eventsPage.timeline.headers.actions")})]})}),d.jsx(Oh,{children:t.map(I=>d.jsxs(lo,{children:[d.jsx(sn,{className:"font-medium",children:I.name}),d.jsx(sn,{children:k1(new Date(I.startDate),"MMM d, yyyy")}),d.jsx(sn,{className:"text-center",children:d.jsx("span",{className:`inline-block px-2 py-1 rounded-full text-xs ${I.status==="active"?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"}`,children:s(`eventsPage.timeline.status.${I.status}`)})}),d.jsx(sn,{className:"text-right",children:d.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[d.jsx(Le,{variant:"ghost",size:"icon",onClick:()=>b(I),children:d.jsx(Yv,{className:"h-4 w-4"})}),d.jsx(Le,{variant:"ghost",size:"icon",onClick:()=>{m({id:I.id,title:I.name,description:I.description,start_date:I.startDate,end_date:I.endDate||null,status:I.status,is_public:!0,created_at:null,updated_at:null}),l(!0)},children:d.jsx(Jv,{className:"h-4 w-4"})})]})})]},I.id))})]})})]})]}),d.jsx(Sh,{open:c,onOpenChange:f,children:d.jsxs(Ku,{className:"sm:max-w-md",children:[d.jsx(Th,{children:d.jsx(E
407h,{children:s(p?"eventsPage.sheet.editTitle":"eventsPage.sheet.addTitle")})}),d.jsxs("form",{onSubmit:E,className:"space-y-4 mt-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"title",children:s("eventsPage.sheet.labels.title")}),d.jsx(Et,{id:"title",value:_.title,onChange:I=>x({..._,title:I.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"description",children:s("eventsPage.sheet.labels.description")}),d.jsx(Ok,{id:"description",value:_.description,onChange:I=>x({..._,description:I.target.value}),rows:3})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"start_date",children:s("eventsPage.sheet.labels.startDate")}),d.jsx(Et,{id:"start_date",type:"datetime-local",value:_.start_date?new Date(_.start_date).toISOString().slice(0,16):"",onChange:I=>{I.target.value&&x({..._,start_date:new Date(I.target.value).toISOString()})},required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"end_date",children:s("eventsPage.sheet.labels.endDate")}),d.jsx(Et,{id:"end_date",type:"datetime-local",value:_.end_date?new Date(_.end_date).toISOString().slice(0,16):"",onChange:I=>{I.target.value?x({..._,end_date:new Date(I.target.value).toISOString()}):x({..._,end_date:null})}})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"status",children:s("eventsPage.sheet.labels.status")}),d.jsxs("select",{id:"status",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
407ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",value:_.status,onChange:I=>x({..._,status:I.target.value}),required:!0,children:[d.jsx("option",{value:"active",children:s("eventsPage.timeline.status.active")}),d.jsx("option",{value:"resolved",children:s("eventsPage.timeline.status.resolved")})]})]}),d.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[d.jsx(Le,{type:"button",variant:"outline",onClick:()=>f(!1),children:s("eventsPage.sheet.buttons.cancel")}),d.jsx(Le,{type:"submit",children:s(p?"eventsPage.sheet.buttons.update":"eventsPage.sheet.buttons.create")})]})]})]})}),d.jsx(Nh,{open:a,onOpenChange:l,children:d.jsxs(Xu,{children:[d.jsx(Rh,{children:d.jsx(Ah,{children:s("eventsPage.dialog.title")})}),d.jsx("p",{children:s("eventsPage.dialog.confirmText",{eventName:p==null?void 0:p.title})}),d.jsxs(Ih,{children:[d.jsx(Le,{variant:"outline",onClick:()=>l(!1),children:s("eventsPage.dialog.buttons.cancel")}),d.jsx(Le,{variant:"destructive",onClick:()=>p&&k(p.id),children:s("eventsPage.dialog.buttons.delete")})]})]})})]})},V6=()=>{const{t}=Nt(),{patients:e,hospitals:n,events:r,isLoading:i,refreshData:s}=Gn(),{toast:a}=_s(),[l,c]=w.useState(!1),[f,p]=w.useState(!1),[m,_]=w.useState(null),[x,P]=w.useState(1),b=10;w.useEffect(()=>{s()},[]);const[k,E]=w.useState({full_name:"",status:"stable",hospital_id:"",event_id:"",additional_info:{}}),T=()=>{E({full_name:"",status:"stable",hospital_id:"",event_id:"",additional_info:{}})},S=$=>{_($),E({full_name:$.name,status:$.condition||"unknown",hospital_id:$.hospitalId||"",event_id:$.eventId||"",additional_info:{}}),p(!0)},R=async $=>{c(!1);try{const{error:z}=await Je.from("victims").delete().eq("id",$);if(z)throw z;await s(),a({title:t("patientsPage.toast.deleteSuccess.title"),description:t("patientsPage.toast.deleteSuccess.description")})}catch(z){console.error("Failed to delete patient:",z),a({title:t("patientsPage.toast.deleteError.title"),description:t("patientsPage.toast.deleteError.description"),variant:"destructive"})}},I=async $=>{$.preventDefault();try{if(m){const{error:z}=await Je.from("victims").update({full_name:k.full_name,status:k.status,hospital_id:k.hospital_id||null,event_id:k.event_id||null}).eq("id",m.id);if(z)throw z;a({title:t("patientsPage.toast.updateSuccess.title"),description:t("patientsPage.toast.updateSuccess.description")})}else{const{error:z}=await Je.from("victims").insert({full_name:k.full_name,status:k.status,hospital_id:k.hospital_id||null,event_id:k.event_id||null});if(z)throw z;a({title:t("patientsPage.toast.addSuccess.title"),description:t("patientsPage.toast.addSuccess.description")})}p(!1),T(),await s()}catch(z){console.error("Failed to save patient:",z),a({title:t("patientsPage.toast.saveError.title"),description:t("patientsPage.toast.saveError.description"),variant:"destructive"})}},M=e.length,O=e.filter($=>$.condition==="deceased").length,D=e.filter($=>$.condition==="critical").length,K=x*b,q=K-b,ne=e.slice(q,K),W=Math.ceil(e.length/b);return d.jsxs(Ja,{children:[d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:t("patientsPage.title")}),d.jsxs(Le,{onClick:()=>{_(null),T(),p(!0)},children:[d.jsx(Kv,{className:"mr-2 h-4 w-4"})," ",t("patientsPage.addPatientButton")]})]}),d.jsx("p",{className:"text-muted-foreground",children:t("patientsPage.description")}),d.jsxs("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:[d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:t("patientsPage.stats.total")}),d.jsx(kt,{children:t("patientsPage.stats.totalDesc")})]}),d.jsx(We,{children:d.jsx("p",{className:"text-2xl font-bold",children:M})})]}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:t("patientsPage.stats.hospitalized")}
407),d.jsx(kt,{children:t("patientsPage.stats.hospitalizedDesc")})]}),d.jsx(We,{children:d.jsx("p",{className:"text-2xl font-bold",children:O})})]}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:t("patientsPage.stats.critical")}),d.jsx(kt,{children:t("patientsPage.stats.criticalDesc")})]}),d.jsx(We,{children:d.jsx("p",{className:"text-2xl font-bold",children:D})})]})]}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:t("patientsPage.list.title")}),d.jsx(kt,{children:t("patientsPage.list.description")})]}),d.jsx(We,{children:i?d.jsx("div",{className:"flex items-center justify-center p-4",children:d.jsx("p",{children:t("patientsPage.list.loading")})}):d.jsxs(d.Fragment,{children:[d.jsxs(Mh,{children:[d.jsx(Lh,{children:d.jsxs(lo,{children:[d.jsx(rn,{children:t("patientsPage.list.headers.name")}),d.jsx(rn,{children:t("patientsPage.list.headers.hospital")}),d.jsx(rn,{children:t("patientsPage.list.headers.condition")}),d.jsx(rn,{children:t("patientsPage.list.headers.admitted")}),d.jsx(rn,{className:"text-right",children:t("patientsPage.list.headers.actions")})]})}),d.jsx(Oh,{children:ne.map($=>{const z=n.find(se=>se.id===$.hospitalId);return d.jsxs(lo,{children:[d.jsx(sn,{className:"font-medium",children:$.name}),d.jsx(sn,{children:(z==null?void 0:z.name)||t("patientsPage.list.headers.notAssigned")}),d.jsx(sn,{children:d.jsx("span",{className:`inline-block px-2 py-1 rounded-full text-xs ${$.condition==="critical"?"bg-red-100 text-red-800":$.condition==="stable"?"bg-green-100 text-green-800":$.condition==="deceased"?"bg-red-100 text-red-800":"bg-gray-100 text-gray-800"}`,children:t(`patientsPage.list.status.${$.condition||"unknown"}`)})}),d.jsx(sn,{children:k1(new Date($.dateAdmitted),"MMM d, yyyy")}),d.jsx(sn,{className:"text-right",children:d.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[d.jsx(Le,{variant:"ghost",size:"icon",onClick:()=>S($),children:d.jsx(Yv,{className:"h-4 w-4"})}),d.jsx(Le,{variant:"ghost",size:"icon",onClick:()=>{_($),c(!0)},children:d.jsx(Jv,{className:"h-4 w-4"})})]})})]},$.id)})})]}),W>1&&d.jsx(ky,{className:"mt-4",children:d.jsxs(Ny,{children:[d.jsx(ai,{children:d.jsx(Ry,{onClick:()=>P($=>Math.max($-1,1)),className:x===1?"pointer-events-none opacity-50":""})}),Array.from({length:Math.min(5,W)},($,z)=>{const se=z+1;return d.jsx(ai,{children:d.jsx(_u,{isActive:x===se,onClick:()=>P(se),children:se})},se)}),W>5&&d.jsxs(d.Fragment,{children:[d.jsx(ai,{children:d.jsx("span",{className:"p-2",children:"..."})}),d.jsx(ai,{children:d.jsx(_u,{isActive:x===W,onClick:()=>P(W),children:W})})]}),d.jsx(ai,{children:d.jsx(Iy,{onClick:()=>P($=>Math.min($+1,W)),className:x===W?"pointer-events-none opacity-50":""})})]})})]})})]})]}),d.jsx(Sh,{open:f,onOpenChange:p,children:d.jsxs(Ku,{className:"sm:max-w-md",children:[d.jsx(Th,{children:d.jsx(Eh,{children:t(m?"patientsPage.sheet.editTitle":"patientsPage.sheet.addTitle")})}),d.jsxs("form",{onSubmit:I,className:"space-y-4 mt-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"full_name",children:t("patientsPage.sheet.fields.fullName")}),d.jsx(Et,{id:"full_name",value:k.full_name,onChange:$=>E({...k,full_name:$.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"status",children:t("patientsPage.sheet.fields.condition")}),d.jsxs("select",{id:"status",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
407ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",value:k.status,onChange:$=>E({...k,status:$.target.value}),required:!0,children:[d.jsx("option",{value:"stable",children:t("patientsPage.sheet.fields.conditionOptions.stable")}),d.jsx("option",{value:"critical",children:t("patientsPage.sheet.fields.conditionOptions.critical")}),d.jsx("option",{value:"unknown",children:t("patientsPage.sheet.fields.conditionOptions.unknown")}),d.jsx("option",{value:"deceased",children:t("patientsPage.sheet.fields.conditionOptions.deceased")})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"hospital_id",children:t("patientsPage.sheet.fields.hospital")}),d.jsxs("select",{id:"hospital_id",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",value:k.hospital_id,onChange:$=>E({...k,hospital_id:$.target.value}),children:[d.jsx("option",{value:"",children:t("patientsPage.sheet.fields.hospitalOptions.notAssigned")}),n.map($=>d.jsx("option",{value:$.id,children:$.name},$.id))]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"event_id",children:t("patientsPage.sheet.fields.event")}),d.jsxs("select",{id:"event_id",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
407ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",value:k.event_id,onChange:$=>E({...k,event_id:$.target.value}),children:[d.jsx("option",{value:"",children:t("patientsPage.sheet.fields.eventOptions.notAssociated")}),r.map($=>d.jsx("option",{value:$.id,children:$.name},$.id))]})]}),d.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[d.jsx(Le,{type:"button",variant:"outline",onClick:()=>p(!1),children:t("patientsPage.sheet.cancelButton")}),d.jsx(Le,{type:"submit",children:t(m?"patientsPage.sheet.updateButton":"patientsPage.sheet.createButton")})]})]})]})}),d.jsx(Nh,{open:l,onOpenChange:c,children:d.jsxs(Xu,{children:[d.jsx(Rh,{children:d.jsx(Ah,{children:t("patientsPage.dialog.title")})}),d.jsx("p",{children:t("patientsPage.dialog.description",{name:m==null?void 0:m.name})}),d.jsxs(Ih,{children:[d.jsx(Le,{variant:"outline",onClick:()=>c(!1),children:t("patientsPage.dialog.cancelButton")}),d.jsx(Le,{variant:"destructive",onClick:()=>m&&R(m.id),children:t("patientsPage.dialog.deleteButton")})]})]})})]})};var $y="Radio",[H6,jk]=Hr($y),[W6,Z6]=H6($y),Dk=w.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:s,disabled:a,value:l="on",onCheck:c,form:f,...p}=t,[m,_]=w.useState(null),x=Qe(e,k=>_(k)),P=w.useRef(!1),b=m?f||!!m.closest("form"):!0;return d.jsxs(W6,{scope:n,checked:i,disabled:a,children:[d.jsx(be.button,{type:"button",role:"radio","aria-checked":i,"data-state":zk(i),"data-disabled":a?"":void 0,disabled:a,value:l,...p,ref:x,onClick:ve(t.onClick,k=>{i||c==null||c(),b&&(P.current=k.isPropagationStopped(),P.current||k.stopPropagation())})}),b&&d.jsx(q6,{control:m,bubbles:!P.current,name:r,value:l,checked:i,required:s,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});Dk.displayName=$y;var Fk="RadioIndicator",$k=w.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...i}=t,s=Z6(Fk,n);return d.jsx(xs,{present:r||s.checked,children:d.jsx(be.span,{"data-state":zk(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});$k.displayName=Fk;var q6=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,s=w.useRef(null),a=sP(n),l=LT(e);return w.useEffect(()=>{const c=s.current,f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(a!==n&&m){const _=new Event("click",{bubbles:r});m.call(c,n),c.dispatchEvent(_)}},[a,n,r]),d.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...t.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function zk(t){return t?"checked":"unchecked"}var G6=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],zy="RadioGroup",[K6,C8]=Hr(zy,[yh,jk]),Bk=yh(),Uk=jk(),[Y6,J6]=K6(zy),Vk=w.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:s,required:a=!1,disabled:l=!1,orientation:c,dir:f,loop:p=!0,onValueChange:m,..._}=t,x=Bk(n),P=dh(f),[b,k]=os({prop:s,defaultProp:i,onChange:m});return d.jsx(Y6,{scope:n,name:r,required:a,disabled:l,value:b,onValueChange:k,children:d.jsx(o1,{asChild:!0,...x,orientation:c,dir:P,loop:p,children:d.jsx(be.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":l?"":void 0,dir:P,..._,ref:e})})})});Vk.displayName=zy;var Hk="RadioGroupItem",Wk=w.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...i}=t,s=J6(Hk,n),a=s.disabled||r,l=Bk(n),c=Uk(n),f=w.useRef(null),p=Qe(e,f),m=s.value===i.value,_=w.useRef(!1);return w.useEffect(()=>{const x=b=>{G6.includes(b.key)&&(_.current=!0)},P=()=>_.current=!1;return document.addEventListener("keydown",x),document.addEventListener("keyup",P),()=>{document.removeEventListener("keydown",x),document.removeEventListener("keyup",P)}},[]),d.jsx(a1,{asChild:!0,...l,focusable:!a,active:m,children:d.jsx(Dk,{disabled:a,required:s.required,
407checked:m,...c,...i,name:s.name,ref:p,onCheck:()=>s.onValueChange(i.value),onKeyDown:ve(x=>{x.key==="Enter"&&x.preventDefault()}),onFocus:ve(i.onFocus,()=>{var x;_.current&&((x=f.current)==null||x.click())})})})});Wk.displayName=Hk;var Q6="RadioGroupIndicator",Zk=w.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,i=Uk(n);return d.jsx($k,{...i,...r,ref:e})});Zk.displayName=Q6;var qk=Vk,Gk=Wk,X6=Zk;const Kk=w.forwardRef(({className:t,...e},n)=>d.jsx(qk,{className:X("grid gap-2",t),...e,ref:n}));Kk.displayName=qk.displayName;const Kg=w.forwardRef(({className:t,...e},n)=>d.jsx(Gk,{ref:n,className:X("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:d.jsx(X6,{className:"flex items-center justify-center",children:d.jsx(NM,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Kg.displayName=Gk.displayName;const ub="appSettings",e8=()=>{const{toast:t}=_s(),{t:e,language:n,setLanguage:r}=Nt(),[i,s]=w.useState({aiProvider:"Google",aiModel:"",apiKey:"",theme:"light"});w.useEffect(()=>{const f=localStorage.getItem(ub);if(f)try{const p=JSON.parse(f),{language:m,..._}=p;s(x=>({...x,..._})),console.log("Loaded non-language settings from localStorage:",_),p.theme&&l(p.theme)}catch(p){console.error("Failed to parse settings from localStorage:",p)}},[]);const a=(f,p)=>{s(m=>({...m,[f]:p})),f==="theme"&&l(p)},l=f=>{const p=window.document.documentElement;p.classList.remove("light","dark"),p.classList.add(f),console.log(`Applied theme: ${f}`)},c=f=>{f.preventDefault();try{const p={...i};localStorage.setItem(ub,JSON.stringify(p)),t({title:e("settingsSaved"),description:e("settingsSavedDescription")})}catch(p){console.error("Failed to save settings to localStorage:",p),t({title:e("errorSavingSettings"),description:e("errorSavingSettingsDescription"),variant:"destructive"})}};return d.jsx(Ja,{children:d.jsxs("div",{className:"p-6 space-y-6 max-w-4xl mx-auto",children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:e("settings")}),d.jsxs("form",{onSubmit:c,className:"space-y-6",children:[d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:e("aiConfig")}),d.jsx(kt,{children:e("aiConfigDescription")})]}),d.jsxs(We,{className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 items-center",children:[d.jsx(rt,{htmlFor:"ai-provider",className:"md:text-right",children:e("provider")}),d.jsxs(af,{value:i.aiProvider,onValueChange:f=>a("aiProvider",f),children:[d.jsx(gu,{id:"ai-provider",className:"col-span-2",children:d.jsx(lf,{placeholder:e("selectProvider")})}),d.jsxs(vu,{children:[d.jsx(Nr,{value:"Google",children:"Google"}),d.jsx(Nr,{value:"OpenAI",children:"OpenAI"}),d.jsx(Nr,{value:"OpenRouter",children:"OpenRouter"}),d.jsx(Nr,{value:"Grok",children:"Grok"}),d.jsx(Nr,{value:"xAI",children:"xAI"})]})]})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 items-center",children:[d.jsx(rt,{htmlFor:"ai-model",className:"md:text-right",children:e("model")}),d.jsx(Et,{id:"ai-model",value:i.aiModel,onChange:f=>a("aiModel",f.target.value),placeholder:e("modelPlaceholder"),className:"col-span-2"})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 items-center",children:[d.jsx(rt,{htmlFor:"api-key",className:"md:text-right",children:e("apiKey")}),d.jsx(Et,{id:"api-key",type:"password",value:i.apiKey,onChange:f=>a("apiKey",f.target.value),placeholder:e("apiKeyPlaceholder"),className:"col-span-2"}),d.jsx("p",{className:"text-xs text-muted-foreground col-span-2 md:col-start-2",children:e("apiKeyNote")})]})]})]}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:e("languageRegion")}),d.jsx(kt,{children:e("languageRegionDescription")})]}),d.jsx(We,{className:"space-y-4",children:d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 items-center",children:[d.jsx(rt,{htmlFor:"language",className:"md:text-right",children:e("language")}),d.jsxs(af,{value:n,onValueChange:f=>r(f),children:[d.jsx(gu,{id:"language",className:"col-span-2",children:d.jsx(lf,{placeholder:e("selectLanguage")})}),d.jsxs(vu,{children:[d.jsx(Nr,{value:"es",children:e("spanish")}),d.jsx(Nr,{value:"en",children:e("english")})]})]})]})})]}),d.jsxs(He,{children:[d.jsxs(Ke,{children:[d.jsx(at,{children:e("appearance")}),d.jsx(kt,{children:e("appearanceDescription")})]}),d.jsx(We,{children:d.jsxs(Kk,{value:i.theme,onValueChange:f=>a("theme",f),className:"flex space-x-4",children:[d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx(Kg,{value:"light",id:"theme-light"}),d.jsx(rt,{htmlFor:"theme-light",children:e("light")})]}),d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx(Kg,{value:"dark",id:"theme-dark"}),d.jsx(rt,{htmlFor:"theme-dark",children:e("dark")})]})]})})]}),d.jsx("div",{className:"flex justify-end pt-4",children:d.jsx(Le,{type:"submit",children:e("saveSettings")})})]})]})})},t8=()=>{const t=ws(),e=qa(),n=t.pathname.startsWith("/dashboard");return w.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),d.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:d.jsxs("div",{className:"text-center max-w-md mx-auto p-6 bg-white rounded-lg shadow-md",children:[d.jsx("h1",{className:"text-6xl font-bold mb-4 text-primary",children:"404"}),d.jsx("p",{className:"text-xl text-gray-600 mb-6",children:"Oops! The page you're looking for doesn't exist."}),d.jsx("div",{className:"space-y-4",children:n?d.jsxs(Le,{variant:"default",className:"flex items-center gap-2",onClick:()=>
407e("/dashboard"),children:[d.jsx(Xx,{size:16}),"Return to Dashboard"]}):d.jsxs(Le,{variant:"default",className:"flex items-center gap-2",onClick:()=>e("/"),children:[d.jsx(Xx,{size:16}),"Return to Home"]})})]})})},n8="appSettings",r8=new JO,Lo=({children:t})=>{const[e,n]=w.useState(!0),[r,i]=w.useState(!1);return w.useEffect(()=>{(async()=>{const{data:{session:a}}=await Je.auth.getSession();i(!!a),n(!1)})()},[]),e?d.jsx("div",{children:"Loading..."}):r?t:d.jsx(Uj,{to:"/login",replace:!0})},i8=()=>{const[t,e]=w.useState(null);return w.useEffect(()=>{Je.auth.getSession().then(({data:{session:r}})=>{e(r)});const{data:{subscription:n}}=Je.auth.onAuthStateChange((r,i)=>{e(i)});return()=>n.unsubscribe()},[]),w.useEffect(()=>{const n=localStorage.getItem(n8);let r="light";if(n)try{const s=JSON.parse(n);(s.theme==="dark"||s.theme==="light")&&(r=s.theme)}catch(s){console.error("Failed to parse theme from localStorage:",s)}const i=window.document.documentElement;i.classList.remove("light","dark"),i.classList.add(r),console.log(`Applied initial theme: ${r}`)},[]),d.jsx(XO,{client:r8,children:d.jsxs(O$,{children:[d.jsxs(D$,{children:[" ",d.jsxs(nE,{children:[d.jsx(bL,{}),d.jsx(e2,{}),d.jsx(Qj,{children:d.jsxs(Hj,{children:[d.jsx(Xt,{path:"/",element:d.jsx($$,{})}),d.jsx(Xt,{path:"/map",element:d.jsx(N4,{})}),d.jsx(Xt,{path:"/hospitals",element:d.jsx(A4,{})}),d.jsx(Xt,{path:"/hospitals/:hospitalId",element:d.jsx(DU,{})}),d.jsx(Xt,{path:"/search",element:d.jsx(zU,{})}),d.jsx(Xt,{path:"/donate",element:d.jsx(BU,{})}),d.jsx(Xt,{path:"/login",element:d.jsx(F$,{})}),d.jsx(Xt,{path:"/dashboard",element:d.jsx(Lo,{children:d.jsx(E3,{})})}),d.jsx(Xt,{path:"/dashboard/upload",element:d.jsx(Lo,{children:d.jsx(F6,{})})}),d.jsx(Xt,{path:"/dashboard/hospitals",element:d.jsx(Lo,{children:d.jsx(B6,{})})}),d.jsx(Xt,{path:"/dashboard/events",element:d.jsx(Lo,{children:d.jsx(U6,{})})}),d.jsx(Xt,{path:"/dashboard/patients",element:d.jsx(Lo,{children:d.jsx(V6,{})})}),d.jsx(Xt,{path:"/dashboard/settings",element:d.jsx(Lo,{children:d.jsx(e8,{})})}),d.jsx(Xt,{path:"*",element:d.jsx(t8,{})})]})})]})]})," "]})})};AS(document.getElementById("root")).render(d.jsx(i8,{}));"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/service-worker.js").then(t=>{console.log("Service Worker registered: ",t)}).catch(t=>{console.log("Service Worker registration failed: ",t)})});export{Yg as g};
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.