PageSourceSearch

https://richmedia.bf/assets/index-BxRgjxLh.js

js richmedia.bf collected 2026-10-06 13:17:16 UTC 966,606 bytes, 594 lines download raw bytes

vendor: 4,140 bytes, lines 1-9
1var Ny=e=>{throw TypeError(e)};var qh=(e,t,n)=>t.has(e)||Ny("Cannot "+n);var F=(e,t,n)=>(qh(e,t,"read from private field"),n?n.call(e):t.get(e)),Ce=(e,t,n)=>t.has(e)?Ny("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ye=(e,t,n,r)=>(qh(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Tt=(e,t,n)=>(qh(e,t,"access private method"),n);var Cc=(e,t,n,r)=>({set _(s){ye(e,t,s,n)},get _(){return F(e,t,r)}});function f2(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function o_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a_={exports:{}},Ud={},l_={exports:{}},_e={};/**
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 oc=Symbol.for("react.element"),p2=Symbol.for("react.portal"),m2=Symbol.for("react.fragment"),g2=Symbol.for("react.strict_mode"),v2=Symbol.for("react.profiler"),y2=Symbol.for("react.provider"),x2=Symbol.for("react.context"),w2=Symbol.for("react.forward_ref"),b2=Symbol.for("react.suspense"),_2=Symbol.for("react.memo"),S2=Symbol.for("react.lazy"),Py=Symbol.iterator;function j2(e){return e===null||typeof e!="object"?null:(e=Py&&e[Py]||e["@@iterator"],typeof e=="function"?e:null)}var c_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},u_=Object.assign,d_={};function ma(e,t,n){this.props=e,this.context=t,this.refs=d_,this.updater=n||c_}ma.prototype.isReactComponent={};ma.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};ma.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function h_(){}h_.prototype=ma.prototype;function hg(e,t,n){this.props=e,this.context=t,this.refs=d_,this.updater=n||c_}var fg=hg.prototype=new h_;fg.constructor=hg;u_(fg,ma.prototype);fg.isPureReactComponent=!0;var Ay=Array.isArray,f_=Object.prototype.hasOwnProperty,pg={current:null},p_={key:!0,ref:!0,__self:!0,__source:!0};function m_(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)f_.call(t,r)&&!p_.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:oc,type:e,key:i,ref:o,props:s,_owner:pg.current}}function k2(e,t){return{$$typeof:oc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function mg(e){return typeof e=="object"&&e!==null&&e.$$typeof===oc}function C2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ry=/\/+/g;function Kh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?C2(""+e.key):t.toString(36)}
vendor: 4,786 bytes, lines 9-17
9function fu(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case oc:case p2:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Kh(o,0):r,Ay(s)?(n="",e!=null&&(n=e.replace(Ry,"$&/")+"/"),fu(s,t,n,"",function(u){return u})):s!=null&&(mg(s)&&(s=k2(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Ry,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Ay(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Kh(i,l);o+=fu(i,t,n,c,s)}else if(c=j2(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Kh(i,l++),o+=fu(i,t,n,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Ec(e,t,n){if(e==null)return e;var r=[],s=0;return fu(e,r,"","",function(i){return t.call(n,i,s++)}),r}function E2(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ht={current:null},pu={transition:null},T2={ReactCurrentDispatcher:Ht,ReactCurrentBatchConfig:pu,ReactCurrentOwner:pg};function g_(){throw Error("act(...) is not supported in production builds of React.")}_e.Children={map:Ec,forEach:function(e,t,n){Ec(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ec(e,function(){t++}),t},toArray:function(e){return Ec(e,function(t){return t})||[]},only:function(e){if(!mg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};_e.Component=ma;_e.Fragment=m2;_e.Profiler=v2;_e.PureComponent=hg;_e.StrictMode=g2;_e.Suspense=b2;_e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T2;_e.act=g_;_e.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=u_({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=pg.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)f_.call(t,c)&&!p_.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:oc,type:e.type,key:s,ref:i,props:r,_owner:o}};_e.createContext=function(e){return e={$$typeof:x2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:y2,_context:e},e.Consumer=e};_e.createElement=m_;_e.createFactory=function(e){var t=m_.bind(null,e);return t.type=e,t};_e.createRef=function(){return{current:null}};_e.forwardRef=function(e){return{$$typeof:w2,render:e}};_e.isValidElement=mg;_e.lazy=function(e){return{$$typeof:S2,_payload:{_status:-1,_result:e},_init:E2}};_e.memo=function(e,t){return{$$typeof:_2,type:e,compare:t===void 0?null:t}};_e.startTransition=function(e){var t=pu.transition;pu.transition={};try{e()}finally{pu.transition=t}};_e.unstable_act=g_;_e.useCallback=function(e,t){return Ht.current.useCallback(e,t)};_e.useContext=function(e){return Ht.current.useContext(e)};_e.useDebugValue=function(){};_e.useDeferredValue=function(e){return Ht.current.useDeferredValue(e)};_e.useEffect=function(e,t){return Ht.current.useEffect(e,t)};_e.useId=function(){return Ht.current.useId()};_e.useImperativeHandle=function(e,t,n){return Ht.current.useImperativeHandle(e,t,n)};_e.useInsertionEffect=function(e,t){return Ht.current.useInsertionEffect(e,t)};_e.useLayoutEffect=function(e,t){return Ht.current.useLayoutEffect(e,t)};_e.useMemo=function(e,t){return Ht.current.useMemo(e,t)};_e.useReducer=function(e,t,n){return Ht.current.useReducer(e,t,n)};_e.useRef=function(e){return Ht.current.useRef(e)};_e.useState=function(e){return Ht.current.useState(e)};_e.useSyncExternalStore=function(e,t,n){return Ht.current.useSyncExternalStore(e,t,n)};_e.useTransition=function(){return Ht.current.useTransition()};_e.version="18.3.1";l_.exports=_e;var m=l_.exports;const G=o_(m),gg=f2({__proto__:null,default:G},[m]);/**
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 N2=m,P2=Symbol.for("react.element"),A2=Symbol.for("react.fragment"),R2=Object.prototype.hasOwnProperty,O2=N2.__SECRET_INT
vendor: 11,408 bytes, lines 17-34
17ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,I2={key:!0,ref:!0,__self:!0,__source:!0};function v_(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)R2.call(t,r)&&!I2.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:P2,type:e,key:i,ref:o,props:s,_owner:O2.current}}Ud.Fragment=A2;Ud.jsx=v_;Ud.jsxs=v_;a_.exports=Ud;var a=a_.exports,y_={exports:{}},un={},x_={exports:{}},w_={};/**
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(e){function t(N,O){var V=N.length;N.push(O);e:for(;0<V;){var H=V-1>>>1,Z=N[H];if(0<s(Z,O))N[H]=O,N[V]=Z,V=H;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var O=N[0],V=N.pop();if(V!==O){N[0]=V;e:for(var H=0,Z=N.length,B=Z>>>1;H<B;){var le=2*(H+1)-1,Pe=N[le],Me=le+1,Q=N[Me];if(0>s(Pe,V))Me<Z&&0>s(Q,Pe)?(N[H]=Q,N[Me]=V,H=Me):(N[H]=Pe,N[le]=V,H=le);else if(Me<Z&&0>s(Q,V))N[H]=Q,N[Me]=V,H=Me;else break e}}return O}function s(N,O){var V=N.sortIndex-O.sortIndex;return V!==0?V:N.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,h=null,f=3,p=!1,g=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(N){for(var O=n(u);O!==null;){if(O.callback===null)r(u);else if(O.startTime<=N)r(u),O.sortIndex=O.expirationTime,t(c,O);else break;O=n(u)}}function _(N){if(v=!1,y(N),!g)if(n(c)!==null)g=!0,D(j);else{var O=n(u);O!==null&&A(_,O.startTime-N)}}function j(N,O){g=!1,v&&(v=!1,b(S),S=-1),p=!0;var V=f;try{for(y(O),h=n(c);h!==null&&(!(h.expirationTime>O)||N&&!I());){var H=h.callback;if(typeof H=="function"){h.callback=null,f=h.priorityLevel;var Z=H(h.expirationTime<=O);O=e.unstable_now(),typeof Z=="function"?h.callback=Z:h===n(c)&&r(c),y(O)}else r(c);h=n(c)}if(h!==null)var B=!0;else{var le=n(u);le!==null&&A(_,le.startTime-O),B=!1}return B}finally{h=null,f=V,p=!1}}var C=!1,k=null,S=-1,P=5,E=-1;function I(){return!(e.unstable_now()-E<P)}function R(){if(k!==null){var N=e.unstable_now();E=N;var O=!0;try{O=k(!0,N)}finally{O?$():(C=!1,k=null)}}else C=!1}var $;if(typeof w=="function")$=function(){w(R)};else if(typeof MessageChannel<"u"){var T=new MessageChannel,U=T.port2;T.port1.onmessage=R,$=function(){U.postMessage(null)}}else $=function(){x(R,0)};function D(N){k=N,C||(C=!0,$())}function A(N,O){S=x(function(){N(e.unstable_now())},O)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,D(j))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(N){switch(f){case 1:case 2:case 3:var O=3;break;default:O=f}var V=f;f=O;try{return N()}finally{f=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,O){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var V=f;f=N;try{return O()}finally{f=V}},e.unstable_scheduleCallback=function(N,O,V){var H=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?H+V:H):V=H,N){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=V+Z,N={id:d++,callback:O,priorityLevel:N,startTime:V,expirationTime:Z,sortIndex:-1},V>H?(N.sortIndex=V,t(u,N),n(c)===null&&N===n(u)&&(v?(b(S),S=-1):v=!0,A(_,V-H))):(N.sortIndex=Z,t(c,N),g||p||(g=!0,D(j))),N},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(N){var O=f;return function(){var V=f;f=O;try{return N.apply(this,arguments)}finally{f=V}}}})(w_);x_.exports=w_;var M2=x_.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 D2=m,ln=M2;function q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var b_=new Set,xl={};function Mi(e,t){Zo(e,t),Zo(e+"Capture",t)}function Zo(e,t){for(xl[e]=t,e=0;e<t.length;e++)b_.add(t[e])}var Or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ip=Object.prototype.hasOwnProperty,L2=/^[: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]*$/,Oy={},Iy={};function $2(e){return ip.call(Iy,e)?!0:ip.call(Oy,e)?!1:L2.test(e)?Iy[e]=!0:(Oy[e]=!0,!1)}function F2(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function V2(e,t,n,r){if(t===null||typeof t>"u"||F2(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Wt(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Wt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Wt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Wt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Wt(e,2,!1,e,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(e){kt[e]=new Wt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Wt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Wt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Wt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Wt(e,5,!1,e.toLowerCase(),null,!1,!1)});var vg=/[\-:]([a-z])/g;function yg(e){return e[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(e){var t=e.replace(vg,yg);kt[t]=new Wt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(vg,yg);kt[t]=new Wt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(vg,yg);kt[t]=new Wt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Wt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!0,!0)});function xg(e,t,n,r){var s=kt.hasOwnProperty(t)?kt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(V2(t,n,s,r)&&(n=null),r||s===null?$2(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ur=D2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Tc=Symbol.for("react.element"),mo=Symbol.for("react.portal"),go=Symbol.for("react.fragment"),wg=Symbol.for("react.strict_mode"),op=Symbol.for("react.profiler"),__=Symbol.for("react.provider"),S_=Symbol.for("react.context"),bg=Symbol.for("react.forward_ref"),ap=Symbol.for("react.suspense"),lp=Symbol.for("react.suspense_list"),_g=Symbol.for("react.memo"),ns=Symbol.for("react.lazy"),j_=Symbol.for("react.offscreen"),My=Symbol.iterator;function Ra(e){return e===null||typeof e!="object"?null:(e=My&&e[My]||e["@@iterator"],typeof e=="function"?e:null)}var Qe=Object.assign,Gh;function Wa(e){if(Gh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Gh=t&&t[1]||""}return`
34`+Gh+e}var Yh=!1;function Zh(e,t){if(!e||Yh)return"";Yh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}
vendor: 15,720 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
35`),i=r.stack.split(`
36`),o=s.length-1,l=i.length-1;1<=o&&0<=l&&s[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==i[l]){var c=`
37`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Yh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wa(e):""}function U2(e){switch(e.tag){case 5:return Wa(e.type);case 16:return Wa("Lazy");case 13:return Wa("Suspense");case 19:return Wa("SuspenseList");case 0:case 2:case 15:return e=Zh(e.type,!1),e;case 11:return e=Zh(e.type.render,!1),e;case 1:return e=Zh(e.type,!0),e;default:return""}}function cp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case go:return"Fragment";case mo:return"Portal";case op:return"Profiler";case wg:return"StrictMode";case ap:return"Suspense";case lp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case S_:return(e.displayName||"Context")+".Consumer";case __:return(e._context.displayName||"Context")+".Provider";case bg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _g:return t=e.displayName||null,t!==null?t:cp(e.type)||"Memo";case ns:t=e._payload,e=e._init;try{return cp(e(t))}catch{}}return null}function B2(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return cp(t);case 8:return t===wg?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function As(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function k_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function z2(e){var t=k_(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Nc(e){e._valueTracker||(e._valueTracker=z2(e))}function C_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=k_(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function up(e,t){var n=t.checked;return Qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Dy(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=As(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function E_(e,t){t=t.checked,t!=null&&xg(e,"checked",t,!1)}function dp(e,t){E_(e,t);var n=As(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hp(e,t.type,n):t.hasOwnProperty("defaultValue")&&hp(e,t.type,As(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ly(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function hp(e,t,n){(t!=="number"||Vu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qa=Array.isArray;function Ao(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+As(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function fp(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(q(91));return Qe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function $y(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(q(92));if(qa(n)){if(1<n.length)throw Error(q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:As(n)}}function T_(e,t){var n=As(t.value),r=As(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Fy(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function N_(e){switch(e){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 pp(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?N_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Pc,P_=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Pc=Pc||document.createElement("div"),Pc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Pc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function wl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var el={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},H2=["Webkit","ms","Moz","O"];Object.keys(el).forEach(function(e){H2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),el[t]=el[e]})});function A_(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||el.hasOwnProperty(e)&&el[e]?(""+t).trim():t+"px"}function R_(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=A_(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var W2=Qe({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 mp(e,t){if(t){if(W2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(q(62))}}function gp(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 vp=null;function Sg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yp=null,Ro=null,Oo=null;function Vy(e){if(e=cc(e)){if(typeof yp!="function")throw Error(q(280));var t=e.stateNode;t&&(t=qd(t),yp(e.stateNode,e.type,t))}}function O_(e){Ro?Oo?Oo.push(e):Oo=[e]:Ro=e}function I_(){if(Ro){var e=Ro,t=Oo;if(Oo=Ro=null,Vy(e),t)for(e=0;e<t.length;e++)Vy(t[e])}}function M_(e,t){return e(t)}function D_(){}var Jh=!1;function L_(e,t,n){if(Jh)return e(t,n);Jh=!0;try{return M_(e,t,n)}finally{Jh=!1,(Ro!==null||Oo!==null)&&(D_(),I_())}}function bl(e,t){var n=e.stateNode;if(n===null)return null;var r=qd(n);if(r===null)return null;n=r[t];e:switch(t){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)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(q(231,t,typeof n));return n}var xp=!1;if(Or)try{var Oa={};Object.defineProperty(Oa,"passive",{get:function(){xp=!0}}),window.addEventListener("test",Oa,Oa),window.removeEventListener("test",Oa,Oa)}catch{xp=!1}function q2(e,t,n,r,s,i,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var tl=!1,Uu=null,Bu=!1,wp=null,K2={onError:function(e){tl=!0,Uu=e}};function G2(e,t,n,r,s,i,o,l,c){tl=!1,Uu=null,q2.apply(K2,arguments)}function Y2(e,t,n,r,s,i,o,l,c){if(G2.apply(this,arguments),tl){if(tl){var u=Uu;tl=!1,Uu=null}else throw Error(q(198));Bu||(Bu=!0,wp=u)}}function Di(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function $_(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Uy(e){if(Di(e)!==e)throw Error(q(188))}function Z2(e){var t=e.alternate;if(!t){if(t=Di(e),t===null)throw Error(q(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Uy(s),e;if(i===r)return Uy(s),t;i=i.sibling}throw Error(q(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o)throw Error(q(189))}}if(n.alternate!==r)throw Error(q(190))}if(n.tag!==3)throw Error(q(188));return n.stateNode.current===n?e:t}function F_(e){return e=Z2(e),e!==null?V_(e):null}function V_(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=V_(e);if(t!==null)return t;e=e.sibling}return null}var U_=ln.unstable_scheduleCallback,By=ln.unstable_cancelCallback,J2=ln.unstable_shouldYield,Q2=ln.unstable_requestPaint,st=ln.unstable_now,X2=ln.unstable_getCurrentPriorityLevel,jg=ln.unstable_ImmediatePriority,B_=ln.unstable_UserBlockingPriority,zu=ln.unstable_NormalPriority,eP=ln.unstable_LowPriority,z_=ln.unstable_IdlePriority,Bd=null,hr=null;function tP(e){if(hr&&typeof hr.onCommitFiberRoot=="function")try{hr.onCommitFiberRoot(Bd,e,void 0,(e.current.flags&128)===128)}catch{}}var qn=Math.clz32?Math.clz32:sP,nP=Math.log,rP=Math.LN2;function sP(e){return e>>>=0,e===0?32:31-(nP(e)/rP|0)|0}var Ac=64,Rc=4194304;function Ka(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~s;l!==0?r=Ka(l):(i&=o,i!==0&&(r=Ka(i)))}else o=n&~s,o!==0?r=Ka(o):i!==0&&(r=Ka(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-qn(t),s=1<<n,r|=e[n],t&=~s;return r}function iP(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 oP(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-qn(i),l=1<<o,c=s[o];c===-1?(!(l&n)||l&r)&&(s[o]=iP(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function bp(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function H_(){var e=Ac;return Ac<<=1,!(Ac&4194240)&&(Ac=64),e}function Qh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ac(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qn(t),e[t]=n}function aP(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-qn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function kg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-qn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var Ae=0;function W_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var q_,Cg,K_,G_,Y_,_p=!1,Oc=[],xs=null,ws=null,bs=null,_l=new Map,Sl=new Map,is=[],lP="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 zy(e,t){switch(e){case"focusin":case"focusout":xs=null;break;case"dragenter":case"dragleave":ws=null;break;case"mouseover":case"mouseout":bs=null;break;case"pointerover":case"pointerout":_l.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sl.delete(t.pointerId)}}function Ia(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=cc(t),t!==null&&Cg(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function cP(e,t,n,r,s){switch(t){case"focusin":return xs=Ia(xs,e,t,n,r,s),!0;case"dragenter":return ws=Ia(ws,e,t,n,r,s),!0;
vendor: 11,584 bytes, line 37
37case"mouseover":return bs=Ia(bs,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return _l.set(i,Ia(_l.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Sl.set(i,Ia(Sl.get(i)||null,e,t,n,r,s)),!0}return!1}function Z_(e){var t=ci(e.target);if(t!==null){var n=Di(t);if(n!==null){if(t=n.tag,t===13){if(t=$_(n),t!==null){e.blockedOn=t,Y_(e.priority,function(){K_(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function mu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sp(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);vp=r,n.target.dispatchEvent(r),vp=null}else return t=cc(n),t!==null&&Cg(t),e.blockedOn=n,!1;t.shift()}return!0}function Hy(e,t,n){mu(e)&&n.delete(t)}function uP(){_p=!1,xs!==null&&mu(xs)&&(xs=null),ws!==null&&mu(ws)&&(ws=null),bs!==null&&mu(bs)&&(bs=null),_l.forEach(Hy),Sl.forEach(Hy)}function Ma(e,t){e.blockedOn===t&&(e.blockedOn=null,_p||(_p=!0,ln.unstable_scheduleCallback(ln.unstable_NormalPriority,uP)))}function jl(e){function t(s){return Ma(s,e)}if(0<Oc.length){Ma(Oc[0],e);for(var n=1;n<Oc.length;n++){var r=Oc[n];r.blockedOn===e&&(r.blockedOn=null)}}for(xs!==null&&Ma(xs,e),ws!==null&&Ma(ws,e),bs!==null&&Ma(bs,e),_l.forEach(t),Sl.forEach(t),n=0;n<is.length;n++)r=is[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<is.length&&(n=is[0],n.blockedOn===null);)Z_(n),n.blockedOn===null&&is.shift()}var Io=Ur.ReactCurrentBatchConfig,Wu=!0;function dP(e,t,n,r){var s=Ae,i=Io.transition;Io.transition=null;try{Ae=1,Eg(e,t,n,r)}finally{Ae=s,Io.transition=i}}function hP(e,t,n,r){var s=Ae,i=Io.transition;Io.transition=null;try{Ae=4,Eg(e,t,n,r)}finally{Ae=s,Io.transition=i}}function Eg(e,t,n,r){if(Wu){var s=Sp(e,t,n,r);if(s===null)cf(e,t,r,qu,n),zy(e,r);else if(cP(s,e,t,n,r))r.stopPropagation();else if(zy(e,r),t&4&&-1<lP.indexOf(e)){for(;s!==null;){var i=cc(s);if(i!==null&&q_(i),i=Sp(e,t,n,r),i===null&&cf(e,t,r,qu,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else cf(e,t,r,null,n)}}var qu=null;function Sp(e,t,n,r){if(qu=null,e=Sg(r),e=ci(e),e!==null)if(t=Di(e),t===null)e=null;else if(n=t.tag,n===13){if(e=$_(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return qu=e,null}function J_(e){switch(e){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(X2()){case jg:return 1;case B_:return 4;case zu:case eP:return 16;case z_:return 536870912;default:return 16}default:return 16}}var ps=null,Tg=null,gu=null;function Q_(){if(gu)return gu;var e,t=Tg,n=t.length,r,s="value"in ps?ps.value:ps.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return gu=s.slice(e,1<r?1-r:void 0)}function vu(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ic(){return!0}function Wy(){return!1}function dn(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ic:Wy,this.isPropagationStopped=Wy,this}return Qe(t.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}),t}var ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ng=dn(ga),lc=Qe({},ga,{view:0,detail:0}),fP=dn(lc),Xh,ef,Da,zd=Qe({},lc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pg,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Da&&(Da&&e.type==="mousemove"?(Xh=e.screenX-Da.screenX,ef=e.screenY-Da.screenY):ef=Xh=0,Da=e),Xh)},movementY:function(e){return"movementY"in e?e.movementY:ef}}),qy=dn(zd),pP=Qe({},zd,{dataTransfer:0}),mP=dn(pP),gP=Qe({},lc,{relatedTarget:0}),tf=dn(gP),vP=Qe({},ga,{animationName:0,elapsedTime:0,pseudoElement:0}),yP=dn(vP),xP=Qe({},ga,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wP=dn(xP),bP=Qe({},ga,{data:0}),Ky=dn(bP),_P={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},SP={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"},jP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jP[e])?!!t[e]:!1}function Pg(){return kP}var CP=Qe({},lc,{key:function(e){if(e.key){var t=_P[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?SP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pg,charCode:function(e){return e.type==="keypress"?vu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),EP=dn(CP),TP=Qe({},zd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gy=dn(TP),NP=Qe({},lc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pg}),PP=dn(NP),AP=Qe({},ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),RP=dn(AP),OP=Qe({},zd,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),IP=dn(OP),MP=[9,13,27,32],Ag=Or&&"CompositionEvent"in window,nl=null;Or&&"documentMode"in document&&(nl=document.documentMode);var DP=Or&&"TextEvent"in window&&!nl,X_=Or&&(!Ag||nl&&8<nl&&11>=nl),Yy=" ",Zy=!1;function e1(e,t){switch(e){case"keyup":return MP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function t1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vo=!1;function LP(e,t){switch(e){case"compositionend":return t1(t);case"keypress":return t.which!==32?null:(Zy=!0,Yy);case"textInput":return e=t.data,e===Yy&&Zy?null:e;default:return null}}function $P(e,t){if(vo)return e==="compositionend"||!Ag&&e1(e,t)?(e=Q_(),gu=Tg=ps=null,vo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return X_&&t.locale!=="ko"?null:t.data;default:return null}}var FP={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 Jy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!FP[e.type]:t==="textarea"}function n1(e,t,n,r){O_(r),t=Ku(t,"onChange"),0<t.length&&(n=new Ng("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var rl=null,kl=null;function VP(e){f1(e,0)}function Hd(e){var t=wo(e);if(C_(t))return e}function UP(e,t){if(e==="change")return t}var r1=!1;if(Or){var nf;if(Or){var rf="oninput"in document;if(!rf){var Qy=document.createElement("div");Qy.setAttribute("oninput","return;"),rf=typeof Qy.oninput=="function"}nf=rf}else nf=!1;r1=nf&&(!document.documentMode||9<document.documentMode)}function Xy(){rl&&(rl.detachEvent("onpropertychange",s1),kl=rl=null)}function s1(e){if(e.propertyName==="value"&&Hd(kl)){var t=[];n1(t,kl,e,Sg(e)),L_(VP,t)}}function BP(e,t,n){e==="focusin"?(Xy(),rl=t,kl=n,rl.attachEvent("onpropertychange",s1)):e==="focusout"&&Xy()}function zP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hd(kl)}function HP(e,t){if(e==="click")return Hd(t)}function WP(e,t){if(e==="input"||e==="change")return Hd(t)}function qP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yn=typeof Object.is=="function"?Object.is:qP;function Cl(e,t){if(Yn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!ip.call(t,s)||!Yn(e[s],t[s]))return!1}return!0}function ex(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tx(e,t){var n=ex(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ex(n)}}function i1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?i1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function o1(){for(var e=window,t=Vu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vu(e.document)}return t}function Rg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function KP(e){var t=o1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&i1(n.ownerDocument.documentElement,n)){if(r!==null&&Rg(n)){if
vendor: 4,424 bytes, line 37
37(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=tx(n,i);var o=tx(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var GP=Or&&"documentMode"in document&&11>=document.documentMode,yo=null,jp=null,sl=null,kp=!1;function nx(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kp||yo==null||yo!==Vu(r)||(r=yo,"selectionStart"in r&&Rg(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}),sl&&Cl(sl,r)||(sl=r,r=Ku(jp,"onSelect"),0<r.length&&(t=new Ng("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=yo)))}function Mc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var xo={animationend:Mc("Animation","AnimationEnd"),animationiteration:Mc("Animation","AnimationIteration"),animationstart:Mc("Animation","AnimationStart"),transitionend:Mc("Transition","TransitionEnd")},sf={},a1={};Or&&(a1=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function Wd(e){if(sf[e])return sf[e];if(!xo[e])return e;var t=xo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in a1)return sf[e]=t[n];return e}var l1=Wd("animationend"),c1=Wd("animationiteration"),u1=Wd("animationstart"),d1=Wd("transitionend"),h1=new Map,rx="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 Ws(e,t){h1.set(e,t),Mi(t,[e])}for(var of=0;of<rx.length;of++){var af=rx[of],YP=af.toLowerCase(),ZP=af[0].toUpperCase()+af.slice(1);Ws(YP,"on"+ZP)}Ws(l1,"onAnimationEnd");Ws(c1,"onAnimationIteration");Ws(u1,"onAnimationStart");Ws("dblclick","onDoubleClick");Ws("focusin","onFocus");Ws("focusout","onBlur");Ws(d1,"onTransitionEnd");Zo("onMouseEnter",["mouseout","mouseover"]);Zo("onMouseLeave",["mouseout","mouseover"]);Zo("onPointerEnter",["pointerout","pointerover"]);Zo("onPointerLeave",["pointerout","pointerover"]);Mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Mi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ga="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(" "),JP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ga));function sx(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Y2(r,t,void 0,e),e.currentTarget=null}
vendor: 5,656 bytes, line 37
37function f1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&s.isPropagationStopped())break e;sx(s,l,u),i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&s.isPropagationStopped())break e;sx(s,l,u),i=c}}}if(Bu)throw e=wp,Bu=!1,wp=null,e}function Be(e,t){var n=t[Pp];n===void 0&&(n=t[Pp]=new Set);var r=e+"__bubble";n.has(r)||(p1(t,e,2,!1),n.add(r))}function lf(e,t,n){var r=0;t&&(r|=4),p1(n,e,r,t)}var Dc="_reactListening"+Math.random().toString(36).slice(2);function El(e){if(!e[Dc]){e[Dc]=!0,b_.forEach(function(n){n!=="selectionchange"&&(JP.has(n)||lf(n,!1,e),lf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Dc]||(t[Dc]=!0,lf("selectionchange",!1,t))}}function p1(e,t,n,r){switch(J_(t)){case 1:var s=dP;break;case 4:s=hP;break;default:s=Eg}n=s.bind(null,t,n,e),s=void 0,!xp||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function cf(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;l!==null;){if(o=ci(l),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}l=l.parentNode}}r=r.return}L_(function(){var u=i,d=Sg(n),h=[];e:{var f=h1.get(e);if(f!==void 0){var p=Ng,g=e;switch(e){case"keypress":if(vu(n)===0)break e;case"keydown":case"keyup":p=EP;break;case"focusin":g="focus",p=tf;break;case"focusout":g="blur",p=tf;break;case"beforeblur":case"afterblur":p=tf;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":p=qy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=mP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=PP;break;case l1:case c1:case u1:p=yP;break;case d1:p=RP;break;case"scroll":p=fP;break;case"wheel":p=IP;break;case"copy":case"cut":case"paste":p=wP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Gy}var v=(t&4)!==0,x=!v&&e==="scroll",b=v?f!==null?f+"Capture":null:f;v=[];for(var w=u,y;w!==null;){y=w;var _=y.stateNode;if(y.tag===5&&_!==null&&(y=_,b!==null&&(_=bl(w,b),_!=null&&v.push(Tl(w,_,y)))),x)break;w=w.return}0<v.length&&(f=new p(f,g,null,n,d),h.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==vp&&(g=n.relatedTarget||n.fromElement)&&(ci(g)||g[Ir]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?ci(g):null,g!==null&&(x=Di(g),g!==x||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(v=qy,_="onMouseLeave",b="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(v=Gy,_="onPointerLeave",b="onPointerEnter",w="pointer"),x=p==null?f:wo(p),y=g==null?f:wo(g),f=new v(_,w+"leave",p,n,d),f.target=x,f.relatedTarget=y,_=null,ci(d)===u&&(v=new v(b,w+"enter",g,n,d),v.target=y,v.relatedTarget=x,_=v),x=_,p&&g)t:{for(v=p,b=g,w=0,y=v;y;y=Ji(y))w++;for(y=0,_=b;_;_=Ji(_))y++;for(;0<w-y;)v=Ji(v),w--;for(;0<y-w;)b=Ji(b),y--;for(;w--;){if(v===b||b!==null&&v===b.alternate)break t;v=Ji(v),b=Ji(b)}v=null}else v=null;p!==null&&ix(h,f,p,v,!1),g!==null&&x!==null&&ix(h,x,g,v,!0)}}e:{if(f=u?wo(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var j=UP;else if(Jy(f))if(r1)j=WP;else{j=zP;var C=BP}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(j=HP);if(j&&(j=j(e,u))){n1(h,j,n,d);break e}C&&C(e,f,u),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&hp(f,"number",f.value)}switch(C=u?wo(u):window,e){case"focusin":(Jy(C)||C.contentEditable==="true")&&(yo=C,jp=u,sl=null);break;case"focusout":sl=jp=yo=null;break;case"mousedown":kp=!0;break;case"contextmenu":case"mouseup":case"dragend":kp=!1,nx(h,n,d);break;case"selectionchange":if(GP)break;case"keydown":case"keyup":nx(h,n,d)}var k;if(Ag)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else vo?e1(e,n)&&(S="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(X_&&n.locale!=="ko"&&(vo||S!=="onCompositionStart"?S==="onCompositionEnd"&&vo&&(k=Q_()):(ps=d,Tg="value"in ps?ps.value:ps.textContent,vo=!0)),C=Ku(u,S),0<C.length&&(S=new Ky(S,e,null,n,d),h.push({event:S,listeners:C}),k?S.data=k:(k=t1(n),k!==null&&(S.data=k)))),(k=DP?LP(e,n):$P(e,n))&&(u=Ku(u,"onBeforeInput"),0<u.length&&(d=new Ky("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=k))}f1(h,t)})}function Tl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ku(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=bl(e,n),i!=null&&r.unshift(Tl(e,i,s)),i=bl(e,t),i!=null&&r.push(Tl(e,i,s))),e=e.return}return r}function Ji(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}
vendor: 4,594 bytes, lines 37-38
37function ix(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,s?(c=bl(n,i),c!=null&&o.unshift(Tl(n,c,l))):s||(c=bl(n,i),c!=null&&o.push(Tl(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var QP=/\r\n?/g,XP=/\u0000|\uFFFD/g;function ox(e){return(typeof e=="string"?e:""+e).replace(QP,`
38`).replace(XP,"")}function Lc(e,t,n){if(t=ox(t),ox(e)!==t&&n)throw Error(q(425))}function Gu(){}var Cp=null,Ep=null;function Tp(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Np=typeof setTimeout=="function"?setTimeout:void 0,eA=typeof clearTimeout=="function"?clearTimeout:void 0,ax=typeof Promise=="function"?Promise:void 0,tA=typeof queueMicrotask=="function"?queueMicrotask:typeof ax<"u"?function(e){return ax.resolve(null).then(e).catch(nA)}:Np;function nA(e){setTimeout(function(){throw e})}function uf(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),jl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);jl(t)}function _s(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function lx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var va=Math.random().toString(36).slice(2),ur="__reactFiber$"+va,Nl="__reactProps$"+va,Ir="__reactContainer$"+va,Pp="__reactEvents$"+va,rA="__reactListeners$"+va,sA="__reactHandles$"+va;function ci(e){var t=e[ur];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ir]||n[ur]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=lx(e);e!==null;){if(n=e[ur])return n;e=lx(e)}return t}e=n,n=e.parentNode}return null}function cc(e){return e=e[ur]||e[Ir],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function wo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(q(33))}function qd(e){return e[Nl]||null}var Ap=[],bo=-1;function qs(e){return{current:e}}function We(e){0>bo||(e.current=Ap[bo],Ap[bo]=null,bo--)}function Fe(e,t){bo++,Ap[bo]=e.current,e.current=t}var Rs={},Ot=qs(Rs),Zt=qs(!1),ki=Rs;function Jo(e,t){var n=e.type.contextTypes;if(!n)return Rs;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Jt(e){return e=e.childContextTypes,e!=null}function Yu(){We(Zt),We(Ot)}function cx(e,t,n){if(Ot.current!==Rs)throw Error(q(168));Fe(Ot,t),Fe(Zt,n)}function m1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(q(108,B2(e)||"Unknown",s));return Qe({},n,r)}function Zu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Rs,ki=Ot.current,Fe(Ot,e),Fe(Zt,Zt.current),!0}function ux(e,t,n){var r=e.stateNode;if(!r)throw Error(q(169));n?(e=m1(e,t,ki),r.__reactInternalMemoizedMergedChildContext=e,We(Zt),We(Ot),Fe(Ot,e)):We(Zt),Fe(Zt,n)}var Tr=null,Kd=!1,df=!1;function g1(e){Tr===null?Tr=[e]:Tr.push(e)}function iA(e){Kd=!0,g1(e)}function Ks(){if(!df&&Tr!==null){df=!0;var e=0,t=Ae;try{var n=Tr;for(Ae=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Tr=null,Kd=!1}catch(s){throw Tr!==null&&(Tr=Tr.slice(e+1)),U_(jg,Ks),s}finally{Ae=t,df=!1}}return null}var _o=[],So=0,Ju=null,Qu=0,vn=[],yn=0,Ci=null,Pr=1,Ar="";function ii(e,t){_o[So++]=Qu,_o[So++]=Ju,Ju=e,Qu=t}function v1(e,t,n){vn[yn++]=Pr,vn[yn++]=Ar,vn[yn++]=Ci,Ci=e;var r=Pr;e=Ar;var s=32-qn(r)-1;r&=~(1<<s),n+=1;var i=32-qn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Pr=1<<32-qn(t)+s|n<<s|r,Ar=i+e}else Pr=1<<i|n<<s|r,Ar=e}function Og(e){e.return!==null&&(ii(e,1),v1(e,1,0))}function Ig(e){for(;e===Ju;)Ju=_o[--So],_o[So]=null,Qu=_o[--So],_o[So]=null;for(;e===Ci;)Ci=vn[--yn],vn[yn]=null,Ar=vn[--yn],vn[yn]=null,Pr=vn[--yn],vn[yn]=null}var on=null,sn=null,Ke=!1,Hn=null;function y1(e,t){var n=xn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function dx(e,t){switch(e.tag){case 5:var n=e.type;
vendor: 24,038 bytes, lines 38-40
38return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,on=e,sn=_s(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,on=e,sn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ci!==null?{id:Pr,overflow:Ar}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=xn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,on=e,sn=null,!0):!1;default:return!1}}function Rp(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Op(e){if(Ke){var t=sn;if(t){var n=t;if(!dx(e,t)){if(Rp(e))throw Error(q(418));t=_s(n.nextSibling);var r=on;t&&dx(e,t)?y1(r,n):(e.flags=e.flags&-4097|2,Ke=!1,on=e)}}else{if(Rp(e))throw Error(q(418));e.flags=e.flags&-4097|2,Ke=!1,on=e}}}function hx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;on=e}function $c(e){if(e!==on)return!1;if(!Ke)return hx(e),Ke=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Tp(e.type,e.memoizedProps)),t&&(t=sn)){if(Rp(e))throw x1(),Error(q(418));for(;t;)y1(e,t),t=_s(t.nextSibling)}if(hx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){sn=_s(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}sn=null}}else sn=on?_s(e.stateNode.nextSibling):null;return!0}function x1(){for(var e=sn;e;)e=_s(e.nextSibling)}function Qo(){sn=on=null,Ke=!1}function Mg(e){Hn===null?Hn=[e]:Hn.push(e)}var oA=Ur.ReactCurrentBatchConfig;function La(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(q(309));var r=n.stateNode}if(!r)throw Error(q(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=s.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(q(284));if(!n._owner)throw Error(q(290,e))}return e}function Fc(e,t){throw e=Object.prototype.toString.call(t),Error(q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function fx(e){var t=e._init;return t(e._payload)}function w1(e){function t(b,w){if(e){var y=b.deletions;y===null?(b.deletions=[w],b.flags|=16):y.push(w)}}function n(b,w){if(!e)return null;for(;w!==null;)t(b,w),w=w.sibling;return null}function r(b,w){for(b=new Map;w!==null;)w.key!==null?b.set(w.key,w):b.set(w.index,w),w=w.sibling;return b}function s(b,w){return b=Cs(b,w),b.index=0,b.sibling=null,b}function i(b,w,y){return b.index=y,e?(y=b.alternate,y!==null?(y=y.index,y<w?(b.flags|=2,w):y):(b.flags|=2,w)):(b.flags|=1048576,w)}function o(b){return e&&b.alternate===null&&(b.flags|=2),b}function l(b,w,y,_){return w===null||w.tag!==6?(w=yf(y,b.mode,_),w.return=b,w):(w=s(w,y),w.return=b,w)}function c(b,w,y,_){var j=y.type;return j===go?d(b,w,y.props.children,_,y.key):w!==null&&(w.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ns&&fx(j)===w.type)?(_=s(w,y.props),_.ref=La(b,w,y),_.return=b,_):(_=ju(y.type,y.key,y.props,null,b.mode,_),_.ref=La(b,w,y),_.return=b,_)}function u(b,w,y,_){return w===null||w.tag!==4||w.stateNode.containerInfo!==y.containerInfo||w.stateNode.implementation!==y.implementation?(w=xf(y,b.mode,_),w.return=b,w):(w=s(w,y.children||[]),w.return=b,w)}function d(b,w,y,_,j){return w===null||w.tag!==7?(w=_i(y,b.mode,_,j),w.return=b,w):(w=s(w,y),w.return=b,w)}function h(b,w,y){if(typeof w=="string"&&w!==""||typeof w=="number")return w=yf(""+w,b.mode,y),w.return=b,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Tc:return y=ju(w.type,w.key,w.props,null,b.mode,y),y.ref=La(b,null,w),y.return=b,y;case mo:return w=xf(w,b.mode,y),w.return=b,w;case ns:var _=w._init;return h(b,_(w._payload),y)}if(qa(w)||Ra(w))return w=_i(w,b.mode,y,null),w.return=b,w;Fc(b,w)}return null}function f(b,w,y,_){var j=w!==null?w.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return j!==null?null:l(b,w,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Tc:return y.key===j?c(b,w,y,_):null;case mo:return y.key===j?u(b,w,y,_):null;case ns:return j=y._init,f(b,w,j(y._payload),_)}if(qa(y)||Ra(y))return j!==null?null:d(b,w,y,_,null);Fc(b,y)}return null}function p(b,w,y,_,j){if(typeof _=="string"&&_!==""||typeof _=="number")return b=b.get(y)||null,l(w,b,""+_,j);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Tc:return b=b.get(_.key===null?y:_.key)||null,c(w,b,_,j);case mo:return b=b.get(_.key===null?y:_.key)||null,u(w,b,_,j);case ns:var C=_._init;return p(b,w,y,C(_._payload),j)}if(qa(_)||Ra(_))return b=b.get(y)||null,d(w,b,_,j,null);Fc(w,_)}return null}function g(b,w,y,_){for(var j=null,C=null,k=w,S=w=0,P=null;k!==null&&S<y.length;S++){k.index>S?(P=k,k=null):P=k.sibling;var E=f(b,k,y[S],_);if(E===null){k===null&&(k=P);break}e&&k&&E.alternate===null&&t(b,k),w=i(E,w,S),C===null?j=E:C.sibling=E,C=E,k=P}if(S===y.length)return n(b,k),Ke&&ii(b,S),j;if(k===null){for(;S<y.length;S++)k=h(b,y[S],_),k!==null&&(w=i(k,w,S),C===null?j=k:C.sibling=k,C=k);return Ke&&ii(b,S),j}for(k=r(b,k);S<y.length;S++)P=p(k,b,S,y[S],_),P!==null&&(e&&P.alternate!==null&&k.delete(P.key===null?S:P.key),w=i(P,w,S),C===null?j=P:C.sibling=P,C=P);return e&&k.forEach(function(I){return t(b,I)}),Ke&&ii(b,S),j}function v(b,w,y,_){var j=Ra(y);if(typeof j!="function")throw Error(q(150));if(y=j.call(y),y==null)throw Error(q(151));for(var C=j=null,k=w,S=w=0,P=null,E=y.next();k!==null&&!E.done;S++,E=y.next()){k.index>S?(P=k,k=null):P=k.sibling;var I=f(b,k,E.value,_);if(I===null){k===null&&(k=P);break}e&&k&&I.alternate===null&&t(b,k),w=i(I,w,S),C===null?j=I:C.sibling=I,C=I,k=P}if(E.done)return n(b,k),Ke&&ii(b,S),j;if(k===null){for(;!E.done;S++,E=y.next())E=h(b,E.value,_),E!==null&&(w=i(E,w,S),C===null?j=E:C.sibling=E,C=E);return Ke&&ii(b,S),j}for(k=r(b,k);!E.done;S++,E=y.next())E=p(k,b,S,E.value,_),E!==null&&(e&&E.alternate!==null&&k.delete(E.key===null?S:E.key),w=i(E,w,S),C===null?j=E:C.sibling=E,C=E);return e&&k.forEach(function(R){return t(b,R)}),Ke&&ii(b,S),j}function x(b,w,y,_){if(typeof y=="object"&&y!==null&&y.type===go&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Tc:e:{for(var j=y.key,C=w;C!==null;){if(C.key===j){if(j=y.type,j===go){if(C.tag===7){n(b,C.sibling),w=s(C,y.props.children),w.return=b,b=w;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ns&&fx(j)===C.type){n(b,C.sibling),w=s(C,y.props),w.ref=La(b,C,y),w.return=b,b=w;break e}n(b,C);break}else t(b,C);C=C.sibling}y.type===go?(w=_i(y.props.children,b.mode,_,y.key),w.return=b,b=w):(_=ju(y.type,y.key,y.props,null,b.mode,_),_.ref=La(b,w,y),_.return=b,b=_)}return o(b);case mo:e:{for(C=y.key;w!==null;){if(w.key===C)if(w.tag===4&&w.stateNode.containerInfo===y.containerInfo&&w.stateNode.implementation===y.implementation){n(b,w.sibling),w=s(w,y.children||[]),w.return=b,b=w;break e}else{n(b,w);break}else t(b,w);w=w.sibling}w=xf(y,b.mode,_),w.return=b,b=w}return o(b);case ns:return C=y._init,x(b,w,C(y._payload),_)}if(qa(y))return g(b,w,y,_);if(Ra(y))return v(b,w,y,_);Fc(b,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,w!==null&&w.tag===6?(n(b,w.sibling),w=s(w,y),w.return=b,b=w):(n(b,w),w=yf(y,b.mode,_),w.return=b,b=w),o(b)):n(b,w)}return x}var Xo=w1(!0),b1=w1(!1),Xu=qs(null),ed=null,jo=null,Dg=null;function Lg(){Dg=jo=ed=null}function $g(e){var t=Xu.current;We(Xu),e._currentValue=t}function Ip(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Mo(e,t){ed=e,Dg=jo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Yt=!0),e.firstContext=null)}function Sn(e){var t=e._currentValue;if(Dg!==e)if(e={context:e,memoizedValue:t,next:null},jo===null){if(ed===null)throw Error(q(308));jo=e,ed.dependencies={lanes:0,firstContext:e}}else jo=jo.next=e;return t}var ui=null;function Fg(e){ui===null?ui=[e]:ui.push(e)}function _1(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Fg(t)):(n.next=s.next,s.next=n),t.interleaved=n,Mr(e,r)}function Mr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var rs=!1;function Vg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function S1(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Rr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ss(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,je&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Mr(e,n)}return s=r.interleaved,s===null?(t.next=t,Fg(r)):(t.next=s.next,s.next=t),r.interleaved=t,Mr(e,n)}function yu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,kg(e,n)}}function px(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function td(e,t,n,r){var s=e.updateQueue;rs=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var h=s.baseState;o=0,d=u=c=null,l=i;do{var f=l.lane,p=l.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,v=l;switch(f=t,p=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){h=g.call(p,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,f=typeof g=="function"?g.call(p,h,f):g,f==null)break e;h=Qe({},h,f);break e;case 2:rs=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=h):d=d.next=p,o|=f;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;f=l,l=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(d===null&&(c=h),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Ti|=o,e.lanes=o,e.memoizedState=h}}function mx(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(q(191,s));s.call(r)}}}var uc={},fr=qs(uc),Pl=qs(uc),Al=qs(uc);function di(e){if(e===uc)throw Error(q(174));return e}function Ug(e,t){switch(Fe(Al,t),Fe(Pl,e),Fe(fr,uc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=pp(t,e)}We(fr),Fe(fr,t)}function ea(){We(fr),We(Pl),We(Al)}function j1(e){di(Al.current);var t=di(fr.current),n=pp(t,e.type);t!==n&&(Fe(Pl,e),Fe(fr,n))}function Bg(e){Pl.current===e&&(We(fr),We(Pl))}var Ye=qs(0);function nd(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var hf=[];function zg(){for(var e=0;e<hf.length;e++)hf[e]._workInProgressVersionPrimary=null;hf.length=0}var xu=Ur.ReactCurrentDispatcher,ff=Ur.ReactCurrentBatchConfig,Ei=0,Je=null,ft=null,vt=null,rd=!1,il=!1,Rl=0,aA=0;function Nt(){throw Error(q(321))}function Hg(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yn(e[n],t[n]))return!1;return!0}function Wg(e,t,n,r,s,i){if(Ei=i,Je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,xu.current=e===null||e.memoizedState===null?dA:hA,e=n(r,s),il){i=0;do{if(il=!1,Rl=0,25<=i)throw Error(q(301));i+=1,vt=ft=null,t.updateQueue=null,xu.current=fA,e=n(r,s)}while(il)}if(xu.current=sd,t=ft!==null&&ft.next!==null,Ei=0,vt=ft=Je=null,rd=!1,t)throw Error(q(300));return e}function qg(){var e=Rl!==0;return Rl=0,e}function nr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Je.memoizedState=vt=e:vt=vt.next=e,vt}function jn(){if(ft===null){var e=Je.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var t=vt===null?Je.memoizedState:vt.next;if(t!==null)vt=t,ft=e;else{if(e===null)throw Error(q(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},vt===null?Je.memoizedState=vt=e:vt=vt.next=e}return vt}function Ol(e,t){return typeof t=="function"?t(e):t}function pf(e){var t=jn(),n=t.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=e;var r=ft,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var l=o=null,c=null,u=i;do{var d=u.lane;if((Ei&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=h,o=r):c=c.next=h,Je.lanes|=d,Ti|=d}u=u.next}while(u!==null&&u!==i);c===null?o=r:c.next=l,Yn(r,t.memoizedState)||(Yt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Je.lanes|=i,Ti|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function mf(e){var t=jn(),n=t.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);Yn(i,t.memoizedState)||(Yt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function k1(){}function C1(e,t){var n=Je,r=jn(),s=t(),i=!Yn(r.memoizedState,s);if(i&&(r.memoizedState=s,Yt=!0),r=r.queue,Kg(N1.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||vt!==null&&vt.memoizedState.tag&1){if(n.flags|=2048,Il(9,T1.bind(null,n,r,s,t),void 0,null),yt===null)throw Error(q(349));Ei&30||E1(n,t,s)}return s}function E1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Je.updateQueue,t===null?(t={lastEffect:null,stores:null},Je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function T1(e,t,n,r){t.value=n,t.getSnapshot=r,P1(t)&&A1(e)}function N1(e,t,n){return n(function(){P1(t)&&A1(e)})}function P1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yn(e,n)}catch{return!0}}function A1(e){var t=Mr(e,1);t!==null&&Kn(t,e,1,-1)}function gx(e){var t=nr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:e},t.queue=e,e=e.dispatch=uA.bind(null,Je,e),[t.memoizedState,e]}function Il(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Je.updateQueue,t===null?(t={lastEffect:null,stores:null},Je.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function R1(){return jn().memoizedState}function wu(e,t,n,r){var s=nr();Je.flags|=e,s.memoizedState=Il(1|t,n,void 0,r===void 0?null:r)}function Gd(e,t,n,r){var s=jn();r=r===void 0?null:r;var i=void 0;if(ft!==null){var o=ft.memoizedState;if(i=o.destroy,r!==null&&Hg(r,o.deps)){s.memoizedState=Il(t,n,i,r);return}}Je.flags|=e,s.memoizedState=Il(1|t,n,i,r)}function vx(e,t){return wu(8390656,8,e,t)}function Kg(e,t){return Gd(2048,8,e,t)}function O1(e,t){return Gd(4,2,e,t)}function I1(e,t){return Gd(4,4,e,t)}function M1(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function D1(e,t,n){return n=n!=null?n.concat([e]):null,Gd(4,4,M1.bind(null,t,e),n)}function Gg(){}function L1(e,t){var n=jn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Hg(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function $1(e,t){var n=jn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Hg(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function F1(e,t,n){return Ei&21?(Yn(n,t)||(n=H_(),Je.lanes|=n,Ti|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Yt=!0),e.memoizedState=n)}function lA(e,t){var n=Ae;Ae=n!==0&&4>n?n:4,e(!0);var r=ff.transition;ff.transition={};try{e(!1),t()}finally{Ae=n,ff.transition=r}}function V1(){return jn().memoizedState}function cA(e,t,n){var r=ks(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},U1(e))B1(t,n);else if(n=_1(e,t,n,r),n!==null){var s=Vt();Kn(n,e,r,s),z1(n,t,r)}}function uA(e,t,n){var r=ks(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(U1(e))B1(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(s.hasEagerState=!0,s.eagerState=l,Yn(l,o)){var c=t.interleaved;c===null?(s.next=s,Fg(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=_1(e,t,s,r),n!==null&&(s=Vt(),Kn(n,e,r,s),z1(n,t,r))}}function U1(e){var t=e.alternate;return e===Je||t!==null&&t===Je}function B1(e,t){il=rd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function z1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,kg(e,n)}}var sd={readContext:Sn,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useInsertionEffect:Nt,useLayoutEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useMutableSource:Nt,useSyncExternalStore:Nt,useId:Nt,unstable_isNewReconciler:!1},dA={readContext:Sn,useCallback:function(e,t){return nr().memoizedState=[e,t===void 0?null:t],e},useContext:Sn,useEffect:vx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,wu(4194308,4,M1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wu(4194308,4,e,t)},useInsertionEffect:function(e,t){return wu(4,2,e,t)},useMemo:function(e,t){var n=nr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=nr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=cA.bind(null,Je,e),[r.memoizedState,e]},useRef:function(e){var t=nr();return e={current:e},t.memoizedState=e},useState:gx,useDebugValue:Gg,useDeferredValue:function(e){return nr().memoizedState=e},useTransition:function(){var e=gx(!1),t=e[0];return e=lA.bind(null,e[1]),nr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Je,s=nr();if(Ke){if(n===void 0)throw Error(q(407));n=n()}else{if(n=t(),yt===null)throw Error(q(349));Ei&30||E1(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,vx(N1.bind(null,r,i,e),[e]),r.flags|=2048,Il(9,T1.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=nr(),t=yt.identifierPrefix;if(Ke){var n=Ar,r=Pr;n=(r&~(1<<32-qn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Rl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=aA++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hA={readContext:Sn,useCallback:L1,useContext:Sn,useEffect:Kg,useImperativeHandle:D1,useInsertionEffect:O1,useLayoutEffect:I1,useMemo:$1,useReducer:pf,useRef:R1,useState:function(){return pf(Ol)},useDebugValue:Gg,useDeferredValue:function(e){var t=jn();return F1(t,ft.memoizedState,e)},useTransition:function(){var e=pf(Ol)[0],t=jn().memoizedState;return[e,t]},useMutableSource:k1,useSyncExternalStore:C1,useId:V1,unstable_isNewReconciler:!1},fA={readContext:Sn,useCallback:L1,useContext:Sn,useEffect:Kg,useImperativeHandle:D1,useInsertionEffect:O1,useLayoutEffect:I1,useMemo:$1,useReducer:mf,useRef:R1,useState:function(){return mf(Ol)},useDebugValue:Gg,useDeferredValue:function(e){var t=jn();return ft===null?t.memoizedState=e:F1(t,ft.memoizedState,e)},useTransition:function(){var e=mf(Ol)[0],t=jn().memoizedState;return[e,t]},useMutableSource:k1,useSyncExternalStore:C1,useId:V1,unstable_isNewReconciler:!1};function $n(e,t){if(e&&e.defaultProps){t=Qe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Mp(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Qe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Yd={isMounted:function(e){return(e=e._reactInternals)?Di(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Vt(),s=ks(e),i=Rr(r,s);i.payload=t,n!=null&&(i.callback=n),t=Ss(e,i,s),t!==null&&(Kn(t,e,s,r),yu(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Vt(),s=ks(e),i=Rr(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ss(e,i,s),t!==null&&(Kn(t,e,s,r),yu(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vt(),r=ks(e),s=Rr(n,r);s.tag=2,t!=null&&(s.callback=t),t=Ss(e,s,r),t!==null&&(Kn(t,e,r,n),yu(t,e,r))}};function yx(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Cl(n,r)||!Cl(s,i):!0}function H1(e,t,n){var r=!1,s=Rs,i=t.contextType;return typeof i=="object"&&i!==null?i=Sn(i):(s=Jt(t)?ki:Ot.current,r=t.contextTypes,i=(r=r!=null)?Jo(e,s):Rs),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Yd,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function xx(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Yd.enqueueReplaceState(t,t.state,null)}function Dp(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Vg(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Sn(i):(i=Jt(t)?ki:Ot.current,s.context=Jo(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Mp(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Yd.enqueueReplaceState(s,s.state,null),td(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ta(e,t){try{var n="",r=t;do n+=U2(r),r=r.return;while(r);var s=n}catch(i){s=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:e,source:t,stack:s,digest:null}}function gf(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Lp(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var pA=typeof WeakMap=="function"?WeakMap:Map;
vendor: 9,525 bytes, line 40
40function W1(e,t,n){n=Rr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){od||(od=!0,Kp=r),Lp(e,t)},n}function q1(e,t,n){n=Rr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Lp(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Lp(e,t),typeof r!="function"&&(js===null?js=new Set([this]):js.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function wx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new pA;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=TA.bind(null,e,t,n),t.then(e,e))}function bx(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function _x(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Rr(-1,1),t.tag=2,Ss(n,t,1))),n.lanes|=1),e)}var mA=Ur.ReactCurrentOwner,Yt=!1;function Mt(e,t,n,r){t.child=e===null?b1(t,null,n,r):Xo(t,e.child,n,r)}function Sx(e,t,n,r,s){n=n.render;var i=t.ref;return Mo(t,s),r=Wg(e,t,n,r,i,s),n=qg(),e!==null&&!Yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Dr(e,t,s)):(Ke&&n&&Og(t),t.flags|=1,Mt(e,t,r,s),t.child)}function jx(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!nv(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,K1(e,t,i,r,s)):(e=ju(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Cl,n(o,r)&&e.ref===t.ref)return Dr(e,t,s)}return t.flags|=1,e=Cs(i,r),e.ref=t.ref,e.return=t,t.child=e}function K1(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Cl(i,r)&&e.ref===t.ref)if(Yt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Yt=!0);else return t.lanes=e.lanes,Dr(e,t,s)}return $p(e,t,n,r,s)}function G1(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Fe(Co,tn),tn|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Fe(Co,tn),tn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Fe(Co,tn),tn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Fe(Co,tn),tn|=r;return Mt(e,t,s,n),t.child}function Y1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $p(e,t,n,r,s){var i=Jt(n)?ki:Ot.current;return i=Jo(t,i),Mo(t,s),n=Wg(e,t,n,r,i,s),r=qg(),e!==null&&!Yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Dr(e,t,s)):(Ke&&r&&Og(t),t.flags|=1,Mt(e,t,n,s),t.child)}function kx(e,t,n,r,s){if(Jt(n)){var i=!0;Zu(t)}else i=!1;if(Mo(t,s),t.stateNode===null)bu(e,t),H1(t,n,r),Dp(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Sn(u):(u=Jt(n)?ki:Ot.current,u=Jo(t,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==u)&&xx(t,o,r,u),rs=!1;var f=t.memoizedState;o.state=f,td(t,r,o,s),c=t.memoizedState,l!==r||f!==c||Zt.current||rs?(typeof d=="function"&&(Mp(t,n,d,r),c=t.memoizedState),(l=rs||yx(t,n,l,r,f,c,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,S1(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:$n(t.type,l),o.props=u,h=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Sn(c):(c=Jt(n)?ki:Ot.current,c=Jo(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||f!==c)&&xx(t,o,r,c),rs=!1,f=t.memoizedState,o.state=f,td(t,r,o,s);var g=t.memoizedState;l!==h||f!==g||Zt.current||rs?(typeof p=="function"&&(Mp(t,n,p,r),g=t.memoizedState),(u=rs||yx(t,n,u,r,f,g,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),o.props=r,o.state=g,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Fp(e,t,n,r,i,s)}function Fp(e,t,n,r,s,i){Y1(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&ux(t,n,!1),Dr(e,t,i);r=t.stateNode,mA.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Xo(t,e.child,null,i),t.child=Xo(t,null,l,i)):Mt(e,t,l,i),t.memoizedState=r.state,s&&ux(t,n,!0),t.child}function Z1(e){var t=e.stateNode;t.pendingContext?cx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cx(e,t.context,!1),Ug(e,t.containerInfo)}function Cx(e,t,n,r,s){return Qo(),Mg(s),t.flags|=256,Mt(e,t,n,r),t.child}var Vp={dehydrated:null,treeContext:null,retryLane:0};function Up(e){return{baseLanes:e,cachePool:null,transitions:null}}function J1(e,t,n){var r=t.pendingProps,s=Ye.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Fe(Ye,s&1),e===null)return Op(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Qd(o,r,0,null),e=_i(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Up(n),t.memoizedState=Vp,e):Yg(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return gA(e,t,o,r,l,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Cs(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=Cs(l,i):(i=_i(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Up(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Vp,r}return i=e.child,e=i.sibling,r=Cs(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Yg(e,t){return t=Qd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Vc(e,t,n,r){return r!==null&&Mg(r),Xo(t,e.child,null,n),e=Yg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gA(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=gf(Error(q(422))),Vc(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Qd({mode:"visible",children:r.children},s,0,null),i=_i(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Xo(t,e.child,null,o),t.child.memoizedState=Up(o),t.memoizedState=Vp,i);if(!(t.mode&1))return Vc(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(q(419)),r=gf(i,r,void 0),Vc(e,t,o,r)}if(l=(o&e.childLanes)!==0,Yt||l){if(r=yt,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Mr(e,s),Kn(r,e,s,-1))}return tv(),r=gf(Error(q(421))),Vc(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=NA.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,sn=_s(s.nextSibling),on=t,Ke=!0,Hn=null,e!==null&&(vn[yn++]=Pr,vn[yn++]=Ar,vn[yn++]=Ci,Pr=e.id,Ar=e.overflow,Ci=t),t=Yg(t,r.children),t.flags|=4096,t)}function Ex(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ip(e.return,t,n)}
vendor: 5,381 bytes, line 40
40function vf(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function Q1(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(Mt(e,t,r.children,n),r=Ye.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ex(e,n,t);else if(e.tag===19)Ex(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Fe(Ye,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&nd(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),vf(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&nd(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}vf(t,!0,n,null,i);break;case"together":vf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function bu(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Dr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ti|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(q(153));if(t.child!==null){for(e=t.child,n=Cs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Cs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function vA(e,t,n){switch(t.tag){case 3:Z1(t),Qo();break;case 5:j1(t);break;case 1:Jt(t.type)&&Zu(t);break;case 4:Ug(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Fe(Xu,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Fe(Ye,Ye.current&1),t.flags|=128,null):n&t.child.childLanes?J1(e,t,n):(Fe(Ye,Ye.current&1),e=Dr(e,t,n),e!==null?e.sibling:null);Fe(Ye,Ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Q1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Fe(Ye,Ye.current),r)break;return null;case 22:case 23:return t.lanes=0,G1(e,t,n)}return Dr(e,t,n)}var X1,Bp,eS,tS;X1=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Bp=function(){};eS=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,di(fr.current);var i=null;switch(n){case"input":s=up(e,s),r=up(e,r),i=[];break;case"select":s=Qe({},s,{value:void 0}),r=Qe({},r,{value:void 0}),i=[];break;case"textarea":s=fp(e,s),r=fp(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Gu)}mp(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(xl.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(l=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(xl.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Be("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};tS=function(e,t,n,r){n!==r&&(t.flags|=4)};function $a(e,t){if(!Ke)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function yA(e,t,n){var r=t.pendingProps;switch(Ig(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(t),null;case 1:return Jt(t.type)&&Yu(),Pt(t),null;case 3:return r=t.stateNode,ea(),We(Zt),We(Ot),zg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&($c(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Hn!==null&&(Zp(Hn),Hn=null))),Bp(e,t),Pt(t),null;case 5:Bg(t);var s=di(Al.current);
vendor: 29,780 bytes, line 40
40if(n=t.type,e!==null&&t.stateNode!=null)eS(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(q(166));return Pt(t),null}if(e=di(fr.current),$c(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[ur]=t,r[Nl]=i,e=(t.mode&1)!==0,n){case"dialog":Be("cancel",r),Be("close",r);break;case"iframe":case"object":case"embed":Be("load",r);break;case"video":case"audio":for(s=0;s<Ga.length;s++)Be(Ga[s],r);break;case"source":Be("error",r);break;case"img":case"image":case"link":Be("error",r),Be("load",r);break;case"details":Be("toggle",r);break;case"input":Dy(r,i),Be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Be("invalid",r);break;case"textarea":$y(r,i),Be("invalid",r)}mp(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Lc(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Lc(r.textContent,l,e),s=["children",""+l]):xl.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Be("scroll",r)}switch(n){case"input":Nc(r),Ly(r,i,!0);break;case"textarea":Nc(r),Fy(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Gu)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=N_(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ur]=t,e[Nl]=r,X1(e,t,!1,!1),t.stateNode=e;e:{switch(o=gp(n,r),n){case"dialog":Be("cancel",e),Be("close",e),s=r;break;case"iframe":case"object":case"embed":Be("load",e),s=r;break;case"video":case"audio":for(s=0;s<Ga.length;s++)Be(Ga[s],e);s=r;break;case"source":Be("error",e),s=r;break;case"img":case"image":case"link":Be("error",e),Be("load",e),s=r;break;case"details":Be("toggle",e),s=r;break;case"input":Dy(e,r),s=up(e,r),Be("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Qe({},r,{value:void 0}),Be("invalid",e);break;case"textarea":$y(e,r),s=fp(e,r),Be("invalid",e);break;default:s=r}mp(n,s),l=s;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?R_(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&P_(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&wl(e,c):typeof c=="number"&&wl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(xl.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Be("scroll",e):c!=null&&xg(e,i,c,o))}switch(n){case"input":Nc(e),Ly(e,r,!1);break;case"textarea":Nc(e),Fy(e);break;case"option":r.value!=null&&e.setAttribute("value",""+As(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Ao(e,!!r.multiple,i,!1):r.defaultValue!=null&&Ao(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Gu)}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&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Pt(t),null;case 6:if(e&&t.stateNode!=null)tS(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(q(166));if(n=di(Al.current),di(fr.current),$c(t)){if(r=t.stateNode,n=t.memoizedProps,r[ur]=t,(i=r.nodeValue!==n)&&(e=on,e!==null))switch(e.tag){case 3:Lc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Lc(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ur]=t,t.stateNode=r}return Pt(t),null;case 13:if(We(Ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ke&&sn!==null&&t.mode&1&&!(t.flags&128))x1(),Qo(),t.flags|=98560,i=!1;else if(i=$c(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(q(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(q(317));i[ur]=t}else Qo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pt(t),i=!1}else Hn!==null&&(Zp(Hn),Hn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ye.current&1?pt===0&&(pt=3):tv())),t.updateQueue!==null&&(t.flags|=4),Pt(t),null);case 4:return ea(),Bp(e,t),e===null&&El(t.stateNode.containerInfo),Pt(t),null;case 10:return $g(t.type._context),Pt(t),null;case 17:return Jt(t.type)&&Yu(),Pt(t),null;case 19:if(We(Ye),i=t.memoizedState,i===null)return Pt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)$a(i,!1);else{if(pt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=nd(e),o!==null){for(t.flags|=128,$a(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Fe(Ye,Ye.current&1|2),t.child}e=e.sibling}i.tail!==null&&st()>na&&(t.flags|=128,r=!0,$a(i,!1),t.lanes=4194304)}else{if(!r)if(e=nd(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),$a(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ke)return Pt(t),null}else 2*st()-i.renderingStartTime>na&&n!==1073741824&&(t.flags|=128,r=!0,$a(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=st(),t.sibling=null,n=Ye.current,Fe(Ye,r?n&1|2:n&1),t):(Pt(t),null);case 22:case 23:return ev(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tn&1073741824&&(Pt(t),t.subtreeFlags&6&&(t.flags|=8192)):Pt(t),null;case 24:return null;case 25:return null}throw Error(q(156,t.tag))}function xA(e,t){switch(Ig(t),t.tag){case 1:return Jt(t.type)&&Yu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(),We(Zt),We(Ot),zg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bg(t),null;case 13:if(We(Ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));Qo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return We(Ye),null;case 4:return ea(),null;case 10:return $g(t.type._context),null;case 22:case 23:return ev(),null;case 24:return null;default:return null}}var Uc=!1,Rt=!1,wA=typeof WeakSet=="function"?WeakSet:Set,te=null;function ko(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nt(e,t,r)}else n.current=null}function zp(e,t,n){try{n()}catch(r){nt(e,t,r)}}var Tx=!1;function bA(e,t){if(Cp=Wu,e=o1(),Rg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,h=e,f=null;t:for(;;){for(var p;h!==n||s!==0&&h.nodeType!==3||(l=o+s),h!==i||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===e)break t;if(f===n&&++u===s&&(l=o),f===i&&++d===r&&(c=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ep={focusedElem:e,selectionRange:n},Wu=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,x=g.memoizedState,b=t.stateNode,w=b.getSnapshotBeforeUpdate(t.elementType===t.type?v:$n(t.type,v),x);b.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(_){nt(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return g=Tx,Tx=!1,g}function ol(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&zp(t,n,i)}s=s.next}while(s!==r)}}function Zd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Hp(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function nS(e){var t=e.alternate;t!==null&&(e.alternate=null,nS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ur],delete t[Nl],delete t[Pp],delete t[rA],delete t[sA])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function rS(e){return e.tag===5||e.tag===3||e.tag===4}function Nx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rS(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Gu));else if(r!==4&&(e=e.child,e!==null))for(Wp(e,t,n),e=e.sibling;e!==null;)Wp(e,t,n),e=e.sibling}function qp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(qp(e,t,n),e=e.sibling;e!==null;)qp(e,t,n),e=e.sibling}var bt=null,zn=!1;function Zr(e,t,n){for(n=n.child;n!==null;)sS(e,t,n),n=n.sibling}function sS(e,t,n){if(hr&&typeof hr.onCommitFiberUnmount=="function")try{hr.onCommitFiberUnmount(Bd,n)}catch{}switch(n.tag){case 5:Rt||ko(n,t);case 6:var r=bt,s=zn;bt=null,Zr(e,t,n),bt=r,zn=s,bt!==null&&(zn?(e=bt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):bt.removeChild(n.stateNode));break;case 18:bt!==null&&(zn?(e=bt,n=n.stateNode,e.nodeType===8?uf(e.parentNode,n):e.nodeType===1&&uf(e,n),jl(e)):uf(bt,n.stateNode));break;case 4:r=bt,s=zn,bt=n.stateNode.containerInfo,zn=!0,Zr(e,t,n),bt=r,zn=s;break;case 0:case 11:case 14:case 15:if(!Rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&zp(n,t,o),s=s.next}while(s!==r)}Zr(e,t,n);break;case 1:if(!Rt&&(ko(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){nt(n,t,l)}Zr(e,t,n);break;case 21:Zr(e,t,n);break;case 22:n.mode&1?(Rt=(r=Rt)||n.memoizedState!==null,Zr(e,t,n),Rt=r):Zr(e,t,n);break;default:Zr(e,t,n)}}function Px(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new wA),t.forEach(function(r){var s=PA.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Rn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:bt=l.stateNode,zn=!1;break e;case 3:bt=l.stateNode.containerInfo,zn=!0;break e;case 4:bt=l.stateNode.containerInfo,zn=!0;break e}l=l.return}if(bt===null)throw Error(q(160));sS(i,o,s),bt=null,zn=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){nt(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)iS(t,e),t=t.sibling}function iS(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Rn(t,e),er(e),r&4){try{ol(3,e,e.return),Zd(3,e)}catch(v){nt(e,e.return,v)}try{ol(5,e,e.return)}catch(v){nt(e,e.return,v)}}break;case 1:Rn(t,e),er(e),r&512&&n!==null&&ko(n,n.return);break;case 5:if(Rn(t,e),er(e),r&512&&n!==null&&ko(n,n.return),e.flags&32){var s=e.stateNode;try{wl(s,"")}catch(v){nt(e,e.return,v)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&E_(s,i),gp(l,o);var u=gp(l,i);for(o=0;o<c.length;o+=2){var d=c[o],h=c[o+1];d==="style"?R_(s,h):d==="dangerouslySetInnerHTML"?P_(s,h):d==="children"?wl(s,h):xg(s,d,h,u)}switch(l){case"input":dp(s,i);break;case"textarea":T_(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?Ao(s,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?Ao(s,!!i.multiple,i.defaultValue,!0):Ao(s,!!i.multiple,i.multiple?[]:"",!1))}s[Nl]=i}catch(v){nt(e,e.return,v)}}break;case 6:if(Rn(t,e),er(e),r&4){if(e.stateNode===null)throw Error(q(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(v){nt(e,e.return,v)}}break;case 3:if(Rn(t,e),er(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{jl(t.containerInfo)}catch(v){nt(e,e.return,v)}break;case 4:Rn(t,e),er(e);break;case 13:Rn(t,e),er(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Qg=st())),r&4&&Px(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Rt=(u=Rt)||d,Rn(t,e),Rt=u):Rn(t,e),er(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(te=e,d=e.child;d!==null;){for(h=te=d;te!==null;){switch(f=te,p=f.child,f.tag){case 0:case 11:case 14:case 15:ol(4,f,f.return);break;case 1:ko(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){nt(r,n,v)}}break;case 5:ko(f,f.return);break;case 22:if(f.memoizedState!==null){Rx(h);continue}}p!==null?(p.return=f,te=p):Rx(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{s=h.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=A_("display",o))}catch(v){nt(e,e.return,v)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(v){nt(e,e.return,v)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Rn(t,e),er(e),r&4&&Px(e);break;case 21:break;default:Rn(t,e),er(e)}}function er(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(rS(n)){var r=n;break e}n=n.return}throw Error(q(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(wl(s,""),r.flags&=-33);var i=Nx(e);qp(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Nx(e);Wp(e,l,o);break;default:throw Error(q(161))}}catch(c){nt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _A(e,t,n){te=e,oS(e)}function oS(e,t,n){for(var r=(e.mode&1)!==0;te!==null;){var s=te,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Uc;if(!o){var l=s.alternate,c=l!==null&&l.memoizedState!==null||Rt;l=Uc;var u=Rt;if(Uc=o,(Rt=c)&&!u)for(te=s;te!==null;)o=te,c=o.child,o.tag===22&&o.memoizedState!==null?Ox(s):c!==null?(c.return=o,te=c):Ox(s);for(;i!==null;)te=i,oS(i),i=i.sibling;te=s,Uc=l,Rt=u}Ax(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,te=i):Ax(e)}}function Ax(e){for(;te!==null;){var t=te;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Rt||Zd(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Rt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:$n(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&mx(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}mx(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.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(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&jl(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(q(163))}Rt||t.flags&512&&Hp(t)}catch(f){nt(t,t.return,f)}}if(t===e){te=null;break}if(n=t.sibling,n!==null){n.return=t.return,te=n;break}te=t.return}}function Rx(e){for(;te!==null;){var t=te;if(t===e){te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,te=n;break}te=t.return}}function Ox(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Zd(4,t)}catch(c){nt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){nt(t,s,c)}}var i=t.return;try{Hp(t)}catch(c){nt(t,i,c)}break;case 5:var o=t.return;try{Hp(t)}catch(c){nt(t,o,c)}}}catch(c){nt(t,t.return,c)}if(t===e){te=null;break}var l=t.sibling;if(l!==null){l.return=t.return,te=l;break}te=t.return}}var SA=Math.ceil,id=Ur.ReactCurrentDispatcher,Zg=Ur.ReactCurrentOwner,bn=Ur.ReactCurrentBatchConfig,je=0,yt=null,at=null,jt=0,tn=0,Co=qs(0),pt=0,Ml=null,Ti=0,Jd=0,Jg=0,al=null,Gt=null,Qg=0,na=1/0,kr=null,od=!1,Kp=null,js=null,Bc=!1,ms=null,ad=0,ll=0,Gp=null,_u=-1,Su=0;function Vt(){return je&6?st():_u!==-1?_u:_u=st()}function ks(e){return e.mode&1?je&2&&jt!==0?jt&-jt:oA.transition!==null?(Su===0&&(Su=H_()),Su):(e=Ae,e!==0||(e=window.event,e=e===void 0?16:J_(e.type)),e):1}function Kn(e,t,n,r){if(50<ll)throw ll=0,Gp=null,Error(q(185));ac(e,n,r),(!(je&2)||e!==yt)&&(e===yt&&(!(je&2)&&(Jd|=n),pt===4&&os(e,jt)),Qt(e,r),n===1&&je===0&&!(t.mode&1)&&(na=st()+500,Kd&&Ks()))}function Qt(e,t){var n=e.callbackNode;oP(e,t);var r=Hu(e,e===yt?jt:0);if(r===0)n!==null&&By(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&By(n),t===1)e.tag===0?iA(Ix.bind(null,e)):g1(Ix.bind(null,e)),tA(function(){!(je&6)&&Ks()}),n=null;else{switch(W_(r)){case 1:n=jg;break;case 4:n=B_;break;case 16:n=zu;break;case 536870912:n=z_;break;default:n=zu}n=pS(n,aS.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function aS(e,t){if(_u=-1,Su=0,je&6)throw Error(q(327));var n=e.callbackNode;if(Do()&&e.callbackNode!==n)return null;var r=Hu(e,e===yt?jt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ld(e,r);else{t=r;var s=je;je|=2;var i=cS();(yt!==e||jt!==t)&&(kr=null,na=st()+500,bi(e,t));do try{CA();break}catch(l){lS(e,l)}while(!0);Lg(),id.current=i,je=s,at!==null?t=0:(yt=null,jt=0,t=pt)}if(t!==0){if(t===2&&(s=bp(e),s!==0&&(r=s,t=Yp(e,s))),t===1)throw n=Ml,bi(e,0),os(e,r),Qt(e,st()),n;if(t===6)os(e,r);else{if(s=e.current.alternate,!(r&30)&&!jA(s)&&(t=ld(e,r),t===2&&(i=bp(e),i!==0&&(r=i,t=Yp(e,i))),t===1))throw n=Ml,bi(e,0),os(e,r),Qt(e,st()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(q(345));case 2:oi(e,Gt,kr);break;case 3:if(os(e,r),(r&130023424)===r&&(t=Qg+500-st(),10<t)){if(Hu(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Vt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Np(oi.bind(null,e,Gt,kr),t);break}oi(e,Gt,kr);break;case 4:if(os(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-qn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=st()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*SA(r/1960))-r,10<r){e.timeoutHandle=Np(oi.bind(null,e,Gt,kr),r);break}oi(e,Gt,kr);break;case 5:oi(e,Gt,kr);break;default:throw Error(q(329))}}}return Qt(e,st()),e.callbackNode===n?aS.bind(null,e):null}function Yp(e,t){var n=al;return e.current.memoizedState.isDehydrated&&(bi(e,t).flags|=256),e=ld(e,t),e!==2&&(t=Gt,Gt=n,t!==null&&Zp(t)),e}function Zp(e){Gt===null?Gt=e:Gt.push.apply(Gt,e)}function jA(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!Yn(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function os(e,t){for(t&=~Jg,t&=~Jd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qn(t),r=1<<n;e[n]=-1,t&=~r}}function Ix(e){if(je&6)throw Error(q(327));Do();var t=Hu(e,0);if(!(t&1))return Qt(e,st()),null;var n=ld(e,t);if(e.tag!==0&&n===2){var r=bp(e);r!==0&&(t=r,n=Yp(e,r))}if(n===1)throw n=Ml,bi(e,0),os(e,t),Qt(e,st()),n;if(n===6)throw Error(q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,oi(e,Gt,kr),Qt(e,st()),null}function Xg(e,t){var n=je;je|=1;try{return e(t)}finally{je=n,je===0&&(na=st()+500,Kd&&Ks())}}function Ni(e){ms!==null&&ms.tag===0&&!(je&6)&&Do();var t=je;je|=1;var n=bn.transition,r=Ae;try{if(bn.transition=null,Ae=1,e)return e()}finally{Ae=r,bn.transition=n,je=t,!(je&6)&&Ks()}}function ev(){tn=Co.current,We(Co)}function bi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,eA(n)),at!==null)for(n=at.return;n!==null;){var r=n;switch(Ig(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Yu();break;case 3:ea(),We(Zt),We(Ot),zg();break;case 5:Bg(r);break;case 4:ea();break;case 13:We(Ye);break;case 19:We(Ye);break;case 10:$g(r.type._context);break;case 22:case 23:ev()}n=n.return}if(yt=e,at=e=Cs(e.current,null),jt=tn=t,pt=0,Ml=null,Jg=Jd=Ti=0,Gt=al=null,ui!==null){for(t=0;t<ui.length;t++)if(n=ui[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}ui=null}return e}function lS(e,t){do{var n=at;try{if(Lg(),xu.current=sd,rd){for(var r=Je.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}rd=!1}if(Ei=0,vt=ft=Je=null,il=!1,Rl=0,Zg.current=null,n===null||n.return===null){pt=1,Ml=t,at=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=jt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=bx(o);if(p!==null){p.flags&=-257,_x(p,o,l,i,t),p.mode&1&&wx(i,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(c),t.updateQueue=v}else g.add(c);break e}else{if(!(t&1)){wx(i,u,t),tv();break e}c=Error(q(426))}}else if(Ke&&l.mode&1){var x=bx(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),_x(x,o,l,i,t),Mg(ta(c,l));break e}}i=c=ta(c,l),pt!==4&&(pt=2),al===null?al=[i]:al.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var b=W1(i,c,t);px(i,b);break e;case 1:l=c;var w=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(js===null||!js.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var _=q1(i,l,t);px(i,_);break e}}i=i.return}while(i!==null)}dS(n)}catch(j){t=j,at===n&&n!==null&&(at=n=n.return);continue}break}while(!0)}function cS(){var e=id.current;return id.current=sd,e===null?sd:e}function tv(){(pt===0||pt===3||pt===2)&&(pt=4),yt===null||!(Ti&268435455)&&!(Jd&268435455)||os(yt,jt)}function ld(e,t){var n=je;je|=2;var r=cS();(yt!==e||jt!==t)&&(kr=null,bi(e,t));do try{kA();break}catch(s){lS(e,s)}while(!0);if(Lg(),je=n,id.current=r,at!==null)throw Error(q(261));return yt=null,jt=0,pt}function kA(){for(;at!==null;)uS(at)}function CA(){for(;at!==null&&!J2();)uS(at)}function uS(e){var t=fS(e.alternate,e,tn);e.memoizedProps=e.pendingProps,t===null?dS(e):at=t,Zg.current=null}function dS(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=xA(n,t),n!==null){n.flags&=32767,at=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{pt=6,at=null;return}}else if(n=yA(n,t,tn),n!==null){at=n;return}if(t=t.sibling,t!==null){at=t;return}at=t=e}while(t!==null);pt===0&&(pt=5)}function oi(e,t,n){var r=Ae,s=bn.transition;try{bn.transition=null,Ae=1,EA(e,t,n,r)}finally{bn.transition=s,Ae=r}return null}function EA(e,t,n,r){do Do();while(ms!==null);if(je&6)throw Error(q(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(q(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(aP(e,i),e===yt&&(at=yt=null,jt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Bc||(Bc=!0,pS(zu,function(){return Do(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=bn.transition,bn.transition=null;var o=Ae;Ae=1;var l=je;je|=4,Zg.current=null,bA(e,n),iS(n,e),KP(Ep),Wu=!!Cp,Ep=Cp=null,e.current=n,_A(n),Q2(),je=l,Ae=o,bn.transition=i}else e.current=n;if(Bc&&(Bc=!1,ms=e,ad=s),i=e.pendingLanes,i===0&&(js=null),tP(n.stateNode),Qt(e,st()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(od)throw od=!1,e=Kp,Kp=null,e;return ad&1&&e.tag!==0&&Do(),i=e.pendingLanes,i&1?e===Gp?ll++:(ll=0,Gp=e):ll=0,Ks(),null}function Do(){if(ms!==null){var e=W_(ad),t=bn.transition,n=Ae;try{if(bn.transition=null,Ae=16>e?16:e,ms===null)var r=!1;else{if(e=ms,ms=null,ad=0,je&6)throw Error(q(331));var s=je;for(je|=4,te=e.current;te!==null;){var i=te,o=i.child;if(te.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(te=u;te!==null;){var d=te;switch(d.tag){case 0:case 11:case 15:ol(8,d,i)}var h=d.child;if(h!==null)h.return=d,te=h;else for(;te!==null;){d=te;var f=d.sibling,p=d.return;if(nS(d),d===u){te=null;break}if(f!==null){f.return=p,te=f;break}te=p}}}var g=i.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var x=v.sibling;v.sibling=null,v=x}while(v!==null)}}te=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,te=o;else e:for(;te!==null;){if(i=te,i.flags&2048)switch(i.tag){case 0:case 11:case 15:ol(9,i,i.return)}var b=i.sibling;if(b!==null){b.return=i.return,te=b;break e}te=i.return}}var w=e.current;for(te=w;te!==null;){o=te;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,te=y;else e:for(o=w;te!==null;){if(l=te,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Zd(9,l)}}catch(j){nt(l,l.return,j)}if(l===o){te=null;break e}var _=l.sibling;if(_!==null){_.return=l.return,te=_;break e}te=l.return}}if(je=s,Ks(),hr&&typeof hr.onPostCommitFiberRoot=="function")try{hr.onPostCommitFiberRoot(Bd,e)}catch{}r=!0}return r}finally{Ae=n,bn.transition=t}}return!1}function Mx(e,t,n){t=ta(n,t),t=W1(e,t,1),e=Ss(e,t,1),t=Vt(),e!==null&&(ac(e,1,t),Qt(e,t))}function nt(e,t,n){if(e.tag===3)Mx(e,e,n);else for(;t!==null;){if(t.tag===3){Mx(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(js===null||!js.has(r))){e=ta(n,e),e=q1(t,e,1),t=Ss(t,e,1),e=Vt(),t!==null&&(ac(t,1,e),Qt(t,e));break}}t=t.return}}function TA(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Vt(),e.pingedLanes|=e.suspendedLanes&n,yt===e&&(jt&n)===n&&(pt===4||pt===3&&(jt&130023424)===jt&&500>st()-Qg?bi(e,0):Jg|=n),Qt(e,t)}function hS(e,t){t===0&&(e.mode&1?(t=Rc,Rc<<=1,!(Rc&130023424)&&(Rc=4194304)):t=1);var n=Vt();e=Mr(e,t),e!==null&&(ac(e,t,n),Qt(e,n))}function NA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hS(e,n)}function PA(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(q(314))}r!==null&&r.delete(t),hS(e,n)}var fS;fS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Zt.current)Yt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Yt=!1,vA(e,t,n);Yt=!!(e.flags&131072)}else Yt=!1,Ke&&t.flags&1048576&&v1(t,Qu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;bu(e,t),e=t.pendingProps;var s=Jo(t,Ot.current);Mo(t,n),s=Wg(null,t,r,e,s,n);var i=qg();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jt(r)?(i=!0,Zu(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Vg(t),s.updater=Yd,t.stateNode=s,s._reactInternals=t,Dp(t,r,e,n),t=Fp(null,t,r,!0,i,n)):(t.tag=0,Ke&&i&&Og(t),Mt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(bu(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=RA(r),e=$n(r,e),s){case 0:t=$p(null,t,r,e,n);break e;case 1:t=kx(null,t,r,e,n);break e;case 11:t=Sx(null,t,r,e,n);break e;case 14:t=jx(null,t,r,$n(r.type,e),n);break e}throw Error(q(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:$n(r,s),$p(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:$n(r,s),kx(e,t,r,s,n);case 3:e:{if(Z1(t),e===null)throw Error(q(387));
vendor: 4,912 bytes, line 40
40r=t.pendingProps,i=t.memoizedState,s=i.element,S1(e,t),td(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=ta(Error(q(423)),t),t=Cx(e,t,r,n,s);break e}else if(r!==s){s=ta(Error(q(424)),t),t=Cx(e,t,r,n,s);break e}else for(sn=_s(t.stateNode.containerInfo.firstChild),on=t,Ke=!0,Hn=null,n=b1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qo(),r===s){t=Dr(e,t,n);break e}Mt(e,t,r,n)}t=t.child}return t;case 5:return j1(t),e===null&&Op(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Tp(r,s)?o=null:i!==null&&Tp(r,i)&&(t.flags|=32),Y1(e,t),Mt(e,t,o,n),t.child;case 6:return e===null&&Op(t),null;case 13:return J1(e,t,n);case 4:return Ug(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Xo(t,null,r,n):Mt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:$n(r,s),Sx(e,t,r,s,n);case 7:return Mt(e,t,t.pendingProps,n),t.child;case 8:return Mt(e,t,t.pendingProps.children,n),t.child;case 12:return Mt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,Fe(Xu,r._currentValue),r._currentValue=o,i!==null)if(Yn(i.value,o)){if(i.children===s.children&&!Zt.current){t=Dr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Rr(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Ip(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(q(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ip(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Mt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Mo(t,n),s=Sn(s),r=r(s),t.flags|=1,Mt(e,t,r,n),t.child;case 14:return r=t.type,s=$n(r,t.pendingProps),s=$n(r.type,s),jx(e,t,r,s,n);case 15:return K1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:$n(r,s),bu(e,t),t.tag=1,Jt(r)?(e=!0,Zu(t)):e=!1,Mo(t,n),H1(t,r,s),Dp(t,r,s,n),Fp(null,t,r,!0,e,n);case 19:return Q1(e,t,n);case 22:return G1(e,t,n)}throw Error(q(156,t.tag))};function pS(e,t){return U_(e,t)}function AA(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,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 xn(e,t,n,r){return new AA(e,t,n,r)}function nv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function RA(e){if(typeof e=="function")return nv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bg)return 11;if(e===_g)return 14}return 2}function Cs(e,t){var n=e.alternate;return n===null?(n=xn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ju(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")nv(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case go:return _i(n.children,s,i,t);case wg:o=8,s|=8;break;case op:return e=xn(12,n,t,s|2),e.elementType=op,e.lanes=i,e;case ap:return e=xn(13,n,t,s),e.elementType=ap,e.lanes=i,e;case lp:return e=xn(19,n,t,s),e.elementType=lp,e.lanes=i,e;case j_:return Qd(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case __:o=10;break e;case S_:o=9;break e;case bg:o=11;break e;case _g:o=14;break e;case ns:o=16,r=null;break e}throw Error(q(130,e==null?e:typeof e,""))}return t=xn(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function _i(e,t,n,r){return e=xn(7,e,r,t),e.lanes=n,e}function Qd(e,t,n,r){return e=xn(22,e,r,t),e.elementType=j_,e.lanes=n,e.stateNode={isHidden:!1},e}function yf(e,t,n){return e=xn(6,e,null,t),e.lanes=n,e}function xf(e,t,n){return t=xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}
vendor: 5,453 bytes, line 40
40function OA(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qh(0),this.expirationTimes=Qh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qh(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function rv(e,t,n,r,s,i,o,l,c){return e=new OA(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=xn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vg(i),e}function IA(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:mo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function mS(e){if(!e)return Rs;e=e._reactInternals;e:{if(Di(e)!==e||e.tag!==1)throw Error(q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(q(171))}if(e.tag===1){var n=e.type;if(Jt(n))return m1(e,n,t)}return t}function gS(e,t,n,r,s,i,o,l,c){return e=rv(n,r,!0,e,s,i,o,l,c),e.context=mS(null),n=e.current,r=Vt(),s=ks(n),i=Rr(r,s),i.callback=t??null,Ss(n,i,s),e.current.lanes=s,ac(e,s,r),Qt(e,r),e}function Xd(e,t,n,r){var s=t.current,i=Vt(),o=ks(s);return n=mS(n),t.context===null?t.context=n:t.pendingContext=n,t=Rr(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ss(s,t,o),e!==null&&(Kn(e,s,o,i),yu(e,s,o)),o}function cd(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Dx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sv(e,t){Dx(e,t),(e=e.alternate)&&Dx(e,t)}function MA(){return null}var vS=typeof reportError=="function"?reportError:function(e){console.error(e)};function iv(e){this._internalRoot=e}eh.prototype.render=iv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));Xd(e,t,null,null)};eh.prototype.unmount=iv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ni(function(){Xd(null,e,null,null)}),t[Ir]=null}};function eh(e){this._internalRoot=e}eh.prototype.unstable_scheduleHydration=function(e){if(e){var t=G_();e={blockedOn:null,target:e,priority:t};for(var n=0;n<is.length&&t!==0&&t<is[n].priority;n++);is.splice(n,0,e),n===0&&Z_(e)}};function ov(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function th(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Lx(){}function DA(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=cd(o);i.call(u)}}var o=gS(t,r,e,0,null,!1,!1,"",Lx);return e._reactRootContainer=o,e[Ir]=o.current,El(e.nodeType===8?e.parentNode:e),Ni(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var u=cd(c);l.call(u)}}var c=rv(e,0,!1,null,null,!1,!1,"",Lx);return e._reactRootContainer=c,e[Ir]=c.current,El(e.nodeType===8?e.parentNode:e),Ni(function(){Xd(t,c,n,r)}),c}function nh(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var l=s;s=function(){var c=cd(o);l.call(c)}}Xd(t,o,e,s)}else o=DA(n,t,e,s,r);return cd(o)}q_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ka(t.pendingLanes);n!==0&&(kg(t,n|1),Qt(t,st()),!(je&6)&&(na=st()+500,Ks()))}break;case 13:Ni(function(){var r=Mr(e,1);if(r!==null){var s=Vt();Kn(r,e,1,s)}}),sv(e,1)}};Cg=function(e){if(e.tag===13){var t=Mr(e,134217728);if(t!==null){var n=Vt();Kn(t,e,134217728,n)}sv(e,134217728)}};K_=function(e){if(e.tag===13){var t=ks(e),n=Mr(e,t);if(n!==null){var r=Vt();Kn(n,e,t,r)}sv(e,t)}};G_=function(){return Ae};Y_=function(e,t){var n=Ae;try{return Ae=e,t()}finally{Ae=n}};yp=function(e,t,n){switch(t){case"input":if(dp(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=qd(r);if(!s)throw Error(q(90));C_(r),dp(r,s)}}}break;case"textarea":T_(e,n);break;case"select":t=n.value,t!=null&&Ao(e,!!n.multiple,t,!1)}};M_=Xg;D_=Ni;var LA={usingClientEntryPoint:!1,Events:[cc,wo,qd,O_,I_,Xg]},Fa={findFiberByHostInstance:ci,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$A={bundleType:Fa.bundleType,version:Fa.version,rendererPackageName:Fa.rendererPackageName,rendererConfig:Fa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ur.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=F_(e),e===null?null:e.stateNode},findFiberByHostInstance:Fa.findFiberByHostInstance||MA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zc.isDisabled&&zc.supportsFiber)try{Bd=zc.inject($A),hr=zc}catch{}}un.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=LA;un.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ov(t))throw Error(q(200));return IA(e,t,null,n)};un.createRoot=function(e,t){if(!ov(e))throw Error(q(299));var n=!1,r="",s=vS;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=rv(e,1,!1,null,null,n,!1,r,s),e[Ir]=t.current,El(e.nodeType===8?e.parentNode:e),new iv(t)};un.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=F_(t),e=e===null?null:e.stateNode,e};un.flushSync=function(e){return Ni(e)};un.hydrate=function(e,t,n){if(!th(t))throw Error(q(200));return nh(null,e,t,!0,n)};un.hydrateRoot=function(e,t,n){if(!ov(e))throw Error(q(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=vS;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=gS(t,null,e,1,n??null,s,!1,i,o),e[Ir]=t.current,El(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new eh(t)};un.render=function(e,t,n){if(!th(t))throw Error(q(200));return nh(null,e,t,!1,n)};un.unmountComponentAtNode=function(e){if(!th(e))throw Error(q(40));return e._reactRootContainer?(Ni(function(){nh(null,null,e,!1,function(){e._reactRootContainer=null,e[Ir]=null})}),!0):!1};un.unstable_batchedUpdates=Xg;un.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!th(n))throw Error(q(200));if(e==null||e._reactInternals===void 0)throw Error(q(38));return nh(e,t,n,!1,r)};un.version="18.3.1-next-f1338f8080-20240426";function yS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yS)}catch(e){console.error(e)}}yS(),y_.exports=un;var Li=y_.exports;const xS=o_(Li);var wS,$x=Li;wS=$x.createRoot,$x.hydrateRoot;const FA=1,VA=1e6;let wf=0;function UA(){return wf=(wf+1)%Number.MAX_SAFE_INTEGER,wf.toString()}const bf=new Map,Fx=e=>{if(bf.has(e))return;const t=setTimeout(()=>{bf.delete(e),cl({type:"REMOVE_TOAST",toastId:e})},VA);bf.set(e,t)},BA=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,FA)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Fx(n):e.toasts.forEach(r=>{Fx(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},ku=[];let Cu={toasts:[]};function cl(e){Cu=BA(Cu,e),ku.forEach(t=>{t(Cu)})}function bS({...e}){const t=UA(),n=s=>cl({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>cl({type:"DISMISS_TOAST",toastId:t});return cl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function Et(){const[e,t]=m.useState(Cu);return m.useEffect(()=>(ku.push(t),()=>{const n=ku.indexOf(t);n>-1&&ku.splice(n,1)}),[e]),{...e,toast:bS,dismiss:n=>cl({type:"DISMISS_TOAST",toastId:n})}}function ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Vx(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _S(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Vx(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Vx(e[s],null)}}}}function Se(...e){return m.useCallback(_S(...e),e)}function zA(e,t){const n=m.createContext(t),r=i=>{const{children:o,...l}=i,c=m.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function hn(e,t=[]){let n=[];function r(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];const u=h=>{var b;const{scope:f,children:p,...g}=h,v=((b=f==null?void 0:f[e])==null?void 0:b[c])||l,x=m.useMemo(()=>g,Object.values(g));return a.jsx(v.Provider,{value:x,children:p})};u.displayName=i+"Provider";function d(h,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[u,d]}const s=()=>{const i=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,HA(s,...t)]}function HA(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));
vendor: 10,698 bytes, line 40
40return function(i){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const h=c(i)[`__scope${u}`];return{...l,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function ra(e){const t=qA(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,l=m.Children.toArray(i),c=l.find(KA);if(c){const u=c.props.children,d=l.map(h=>h===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:h);return a.jsx(t,{...o,ref:s,children:m.isValidElement(u)?m.cloneElement(u,void 0,d):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var WA=ra("Slot");function qA(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=YA(s),l=GA(i,s.props);return s.type!==m.Fragment&&(l.ref=r?_S(r,o):o),m.cloneElement(s,l)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SS=Symbol("radix.slottable");function jS(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=SS,t}function KA(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SS}function GA(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function YA(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function av(e){const t=e+"CollectionProvider",[n,r]=hn(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=v=>{const{scope:x,children:b}=v,w=G.useRef(null),y=G.useRef(new Map).current;return a.jsx(s,{scope:x,itemMap:y,collectionRef:w,children:b})};o.displayName=t;const l=e+"CollectionSlot",c=ra(l),u=G.forwardRef((v,x)=>{const{scope:b,children:w}=v,y=i(l,b),_=Se(x,y.collectionRef);return a.jsx(c,{ref:_,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",h="data-radix-collection-item",f=ra(d),p=G.forwardRef((v,x)=>{const{scope:b,children:w,...y}=v,_=G.useRef(null),j=Se(x,_),C=i(d,b);return G.useEffect(()=>(C.itemMap.set(_,{ref:_,...y}),()=>void C.itemMap.delete(_))),a.jsx(f,{[h]:"",ref:j,children:w})});p.displayName=d;function g(v){const x=i(e+"CollectionConsumer",v);return G.useCallback(()=>{const w=x.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(x.itemMap.values()).sort((C,k)=>y.indexOf(C.ref.current)-y.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:u,ItemSlot:p},g,r]}var ZA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],he=ZA.reduce((e,t)=>{const n=ra(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kS(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}function kn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function JA(e,t=globalThis==null?void 0:globalThis.document){const n=kn(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var QA="DismissableLayer",Jp="dismissableLayer.update",XA="dismissableLayer.pointerDownOutside",eR="dismissableLayer.focusOutside",Ux,CS=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dc=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=m.useContext(CS),[d,h]=m.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=m.useState({}),g=Se(t,k=>h(k)),v=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(x),w=d?v.indexOf(d):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,_=w>=b,j=nR(k=>{const S=k.target,P=[...u.branches].some(E=>E.contains(S));!_||P||(s==null||s(k),o==null||o(k),k.defaultPrevented||l==null||l())},f),C=rR(k=>{const S=k.target;[...u.branches].some(E=>E.contains(S))||(i==null||i(k),o==null||o(k),k.defaultPrevented||l==null||l())},f);return JA(k=>{w===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},f),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ux=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Bx(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Ux)}},[d,f,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Bx())},[d,u]),m.useEffect(()=>{const k=()=>p({});return document.addEventListener(Jp,k),()=>document.removeEventListener(Jp,k)},[]),a.jsx(he.div,{...c,ref:g,style:{pointerEvents:y?_?"auto":"none":void 0,...e.style},onFocusCapture:ae(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ae(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ae(e.onPointerDownCapture,j.onPointerDownCapture)})});dc.displayName=QA;var tR="DismissableLayerBranch",ES=m.forwardRef((e,t)=>{const n=m.useContext(CS),r=m.useRef(null),s=Se(t,r);return m.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(he.div,{...e,ref:s})});ES.displayName=tR;function nR(e,t=globalThis==null?void 0:globalThis.document){const n=kn(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){TS(XA,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function rR(e,t=globalThis==null?void 0:globalThis.document){const n=kn(e),r=m.useRef(!1);return m.useEffect(()=>{const s=i=>{i.target&&!r.current&&TS(eR,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Bx(){const e=new CustomEvent(Jp);document.dispatchEvent(e)}function TS(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?kS(s,i):s.dispatchEvent(i)}var sR=dc,iR=ES,Ct=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},oR="Portal",rh=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,i]=m.useState(!1);Ct(()=>i(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?xS.createPortal(a.jsx(he.div,{...r,ref:t}),o):null});rh.displayName=oR;function aR(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Br=e=>{const{present:t,children:n}=e,r=lR(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Se(r.ref,cR(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null};Br.displayName="Presence";function lR(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=aR(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Hc(r.current);i.current=l==="mounted"?u:"none"},[l]),Ct(()=>{const u=r.current,d=s.current;if(d!==e){const f=i.current,p=Hc(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Ct(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=p=>{const v=Hc(r.current).includes(p.animationName);if(p.target===t&&v&&(c("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=p=>{p.target===t&&(i.current=Hc(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Hc(e){return(e==null?void 0:e.animationName)||"none"}function cR(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uR=gg[" useInsertionEffect ".trim().toString()]||Ct;function Lr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,o]=dR({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const d=m.useRef(e!==void 0);m.useEffect(()=>{const h=d.current;h!==l&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,r])}const u=m.useCallback(d=>{var h;if(l){const f=hR(d)?d(e):d;f!==e&&((h=o.current)==null||h.call(o,f))}else i(d)},[l,e,i,o]);return[c,u]}function dR({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),i=m.useRef(t);return uR(()=>{i.current=t},[t]),m.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function hR(e){return typeof e=="function"}var NS=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fR="VisuallyHidden",sh=m.forwardRef((e,t)=>
40a.jsx(he.span,{...e,ref:t,style:{...NS,...e.style}}));sh.displayName=fR;var pR=sh,lv="ToastProvider",[cv,mR,gR]=av("Toast"),[PS,D9]=hn("Toast",[gR]),[vR,ih]=PS(lv),AS=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=e,[l,c]=m.useState(null),[u,d]=m.useState(0),h=m.useRef(!1),f=m.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${lv}\`. Expected non-empty \`string\`.`),a.jsx(cv.Provider,{scope:t,children:a.jsx(vR,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:m.useCallback(()=>d(p=>p+1),[]),onToastRemove:m.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:o})})};AS.displayName=lv;var RS="ToastViewport",yR=["F8"],Qp="toast.viewportPause",Xp="toast.viewportResume",OS=m.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=yR,label:s="Notifications ({hotkey})",...i}=e,o=ih(RS,n),l=mR(n),c=m.useRef(null),u=m.useRef(null),d=m.useRef(null),h=m.useRef(null),f=Se(t,h,o.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;m.useEffect(()=>{const x=b=>{var y;r.length!==0&&r.every(_=>b[_]||b.code===_)&&((y=h.current)==null||y.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),m.useEffect(()=>{const x=c.current,b=h.current;if(g&&x&&b){const w=()=>{if(!o.isClosePausedRef.current){const C=new CustomEvent(Qp);b.dispatchEvent(C),o.isClosePausedRef.current=!0}},y=()=>{if(o.isClosePausedRef.current){const C=new CustomEvent(Xp);b.dispatchEvent(C),o.isClosePausedRef.current=!1}},_=C=>{!x.contains(C.relatedTarget)&&y()},j=()=>{x.contains(document.activeElement)||y()};return x.addEventListener("focusin",w),x.addEventListener("focusout",_),x.addEventListener("pointermove",w),x.addEventListener("pointerleave",j),window.addEventListener("blur",w),window.addEventListener("focus",y),()=>{x.removeEventListener("focusin",w),x.removeEventListener("focusout",_),x.removeEventListener("pointermove",w),x.removeEventListener("pointerleave",j),window.removeEventListener("blur",w),window.removeEventListener("focus",y)}}},[g,o.isClosePausedRef]);const v=m.useCallback(({tabbingDirection:x})=>{const w=l().map(y=>{const _=y.ref.current,j=[_,...AR(_)];return x==="forwards"?j:j.reverse()});return(x==="forwards"?w.reverse():w).flat()},[l]);return m.useEffect(()=>{const x=h.current;if(x){const b=w=>{var j,C,k;const y=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!y){const S=document.activeElement,P=w.shiftKey;if(w.target===x&&P){(j=u.current)==null||j.focus();return}const R=v({tabbingDirection:P?"backwards":"forwards"}),$=R.findIndex(T=>T===S);_f(R.slice($+1))?w.preventDefault():P?(C=u.current)==null||C.focus():(k=d.current)==null||k.focus()}};return x.addEventListener("keydown",b),()=>x.removeEventListener("keydown",b)}},[l,v]),a.jsxs(iR,{ref:c,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&a.jsx(em,{ref:u,onFocusFromOutsideViewport:()=>{const x=v({tabbingDirection:"forwards"});_f(x)}}),a.jsx(cv.Slot,{scope:n,children:a.jsx(he.ol,{tabIndex:-1,...i,ref:f})}),g&&a.jsx(em,{ref:d,onFocusFromOutsideViewport:()=>{const x=v({tabbingDirection:"backwards"});_f(x)}})]})});OS.displayName=RS;var IS="ToastFocusProxy",em=m.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,i=ih(IS,n);return a.jsx(sh,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(l))&&r()}})});em.displayName=IS;var hc="Toast",xR="toast.swipeStart",wR="toast.swipeMove",bR="toast.swipeCancel",_R="toast.swipeEnd",MS=m.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=e,[l,c]=Lr({prop:r,defaultProp:s??!0,onChange:i,caller:hc});return a.jsx(Br,{present:n||l,children:a.jsx(kR,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:kn(e.onPause),onResume:kn(e.onResume),onSwipeStart:ae(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ae(e.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:ae(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ae(e.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});MS.displayName=hc;var[SR,jR]=PS(hc,{onClose(){}}),kR=m.forwardRef((e,t)=>
40{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:p,...g}=e,v=ih(hc,n),[x,b]=m.useState(null),w=Se(t,T=>b(T)),y=m.useRef(null),_=m.useRef(null),j=s||v.duration,C=m.useRef(0),k=m.useRef(j),S=m.useRef(0),{onToastAdd:P,onToastRemove:E}=v,I=kn(()=>{var U;(x==null?void 0:x.contains(document.activeElement))&&((U=v.viewport)==null||U.focus()),o()}),R=m.useCallback(T=>{!T||T===1/0||(window.clearTimeout(S.current),C.current=new Date().getTime(),S.current=window.setTimeout(I,T))},[I]);m.useEffect(()=>{const T=v.viewport;if(T){const U=()=>{R(k.current),u==null||u()},D=()=>{const A=new Date().getTime()-C.current;k.current=k.current-A,window.clearTimeout(S.current),c==null||c()};return T.addEventListener(Qp,D),T.addEventListener(Xp,U),()=>{T.removeEventListener(Qp,D),T.removeEventListener(Xp,U)}}},[v.viewport,j,c,u,R]),m.useEffect(()=>{i&&!v.isClosePausedRef.current&&R(j)},[i,j,v.isClosePausedRef,R]),m.useEffect(()=>(P(),()=>E()),[P,E]);const $=m.useMemo(()=>x?BS(x):null,[x]);return v.viewport?a.jsxs(a.Fragment,{children:[$&&a.jsx(CR,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:$}),a.jsx(SR,{scope:n,onClose:I,children:Li.createPortal(a.jsx(cv.ItemSlot,{scope:n,children:a.jsx(sR,{asChild:!0,onEscapeKeyDown:ae(l,()=>{v.isFocusedToastEscapeKeyDownRef.current||I(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(he.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":v.swipeDirection,...g,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ae(e.onKeyDown,T=>{T.key==="Escape"&&(l==null||l(T.nativeEvent),T.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,I()))}),onPointerDown:ae(e.onPointerDown,T=>{T.button===0&&(y.current={x:T.clientX,y:T.clientY})}),onPointerMove:ae(e.onPointerMove,T=>{if(!y.current)return;const U=T.clientX-y.current.x,D=T.clientY-y.current.y,A=!!_.current,N=["left","right"].includes(v.swipeDirection),O=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,V=N?O(0,U):0,H=N?0:O(0,D),Z=T.pointerType==="touch"?10:2,B={x:V,y:H},le={originalEvent:T,delta:B};A?(_.current=B,Wc(wR,h,le,{discrete:!1})):zx(B,v.swipeDirection,Z)?(_.current=B,Wc(xR,d,le,{discrete:!1}),T.target.setPointerCapture(T.pointerId)):(Math.abs(U)>Z||Math.abs(D)>Z)&&(y.current=null)}),onPointerUp:ae(e.onPointerUp,T=>{const U=_.current,D=T.target;if(D.hasPointerCapture(T.pointerId)&&D.releasePointerCapture(T.pointerId),_.current=null,y.current=null,U){const A=T.currentTarget,N={originalEvent:T,delta:U};zx(U,v.swipeDirection,v.swipeThreshold)?Wc(_R,p,N,{discrete:!0}):Wc(bR,f,N,{discrete:!0}),A.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),CR=e=>{const{__scopeToast:t,children:n,...r}=e,s=ih(hc,t),[i,o]=m.useState(!1),[l,c]=m.useState(!1);return NR(()=>o(!0)),m.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:a.jsx(rh,{asChild:!0,children:a.jsx(sh,{...r,children:i&&a.jsxs(a.Fragment,{children:[s.label," ",n]})})})},ER="ToastTitle",DS=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(he.div,{...r,ref:t})});DS.displayName=ER;var TR="ToastDescription",LS=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(he.div,{...r,ref:t})});LS.displayName=TR;var $S="ToastAction",FS=m.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?a.jsx(US,{altText:n,asChild:!0,children:a.jsx(uv,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${$S}\`. Expected non-empty \`string\`.`),null)});FS.displayName=$S;var VS="ToastClose",uv=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=jR(VS,n);return a.jsx(US,{asChild:!0,children:a.jsx(he.button,{type:"button",...r,ref:t,onClick:ae(e.onClick,s.onClose)})})});uv.displayName=VS;var US=m.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return a.jsx(he.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function BS(e){const t=[];
40return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),PR(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...BS(r))}}),t}function Wc(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?kS(s,i):s.dispatchEvent(i)}var zx=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),i=r>s;return t==="left"||t==="right"?i&&r>n:!i&&s>n};function NR(e=()=>{}){const t=kn(e);Ct(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function PR(e){return e.nodeType===e.ELEMENT_NODE}function AR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _f(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}
vendor: 6,672 bytes, lines 40-110
40var RR=AS,zS=OS,HS=MS,WS=DS,qS=LS,KS=FS,GS=uv;function YS(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=YS(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ZS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=YS(e))&&(r&&(r+=" "),r+=t);return r}const Hx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Wx=ZS,oh=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Wx(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(u=>{const d=n==null?void 0:n[u],h=i==null?void 0:i[u];if(d===null)return null;const f=Hx(d)||Hx(h);return s[u][f]}),l=n&&Object.entries(n).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:f,...p}=d;return Object.entries(p).every(g=>{let[v,x]=g;return Array.isArray(x)?x.includes({...i,...l}[v]):{...i,...l}[v]===x})?[...u,h,f]:u},[]);return Wx(e,o,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 OR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),JS=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===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 IR={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 MR=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...l},c)=>m.createElement("svg",{ref:c,...IR,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:JS("lucide",s),...l},[...o.map(([u,d])=>m.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
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 Y=(e,t)=>{const n=m.forwardRef(({className:r,...s},i)=>m.createElement(MR,{ref:i,iconNode:t,className:JS(`lucide-${OR(e)}`,r),...s}));return n.displayName=`${e}`,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 DR=Y("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
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 dv=Y("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
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 Eu=Y("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
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 LR=Y("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
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 QS=Y("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
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 $R=Y("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
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 FR=Y("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
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 VR=Y("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
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 hv=Y("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
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 ah=Y("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
110],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
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 UR=Y("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"}]]);/**
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 BR=Y("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
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 Dl=Y("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
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 lh=Y("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
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 zR=Y("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
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 HR=Y("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 WR=Y("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
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 qR=Y("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
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 KR=Y("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
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 GR=Y("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
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 YR=Y("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
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 ZR=Y("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}
170],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
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 JR=Y("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
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 XS=Y("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
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 ej=Y("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
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 QR=Y("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
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 XR=Y("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"}]]);/**
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 eO=Y("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);/**
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 tj=Y("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
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 tO=Y("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/**
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 nO=Y("HeartPulse",[["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"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/**
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 rO=Y("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 sO=Y("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
226 * @license lucide-react v0.462.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const iO=Y("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
231 * @license lucide-react v0.462.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const nj=Y("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
236 * @license lucide-react v0.462.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const oO=Y("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
241 * @license lucide-react v0.462.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const aO=Y("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
246 * @license lucide-react v0.462.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const ul=Y("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
251 * @license lucide-react v0.462.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const lO=Y("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
256 * @license lucide-react v0.462.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const qx=Y("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"}]]);/**
261 * @license lucide-react v0.462.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const ya=Y("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
266 * @license lucide-react v0.462.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const cO=Y("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"}]]);/**
271 * @license lucide-react v0.462.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const rj=Y("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/**
276 * @license lucide-react v0.462.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const uO=Y("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
281 * @license lucide-react v0.462.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const sj=Y("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
286 * @license lucide-react v0.462.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const dO=Y("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
291 * @license lucide-react v0.462.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const zr=Y("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
296 * @license lucide-react v0.462.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const ij=Y("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"}]]);/**
301 * @license lucide-react v0.462.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const $i=Y("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
306 * @license lucide-react v0.462.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const oj=Y("Radar",[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]);/**
311 * @license lucide-react v0.462.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const fv=Y("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
316 * @license lucide-react v0.462.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const Kx=Y("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
321 * @license lucide-react v0.462.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const hO=Y("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3
325kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
326 * @license lucide-react v0.462.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const gr=Y("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
331 * @license lucide-react v0.462.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const fO=Y("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
336 * @license lucide-react v0.462.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const sa=Y("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
341 * @license lucide-react v0.462.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const pO=Y("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
346 * @license lucide-react v0.462.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const mO=Y("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"}]]);/**
351 * @license lucide-react v0.462.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const aj=Y("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
356 * @license lucide-react v0.462.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const pv=Y("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
361 * @license lucide-react v0.462.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const gO=Y("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
366 * @license lucide-react v0.462.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const Os=Y("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
371 * @license lucide-react v0.462.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const vO=Y("Sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);/**
376 * @license lucide-react v0.462.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const mv=Y("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
381 * @license lucide-react v0.462.0 - ISC
382 *
383 * This source code is licensed under the ISC license.
384 * See the LICENSE file in the root directory of this source tree.
385 */const yO=Y("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
386 * @license lucide-react v0.462.0 - ISC
387 *
388 * This source code is licensed under the ISC license.
389 * See the LICENSE file in the root directory of this source tree.
390 */const xO=Y("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
391 * @license lucide-react v0.462.0 - ISC
392 *
393 * This source code is licensed under the ISC license.
394 * See the LICENSE file in the root directory of this source tree.
395 */const xr=Y("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
395],["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"}]]);/**
396 * @license lucide-react v0.462.0 - ISC
397 *
398 * This source code is licensed under the ISC license.
399 * See the LICENSE file in the root directory of this source tree.
400 */const wO=Y("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
401 * @license lucide-react v0.462.0 - ISC
402 *
403 * This source code is licensed under the ISC license.
404 * See the LICENSE file in the root directory of this source tree.
405 */const bO=Y("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
406 * @license lucide-react v0.462.0 - ISC
407 *
408 * This source code is licensed under the ISC license.
409 * See the LICENSE file in the root directory of this source tree.
410 */const _O=Y("Truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);/**
411 * @license lucide-react v0.462.0 - ISC
412 *
413 * This source code is licensed under the ISC license.
414 * See the LICENSE file in the root directory of this source tree.
415 */const SO=Y("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/**
416 * @license lucide-react v0.462.0 - ISC
417 *
418 * This source code is licensed under the ISC license.
419 * See the LICENSE file in the root directory of this source tree.
420 */const jO=Y("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"}]]);/**
421 * @license lucide-react v0.462.0 - ISC
422 *
423 * This source code is licensed under the ISC license.
424 * See the LICENSE file in the root directory of this source tree.
425 */const kO=Y("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
426 * @license lucide-react v0.462.0 - ISC
427 *
428 * This source code is licensed under the ISC license.
429 * See the LICENSE file in the root directory of this source tree.
430 */const Is=Y("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
431 * @license lucide-react v0.462.0 - ISC
432 *
433 * This source code is licensed under the ISC license.
434 * See the LICENSE file in the root directory of this source tree.
435 */const CO=Y("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/**
436 * @license lucide-react v0.462.0 - ISC
437 *
438 * This source code is licensed under the ISC license.
439 * See the LICENSE file in the root directory of this source tree.
440 */const ud=Y("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"}]]);/**
441 * @license lucide-react v0.462.0 - ISC
442 *
443 * This source code is licensed under the ISC license.
444 * See the LICENSE file in the root directory of this source tree.
445 */const EO=Y("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/**
446 * @license lucide-react v0.462.0 - ISC
447 *
448 * This source code is licensed under the ISC license.
449 * See the LICENSE file in the root directory of this source tree.
450 */const fc=Y("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 6,289 bytes, lines 450-455
450],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
451 * @license lucide-react v0.462.0 - ISC
452 *
453 * This source code is licensed under the ISC license.
454 * See the LICENSE file in the root directory of this source tree.
455 */const TO=Y("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),gv="-",NO=e=>{const t=AO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(gv);return l[0]===""&&l.length!==1&&l.shift(),lj(l,t)||PO(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},lj=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?lj(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(gv);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Gx=/^\[(.+)\]$/,PO=e=>{if(Gx.test(e)){const t=Gx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},AO=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return OO(Object.entries(e.classGroups),n).forEach(([i,o])=>{tm(o,r,i,t)}),r},tm=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Yx(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(RO(s)){tm(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{tm(o,Yx(t,i),n,r)})})},Yx=(e,t)=>{let n=e;return t.split(gv).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},RO=e=>e.isThemeGetter,OO=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,s]}):e,IO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},cj="!",MO=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=l=>{const c=[];let u=0,d=0,h;for(let x=0;x<l.length;x++){let b=l[x];if(u===0){if(b===s&&(r||l.slice(x,x+i)===t)){c.push(l.slice(d,x)),d=x+i;continue}if(b==="/"){h=x;continue}}b==="["?u++:b==="]"&&u--}const f=c.length===0?l:l.substring(d),p=f.startsWith(cj),g=p?f.substring(1):f,v=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:o}):o},DO=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},LO=e=>({cache:IO(e.cacheSize),parseClassName:MO(e),...NO(e)}),$O=/\s+/,FO=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split($O);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:p}=n(u);let g=!!p,v=r(g?f.substring(0,p):f);if(!v){if(!g){l=u+(l.length>0?" "+l:l);continue}if(v=r(f),!v){l=u+(l.length>0?" "+l:l);continue}g=!1}const x=DO(d).join(":"),b=h?x+cj:x,w=b+v;if(i.includes(w))continue;i.push(w);const y=s(v,g);for(let _=0;_<y.length;++_){const j=y[_];i.push(b+j)}l=u+(l.length>0?" "+l:l)}return l};function VO(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=uj(t))&&(r&&(r+=" "),r+=n);return r}const uj=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=uj(e[r]))&&(n&&(n+=" "),n+=t);return n};function UO(e,...t){let n,r,s,i=o;function o(c){const u=t.reduce((d,h)=>h(d),e());return n=LO(u),r=n.cache.get,s=n.cache.set,i=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=FO(c,n);return s(c,d),d}return function(){return i(VO.apply(null,arguments))}}const Ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},dj=/^\[(?:([a-z-]+):)?(.+)\]$/i,BO=/^\d+\/\d+$/,zO=new Set(["px","full","screen"]),HO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WO=/\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$/,qO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,KO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,GO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,br=e=>Lo(e)||zO.has(e)||BO.test(e),Jr=e=>xa(e,"length",nI),Lo=e=>!!e&&!Number.isNaN(Number(e)),Sf=e=>xa(e,"number",Lo),Va=e=>!!e&&Number.isInteger(Number(e)),YO=e=>e.endsWith("%")&&Lo(e.slice(0,-1)),xe=e=>dj.test(e),Qr=e=>HO.test(e),ZO=new Set(["length","size","percentage"]),JO=e=>xa(e,ZO,hj),QO=e=>xa(e,"position",hj),XO=new Set(["image","url"]),eI=e=>xa(e,XO,sI),tI=e=>xa(e,"",rI),Ua=()=>!0,xa=(e,t,n)=>{const r=dj.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},nI=e=>WO.test(e)&&!qO.test(e),hj=()=>!1,rI=e=>KO.test(e),sI=e=>GO.test(e),iI=()=>{const e=Ue("colors"),t=Ue("spacing"),n=Ue("blur"),r=Ue("brightness"),s=Ue("borderColor"),i=Ue("borderRadius"),o=Ue("borderSpacing"),l=Ue("borderWidth"),c=Ue("contrast"),u=Ue("grayscale"),d=Ue("hueRotate"),h=Ue("invert"),f=Ue("gap"),p=Ue("gradientColorStops"),g=Ue("gradientColorStopPositions"),v=Ue("inset"),x=Ue("margin"),b=Ue("opacity"),w=Ue("padding"),y=Ue("saturate"),_=Ue("scale"),j=Ue("sepia"),C=Ue("skew"),k=Ue("space"),S=Ue("translate"),P=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",xe,t],R=()=>[xe,t],$=()=>["",br,Jr],T=()=>["auto",Lo,xe],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],A=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",xe],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Lo,xe];return{cacheSize:500,separator:":",theme:{colors:[Ua],spacing:[br,Jr],blur:["none","",Qr,xe],brightness:H(),borderColor:[e],borderRadius:["n
455one","","full",Qr,xe],borderSpacing:R(),borderWidth:$(),contrast:H(),grayscale:O(),hueRotate:H(),invert:O(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[YO,Jr],inset:I(),margin:I(),opacity:H(),padding:R(),saturate:H(),scale:H(),sepia:O(),skew:H(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",xe]}],container:["container"],columns:[{columns:[Qr]}],"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:[...U(),xe]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Va,xe]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",xe]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",Va,xe]}],"grid-cols":[{"grid-cols":[Ua]}],"col-start-end":[{col:["auto",{span:["full",Va,xe]},xe]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[Ua]}],"row-start-end":[{row:["auto",{span:[Va,xe]},xe]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",xe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",xe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",xe,t]}],"min-w":[{"min-w":[xe,t,"min","max","fit"]}],"max-w":[{"max-w":[xe,t,"none","full","min","max","fit","prose",{screen:[Qr]},Qr]}],h:[{h:[xe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[xe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[xe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[xe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qr,Jr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Sf]}],"font-family":[{font:[Ua]}],"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",xe]}],"line-clamp":[{"line-clamp":["none",Lo,Sf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",br,xe]}],"list-image":[{"list-image":["none",xe]}],"list-style-type":[{list:["none","disc","decimal",xe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",br,Jr]}],"underline-offset":[{"underline-offset":["auto",br,xe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe]}],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",xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),QO]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",JO]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},eI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}
vendor: 5,180 bytes, line 455
455],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[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":[b]}],"border-style":[{border:[...D(),"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":[b]}],"divide-style":[{divide:D()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[br,xe]}],"outline-w":[{outline:[br,Jr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[br,Jr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qr,tI]}],"shadow-color":[{shadow:[Ua]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...A(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":A()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Qr,xe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[y]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",xe]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",xe]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",xe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Va,xe]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",xe]}],accent:[{accent:["auto",e]}],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",xe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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,647 bytes, line 455
455],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",xe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[br,Jr,Sf]}],stroke:[{stroke:[e,"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"]}}},oI=UO(iI);function de(...e){return oI(ZS(e))}const aI=RR,fj=m.forwardRef(({className:e,...t},n)=>a.jsx(zS,{ref:n,className:de("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]",e),...t}));fj.displayName=zS.displayName;const lI=oh("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"}}),pj=m.forwardRef(({className:e,variant:t,...n},r)=>a.jsx(HS,{ref:r,className:de(lI({variant:t}),e),...n}));pj.displayName=HS.displayName;const cI=m.forwardRef(({className:e,...t},n)=>a.jsx(KS,{ref:n,className:de("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 group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));cI.displayName=KS.displayName;const mj=m.forwardRef(({className:e,...t},n)=>a.jsx(GS,{ref:n,className:de("absolute right-2 top-2 rounded-md p-1 text-foreground
455/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(fc,{className:"h-4 w-4"})}));mj.displayName=GS.displayName;const gj=m.forwardRef(({className:e,...t},n)=>a.jsx(WS,{ref:n,className:de("text-sm font-semibold",e),...t}));gj.displayName=WS.displayName;const vj=m.forwardRef(({className:e,...t},n)=>a.jsx(qS,{ref:n,className:de("text-sm opacity-90",e),...t}));vj.displayName=qS.displayName;function uI(){const{toasts:e}=Et();return a.jsxs(aI,{children:[e.map(function({id:t,title:n,description:r,action:s,...i}){return a.jsxs(pj,{...i,children:[a.jsxs("div",{className:"grid gap-1",children:[n&&a.jsx(gj,{children:n}),r&&a.jsx(vj,{children:r})]}),s,a.jsx(mj,{})]},t)}),a.jsx(fj,{})]})}var Zx=["light","dark"],dI="(prefers-color-scheme: dark)",hI=m.createContext(void 0),fI={setTheme:e=>{},themes:[]},pI=()=>{var e;return(e=m.useContext(hI))!=null?e:fI};m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let u=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=s?Zx.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(g,v=!1,x=!0)=>{let b=o?o[g]:g,w=v?g+"|| ''":`'${b}'`,y="";return s&&x&&!v&&Zx.includes(g)&&(y+=`d.style.colorScheme = '${g}';`),n==="class"?v||b?y+=`c.add(${w})`:y+="null":b&&(y+=`d[s](n,${w})`),y},p=e?`!function(){${d}${f(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${dI}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(i,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${h}}catch(t){}}();`;return m.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var mI=e=>{switch(e){case"success":return yI;case"info":return wI;case"warning":return xI;case"error":return bI;default:return null}},gI=Array(12).fill(0),vI=({visible:e,className:t})=>G.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},G.createElement("div",{className:"sonner-spinner"},gI.map((n,r)=>G.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),yI=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},G.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"})),xI=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},G.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"})),wI=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},G.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"})),bI=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},G.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"})),_I=G.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"},G.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),G.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),SI=()=>{let[e,t]=G.useState(document.hidden);return G.useEffect(()=>{let n=()=>{t(document.hidden)};
455return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},nm=1,jI=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:nm++,i=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:n}),{...l,...e,id:s,dismissible:o,title:n}):l):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
455this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0,i,o=r.then(async c=>{if(i=["resolve",c],G.isValidElement(c))s=!1,this.create({id:n,type:"default",message:c});else if(CI(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:u,description:d})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var c;s&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>i[0]==="reject"?u(i[1]):c(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||nm++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Kt=new jI,kI=(e,t)=>{let n=(t==null?void 0:t.id)||nm++;return Kt.addToast({title:e,...t,id:n}),n},CI=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",EI=kI,TI=()=>Kt.toasts,NI=()=>Kt.getActiveToasts(),ut=Object.assign(EI,{success:Kt.success,info:Kt.info,warning:Kt.warning,error:Kt.error,custom:Kt.custom,message:Kt.message,promise:Kt.promise,dismiss:Kt.dismiss,loading:Kt.loading},{getHistory:TI,getToasts:NI});function PI(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}PI(`: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;
455left: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}
455: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%);
455--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%)}
456`);function qc(e){return e.label!==void 0}var AI=3,RI="32px",OI="16px",Jx=4e3,II=356,MI=14,DI=20,LI=200;function On(...e){return e.filter(Boolean).join(" ")}function $I(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var FI=e=>{var t,n,r,s,i,o,l,c,u,d,h;let{invert:f,toast:p,unstyled:g,interacting:v,setHeights:x,visibleToasts:b,heights:w,index:y,toasts:_,expanded:j,removeToast:C,defaultRichColors:k,closeButton:S,style:P,cancelButtonStyle:E,actionButtonStyle:I,className:R="",descriptionClassName:$="",duration:T,position:U,gap:D,loadingIcon:A,expandByDefault:N,classNames:O,icons:V,
456closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:Z}=e,[B,le]=G.useState(null),[Pe,Me]=G.useState(null),[Q,M]=G.useState(!1),[ie,fe]=G.useState(!1),[pe,we]=G.useState(!1),[mt,fn]=G.useState(!1),[Qs,qr]=G.useState(!1),[Xs,Pa]=G.useState(0),[Ki,Sy]=G.useState(0),Aa=G.useRef(p.duration||T||Jx),jy=G.useRef(null),ei=G.useRef(null),s2=y===0,i2=y+1<=b,pn=p.type,Gi=p.dismissible!==!1,o2=p.className||"",a2=p.descriptionClassName||"",kc=G.useMemo(()=>w.findIndex(ve=>ve.toastId===p.id)||0,[w,p.id]),l2=G.useMemo(()=>{var ve;return(ve=p.closeButton)!=null?ve:S},[p.closeButton,S]),ky=G.useMemo(()=>p.duration||T||Jx,[p.duration,T]),Hh=G.useRef(0),Yi=G.useRef(0),Cy=G.useRef(0),Zi=G.useRef(null),[c2,u2]=U.split("-"),Ey=G.useMemo(()=>w.reduce((ve,Re,qe)=>qe>=kc?ve:ve+Re.height,0),[w,kc]),Ty=SI(),d2=p.invert||f,Wh=pn==="loading";Yi.current=G.useMemo(()=>kc*D+Ey,[kc,Ey]),G.useEffect(()=>{Aa.current=ky},[ky]),G.useEffect(()=>{M(!0)},[]),G.useEffect(()=>{let ve=ei.current;if(ve){let Re=ve.getBoundingClientRect().height;return Sy(Re),x(qe=>[{toastId:p.id,height:Re,position:p.position},...qe]),()=>x(qe=>qe.filter(Nn=>Nn.toastId!==p.id))}},[x,p.id]),G.useLayoutEffect(()=>{if(!Q)return;let ve=ei.current,Re=ve.style.height;ve.style.height="auto";let qe=ve.getBoundingClientRect().height;ve.style.height=Re,Sy(qe),x(Nn=>Nn.find(Pn=>Pn.toastId===p.id)?Nn.map(Pn=>Pn.toastId===p.id?{...Pn,height:qe}:Pn):[{toastId:p.id,height:qe,position:p.position},...Nn])},[Q,p.title,p.description,x,p.id]);let Kr=G.useCallback(()=>{fe(!0),Pa(Yi.current),x(ve=>ve.filter(Re=>Re.toastId!==p.id)),setTimeout(()=>{C(p)},LI)},[p,C,x,Yi]);G.useEffect(()=>{if(p.promise&&pn==="loading"||p.duration===1/0||p.type==="loading")return;let ve;return j||v||Z&&Ty?(()=>{if(Cy.current<Hh.current){let Re=new Date().getTime()-Hh.current;Aa.current=Aa.current-Re}Cy.current=new Date().getTime()})():Aa.current!==1/0&&(Hh.current=new Date().getTime(),ve=setTimeout(()=>{var Re;(Re=p.onAutoClose)==null||Re.call(p,p),Kr()},Aa.current)),()=>clearTimeout(ve)},[j,v,p,pn,Z,Ty,Kr]),G.useEffect(()=>{p.delete&&Kr()},[Kr,p.delete]);function h2(){var ve,Re,qe;return V!=null&&V.loading?G.createElement("div",{className:On(O==null?void 0:O.loader,(ve=p==null?void 0:p.classNames)==null?void 0:ve.loader,"sonner-loader"),"data-visible":pn==="loading"},V.loading):A?G.createElement("div",{className:On(O==null?void 0:O.loader,(Re=p==null?void 0:p.classNames)==null?void 0:Re.loader,"sonner-loader"),"data-visible":pn==="loading"},A):G.createElement(vI,{className:On(O==null?void 0:O.loader,(qe=p==null?void 0:p.classNames)==null?void 0:qe.loader),visible:pn==="loading"})}return G.createElement("li",{tabIndex:0,ref:ei,className:On(R,o2,O==null?void 0:O.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[pn],(n=p==null?void 0:p.classNames)==null?void 0:n[pn]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:k,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":Q,"data-promise":!!p.promise,"data-swiped":Qs,"data-removed":ie,"data-visible":i2,"data-y-position":c2,"data-x-position":u2,"data-index":y,"data-front":s2,"data-swiping":pe,"data-dismissible":Gi,"data-type":pn,"data-invert":d2,"data-swipe-out":mt,"data-swipe-direction":Pe,"data-expanded":!!(j||N&&Q),style:{"--index":y,"--toasts-before":y,"--z-index":_.length-y,"--offset":`${ie?Xs:Yi.current}px`,"--initial-height":N?"auto":`${Ki}px`,...P,...p.style},onDragEnd:()=>{we(!1),le(null),Zi.current=null},onPointerDown:ve=>{Wh||!Gi||(jy.current=new Date,Pa(Yi.current),ve.target.setPointerCapture(ve.pointerId),ve.target.tagName!=="BUTTON"&&(we(!0),Zi.current={x:ve.clientX,y:ve.clientY}))},onPointerUp:()=>{var ve,Re,qe,Nn;if(mt||!Gi)return;Zi.current=null;let Pn=Number(((ve=ei.current)==null?void 0:ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Gr=Number(((Re=ei.current)==null?void 0:Re.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ti=new Date().getTime()-((qe=jy.current)==null?void 0:qe.getTime()),An=B==="x"?Pn:Gr,Yr=Math.abs(An)/ti;if(Math.abs(An)>=DI||Yr>.11){Pa(Yi.current),(Nn=p.onDismiss)==null||Nn.call(p,p),Me(B==="x"?Pn>0?"right":"left":Gr>0?"down":"up"),Kr(),fn(!0),qr(!1);return}we(!1),le(null)},onPointerMove:ve=>{var Re,qe,Nn,Pn;if(!Zi.current||!Gi||((Re=window.getSelection())==null?void 0:Re.toString().length)>0)return;let Gr=ve.clientY-Zi.current.y,ti=ve.clientX-Zi.current.x,An=(qe=e.swipeDirections)!=null?qe:$I(U);!B&&(Math.abs(ti)>1||Math.abs(Gr)>1)&&le(Math.abs(ti)>Math.abs(Gr)?"x":"y");let Yr={x:0,y:0};B==="y"?(An.includes("top")||An.includes("bottom"))&&(An.includes("top")&&Gr<0||An.includes("bottom")&&Gr>0)&&(Yr.y=Gr):B==="x"&&(An.includes("left")||An.includes("right"))&&(An.includes("left")&&ti<0||An.includes("right")&&ti>0)&&(Yr.x=ti),(Math.abs(Yr.x)>0||Math.abs(Yr.y)>0)&&qr(!0),(Nn=ei.current)==null||Nn.style.setProperty("--swipe-amount-x",`${Yr.x}px`),(Pn=ei.current)==null||Pn.style.setProperty("--swipe-amount-y",`${Yr.y}
456px`)}},l2&&!p.jsx?G.createElement("button",{"aria-label":H,"data-disabled":Wh,"data-close-button":!0,onClick:Wh||!Gi?()=>{}:()=>{var ve;Kr(),(ve=p.onDismiss)==null||ve.call(p,p)},className:On(O==null?void 0:O.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(i=V==null?void 0:V.close)!=null?i:_I):null,p.jsx||m.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:G.createElement(G.Fragment,null,pn||p.icon||p.promise?G.createElement("div",{"data-icon":"",className:On(O==null?void 0:O.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||h2():null,p.type!=="loading"?p.icon||(V==null?void 0:V[pn])||mI(pn):null):null,G.createElement("div",{"data-content":"",className:On(O==null?void 0:O.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},G.createElement("div",{"data-title":"",className:On(O==null?void 0:O.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?G.createElement("div",{"data-description":"",className:On($,a2,O==null?void 0:O.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),m.isValidElement(p.cancel)?p.cancel:p.cancel&&qc(p.cancel)?G.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||E,onClick:ve=>{var Re,qe;qc(p.cancel)&&Gi&&((qe=(Re=p.cancel).onClick)==null||qe.call(Re,ve),Kr())},className:On(O==null?void 0:O.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,m.isValidElement(p.action)?p.action:p.action&&qc(p.action)?G.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||I,onClick:ve=>{var Re,qe;qc(p.action)&&((qe=(Re=p.action).onClick)==null||qe.call(Re,ve),!ve.defaultPrevented&&Kr())},className:On(O==null?void 0:O.actionButton,(h=p==null?void 0:p.classNames)==null?void 0:h.actionButton)},p.action.label):null))};function Qx(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function VI(e,t){let n={};return[e,t].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",l=i?OI:RI;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(l)}),n}var UI=m.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:h,duration:f,style:p,visibleToasts:g=AI,toastOptions:v,dir:x=Qx(),gap:b=MI,loadingIcon:w,icons:y,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:j}=e,[C,k]=G.useState([]),S=G.useMemo(()=>Array.from(new Set([r].concat(C.filter(Z=>Z.position).map(Z=>Z.position)))),[C,r]),[P,E]=G.useState([]),[I,R]=G.useState(!1),[$,T]=G.useState(!1),[U,D]=G.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=G.useRef(null),N=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=G.useRef(null),V=G.useRef(!1),H=G.useCallback(Z=>{k(B=>{var le;return(le=B.find(Pe=>Pe.id===Z.id))!=null&&le.delete||Kt.dismiss(Z.id),B.filter(({id:Pe})=>Pe!==Z.id)})},[]);return G.useEffect(()=>Kt.subscribe(Z=>{if(Z.dismiss){k(B=>B.map(le=>le.id===Z.id?{...le,delete:!0}:le));return}setTimeout(()=>{xS.flushSync(()=>{k(B=>{let le=B.findIndex(Pe=>Pe.id===Z.id);return le!==-1?[...B.slice(0,le),{...B[le],...Z},...B.slice(le+1)]:[Z,...B]})})})}),[]),G.useEffect(()=>{if(d!=="system"){D(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?D("dark"):D("light")),typeof window>"u")return;let Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:B})=>{D(B?"dark":"light")})}catch{Z.addListener(({matches:le})=>{try{D(le?"dark":"light")}catch(Pe){console.error(Pe)}})}},[d]),G.useEffect(()=>{C.length<=1&&R(!1)},[C]),G.useEffect(()=>{let Z=B=>{var le,Pe;s.every(Me=>B[Me]||B.code===Me)&&(R(!0),(le=A.current)==null||le.focus()),B.code==="Escape"&&(document.activeElement===A.current||(Pe=A.current)!=null&&Pe.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[s]),G.useEffect(()=>{if(A.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,V.current=!1)}},[A.current]),G.createElement("section",{ref:t,"aria-label":`${_} ${N}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((Z,B)=>{var le;let[Pe,Me]=Z.split("-");return C.length?G.createElement("ol",{key:Z,dir:x==="auto"?Qx():x,tabIndex:-1,ref:A,className:l,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":Pe,"data-lifted":I&&C.length>1&&!i,"data-x-position":Me,style:{"--front-toast-height":`${((le=P[0])==null?void 0:le.height)||0}px`,"--width":`${II}px`,"--gap":`${b}px`,...p,...VI(c,u)},onBlur:Q=>{V.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(V.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||V.current||(V.current=!0,O.current=Q.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{$||R(!1)},onDragEnd:()=>R(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||T(!0)},onPointerUp:()=>T(!1)},C.filter(Q=>!Q.position&&B===0||Q.position===Z).map((Q,M)=>{var ie,fe;return G.createElement(FI,{key:Q.id,icons:y,index:M,toast:Q,defaultRichColors:h,duration:(ie=v==null?void 0:v.duration)!=null?ie:f,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:g,closeButton:(fe=v==null?void 0:v.closeButton)!=null?fe:o,interacting:$,position:Z,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:H,toasts:C.filter(pe=>pe.position==Q.position),heights:P.filter(pe=>pe.position==Q.position),setHeights:E,expandByDefault:i,gap:b,loadingIcon:w,exp
vendor: 4,493 bytes, line 456
456anded:I,pauseWhenPageIsHidden:j,swipeDirections:e.swipeDirections})})):null}))});const BI=({...e})=>{const{theme:t="system"}=pI();return a.jsx(UI,{theme:t,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"}},...e})};var zI=gg[" useId ".trim().toString()]||(()=>{}),HI=0;function Es(e){const[t,n]=m.useState(zI());return Ct(()=>{n(r=>r??String(HI++))},[e]),t?`radix-${t}`:""}const WI=["top","right","bottom","left"],Ms=Math.min,nn=Math.max,dd=Math.round,Kc=Math.floor,Ds=e=>({x:e,y:e}),qI={left:"right",right:"left",bottom:"top",top:"bottom"},KI={start:"end",end:"start"};function rm(e,t,n){return nn(e,Ms(t,n))}function $r(e,t){return typeof e=="function"?e(t):e}function Fr(e){return e.split("-")[0]}function wa(e){return e.split("-")[1]}function vv(e){return e==="x"?"y":"x"}function yv(e){return e==="y"?"height":"width"}function Ls(e){return["top","bottom"].includes(Fr(e))?"y":"x"}function xv(e){return vv(Ls(e))}function GI(e,t,n){n===void 0&&(n=!1);const r=wa(e),s=xv(e),i=yv(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=hd(o)),[o,hd(o)]}function YI(e){const t=hd(e);return[sm(e),t,sm(t)]}function sm(e){return e.replace(/start|end/g,t=>KI[t])}function ZI(e,t,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?i:o;default:return[]}}function JI(e,t,n,r){const s=wa(e);let i=ZI(Fr(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(sm)))),i}function hd(e){return e.replace(/left|right|bottom|top/g,t=>qI[t])}function QI(e){return{top:0,right:0,bottom:0,left:0,...e}}function yj(e){return typeof e!="number"?QI(e):{top:e,right:e,bottom:e,left:e}}function fd(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Xx(e,t,n){let{reference:r,floating:s}=e;const i=Ls(t),o=xv(t),l=yv(o),c=Fr(t),u=i==="y",d=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,f=r[l]/2-s[l]/2;let p;switch(c){case"top":p={x:d,y:r.y-s.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:h};break;case"left":p={x:r.x-s.width,y:h};break;default:p={x:r.x,y:r.y}}switch(wa(t)){case"start":p[o]-=f*(n&&u?-1:1);break;case"end":p[o]+=f*(n&&u?-1:1);break}return p}const XI=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:h}=Xx(u,r,c),f=r,p={},g=0;for(let v=0;v<l.length;v++){const{name:x,fn:b}=l[v],{x:w,y,data:_,reset:j}=await b({x:d,y:h,initialPlacement:r,placement:f,strategy:s,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});d=w??d,h=y??h,p={...p,[x]:{...p[x],..._}},j&&g<=50&&(g++,typeof j=="object"&&(j.placement&&(f=j.placement),j.rects&&(u=j.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):j.rects),{x:d,y:h}=Xx(u,f,c)),v=-1)}return{x:d,y:h,placement:f,strategy:s,middlewareData:p}};async function Ll(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:p=0}=$r(t,e),g=yj(p),x=l[f?h==="floating"?"reference":"floating":h],b=fd(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=h==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),_=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},j=fd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:y,strategy:c}):w);return{top:(b.top-j.top+g.top)/_.y,bottom:(j.bottom-b.bottom+g.bottom)/_.y,left
vendor: 6,538 bytes, line 456
456:(b.left-j.left+g.left)/_.x,right:(j.right-b.right+g.right)/_.x}}const eM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=$r(e,t)||{};if(u==null)return{};const h=yj(d),f={x:n,y:r},p=xv(s),g=yv(p),v=await o.getDimensions(u),x=p==="y",b=x?"top":"left",w=x?"bottom":"right",y=x?"clientHeight":"clientWidth",_=i.reference[g]+i.reference[p]-f[p]-i.floating[g],j=f[p]-i.reference[p],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=C?C[y]:0;(!k||!await(o.isElement==null?void 0:o.isElement(C)))&&(k=l.floating[y]||i.floating[g]);const S=_/2-j/2,P=k/2-v[g]/2-1,E=Ms(h[b],P),I=Ms(h[w],P),R=E,$=k-v[g]-I,T=k/2-v[g]/2+S,U=rm(R,T,$),D=!c.arrow&&wa(s)!=null&&T!==U&&i.reference[g]/2-(T<R?E:I)-v[g]/2<0,A=D?T<R?T-R:T-$:0;return{[p]:f[p]+A,data:{[p]:U,centerOffset:T-U-A,...D&&{alignmentOffset:A}},reset:D}}}),tM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...x}=$r(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Fr(s),w=Ls(l),y=Fr(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(u.floating)),j=f||(y||!v?[hd(l)]:YI(l)),C=g!=="none";!f&&C&&j.push(...JI(l,v,g,_));const k=[l,...j],S=await Ll(t,x),P=[];let E=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&P.push(S[b]),h){const T=GI(s,o,_);P.push(S[T[0]],S[T[1]])}if(E=[...E,{placement:s,overflows:P}],!P.every(T=>T<=0)){var I,R;const T=(((I=i.flip)==null?void 0:I.index)||0)+1,U=k[T];if(U)return{data:{index:T,overflows:E},reset:{placement:U}};let D=(R=E.filter(A=>A.overflows[0]<=0).sort((A,N)=>A.overflows[1]-N.overflows[1])[0])==null?void 0:R.placement;if(!D)switch(p){case"bestFit":{var $;const A=($=E.filter(N=>{if(C){const O=Ls(N.placement);return O===w||O==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(O=>O>0).reduce((O,V)=>O+V,0)]).sort((N,O)=>N[1]-O[1])[0])==null?void 0:$[0];A&&(D=A);break}case"initialPlacement":D=l;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function e0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function t0(e){return WI.some(t=>e[t]>=0)}const nM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=$r(e,t);switch(r){case"referenceHidden":{const i=await Ll(t,{...s,elementContext:"reference"}),o=e0(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:t0(o)}}}case"escaped":{const i=await Ll(t,{...s,altBoundary:!0}),o=e0(i,n.floating);return{data:{escapedOffsets:o,escaped:t0(o)}}}default:return{}}}}};async function rM(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Fr(n),l=wa(n),c=Ls(n)==="y",u=["left","top"].includes(o)?-1:1,d=i&&c?-1:1,h=$r(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),c?{x:p*d,y:f*u}:{x:f*u,y:p*d}}const sM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:l}=t,c=await rM(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},iM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:x=>{let{x:b,y:w}=x;return{x:b,y:w}}},...c}=$r(e,t),u={x:n,y:r},d=await Ll(t,c),h=Ls(Fr(s)),f=vv(h);let p=u[f],g=u[h];if(i){const x=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=p+d[x],y=p-d[b];p=rm(w,p,y)}if(o){const x=h==="y"?"top":"left",b=h==="y"?"bottom":"right",w=g+d[x],y=g-d[b];g=rm(w,g,y)}const v=l.fn({...t,[f]:p,[h]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[h]:o}}}}}},oM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=$r(e,t),d={x:n,y:r},h=Ls(s),f=vv(h);let p=d[f],g=d[h];const v=$r(l,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const y=f==="y"?"height":"width",_=i.reference[f]-i.floating[y]+x.mainAxis,j=i.reference[f]+i.reference[y]-x.mainAxis;p<_?p=_:p>j&&(p=j)}if(u){var b,w;const y=f==="y"?"width":"height",_=["top","left"].includes(Fr(s)),j=i.reference[h]-i.floating[y]+(_&&((b=o.offset)==null?void 0:b[h])||0)+(_?0:x.crossAxis),C=i.reference[h]+i.reference[y]+(_?0:((w=o.offset)==null?void 0:w[h])||0)-(_?x.crossAxis:0);g<j?g=j:g>C&&(g=C)}return{[f]:p,[h]:g}}}},aM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=$r(e,t),d=await Ll(t,u),h=Fr(s),f=wa(s),p=Ls(s)==="y",{width:g,height:v}=i.floating;let x,b;h==="top"||h==="bottom"?(x=h,b=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(b=h,x=f==="end"?"top":"bottom");const w=v-d.top-d.bottom,y=g-d.left-d.right,_=Ms(v-d[x],w),j=Ms(g-d[b],y),C=!t.middlewareData.shift;let k=_,S=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=w),C&&!f){const E=nn(d.left,0),I=nn(d.right,0),R=nn(d.top,0),$=nn(d.bottom,0);p?S=g-2*(E!==0||I!==0?E+I:nn(d.left,d.right)):k=v-2*(R!==0||$!==0?R+$:nn(d.top,d.bottom))}await c({...t,availableWidth:S,availableHeight:k});const P=await o.getDimensions(l.floating);return g!==P.width||v!==P.height?{reset:{rects:!0}}:{}}}};function ch(){return typeof window<"u"}function ba(e){return xj(e)?(e.nodeName||"").toLowerCase():"#document"}function an(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wr(e){var t;return(t=(xj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xj(e){return ch()?e instanceof Node||e instanceof an(e).Node:!1}function Zn(e){return ch()?e instanceof Element||e instanceof an(e).Element:!1}function vr(e){return ch()?e instanceof HTMLElement||e instanceof an(e).HTMLElement:!1}function n0(e){return!ch()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof an(e).ShadowRoot}function pc(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Jn(e);
vendor: 4,242 bytes, line 456
456return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function lM(e){return["table","td","th"].includes(ba(e))}function uh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function wv(e){const t=bv(),n=Zn(e)?Jn(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function cM(e){let t=$s(e);for(;vr(t)&&!ia(t);){if(wv(t))return t;if(uh(t))return null;t=$s(t)}return null}function bv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ia(e){return["html","body","#document"].includes(ba(e))}function Jn(e){return an(e).getComputedStyle(e)}function dh(e){return Zn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $s(e){if(ba(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n0(e)&&e.host||wr(e);return n0(t)?t.host:t}function wj(e){const t=$s(e);return ia(t)?e.ownerDocument?e.ownerDocument.body:e.body:vr(t)&&pc(t)?t:wj(t)}function $l(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=wj(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=an(s);if(i){const l=im(o);return t.concat(o,o.visualViewport||[],pc(s)?s:[],l&&n?$l(l):[])}return t.concat(s,$l(s,[],n))}function im(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bj(e){const t=Jn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=vr(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=dd(n)!==i||dd(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function _v(e){return Zn(e)?e:e.contextElement}function $o(e){const t=_v(e);if(!vr(t))return Ds(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=bj(t);let o=(i?dd(n.width):n.width)/r,l=(i?dd(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const uM=Ds(0);function _j(e){const t=an(e);return!bv()||!t.visualViewport?uM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==an(e)?!1:t}function Pi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=_v(e);let o=Ds(1);t&&(r?Zn(r)&&(o=$o(r)):o=$o(e));const l=dM(i,n,r)?_j(i):Ds(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,h=s.height/o.y;if(i){const f=an(i),p=r&&Zn(r)?an(r):r;let g=f,v=im(g);for(;v&&r&&p!==g;){const x=$o(v),b=v.getBoundingClientRect(),w=Jn(v),y=b.left+(v.clientLeft+parseFloat(w.paddingLeft))*x.x,_=b.top+(v.clientTop+parseFloat(w.paddingTop))*x.y;c*=x.x,u*=x.y,d*=x.x,h*=x.y,c+=y,u+=_,g=an(v),v=im(g)}}return fd({width:d,height:h,x:c,y:u})}function hM(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=wr(r),l=t?uh(t.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ds(1);const d=Ds(0),h=vr(r);if((h||!h&&!i)&&((ba(r)!=="body"||pc(o))&&(c=dh(r)),vr(r))){const f=Pi(r);u=$o(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function fM(e){return Array.from(e.getClientRects())}function om(e,t){const n=dh(e).scrollLeft;return t?t.left+n:Pi(wr(e)).left+n}function pM(e){const t=wr(e),n=dh(e),r=e.ownerDocument.body,s=nn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=nn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+om(e);const l=-n.scrollTop;return Jn(r).direction==="rtl"&&(o+=nn(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:l}}function mM(e,t){const n=an(e),r=wr(e),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){i=s.width,o=s.height;const u=bv();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:l,y:c}}function gM(e,t){const n=Pi(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=vr(e)?$o(e):Ds(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=s*i.x,u=r*i.y;return{width:o,height:l,x:c,y:u}}
vendor: 4,339 bytes, line 456
456function r0(e,t,n){let r;if(t==="viewport")r=mM(e,n);else if(t==="document")r=pM(wr(e));else if(Zn(t))r=gM(t,n);else{const s=_j(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return fd(r)}function Sj(e,t){const n=$s(e);return n===t||!Zn(n)||ia(n)?!1:Jn(n).position==="fixed"||Sj(n,t)}function vM(e,t){const n=t.get(e);if(n)return n;let r=$l(e,[],!1).filter(l=>Zn(l)&&ba(l)!=="body"),s=null;const i=Jn(e).position==="fixed";let o=i?$s(e):e;for(;Zn(o)&&!ia(o);){const l=Jn(o),c=wv(o);!c&&l.position==="fixed"&&(s=null),(i?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||pc(o)&&!c&&Sj(e,o))?r=r.filter(d=>d!==o):s=l,o=$s(o)}return t.set(e,r),r}function yM(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?uh(t)?[]:vM(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const h=r0(t,d,s);return u.top=nn(h.top,u.top),u.right=Ms(h.right,u.right),u.bottom=Ms(h.bottom,u.bottom),u.left=nn(h.left,u.left),u},r0(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function xM(e){const{width:t,height:n}=bj(e);return{width:t,height:n}}function wM(e,t,n){const r=vr(t),s=wr(t),i=n==="fixed",o=Pi(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ds(0);if(r||!r&&!i)if((ba(t)!=="body"||pc(s))&&(l=dh(t)),r){const p=Pi(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else s&&(c.x=om(s));let u=0,d=0;if(s&&!r&&!i){const p=s.getBoundingClientRect();d=p.top+l.scrollTop,u=p.left+l.scrollLeft-om(s,p)}const h=o.left+l.scrollLeft-c.x-u,f=o.top+l.scrollTop-c.y-d;return{x:h,y:f,width:o.width,height:o.height}}function jf(e){return Jn(e).position==="static"}function s0(e,t){if(!vr(e)||Jn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return wr(e)===n&&(n=n.ownerDocument.body),n}function jj(e,t){const n=an(e);if(uh(e))return n;if(!vr(e)){let s=$s(e);for(;s&&!ia(s);){if(Zn(s)&&!jf(s))return s;s=$s(s)}return n}let r=s0(e,t);for(;r&&lM(r)&&jf(r);)r=s0(r,t);return r&&ia(r)&&jf(r)&&!wv(r)?n:r||cM(e)||n}const bM=async function(e){const t=this.getOffsetParent||jj,n=this.getDimensions,r=await n(e.floating);return{reference:wM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _M(e){return Jn(e).direction==="rtl"}const SM={convertOffsetParentRelativeRectToViewportRelativeRect:hM,getDocumentElement:wr,getClippingRect:yM,getOffsetParent:jj,getElementRects:bM,getClientRects:fM,getDimensions:xM,getScale:$o,isElement:Zn,isRTL:_M};function jM(e,t){let n=null,r;const s=wr(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:h,height:f}=e.getBoundingClientRect();if(l||t(),!h||!f)return;const p=Kc(d),g=Kc(s.clientWidth-(u+h)),v=Kc(s.clientHeight-(d+f)),x=Kc(u),w={rootMargin:-p+"px "+-g+"px "+-v+"px "+-x+"px",threshold:nn(0,Ms(1,c))||1};let y=!0;function _(j){const C=j[0].intersectionRatio;if(C!==c){if(!y)return o();C?o(!1,C):r=setTimeout(()=>{o(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(_,{...w,root:s.ownerDocument})}catch{n=new IntersectionObserver(_,w)}n.observe(e)}return o(!0),i}function kM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=_v(e),d=s||i?[...u?$l(u):[],...$l(t)]:[];d.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const h=u&&l?jM(u,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(b=>{let[w]=b;w&&w.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),n()}),u&&!c&&p.observe(u),p.observe(t));let g,v=c?Pi(e):null;c&&x();function x(){const b=Pi(e);v&&(b.x!==v.x||b.y!==v.y||b.width!==v.width||b.height!==v.height)&&n(),v=b,g=requestAnimationFrame(x)}return n(),()=>{var b;d.forEach(w=>{s&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),h==null||h(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const CM=sM,EM=iM,TM=tM,NM=aM,PM=nM,i0=eM,AM=oM,RM=(e,t,n)=>{const r=new Map,s={platform:SM,...n},i={...s.platform,_c:r};return XI(e,t,{...s,platform:i})};var Tu=typeof document<"u"?m.useLayoutEffect:m.useEffect;function pd(e,t){if(e===t)return!0;
vendor: 4,143 bytes, line 456
456if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!pd(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!pd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function kj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function o0(e,t){const n=kj(e);return Math.round(t*n)/n}function kf(e){const t=m.useRef(e);return Tu(()=>{t.current=e}),t}function OM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,h]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);pd(f,r)||p(r);const[g,v]=m.useState(null),[x,b]=m.useState(null),w=m.useCallback(N=>{N!==C.current&&(C.current=N,v(N))},[]),y=m.useCallback(N=>{N!==k.current&&(k.current=N,b(N))},[]),_=i||g,j=o||x,C=m.useRef(null),k=m.useRef(null),S=m.useRef(d),P=c!=null,E=kf(c),I=kf(s),R=kf(u),$=m.useCallback(()=>{if(!C.current||!k.current)return;const N={placement:t,strategy:n,middleware:f};I.current&&(N.platform=I.current),RM(C.current,k.current,N).then(O=>{const V={...O,isPositioned:R.current!==!1};T.current&&!pd(S.current,V)&&(S.current=V,Li.flushSync(()=>{h(V)}))})},[f,t,n,I,R]);Tu(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,h(N=>({...N,isPositioned:!1})))},[u]);const T=m.useRef(!1);Tu(()=>(T.current=!0,()=>{T.current=!1}),[]),Tu(()=>{if(_&&(C.current=_),j&&(k.current=j),_&&j){if(E.current)return E.current(_,j,$);$()}},[_,j,$,E,P]);const U=m.useMemo(()=>({reference:C,floating:k,setReference:w,setFloating:y}),[w,y]),D=m.useMemo(()=>({reference:_,floating:j}),[_,j]),A=m.useMemo(()=>{const N={position:n,left:0,top:0};if(!D.floating)return N;const O=o0(D.floating,d.x),V=o0(D.floating,d.y);return l?{...N,transform:"translate("+O+"px, "+V+"px)",...kj(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:V}},[n,l,D.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:$,refs:U,elements:D,floatingStyles:A}),[d,$,U,D,A])}const IM=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?i0({element:r.current,padding:s}).fn(n):{}:r?i0({element:r,padding:s}).fn(n):{}}}},MM=(e,t)=>({...CM(e),options:[e,t]}),DM=(e,t)=>({...EM(e),options:[e,t]}),LM=(e,t)=>({...AM(e),options:[e,t]}),$M=(e,t)=>({...TM(e),options:[e,t]}),FM=(e,t)=>({...NM(e),options:[e,t]}),VM=(e,t)=>({...PM(e),options:[e,t]}),UM=(e,t)=>({...IM(e),options:[e,t]});var BM="Arrow",Cj=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return a.jsx(he.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Cj.displayName=BM;var zM=Cj;function hh(e){const[t,n]=m.useState(void 0);return Ct(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Sv="Popper",[Ej,fh]=hn(Sv),[HM,Tj]=Ej(Sv),Nj=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return a.jsx(HM,{scope:t,anchor:r,onAnchorChange:s,children:n})};Nj.displayName=Sv;var Pj="PopperAnchor",Aj=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=Tj(Pj,n),o=m.useRef(null),l=Se(t,o);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:a.jsx(he.div,{...s,ref:l})});Aj.displayName=Pj;var jv="PopperContent",[WM,qM]=Ej(jv),Rj=m.forwardRef((e,t)=>
vendor: 4,210 bytes, line 456
456{var Q,M,ie,fe,pe,we;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:g,...v}=e,x=Tj(jv,n),[b,w]=m.useState(null),y=Se(t,mt=>w(mt)),[_,j]=m.useState(null),C=hh(_),k=(C==null?void 0:C.width)??0,S=(C==null?void 0:C.height)??0,P=r+(i!=="center"?"-"+i:""),E=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(u)?u:[u],R=I.length>0,$={padding:E,boundary:I.filter(GM),altBoundary:R},{refs:T,floatingStyles:U,placement:D,isPositioned:A,middlewareData:N}=OM({strategy:"fixed",placement:P,whileElementsMounted:(...mt)=>kM(...mt,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[MM({mainAxis:s+S,alignmentAxis:o}),c&&DM({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?LM():void 0,...$}),c&&$M({...$}),FM({...$,apply:({elements:mt,rects:fn,availableWidth:Qs,availableHeight:qr})=>{const{width:Xs,height:Pa}=fn.reference,Ki=mt.floating.style;Ki.setProperty("--radix-popper-available-width",`${Qs}px`),Ki.setProperty("--radix-popper-available-height",`${qr}px`),Ki.setProperty("--radix-popper-anchor-width",`${Xs}px`),Ki.setProperty("--radix-popper-anchor-height",`${Pa}px`)}}),_&&UM({element:_,padding:l}),YM({arrowWidth:k,arrowHeight:S}),f&&VM({strategy:"referenceHidden",...$})]}),[O,V]=Mj(D),H=kn(g);Ct(()=>{A&&(H==null||H())},[A,H]);const Z=(Q=N.arrow)==null?void 0:Q.x,B=(M=N.arrow)==null?void 0:M.y,le=((ie=N.arrow)==null?void 0:ie.centerOffset)!==0,[Pe,Me]=m.useState();return Ct(()=>{b&&Me(window.getComputedStyle(b).zIndex)},[b]),a.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:A?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Pe,"--radix-popper-transform-origin":[(fe=N.transformOrigin)==null?void 0:fe.x,(pe=N.transformOrigin)==null?void 0:pe.y].join(" "),...((we=N.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(WM,{scope:n,placedSide:O,onArrowChange:j,arrowX:Z,arrowY:B,shouldHideArrow:le,children:a.jsx(he.div,{"data-side":O,"data-align":V,...v,ref:y,style:{...v.style,animation:A?void 0:"none"}})})})});Rj.displayName=jv;var Oj="PopperArrow",KM={top:"bottom",right:"left",bottom:"top",left:"right"},Ij=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=qM(Oj,r),o=KM[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(zM,{...s,ref:n,style:{...s.style,display:"block"}})})});Ij.displayName=Oj;function GM(e){return e!==null}var YM=e=>({name:"transformOrigin",options:e,fn(t){var x,b,w;const{placement:n,rects:r,middlewareData:s}=t,o=((x=s.arrow)==null?void 0:x.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=Mj(n),h={start:"0%",center:"50%",end:"100%"}[d],f=(((b=s.arrow)==null?void 0:b.x)??0)+l/2,p=(((w=s.arrow)==null?void 0:w.y)??0)+c/2;let g="",v="";return u==="bottom"?(g=o?h:`${f}px`,v=`${-c}px`):u==="top"?(g=o?h:`${f}px`,v=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,v=o?h:`${p}px`):u==="left"&&(g=`${r.floating.width+c}px`,v=o?h:`${p}px`),{data:{x:g,y:v}}}});function Mj(e){const[t,n="center"]=e.split("-");return[t,n]}var ZM=Nj,Dj=Aj,Lj=Rj,$j=Ij,[ph,L9]=hn("Tooltip",[fh]),kv=fh(),Fj="TooltipProvider",JM=700,a0="tooltip.open",[QM,Vj]=ph(Fj),Uj=e=>{const{__scopeTooltip:t,delayDuration:n=JM,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,o=m.useRef(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(QM,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>
vendor: 4,665 bytes, line 456
456o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:s,children:i})};Uj.displayName=Fj;var Bj="Tooltip",[$9,mh]=ph(Bj),am="TooltipTrigger",XM=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=mh(am,n),i=Vj(am,n),o=kv(n),l=m.useRef(null),c=Se(t,l,s.onTriggerChange),u=m.useRef(!1),d=m.useRef(!1),h=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),a.jsx(Dj,{asChild:!0,...o,children:a.jsx(he.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:ae(e.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ae(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ae(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ae(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:ae(e.onBlur,s.onClose),onClick:ae(e.onClick,s.onClose)})})});XM.displayName=am;var e4="TooltipPortal",[F9,t4]=ph(e4,{forceMount:void 0}),oa="TooltipContent",zj=m.forwardRef((e,t)=>{const n=t4(oa,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,o=mh(oa,e.__scopeTooltip);return a.jsx(Br,{present:r||o.open,children:o.disableHoverableContent?a.jsx(Hj,{side:s,...i,ref:t}):a.jsx(n4,{side:s,...i,ref:t})})}),n4=m.forwardRef((e,t)=>{const n=mh(oa,e.__scopeTooltip),r=Vj(oa,e.__scopeTooltip),s=m.useRef(null),i=Se(t,s),[o,l]=m.useState(null),{trigger:c,onClose:u}=n,d=s.current,{onPointerInTransitChange:h}=r,f=m.useCallback(()=>{l(null),h(!1)},[h]),p=m.useCallback((g,v)=>{const x=g.currentTarget,b={x:g.clientX,y:g.clientY},w=a4(b,x.getBoundingClientRect()),y=l4(b,w),_=c4(v.getBoundingClientRect()),j=d4([...y,..._]);l(j),h(!0)},[h]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&d){const g=x=>p(x,d),v=x=>p(x,c);return c.addEventListener("pointerleave",g),d.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",v)}}},[c,d,p,f]),m.useEffect(()=>{if(o){const g=v=>{const x=v.target,b={x:v.clientX,y:v.clientY},w=(c==null?void 0:c.contains(x))||(d==null?void 0:d.contains(x)),y=!u4(b,o);w?f():y&&(f(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,d,o,u,f]),a.jsx(Hj,{...e,ref:i})}),[r4,s4]=ph(Bj,{isInside:!1}),i4=jS("TooltipContent"),Hj=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=mh(oa,n),u=kv(n),{onClose:d}=c;return m.useEffect(()=>(document.addEventListener(a0,d),()=>document.removeEventListener(a0,d)),[d]),m.useEffect(()=>{if(c.trigger){const h=f=>{const p=f.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),a.jsx(dc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:a.jsxs(Lj,{"data-state":c.stateAttribute,...u,...l,ref:t,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:[a.jsx(i4,{children:r}),a.jsx(r4,{scope:n,isInside:!0,children:a.jsx(pR,{id:c.contentId,role:"tooltip",children:s||r})})]})})});zj.displayName=oa;var Wj="TooltipArrow",o4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=kv(n);return s4(Wj,n).isInside?null:a.jsx($j,{...s,...r,ref:t})});o4.displayName=Wj;function a4(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function l4(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function c4(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function u4(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;
456o=i++){const l=t[i],c=t[o],u=l.x,d=l.y,h=c.x,f=c.y;d>r!=f>r&&n<(h-u)*(r-d)/(f-d)+u&&(s=!s)}return s}function d4(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),h4(t)}function h4(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var f4=Uj,qj=zj;const p4=f4,m4=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(qj,{ref:r,sideOffset:t,className:de("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));m4.displayName=qj.displayName;var gh=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},vh=typeof window>"u"||"Deno"in globalThis;function Fn(){}function g4(e,t){return typeof e=="function"?e(t):e}function v4(e){return typeof e=="number"&&e>=0&&e!==1/0}function y4(e,t){return Math.max(e+(t||0)-Date.now(),0)}function lm(e,t){return typeof e=="function"?e(t):e}function x4(e,t){return typeof e=="function"?e(t):e}function l0(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Cv(o,t.options))return!1}else if(!Vl(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||i&&!i(t))}function c0(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Fl(t.options.mutationKey)!==Fl(i))return!1}else if(!Vl(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Cv(e,t){return((t==null?void 0:t.queryKeyHashFn)||Fl)(e)}function Fl(e){return JSON.stringify(e,(t,n)=>cm(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Vl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Vl(e[n],t[n])):!1}function Kj(e,t){if(e===t)return e;const n=u0(e)&&u0(t);if(n||cm(e)&&cm(t)){const r=n?e:Object.keys(e),s=r.length,i=n?t:Object.keys(t),o=i.length,l=n?[]:{},c=new Set(r);let u=0;for(let d=0;d<o;d++){const h=n?d:i[d];(!n&&c.has(h)||n)&&e[h]===void 0&&t[h]===void 0?(l[h]=void 0,u++):(l[h]=Kj(e[h],t[h]),l[h]===e[h]&&e[h]!==void 0&&u++)}return s===o&&u===s?e:l}return t}function u0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cm(e){if(!d0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!d0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function d0(e){return Object.prototype.toString.call(e)==="[object Object]"}function w4(e){return new Promise(t=>{setTimeout(t,e)})}function b4(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Kj(e,t):t}function _4(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function S4(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ev=Symbol();function Gj(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ev?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var mi,cs,Bo,Qb,j4=(Qb=class extends gh{constructor(){super();Ce(this,mi);Ce(this,cs);Ce(this,Bo);ye(this,Bo,t=>{if(!vh&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){F(this,cs)||this.setEventListener(F(this,Bo))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,cs))==null||t.call(this),ye(this,cs,void 0))}setEventListener(t){var n;ye(this,Bo,t),(n=F(this,cs))==null||n.call(this),ye(this,cs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){F(this,mi)!==t&&(ye(this,mi,t),this.onFocus())}onFocus(){const t=this.isFocused();
vendor: 4,924 bytes, line 456
456this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof F(this,mi)=="boolean"?F(this,mi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},mi=new WeakMap,cs=new WeakMap,Bo=new WeakMap,Qb),Yj=new j4,zo,us,Ho,Xb,k4=(Xb=class extends gh{constructor(){super();Ce(this,zo,!0);Ce(this,us);Ce(this,Ho);ye(this,Ho,t=>{if(!vh&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){F(this,us)||this.setEventListener(F(this,Ho))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,us))==null||t.call(this),ye(this,us,void 0))}setEventListener(t){var n;ye(this,Ho,t),(n=F(this,us))==null||n.call(this),ye(this,us,t(this.setOnline.bind(this)))}setOnline(t){F(this,zo)!==t&&(ye(this,zo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return F(this,zo)}},zo=new WeakMap,us=new WeakMap,Ho=new WeakMap,Xb),md=new k4;function C4(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function E4(e){return Math.min(1e3*2**e,3e4)}function Zj(e){return(e??"online")==="online"?md.isOnline():!0}var Jj=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Cf(e){return e instanceof Jj}function Qj(e){let t=!1,n=0,r=!1,s;const i=C4(),o=v=>{var x;r||(f(new Jj(v)),(x=e.abort)==null||x.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>Yj.isFocused()&&(e.networkMode==="always"||md.isOnline())&&e.canRun(),d=()=>Zj(e.networkMode)&&e.canRun(),h=v=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,v),s==null||s(),i.resolve(v))},f=v=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,v),s==null||s(),i.reject(v))},p=()=>new Promise(v=>{var x;s=b=>{(r||u())&&v(b)},(x=e.onPause)==null||x.call(e)}).then(()=>{var v;s=void 0,r||(v=e.onContinue)==null||v.call(e)}),g=()=>{if(r)return;let v;const x=n===0?e.initialPromise:void 0;try{v=x??e.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(h).catch(b=>{var C;if(r)return;const w=e.retry??(vh?0:3),y=e.retryDelay??E4,_=typeof y=="function"?y(n,b):y,j=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,b);if(t||!j){f(b);return}n++,(C=e.onFail)==null||C.call(e,n,b),w4(_).then(()=>u()?void 0:p()).then(()=>{t?f(b):g()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?g():p().then(g),i)}}var T4=e=>setTimeout(e,0);function N4(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=T4;const i=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Dt=N4(),gi,e_,Xj=(e_=class{constructor(){Ce(this,gi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),v4(this.gcTime)&&ye(this,gi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vh?1/0:5*60*1e3))}clearGcTimeout(){F(this,gi)&&(clearTimeout(F(this,gi)),ye(this,gi,void 0))}},gi=new WeakMap,e_),Wo,vi,gn,yi,At,sc,xi,Un,Sr,t_,P4=(t_=class extends Xj{constructor(t){super();Ce(this,Un);Ce(this,Wo);Ce(this,vi);Ce(this,gn);Ce(this,yi);Ce(this,At);Ce(this,sc);Ce(this,xi);ye(this,xi,!1),ye(this,sc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ye(this,yi,t.client),ye(this,gn,F(this,yi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ye(this,Wo,R4(this.options)),this.state=t.state??F(this,Wo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=F(this,At))==null?void 0:t.promise}setOptions(t){this.options={...F(this,sc),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,gn).remove(this)}setData(t,n){const r=b4(this.state.data,t,this.options);return Tt(this,Un,Sr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Tt(this,Un,Sr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=F(this,At))==null?void 0:r.promise;return(s=F(this,At))==null||s.cancel(t),n?n.then(Fn).catch(Fn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(F(this,Wo))}isActive(){return this.observers.some(t=>x4(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ev||this.state.dataUpdateCount+this.state.errorUpdate
vendor: 1,274 bytes, line 456
456Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>lm(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!y4(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,At))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,At))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,gn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(F(this,At)&&(F(this,xi)?F(this,At).cancel({revert:!0}):F(this,At).cancelRetry()),this.scheduleGc()),F(this,gn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Tt(this,Un,Sr).call(this,{type:"invalidate"})}
vendor: 13,738 bytes, line 456
456fetch(t,n){var u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(F(this,At))return F(this,At).continueRetry(),F(this,At).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(ye(this,xi,!0),r.signal)})},i=()=>{const f=Gj(this.options,n),g=(()=>{const v={client:F(this,yi),queryKey:this.queryKey,meta:this.meta};return s(v),v})();return ye(this,xi,!1),this.options.persister?this.options.persister(f,g,this):f(g)},l=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:F(this,yi),state:this.state,fetchFn:i};return s(f),f})();(u=this.options.behavior)==null||u.onFetch(l,this),ye(this,vi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Tt(this,Un,Sr).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta});const c=f=>{var p,g,v,x;Cf(f)&&f.silent||Tt(this,Un,Sr).call(this,{type:"error",error:f}),Cf(f)||((g=(p=F(this,gn).config).onError)==null||g.call(p,f,this),(x=(v=F(this,gn).config).onSettled)==null||x.call(v,this.state.data,f,this)),this.scheduleGc()};return ye(this,At,Qj({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var p,g,v,x;if(f===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(b){c(b);return}(g=(p=F(this,gn).config).onSuccess)==null||g.call(p,f,this),(x=(v=F(this,gn).config).onSettled)==null||x.call(v,f,this.state.error,this),this.scheduleGc()},onError:c,onFail:(f,p)=>{Tt(this,Un,Sr).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{Tt(this,Un,Sr).call(this,{type:"pause"})},onContinue:()=>{Tt(this,Un,Sr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),F(this,At).start()}},Wo=new WeakMap,vi=new WeakMap,gn=new WeakMap,yi=new WeakMap,At=new WeakMap,sc=new WeakMap,xi=new WeakMap,Un=new WeakSet,Sr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...A4(r.data,this.options),fetchMeta:t.meta??null};case"success":return ye(this,vi,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Cf(s)&&s.revert&&F(this,vi)?{...F(this,vi),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Dt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),F(this,gn).notify({query:this,type:"updated",action:t})})},t_);function A4(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zj(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function R4(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 ir,n_,O4=(n_=class extends gh{constructor(t={}){super();Ce(this,ir);this.config=t,ye(this,ir,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??Cv(s,n);let o=this.get(i);return o||(o=new P4({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){F(this,ir).has(t.queryHash)||(F(this,ir).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=F(this,ir).get(t.queryHash);n&&(t.destroy(),n===t&&F(this,ir).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Dt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,ir).get(t)}getAll(){return[...F(this,ir).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>l0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>l0(t,r)):n}notify(t){Dt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Dt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Dt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ir=new WeakMap,n_),or,It,wi,ar,Xr,r_,I4=(r_=class extends Xj{constructor(t){super();Ce(this,ar);Ce(this,or);Ce(this,It);Ce(this,wi);this.mutationId=t.mutationId,ye(this,It,t.mutationCache),ye(this,or,[]),this.state=t.state||M4(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,or).includes(t)||(F(this,or).push(t),this.clearGcTimeout(),F(this,It).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ye(this,or,F(this,or).filter(n=>n!==t)),this.scheduleGc(),F(this,It).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,or).length||(this.state.status==="pending"?this.scheduleGc():F(this,It).remove(this))}continue(){var t;return((t=F(this,wi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,l,c,u,d,h,f,p,g,v,x,b,w,y,_,j,C,k,S;const n=()=>{Tt(this,ar,Xr).call(this,{type:"continue"})};ye(this,wi,Qj({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,E)=>{Tt(this,ar,Xr).call(this,{type:"failed",failureCount:P,error:E})},onPause:()=>{Tt(this,ar,Xr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,It).canRun(this)}));const r=this.state.status==="pending",s=!F(this,wi).canStart();try{if(r)n();else{Tt(this,ar,Xr).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(i=F(this,It).config).onMutate)==null?void 0:o.call(i,t,this));const E=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));E!==this.state.context&&Tt(this,ar,Xr).call(this,{type:"pending",context:E,variables:t,isPaused:s})}const P=await F(this,wi).start();return await((d=(u=F(this,It).config).onSuccess)==null?void 0:d.call(u,P,t,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,P,t,this.state.context)),await((g=(p=F(this,It).config).onSettled)==null?void 0:g.call(p,P,null,this.state.variables,this.state.context,this)),await((x=(v=this.options).onSettled)==null?void 0:x.call(v,P,null,t,this.state.context)),Tt(this,ar,Xr).call(this,{type:"success",data:P}),P}catch(P){try{throw await((w=(b=F(this,It).config).onError)==null?void 0:w.call(b,P,t,this.state.context,this)),await((_=(y=this.options).onError)==null?void 0:_.call(y,P,t,this.state.context)),await((C=(j=F(this,It).config).onSettled)==null?void 0:C.call(j,void 0,P,this.state.variables,this.state.context,this)),await((S=(k=this.options).onSettled)==null?void 0:S.call(k,void 0,P,t,this.state.context)),P}finally{Tt(this,ar,Xr).call(this,{type:"error",error:P})}}finally{F(this,It).runNext(this)}}},or=new WeakMap,It=new WeakMap,wi=new WeakMap,ar=new WeakSet,Xr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Dt.batch(()=>{F(this,or).forEach(r=>{r.onMutationUpdate(t)}),F(this,It).notify({mutation:this,type:"updated",action:t})})},r_);function M4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Nr,Bn,ic,s_,D4=(s_=class extends gh{constructor(t={}){super();Ce(this,Nr);Ce(this,Bn);Ce(this,ic);this.config=t,ye(this,Nr,new Set),ye(this,Bn,new Map),ye(this,ic,0)}build(t,n,r){const s=new I4({mutationCache:this,mutationId:++Cc(this,ic)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){F(this,Nr).add(t);const n=Gc(t);if(typeof n=="string"){const r=F(this,Bn).get(n);r?r.push(t):F(this,Bn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,Nr).delete(t)){const n=Gc(t);if(typeof n=="string"){const r=F(this,Bn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&F(this,Bn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Gc(t);if(typeof n=="string"){const r=F(this,Bn).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Gc(t);if(typeof n=="string"){const s=(r=F(this,Bn).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Dt.batch(()=>{F(this,Nr).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,Nr).clear(),F(this,Bn).clear()})}getAll(){return Array.from(F(this,Nr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>c0(n,r))}findAll(t={}){return this.getAll().filter(n=>c0(t,n))}notify(t){Dt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Dt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Fn))))}},Nr=new WeakMap,Bn=new WeakMap,ic=new WeakMap,s_);function Gc(e){var t;return(t=e.options.scope)==null?void 0:t.id}function h0(e){return{onFetch:(t,n)=>{var d,h,f,p,g;const r=t.options,s=(f=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let v=!1;const x=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},b=Gj(t.options,t.fetchOptions),w=async(y,_,j)=>{if(v)return Promise.reject();if(_==null&&y.pages.length)return Promise.resolve(y);const k=(()=>{const I={client:t.client,queryKey:t.queryKey,pageParam:_,direction:j?"backward":"forward",meta:t.options.meta};return x(I),I})(),S=await b(k),{maxPages:P}=t.options,E=j?S4:_4;return{pages:E(y.pages,S,P),pageParams:E(y.pageParams,_,P)}};if(s&&i.length){const y=s==="backward",_=y?L4:f0,j={pages:i,pageParams:o},C=_(r,j);l=await w(j,C,y)}else{const y=e??i.length;do{const _=c===0?o[0]??r.initialPageParam:f0(r,l);if(c>0&&_==null)break;l=await w(l,_),c++}while(c<y)}return l};t.options.persister?t.fetchFn=()=>{var v,x;return(x=(v=t.options).persister)==null?void 0:x.call(v,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function f0(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function L4(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Xe,ds,hs,qo,Ko,fs,Go,Yo,i_,$4=(i_=class{constructor(e={}){Ce(this,Xe);Ce(this,ds);Ce(this,hs);Ce(this,qo);Ce(this,Ko);Ce(this,fs);Ce(this,Go);Ce(this,Yo);ye(this,Xe,e.queryCache||new O4),ye(this,ds,e.mutationCache||new D4),ye(this,hs,e.defaultOptions||{}),ye(this,qo,new Map),ye(this,Ko,new Map),ye(this,fs,0)}mount(){Cc(this,fs)._++,F(this,fs)===1&&(ye(this,Go,Yj.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,Xe).onFocus())})),ye(this,Yo,md.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,Xe).onOnline())})))}unmount(){var e,t;Cc(this,fs)._--,F(this,fs)===0&&((e=F(this,Go))==null||e.call(this),ye(this,Go,void 0),(t=F(this,Yo))==null||t.call(this),ye(this,Yo,void 0))}isFetching(e){return F(this,Xe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,ds).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,Xe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=F(this,Xe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(lm(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return F(this,Xe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=F(this,Xe).get(r.queryHash),i=s==null?void 0:s.state.data,o=g4(t,i);if(o!==void 0)return F(this,Xe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Dt.batch(()=>F(this,Xe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,Xe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=F(this,Xe);Dt.batch(()=>
456{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=F(this,Xe);return Dt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Dt.batch(()=>F(this,Xe).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Fn).catch(Fn)}invalidateQueries(e,t={}){return Dt.batch(()=>(F(this,Xe).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Dt.batch(()=>F(this,Xe).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Fn)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Fn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=F(this,Xe).build(this,t);return n.isStaleByTime(lm(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fn).catch(Fn)}fetchInfiniteQuery(e){return e.behavior=h0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fn).catch(Fn)}ensureInfiniteQueryData(e){return e.behavior=h0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return md.isOnline()?F(this,ds).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,Xe)}getMutationCache(){return F(this,ds)}getDefaultOptions(){return F(this,hs)}setDefaultOptions(e){ye(this,hs,e)}setQueryDefaults(e,t){F(this,qo).set(Fl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,qo).values()],n={};return t.forEach(r=>{Vl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){F(this,Ko).set(Fl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,Ko).values()],n={};return t.forEach(r=>{Vl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,hs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Cv(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ev&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,hs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,Xe).clear(),F(this,ds).clear()}},Xe=new WeakMap,ds=new WeakMap,hs=new WeakMap,qo=new WeakMap,Ko=new WeakMap,fs=new WeakMap,Go=new WeakMap,Yo=new WeakMap,i_),F4=m.createContext(void 0),V4=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(F4.Provider,{value:e,children:t}));/**
457 * @remix-run/router v1.23.0
458 *
459 * Copyright (c) Remix Software Inc.
460 *
461 * This source code is licensed under the MIT license found in the
462 * LICENSE.md file in the root directory of this source tree.
463 *
464 * @license MIT
465 */function Ul(){return Ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ul.apply(this,arguments)}var gs;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(gs||(gs={}));const p0="popstate";function U4(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:l}=r.location;return um("",{pathname:i,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:gd(s)}return z4(t,n,null,e)}function lt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ek(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function B4(){return Math.random().toString(36).substr(2,8)}function m0(e,t){return{usr:e.state,key:e.key,idx:t}}function um(e,t,n,r){return n===void 0&&(n=null),Ul({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?_a(t):t,{state:n,key:t&&t.key||r||B4()})}function gd(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function _a(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function z4(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,l=gs.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Ul({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function h(){l=gs.Pop;let x=d(),b=x==null?null:x-u;u=x,c&&c({action:l,location:v.location,delta:b})}function f(x,b){l=gs.Push;let w=um(v.location,x,b);u=d()+1;let y=m0(w,u),_=v.createHref(w);try{o.pushState(y,"",_)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;s.location.assign(_)}i&&c&&c({action:l,location:v.location,delta:1})}function p(x,b){l=gs.Replace;let w=um(v.location,x,b);u=d();let y=m0(w,u),_=v.createHref(w);o.replaceState(y,"",_),i&&c&&c({action:l,location:v.location,delta:0})}function g(x){let b=s.location.origin!=="null"?s.location.origin:s.location.href,w=typeof x=="str
465ing"?x:gd(x);return w=w.replace(/ $/,"%20"),lt(b,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,b)}let v={get action(){return l},get location(){return e(s,o)},listen(x){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(p0,h),c=x,()=>{s.removeEventListener(p0,h),c=null}},createHref(x){return t(s,x)},createURL:g,encodeLocation(x){let b=g(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:p,go(x){return o.go(x)}};return v}var g0;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(g0||(g0={}));function H4(e,t,n){return n===void 0&&(n="/"),W4(e,t,n,!1)}function W4(e,t,n,r){let s=typeof t=="string"?_a(t):t,i=Tv(s.pathname||"/",n);if(i==null)return null;let o=tk(e);q4(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=rD(i);l=tD(o[c],u,r)}return l}function tk(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(lt(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 u=Ts([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(lt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),tk(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:X4(u,i.index),routesMeta:d})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))s(i,o);else for(let c of nk(i.path))s(i,o,c)}),t}function nk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=nk(r.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function q4(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:eD(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const K4=/^:[\w-]+$/,G4=3,Y4=2,Z4=1,J4=10,Q4=-2,v0=e=>e==="*";function X4(e,t){let n=e.split("/"),r=n.length;return n.some(v0)&&(r+=Q4),t&&(r+=Y4),n.filter(s=>!v0(s)).reduce((s,i)=>s+(K4.test(i)?G4:i===""?Z4:J4),r)}function eD(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function tD(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",h=y0({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),f=c.route;if(!h&&u&&n&&!r[r.length-1].route.index&&(h=y0({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!h)return null;
vendor: 6,834 bytes, lines 465-474
465Object.assign(s,h.params),o.push({params:s,pathname:Ts([i,h.pathname]),pathnameBase:aD(Ts([i,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(i=Ts([i,h.pathnameBase]))}return o}function y0(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=nD(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((u,d,h)=>{let{paramName:f,isOptional:p}=d;if(f==="*"){let v=l[h]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const g=l[h];return p&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function nD(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ek(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function rD(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ek(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Tv(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function sD(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?_a(e):e;return{pathname:n?n.startsWith("/")?n:iD(n,t):t,search:lD(r),hash:cD(s)}}function iD(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Ef(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` 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 oD(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function rk(e,t){let n=oD(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function sk(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=_a(e):(s=Ul({},e),lt(!s.pathname||!s.pathname.includes("?"),Ef("?","pathname","search",s)),lt(!s.pathname||!s.pathname.includes("#"),Ef("#","pathname","hash",s)),lt(!s.search||!s.search.includes("#"),Ef("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,l;if(o==null)l=n;else{let h=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;s.pathname=f.join("/")}l=h>=0?t[h]:"/"}let c=sD(s,l),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Ts=e=>e.join("/").replace(/\/\/+/g,"/"),aD=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),lD=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cD=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function uD(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ik=["post","put","patch","delete"];new Set(ik);const dD=["get",...ik];new Set(dD);/**
466 * React Router v6.30.1
467 *
468 * Copyright (c) Remix Software Inc.
469 *
470 * This source code is licensed under the MIT license found in the
471 * LICENSE.md file in the root directory of this source tree.
472 *
473 * @license MIT
474 */function Bl(){return Bl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bl.apply(this,arguments)}const Nv=m.createContext(null),hD=m.createContext(null),Fi=m.createContext(null),yh=m.createContext(null),Vi=m.createContext({outlet:null,matches:[],isDataRoute:!1}),ok=m.createContext(null);function fD(e,t){let{relative:n}=t===void 0?{}:t;mc()||lt(!1);let{basename:r,navigator:s}=m.useContext(Fi),{hash:i,pathname:o,search:l}=lk(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Ts([r,o])),s.createHref({pathname:c,search:l,hash:i})}function mc(){return m.useContext(yh)!=null}function gc(){return mc()||lt(!1),m.useContext(yh).location}function ak(e){m.useContext(Fi).static||m.useLayoutEffect(e)}function vc(){let{isDataRoute:e}=m.useContext(Vi);return e?CD():pD()}function pD(){mc()||lt(!1);let e=m.useContext(Nv),{basename:t,future:n,navigator:r}=m.useContext(Fi),{matches:s}=m.useContext(Vi),{pathname:i}=gc(),o=JSON.stringify(rk(s,n.v7_relativeSplatPath)),l=m.useRef(!1);return ak(()=>{l.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let h=sk(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Ts([t,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[t,r,o,i,e])}function lk(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Fi),{matches:s}=m.useContext(Vi),{pathname:i}=gc(),o=JSON.stringify(rk(s,r.v7_relativeSplatPath));return m.useMemo(()=>sk(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function mD(e,t){return gD(e,t)}function gD(e,t,n,r){mc()||lt(!1);let{navigator:s}=m.useContext(Fi),{matches:i}=m.useContext(Vi),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=gc(),d;if(t){var h;let x=typeof t=="string"?_a(t):t;c==="/"||(h=x.pathname)!=null&&h.startsWith(c)||lt(!1),d=x}else d=u;let f=d.pathname||"/",p=f;if(c!=="/"){let x=c.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let g=H4(e,{pathname:p}),v=bD(g&&g.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:Ts([c,s.encodeLocation?s.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Ts([c,s.encodeLocation?s.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&v?m.createElement(yh.Provider,{value:{location:Bl({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:gs.Pop}},v):v}function vD(){let e=kD(),t=uD(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application 
474Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,null)}const yD=m.createElement(vD,null);class xD extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(Vi.Provider,{value:this.props.routeContext},m.createElement(ok.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function wD(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(Nv);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Vi.Provider,{value:t},r)}function bD(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let d=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);d>=0||lt(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let h=o[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:f,errors:p}=n,g=h.route.loader&&f[h.route.id]===void 0&&(!p||p[h.route.id]===void 0);if(h.route.lazy||g){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,f)=>{let p,g=!1,v=null,x=null;n&&(p=l&&h.route.id?l[h.route.id]:void 0,v=h.route.errorElement||yD,c&&(u<0&&f===0?(g=!0,x=null):u===f&&(g=!0,x=h.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,f+1)),w=()=>{let y;return p?y=v:g?y=x:h.route.Component?y=m.createElement(h.route.Component,null):h.route.element?y=h.route.element:y=d,m.createElement(wD,{match:h,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:y})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?m.createElement(xD,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:w(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):w()},null)}var ck=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ck||{}),vd=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(vd||{});function _D(e){let t=m.useContext(Nv);return t||lt(!1),t}function SD(e){let t=m.useContext(hD);return t||lt(!1),t}function jD(e){let t=m.useContext(Vi);return t||lt(!1),t}function uk(e){let t=jD(),n=t.matches[t.matches.length-1];return n.route.id||lt(!1),n.route.id}function kD(){var e;let t=m.useContext(ok),n=SD(vd.UseRouteError),r=uk(vd.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function CD(){let{router:e}=_D(ck.UseNavigateStable),t=uk(vd.UseNavigateStable),n=m.useRef(!1);return ak(()=>{n.current=!0}),m.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Bl({fromRouteId:t},i)))},[e,t])}function ED(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function ao(e){lt(!1)}function TD(e){let{basename:t="/",children:n=null,location:r,navigationType:s=gs.Pop,navigator:i,static:o=!1,future:l}=e;mc()&&lt(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:i,static:o,future:Bl({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof r=="string"&&(r=_a(r));let{pathname:d="/",search:h="",hash:f="",state:p=null,key:g="default"}=r,v=m.useMemo(()=>{let x=Tv(d,c);return x==null?null:{location:{pathname:x,search:h,hash:f,state:p,key:g},navigationType:s}},[c,d,h,f,p,g,s]);return v==null?null:m.createElement(Fi.Provider,{value:u},m.createElement(yh.Provider,{children:n,value:v}))}function ND(e){let{children:t,location:n}=e;return mD(dm(t),n)}new Promise(()=>{});function dm(e,t){t===void 0&&(t=[]);let n=[];
474return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let i=[...t,s];if(r.type===m.Fragment){n.push.apply(n,dm(r.props.children,i));return}r.type!==ao&&lt(!1),!r.props.index||!r.props.children||lt(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=dm(r.props.children,i)),n.push(o)}),n}/**
475 * React Router DOM v6.30.1
476 *
477 * Copyright (c) Remix Software Inc.
478 *
479 * This source code is licensed under the MIT license found in the
480 * LICENSE.md file in the root directory of this source tree.
481 *
482 * @license MIT
483 */function hm(){return hm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hm.apply(this,arguments)}function PD(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function AD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function RD(e,t){return e.button===0&&(!t||t==="_self")&&!AD(e)}const OD=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ID="6";try{window.__reactRouterVersion=ID}catch{}const MD="startTransition",x0=gg[MD];function DD(e){let{basename:t,children:n,future:r,window:s}=e,i=m.useRef();i.current==null&&(i.current=U4({window:s,v5Compat:!0}));let o=i.current,[l,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=m.useCallback(h=>{u&&x0?x0(()=>c(h)):c(h)},[c,u]);return m.useLayoutEffect(()=>o.listen(d),[o,d]),m.useEffect(()=>ED(r),[r]),m.createElement(TD,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const LD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$D=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lt=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:h}=t,f=PD(t,OD),{basename:p}=m.useContext(Fi),g,v=!1;if(typeof u=="string"&&$D.test(u)&&(g=u,LD))try{let y=new URL(window.location.href),_=u.startsWith("//")?new URL(y.protocol+u):new URL(u),j=Tv(_.pathname,p);_.origin===y.origin&&j!=null?u=j+_.search+_.hash:v=!0}catch{}let x=fD(u,{relative:s}),b=FD(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:s,viewTransition:h});function w(y){r&&r(y),y.defaultPrevented||b(y)}return m.createElement("a",hm({},f,{href:g||x,onClick:v||i?r:w,ref:n,target:c}))});var w0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(w0||(w0={}));var b0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(b0||(b0={}));function FD(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=vc(),u=gc(),d=lk(e,{relative:o});return m.useCallback(h=>{if(RD(h,n)){h.preventDefault();let f=r!==void 0?r:gd(u)===gd(d);c(e,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,d,r,s,n,e,i,o,l])}const VD={fr:{nav:{home:"Accueil",services:"Services",about:"À propos",contact:"Contact",consultants:"Consultants",getQuote:"Demander un devis",login:"Connexion",logout:"Déconnexion",dashboard:"Tableau de bord"},hero:{badge:"Pionnier du Digital en Afrique depuis 2008",title1:"Réussissez votre",title2:"transformation",title3:"digitale",subtitle:"IA, automatisation et solutions digitales innovantes pour les organisations africaines. Du Burkina Faso au monde entier.",cta1:"Démarrer un Projet",cta2:"Découvrir nos Services",stats:{years:"Années d'expérience",projects:"Projets livrés",clients:"Clients actifs",countries:"Pays en Afrique"}},services:{badge:"Nos Services",title:"L'Afrique au diapason de l'",titleHighlight:"évolution technologique",subt
483itle:"Des solutions innovantes adaptées aux réalités économiques et aux opportunités uniques du continent africain.",items:{ai:{title:"Intelligence Artificielle",description:"Solutions IA sur mesure, chatbots intelligents, analyse prédictive et machine learning pour optimiser vos opérations."},rpa:{title:"Automatisation (RPA)",description:"Automatisez vos processus métiers répétitifs pour gagner en efficacité et réduire les erreurs humaines."},cloudmigration:{title:"Migration Cloud",description:"Accompagnement stratégique pour migrer vos infrastructures vers le cloud avec créativité et innovation."},strategicsecurity:{title:"Sécurité Stratégique",description:"Solutions de sécurité IT robustes construites sur la confiance et des résultats durables."},managedservices:{title:"Services Gérés",description:"Gestion complète de votre infrastructure IT avec un focus sur les résultats et l'intégrité opérationnelle."},operationalsupport:{title:"Support Opérationnel",description:"Support continu pour vos opérations IT critiques, assurant performance et disponibilité."},professionalservices:{title:"Services Professionnels",description:"Conseil et accompagnement personnalisé pour construire confiance et résultats à long terme."},turnaround:{title:"Redressement & Consulting",description:"Optimisation business et intégration du changement pour transformer vos défis en opportunités."},agritech:{title:"AgriTech",description:"Technologies agricoles intelligentes : monitoring des cultures, prévisions météo IA, gestion des récoltes."},fintech:{title:"FinTech & Mobile Money",description:"Intégration de paiements mobiles, solutions bancaires digitales et plateformes financières sécurisées."},egov:{title:"E-Gouvernance",description:"Digitalisation des services publics, portails citoyens et systèmes de gestion administrative modernes."},energy:{title:"Énergie Renouvelable",description:"Solutions IoT pour le monitoring énergétique, gestion intelligente des réseaux solaires et éoliens."},healthtech:{title:"HealthTech",description:"Télémédecine, gestion hospitalière digitale, dossiers patients électroniques et diagnostics assistés par IA."},supplychain:{title:"Supply Chain",description:"Optimisation logistique, traçabilité blockchain, gestion des stocks prédictive et livraison intelligente."},identity:{title:"Identité Numérique",description:"Solutions d'identification biométrique, KYC digital et systèmes d'authentification sécurisés."},analytics:{title:"Data Analytics",description:"Tableaux de bord temps réel, business intelligence et exploitation de vos données pour des décisions éclairées."}}},about:{badge:"Notre Histoire",title1:"Un acteur clé de l'",titleHighlight:"écosystème digital",title2:" burkinabè",paragraph1:"Fondée à Ouagadougou en 2008 sous le nom de <strong>Linked Afric</strong>, notre entreprise s'est imposée comme un pilier de l'infrastructure numérique du Burkina Faso.",paragraph2:"En 2011, nous avons été parmi les rares entités à endosser officiellement la redélégation du domaine <strong>.bf</strong> auprès de l'IANA, marquant notre engagement dans la gouvernance internet nationale.",paragraph3:"Aujourd'hui, sous la marque Rich Media, nous accompagnons les organisations africaines dans leur transformation digitale, en proposant des solutions d'IA et d'automatisation adaptées aux défis et opportunités uniques du continent.",since:"Depuis 2008",values:{excellence:{title:"Excellence",description:"Standards internationaux appliqués au contexte africain pour des solutions de qualité."},proximity:{title:"Proximité",description:"Accompagnement personnalisé et compréhension profonde des besoins locaux."},vision:{title:"Vision Panafricaine",description:"Solutions conçues pour scaler à travers le continent et au-delà."},innovation:{title:"Innovation",description:"Technologies de pointe adaptées aux réalités économiques africaines."}}},consultants:{badge:"Nos Experts",title:"Rencontrez nos ",titleHighlight:"Consultants",subtitle:"Une équipe d'experts qualifiés prêts à accompagner votre transformation digitale.",viewAll:"Voir tous les consultants",yearsExp:"ans d'exp.",featured:"À la une",loginToView:"Connectez-vous pour voir tous les consultants",noConsultants:"Aucun consultant disponible pour le moment.",becomeConsultant:"Devenir consultant"},auth:{signIn:"Se connecter",signUp:"S'inscrire",email:"Email",password:"Mot de passe",confirmPassword:"Confirmer le mot de passe",fullName:"Nom complet",selectRole:"Sélectionnez votre profil",consultant:"Je suis consultant",hiringProfessional:"Je recrute des consultants",alreadyHaveAccount:"Déjà un compte ?",dontHaveAccount:"Pas encore de compte ?",signingIn:"Connexion...",signingUp:"Inscription...",signInError:"Erreur de connexion",signUpError:"Erreur d'inscription",signUpSuccess:"Inscription réussie ! Vous pouvez maintenant vous connecter.",passwordMismatch:"Les mots de passe ne correspondent pas",consultantSignup:{title:"Profil consultant",expertise:"Domaine d'expertise",expertisePlaceholder:"Ex: IA, Cloud, Cybersécurité...",experience:"Années d'expérience",experiencePlaceholder:"5",skills:"Compétences",skillsPlaceholder:"Python, AWS, Machine Learning (séparées par des virgules)",bio:"Biographie",bioPlaceholder:"Décrivez votre parcours et vos réalisations...",photoUrl:"URL de la photo",photoUrlPlaceholder:"https://exemple.com/photo.jpg"},hiringSignup:{title:"Profil recruteur",companyName:"Nom de l'entreprise",companyPlaceholder:"Votre entreprise",position:"Poste",positionPlaceholder:"Directeur RH, CEO..."}},dashboard:{welcome:"Bienvenue",consultantProfile:"Mon profil consultant",editProfile:"Modifier le profil",saveChanges:"Enregistrer",profileUpdated:"Profil mis à jour avec succès",allConsultants:"Tous les consultants"},contact:{badge:"Contactez-nous",title1:"Prêt à",titleHighlight:" transformer",title2:"votre organisation ?",subtitle:"Discutons de vos projets et découvrons ensemble comment l'IA et l'automatisation peuvent propulser votre croissance.",address:"Adresse",email:"Email",phone:"Téléphone",form:{fullName:"Nom complet",namePlaceholder:"Votre nom",email:"Email",emailPlaceholder:"[email protected]",company:"Entreprise / Organisation",companyPlaceholder:"Nom de votre organisation",project:"Votre projet",projectPlaceholder:"Décrivez votre projet ou vos besoins...",submit:"Envoyer le message"},toast:{title:"Message envoyé !",description:"Notre équipe vous contactera dans les plus brefs délais."}}
483,footer:{description:"Agence digitale pionnière au Burkina Faso depuis 2008, spécialisée dans l'IA, l'automatisation et les solutions technologiques innovantes pour les organisations africaines.",services:"Services",company:"Entreprise",about:"À propos",contact:"Contact",careers:"Carrières",blog:"Blog",rights:"Tous droits réservés.",legal:"Mentions légales",privacy:"Politique de confidentialité"}},en:{nav:{home:"Home",services:"Services",about:"About",contact:"Contact",consultants:"Consultants",getQuote:"Get a Quote",login:"Login",logout:"Logout",dashboard:"Dashboard"},hero:{badge:"Digital Pioneer in Africa since 2008",title1:"Power Your",title2:"Digital",title3:"Transformation",subtitle:"AI, automation, and innovative digital solutions for African organizations. From Burkina Faso to the world.",cta1:"Start a Project",cta2:"Discover Our Services",stats:{years:"Years of Experience",projects:"Projects Delivered",clients:"Active Clients",countries:"Countries in Africa"}},services:{badge:"Our Services",title:"Cutting-edge Technologies for ",titleHighlight:"Tomorrow's Africa",subtitle:"Innovative solutions adapted to the economic realities and unique opportunities of the African continent.",items:{ai:{title:"Artificial Intelligence",description:"Custom AI solutions, intelligent chatbots, predictive analytics, and machine learning to optimize your operations."},rpa:{title:"Automation (RPA)",description:"Automate your repetitive business processes to increase efficiency and reduce human errors."},cloudmigration:{title:"Cloud Migration",description:"Strategic guid
483ance to migrate your infrastructure to the cloud with creativity and innovation."},strategicsecurity:{title:"Strategic Security",description:"Robust IT security solutions built on trust and enduring results."},managedservices:{title:"Managed Services",description:"Complete management of your IT infrastructure with focus on outcomes and operational integrity."},operationalsupport:{title:"Operational Support",description:"Continuous support for your critical IT operations, ensuring performance and availability."},professionalservices:{title:"Professional Services",description:"Advisory and personalized delivery services to build trust and long-term results."},turnaround:{title:"Turnaround Consulting",description:"Business optimization and change integration to transform your challenges into opportunities."},agritech:{title:"AgriTech",description:"Smart agricultural technologies: crop monitoring, AI weather forecasting, harvest management."},fintech:{title:"FinTech & Mobile Money",description:"Mobile payment integration, digital banking solutions, and secure financial platforms."},egov:{title:"E-Governance",description:"Public service digitization, citizen portals, and modern administrative management systems."},energy:{title:"Renewable Energy",description:"IoT solutions for energy monitoring, intelligent management of solar and wind networks."},healthtech:{title:"HealthTech",description:"Telemedicine, digital hospital management, electronic patient records, and AI-assisted diagnostics."},supplychain:{title:"Supply Chain",description:"Logistics optimization, blockchain traceability, predictive inventory management, and smart delivery."},identity:{title:"Digital Identity",description:"Biometric identification solutions, digital KYC, and secure authentication systems."},analytics:{title:"Data Analytics",description:"Real-time dashboards, business intelligence, and data exploitation for informed decisions."}}},about:{badge:"Our Story",title1:"A key player in the ",titleHighlight:"digital ecosystem",title2:" of Burkina Faso",paragraph1:"Founded in Ouagadougou in 2008 as <strong>Linked Afric</strong>, our company has established itself as a pillar of Burkina Faso's digital infrastructure.",paragraph2:"In 2011, we were among the few entities to officially endorse the redelegation of the <strong>.bf</strong> domain to IANA, marking our commitment to national internet governance.",paragraph3:"Today, under the Rich Media brand, we support African organizations in their digital transformation, offering AI and automation solutions adapted to the unique challenges and opportunities of the continent.",since:"Since 2008",values:{excellence:{title:"Excellence",description:"International standards applied to the African context for quality solutions."},proximity:{title:"Proximity",description:"Personalized support and deep understanding of local needs."},vision:{title:"Pan-African Vision",description:"Solutions designed to scale across the continent and beyond."},innovation:{title:"Innovation",description:"Cutting-edge technologies adapted to African economic realities."}}},consultants:{badge:"Our Experts",title:"Meet our ",titleHighlight:"Consultants",subtitle:"A team of qualified experts ready to support your digital transformation.",viewAll:"View all consultants",yearsExp:"yrs exp.",featured:"Featured",loginToView:"Login to view all consultants",noConsultants:"No consultants available at the moment.",becomeConsultant:"Become a consultant"},auth:{signIn:"Sign In",signUp:"Sign Up",email:"Email",password:"Password",confirmPassword:"Confirm Password",fullName:"Full Name",selectRole:"Select your profile",consultant:"I am a consultant",hiringProfessional:"I hire consultants",alreadyHaveAccount:"Already have an account?",dontHaveAccount:"Don't have an account?",signingIn:"Signing in...",signingUp:"Signing up...",signInError:"Sign in error",signUpError:"Sign up error",signUpSuccess:"Sign up successful! You can now sign in.",passwordMismatch:"Passwords do not match",consultantSignup:{title:"Consultant Profile",expertise:"Area of Expertise",expertisePlaceholder:"E.g., AI, Cloud, Cybersecurity...",experience:"Years of Experience",experiencePlaceholder:"5",skills:"Skills",skillsPlaceholder:"Python, AWS, Machine Learning (comma separated)",bio:"Biography",bioPlaceholder:"Describe your background and achievements...",photoUrl:"Photo URL",photoUrlPlaceholder:"https://example.com/photo.jpg"},hiringSignup:{title:"Hiring Profile",companyName:"Company Name",companyPlaceholder:"Your company",position:"Position",positionPlaceholder:"HR Director, CEO..."}},dashboard:{welcome:"Welcome",consultantProfile:"My Consultant Profile",editProfile:"Edit Profile",saveChanges:"Save Changes",profileUpdated:"Profile updated successfully",allConsultants:"All Consultants"},contact:{badge:"Contact Us",title1:"Ready to",titleHighlight:" transform",title2:"your organization?",subtitle:"Let's discuss your projects and discover together how AI and automation can propel your growth.",address:"Address",email:"Email",phone:"Phone",form:{fullName:"Full Name",namePlaceholder:"Your name",email:"Email",emailPlaceholder:"[email protected]",company:"Company / Organization",companyPlaceholder:"Your organization name",project:"Your Project",projectPlaceholder:"Describe your project or needs...",submit:"Send Message"}
483,toast:{title:"Message sent!",description:"Our team will contact you shortly."}},footer:{description:"Pioneer digital agency in Burkina Faso since 2008, specializing in AI, automation, and innovative technology solutions for African organizations.",services:"Services",company:"Company",about:"About",contact:"Contact",careers:"Careers",blog:"Blog",rights:"All rights reserved.",legal:"Legal Notice",privacy:"Privacy Policy"}}},dk=m.createContext(void 0),UD=({children:e})=>{const[t,n]=m.useState(()=>{const s=localStorage.getItem("language");return s==="en"||s==="fr"?s:"fr"});m.useEffect(()=>{localStorage.setItem("language",t),document.documentElement.lang=t},[t]);const r=VD[t];return a.jsx(dk.Provider,{value:{language:t,setLanguage:n,t:r},children:e})},Qn=()=>{const e=m.useContext(dk);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e};function BD(e,t,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?i(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})}const zD=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Pv extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class HD extends Pv{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class _0 extends Pv{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class S0 extends Pv{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var fm;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(fm||(fm={}));class WD{constructor(t,{headers:n={},customFetch:r,region:s=fm.Any}={}){this.url=t,this.headers=n,this.region=s,this.fetch=zD(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return BD(this,arguments,void 0,function*(n,r={}){var s;let i,o;try{const{headers:l,method:c,body:u,signal:d,timeout:h}=r;let f={},{region:p}=r;p||(p=this.region);const g=new URL(`${this.url}/${n}`);p&&p!=="any"&&(f["x-region"]=p,g.searchParams.set("forceFunctionRegion",p));let v;u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",v=u):typeof u=="string"?(f["Content-Type"]="text/plain",v=u):typeof FormData<"u"&&u instanceof FormData?v=u:(f["Content-Type"]="application/json",v=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?v=JSON.stringify(u):v=u;let x=d;h&&(o=new AbortController,i=setTimeout(()=>o.abort(),h),d?(x=o.signal,d.addEventListener("abort",()=>o.abort())):x=o.signal);const b=yield this.fetch(g.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),l),body:v,signal:x}).catch(j=>{throw new HD(j)}),w=b.headers.get("x-relay-error");if(w&&w==="true")throw new _0(b);if(!b.ok)throw new S0(b);let y=((s=b.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),_;return y==="application/json"?_=yield b.json():y==="application/octet-stream"||y==="application/pdf"?_=yield b.blob():y==="text/event-stream"?_=b:y==="multipart/form-data"?_=yield b.formData():_=yield b.text(),{data:_,error:null,response:b}}catch(l){return{data:null,error:l,response:l instanceof S0||l instanceof _0?l.context:void 0}}finally{i&&clearTimeout(i)}})}}const hk=3,j0=e=>Math.min(1e3*2**e,3e4),qD=[520,503],fk=["GET","HEAD","OPTIONS"];var KD=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
483de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function k0(e,t){return new Promise(n=>{if(t!=null&&t.aborted){n();return}const r=setTimeout(()=>{t==null||t.removeEventListener("abort",s),n()},e);function s(){clearTimeout(r),n()}t==null||t.addEventListener("abort",s)})}function GD(e,t,n,r){return!(!r||n>=hk||!fk.includes(e)||!qD.includes(t))}var YD=class{constructor(e){var t,n,r,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(r=e.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(s=e.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(i=e.retry)!==null&&i!==void 0?i:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let i=(async()=>{let o=0;for(;;){const u=new Headers(n.headers);o>0&&u.set("X-Retry-Count",String(o));let d;try{d=await r(n.url.toString(),{method:n.method,headers:u,body:JSON.stringify(n.body,(h,f)=>typeof f=="bigint"?f.toString():f),signal:n.signal})}catch(h){if((h==null?void 0:h.name)==="AbortError"||(h==null?void 0:h.code)==="ABORT_ERR"||!fk.includes(n.method))throw h;if(n.retryEnabled&&o<hk){const f=j0(o);o++,await k0(f,n.signal);continue}throw h}if(GD(n.method,d.status,o,n.retryEnabled)){var l,c;const h=(l=(c=d.headers)===null||c===void 0?void 0:c.get("Retry-After"))!==null&&l!==void 0?l:null,f=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:j0(o);await d.text(),o++,await k0(f,n.signal);continue}return await n.processResponse(d)}})();return this.shouldThrowOnError||(i=i.catch(o=>{var l;let c="",u="",d="";const h=o==null?void 0:o.cause;if(h){var f,p,g,v;const w=(f=h==null?void 0:h.message)!==null&&f!==void 0?f:"",y=(p=h==null?void 0:h.code)!==null&&p!==void 0?p:"";c=`${(g=o==null?void 0:o.name)!==null&&g!==void 0?g:"FetchError"}: ${o==null?void 0:o.message}`,c+=`
484
485Caused by: ${(v=h==null?void 0:h.name)!==null&&v!==void 0?v:"Error"}: ${w}`,y&&(c+=` (${y})`),h!=null&&h.stack&&(c+=`
486${h.stack}`)}else{var x;c=(x=o==null?void 0:o.stack)!==null&&x!==void 0?x:""}const b=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(d="",u="Request was aborted (timeout or manual cancellation)",b>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${b} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",u="HTTP headers exceeded server limits (typically 16KB)",b>this.urlLengthLimit&&(u+=`. Your request URL is ${b} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(l=o==null?void 0:o.name)!==null&&l!==void 0?l:"FetchError"}: ${o==null?void 0:o.message}`,details:c,hint:u,code:d},data:null,count:null,status:0,statusText:""}}
486)),i.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,s=null,i=e.status,o=e.statusText;if(e.ok){var l,c;if(t.method!=="HEAD"){var u;const f=await e.text();f===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((u=t.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?r=f:r=JSON.parse(f))}const d=(l=t.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),h=(c=e.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");d&&h&&h.length>1&&(s=parseInt(h[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,s=null,i=406,o="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const d=await e.text();try{n=JSON.parse(d),Array.isArray(n)&&e.status===404&&(r=[],n=null,i=200,o="OK")}catch{e.status===404&&d===""?(i=204,o="No Content"):n={message:d}}if(n&&t.shouldThrowOnError)throw new KD(n)}return{success:n===null,error:n,data:r,count:s,status:i,statusText:o}}returns(){return this}overrideTypes(){return this}},ZD=class extends YD{select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,i=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:s=!1,format:i="text"}={}){var o;const l=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${c}"; options=${l};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const C0=new RegExp("[,()]");var lo=class extends ZD{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&C0.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&C0.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const i=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${i}.${t}`),this}match(e){return Object.entries(e).filter(([t,n])=>
486n!==void 0).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},JD=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:s=8e3,retry:i}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},s=n?"HEAD":"GET";let i=!1;const o=(e??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",o),r&&c.append("Prefer",`count=${r}`),new lo({method:s,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const s="POST",{url:i,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),n||o.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){const c=[...new Set(l)].map(u=>`"${u}"`);i.searchParams.set("columns",c.join(","))}}return new lo({method:s,url:i,headers:o,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var i;const o="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),r&&c.append("Prefer",`count=${r}`),s||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(u.length>0){const d=[...new Set(u)].map(h=>`"${h}"`);l.searchParams.set("columns",d.join(","))}}return new lo({method:o,url:l,headers:c,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var n;const r="PATCH",{url:s,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new lo({method:r,url:s,headers:i,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new lo({method:n,url:r,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function zl(e){"@babel/helpers - typeof";return zl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zl(e)}function QD(e,t){if(zl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function XD(e){var t=QD(e,"string");return zl(t)=="symbol"?t:t+""}
486function eL(e,t,n){return(t=XD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Yc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E0(Object(n),!0).forEach(function(r){eL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var tL=class pk{constructor(t,{headers:n={},schema:r,fetch:s,timeout:i,urlLengthLimit:o=8e3,retry:l}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=o;const c=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(u,d)=>{const h=new AbortController,f=setTimeout(()=>h.abort(),i),p=d==null?void 0:d.signal;if(p){if(p.aborted)return clearTimeout(f),c(u,d);const g=()=>{clearTimeout(f),h.abort()};return p.addEventListener("abort",g,{once:!0}),c(u,Yc(Yc({},d),{},{signal:h.signal})).finally(()=>{clearTimeout(f),p.removeEventListener("abort",g)})}return c(u,Yc(Yc({},d),{},{signal:h.signal})).finally(()=>clearTimeout(f))}:this.fetch=c,this.retry=l}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new JD(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new pk(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,n={},{head:r=!1,get:s=!1,count:i}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),h=r&&Object.values(n).some(d);h?(l="POST",u=n):r||s?(l=r?"HEAD":"GET",Object.entries(n).filter(([p,g])=>g!==void 0).map(([p,g])=>[p,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([p,g])=>{c.searchParams.append(p,g)})):(l="POST",u=n);const f=new Headers(this.headers);return h?f.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&f.set("Prefer",`count=${i}
486`),new lo({method:l,url:c,headers:f,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class nL{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const n=globalThis;if(typeof globalThis<"u"&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};const r=typeof global<"u"?global:void 0;if(r&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};if(typeof globalThis<"u"&&typeof n.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&n.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const s=globalThis.process;if(s){const i=s.versions;if(i&&i.node){const o=i.node,l=parseInt(o.replace(/^v/,"").split(".")[0]);return l>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${l} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${l} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
487import ws from "ws"
488new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
489
490Suggested solution: ${t.workaround}`),new Error(n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const rL="2.106.2",sL=`realtime-js/${rL}`,iL="1.0.0",mk="2.0.0",oL=mk,aL=1e4,lL=100,as={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},gk={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},pm={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class cL{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,n,r){var s,i;const o=t.topic,l=(s=t.ref)!==null&&s!==void 0?s:"",c=(i=t.join_ref)!==null&&i!==void 0?i:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},h=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+o.length+u.length+h.length,p=new ArrayBuffer(this.HEADER_LENGTH+f);let g=new DataView(p),v=0;g.setUint8(v++,this.KINDS.userBroadcastPush),g.setUint8(v++,c.length),g.setUint8(v++,l.length),g.setUint8(v++,o.length),g.setUint8(v++,u.length),g.setUint8(v++,h.length),g.setUint8(v++,n),Array.from(c,b=>g.setUint8(v++,b.charCodeAt(0))),Array.from(l,b=>g.setUint8(v++,b.charCodeAt(0))),Array.from(o,b=>g.setUint8(v++,b.charCodeAt(0))),Array.from(u,b=>g.setUint8(v++,b.charCodeAt(0))),Array.from(h,b=>g.setUint8(v++,b.charCodeAt(0)));var x=new Uint8Array(p.byteLength+r.byteLength);return x.set(new Uint8Array(p),0),x.set(new Uint8Array(r),p.byteLength),x.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[s,i,o,l,c]=r;
490return n({join_ref:s,ref:i,topic:o,event:l,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,s)}}_decodeUserBroadcast(t,n,r){const s=n.getUint8(1),i=n.getUint8(2),o=n.getUint8(3),l=n.getUint8(4);let c=this.HEADER_LENGTH+4;const u=r.decode(t.slice(c,c+s));c=c+s;const d=r.decode(t.slice(c,c+i));c=c+i;const h=r.decode(t.slice(c,c+o));c=c+o;const f=t.slice(c,t.byteLength),p=l===this.JSON_ENCODING?JSON.parse(r.decode(f)):f,g={type:this.BROADCAST_EVENT,event:d,payload:p};return o>0&&(g.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:g}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}var De;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(De||(De={}));const T0=(e,t,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=uL(o,e,t,s),i),{}):{}},uL=(e,t,n,r)=>{const s=t.find(l=>
vendor: 5,523 bytes, line 490
490l.name===e),i=s==null?void 0:s.type,o=n[e];return i&&!r.includes(i)?vk(i,o):mm(o)},vk=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return pL(t,n)}switch(e){case De.bool:return dL(t);case De.float4:case De.float8:case De.int2:case De.int4:case De.int8:case De.numeric:case De.oid:return hL(t);case De.json:case De.jsonb:return fL(t);case De.timestamp:return mL(t);case De.abstime:case De.date:case De.daterange:case De.int4range:case De.int8range:case De.money:case De.reltime:case De.text:case De.time:case De.timestamptz:case De.timetz:case De.tsrange:case De.tstzrange:return mm(t);default:return mm(t)}},mm=e=>e,dL=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},hL=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},fL=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},pL=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let i;const o=e.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(l=>vk(t,l))}return e},mL=e=>typeof e=="string"?e.replace(" ","T"):e,yk=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var dl=e=>typeof e=="function"?e:function(){return e},gL=typeof self<"u"?self:null,co=typeof window<"u"?window:null,sr=gL||co||globalThis,vL="2.0.0",yL=1e4,xL=1e3,lr={connecting:0,open:1,closing:2,closed:3},qt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Cr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},gm={longpoll:"longpoll",websocket:"websocket"},wL={complete:4},vm="base64url.bearer.phx.",Zc=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},xk=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},bL=class{constructor(e,t,n){this.state=qt.closed,this.topic=e,this.params=dl(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Zc(this,Cr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new xk(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=qt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=qt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=qt.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=qt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Zc(this,Cr.leave,dl({}),this.timeout).send(),this.state=qt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Cr.reply,(r,s)=>{this.trigger(this.replyEventName(s),r)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}
vendor: 5,263 bytes, line 490
490teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=qt.closed,this.bindings=[]}onClose(e){this.on(Cr.close,e)}onError(e){return this.on(Cr.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(typeof t>"u"||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Zc(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=qt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Cr.close,"leave")},n=new Zc(this,Cr.leave,dl({}),e);return n.receive("ok",()=>t()).receive("timeout",()=>t()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic!==e?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=qt.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let s=this.onMessage(e,t,n,r);if(t&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(o=>o.event===e&&this.filterBindings(o,t,n));for(let o=0;o<i.length;o++)i[o].callback(s,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===qt.closed}isErrored(){return this.state===qt.errored}isJoined(){return this.state===qt.joined}isJoining(){return this.state===qt.joining}isLeaving(){return this.state===qt.leaving}},yd=class{static request(e,t,n,r,s,i,o){if(sr.XDomainRequest){let l=new sr.XDomainRequest;return this.xdomainRequest(l,e,t,r,s,i,o)}else if(sr.XMLHttpRequest){let l=new sr.XMLHttpRequest;return this.xhrRequest(l,e,t,n,r,s,i,o)}else{if(sr.fetch&&sr.AbortController)return this.fetchRequest(e,t,n,r,s,i,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,n,r,s,i,o){let l={method:e,headers:n,body:r},c=null;return s&&(c=new AbortController,setTimeout(()=>c.abort(),s),l.signal=c.signal),sr.fetch(t,l).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>o&&o(u)).catch(u=>{u.name==="AbortError"&&i?i():o&&o(null)}),c}static xdomainRequest(e,t,n,r,s,i,o){return e.timeout=s,e.open(t,n),e.onload=()=>{let l=this.parseJSON(e.responseText);o&&o(l)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,s,i,o,l){e.open(t,n,!0),e.timeout=i;for(let[c,u]of Object.entries(r))e.setRequestHeader(c,u);return e.onerror=()=>l&&l(null),e.onreadystatechange=()=>{if(e.readyState===wL.complete&&l){let c=this.parseJSON(e.responseText);l(c)}},o&&(e.ontimeout=o),e.send(s),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let s=t?`${t}[${r}]`:r,i=e[r];typeof i=="object"?n.push(this.serialize(i,s)):n.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return n.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},_L=e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let s=0;s<r;s++)t+=String.fromCharCode(n[s]);return btoa(t)},Qi=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(vm)&&(this.authToken=atob(t[1].slice(vm.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=lr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+gm.websocket),"$1/"+gm.longpoll)}endpointURL(){return yd.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=lr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===lr.open||this.readyState===lr.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:n,token:r,messages:s}=t;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:s.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=lr.open,this.onopen({}),this.poll();break;
490case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(e){typeof e!="string"&&(e=_L(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
491`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let s of this.reqs)s.abort();this.readyState=lr.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,s){let i,o=()=>{this.reqs.delete(i),r()};i=yd.request(e,this.endpointURL(),t,n,this.timeout,o,l=>{this.reqs.delete(i),this.isActive()&&s(l)}),this.reqs.add(i)}},SL=class Ya{constructor(t,n={}){let r=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,s=>{let{onJoin:i,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Ya.syncState(this.state,s,i,o),this.pendingDiffs.forEach(c=>{this.state=Ya.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],l()}),this.channel.on(r.diff,s=>{let{onJoin:i,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Ya.syncDiff(this.state,s,i,o),l())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return Ya.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,n,r,s){let i=this.clone(t),o={},l={};return this.map(i,(c,u)=>{n[c]||(l[c]=u)}),this.map(n,(c,u)=>{let d=i[c];if(d){let h=u.metas.map(v=>v.phx_ref),f=d.metas.map(v=>v.phx_ref),p=u.metas.filter(v=>f.indexOf(v.phx_ref)<0),g=d.metas.filter(v=>h.indexOf(v.phx_ref)<0);p.length>0&&(o[c]=u,o[c].metas=p),g.length>0&&(l[c]=this.clone(d),l[c].metas=g)}else o[c]=u}),this.syncDiff(i,{joins:o,leaves:l},r,s)}static syncDiff(t,n,r,s){let{joins:i,leaves:o}=this.clone(n);return r||(r=function(){}),s||(s=function(){}),this.map(i,(l,c)=>{let u=t[l];if(t[l]=this.clone(c),u){let d=t[l].metas.map(f=>f.phx_ref),h=u.metas.filter(f=>d.indexOf(f.phx_ref)<0);t[l].metas.unshift(...h)}r(l,u,c)}),this.map(o,(l,c)=>{let u=t[l];if(!u)return;let d=c.metas.map(h=>h.phx_ref);u.metas=u.metas.filter(h=>d.indexOf(h.phx_ref)<0),s(l,u,c),u.metas.length===0&&delete t[l]}),t}static list(t,n){return n||(n=function(r,s){return s}),this.map(t,(r,s)=>n(r,s))}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static clone(t){return JSON.parse(JSON.stringify(t))}},Jc={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,s,i,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:s,event:i,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:s,payload:i}=e,o=this.META_LENGTH+t.length+n.length+s.length+r.length,l=new ArrayBuffer(this.HEADER_LENGTH+o),c=new DataView(l),u=0;c.setUint8(u++,this.KINDS.push),c.setUint8(u++,t.length),c.setUint8(u++,n.length),c.setUint8(u++,s.length),c.setUint8(u++,r.length),Array.from(t,h=>c.setUint8(u++,h.charCodeAt(0))),Array.from(n,h=>c.setUint8(u++,h.charCodeAt(0))),Array.from(s,h=>c.setUint8(u++,h.charCodeAt(0))),Array.from(r,h=>c.setUint8(u++,h.charCodeAt(0)));var d=new Uint8Array(l.byteLength+i.byteLength);return d.set(new Uint8Array(l),0),d.set(new Uint8Array(i),l.byteLength),d.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}}
vendor: 8,485 bytes, line 491
491,decodePush(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,l=n.decode(e.slice(o,o+r));o=o+r;let c=n.decode(e.slice(o,o+s));o=o+s;let u=n.decode(e.slice(o,o+i));o=o+i;let d=e.slice(o,e.byteLength);return{join_ref:l,ref:null,topic:c,event:u,payload:d}},decodeReply(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),o=t.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(l,l+r));l=l+r;let u=n.decode(e.slice(l,l+s));l=l+s;let d=n.decode(e.slice(l,l+i));l=l+i;let h=n.decode(e.slice(l,l+o));l=l+o;let f=e.slice(l,e.byteLength),p={status:h,response:f};return{join_ref:c,ref:u,topic:d,event:Cr.reply,payload:p}},decodeBroadcast(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),i=this.HEADER_LENGTH+2,o=n.decode(e.slice(i,i+r));i=i+r;let l=n.decode(e.slice(i,i+s));i=i+s;let c=e.slice(i,e.byteLength);return{join_ref:null,ref:null,topic:o,event:l,payload:c}}},jL=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||yL,this.transport=t.transport||sr.WebSocket||Qi,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=sr&&sr.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=Jc.encode.bind(Jc),this.defaultDecoder=Jc.decode.bind(Jc),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Qi?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;co&&co.addEventListener&&(co.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),r=this.connectClock)}),co.addEventListener("pageshow",s=>{r===this.connectClock&&(r=null,this.connect())}),co.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,i,o)=>{console.log(`${s}: ${i}`,o)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=dl(t.params||{}),this.endPoint=`${e}/${gm.websocket}`,this.vsn=t.vsn||vL,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new xk(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Qi}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=yd.appendParams(yd.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=dl(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Qi?this.connectWithFallback(Qi,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage(s=>{s.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case Qi:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${vm}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,s,i,o=this.transportName(e),l=c=>{this.log("transport",`falling back to ${o}...`,c),this.off([s,i]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return l("memorized");this.fallbackTimer=setTimeout(l,t),i=this.onError(c=>{this.log("transport","error",c),r&&!n&&(clearTimeout(this.fallbackTimer),l(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let c=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(l,t),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),xL,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();const r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===lr.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}
vendor: 4,126 bytes, line 491
491triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(Cr.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case lr.connecting:return"connecting";case lr.open:return"open";case lr.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([n])=>e.indexOf(n)===-1)}channel(e,t={}){let n=new bL(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:s,join_ref:i}=e;this.log("push",`${t} ${n} (${i}, ${s})`,r)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:n,event:r,payload:s,ref:i,join_ref:o}=t;if(i&&i===this.pendingHeartbeatRef){const l=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",l)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${n} ${r} ${i&&"("+i+")"||""}`.trim(),s);for(let l=0;l<this.channels.length;l++){const c=this.channels[l];c.isMember(n,r,s,o)&&c.trigger(r,s,i,o)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}leaveOpenTopic(e){let t=this.channels.find(n=>n.topic===e&&(n.isJoined()||n.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class hl{constructor(t,n){const r=CL(n);this.presence=new SL(t.getChannel(),r),this.presence.onJoin((s,i,o)=>{const l=hl.onJoinPayload(s,i,o);t.getChannel().trigger("presence",l)}),this.presence.onLeave((s,i,o)=>{const l=hl.onLeavePayload(s,i,o);t.getChannel().trigger("presence",l)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return hl.transformState(this.presence.state)}static transformState(t){return t=kL(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const s=t[r];return n[r]=Nu(s),n},{})}static onJoinPayload(t,n,r){const s=N0(n),i=Nu(r);return{event:"join",key:t,currentPresences:s,newPresences:i}}static onLeavePayload(t,n,r){const s=N0(n),i=Nu(r);return{event:"leave",key:t,currentPresences:s,leftPresences:i}}}function Nu(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function kL(e){return JSON.parse(JSON.stringify(e))}function CL(e){return(e==null?void 0:e.events)&&{events:e.events}}function N0(e){return e!=null&&e.metas?Nu(e):[]}var P0;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(P0||(P0={}));class EL{get state(){return this.presenceAdapter.state}constructor(t,n){this.channel=t,this.presenceAdapter=new hl(this.channel.channelAdapter,n)}}function TL(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);
491if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const n=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${n}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class NL{constructor(t,n,r){const s=PL(r);this.channel=t.getSocket().channel(n,s),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,n){return this.channel.on(t,n)}off(t,n){this.channel.off(t,n)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,n,r){let s;try{s=this.channel.push(t,n,r)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>lL){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return s}updateJoinPayload(t){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),t)}canPush(){return this.socket.isConnected()&&this.state===as.joined}isJoined(){return this.state===as.joined}isJoining(){return this.state===as.joining}isClosed(){return this.state===as.closed}isLeaving(){return this.state===as.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function PL(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var A0;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(A0||(A0={}));var Eo;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Eo||(Eo={}));var Er;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Er||(Er={}));class fl{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,n={config:{}},r){var s,i;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new NL(this.socket.socketAdapter,t,this.params),this.presence=new EL(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=yk(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,n=this.timeout){var r,s,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:l,private:c}}=this.params,u=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(p=>p.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[Eo.PRESENCE]&&this.bindings[Eo.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,h={},f={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(p=>{t==null||t(Er.CHANNEL_ERROR,TL(p))}),this._onClose(()=>t==null?void 0:t(Er.CLOSED)),this.updateJoinPayload(Object.assign({config:f},h)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(Er.SUBSCRIBED);return}this._updatePostgresBindings(p,t)}
491).receive("error",p=>{this.state=as.errored;const g=Object.values(p).join(", ")||"error";t==null||t(Er.CHANNEL_ERROR,new Error(g,{cause:p}))}).receive("timeout",()=>{t==null||t(Er.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){var r;const s=this.bindings.postgres_changes,i=(r=s==null?void 0:s.length)!==null&&r!==void 0?r:0,o=[];for(let l=0;l<i;l++){const c=s[l],{filter:{event:u,schema:d,table:h,filter:f}}=c,p=t&&t[l];if(p&&p.event===u&&fl.isFilterValueEqual(p.schema,d)&&fl.isFilterValueEqual(p.table,h)&&fl.isFilterValueEqual(p.filter,f))o.push(Object.assign(Object.assign({},c),{id:p.id}));else{this.unsubscribe(),this.state=as.errored,n==null||n(Er.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=as.errored&&n&&n(Er.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=t===Eo.PRESENCE||t===Eo.POSTGRES_CHANGES;if(s&&i)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,n,r)}async httpSend(t,n,r={}){var s;if(n==null)return Promise.reject(new Error("Payload is required for httpSend()"));const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;try{const u=await l.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,n={}){var r,s;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
491in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u instanceof Error&&u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,l,c;const u=this.channelAdapter.push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,n,r){const s=new AbortController,i=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(i),o}_on(t,n,r){const s=t.toLocaleLowerCase(),i=this.channelAdapter.on(t,r),o={type:s,filter:n,callback:r,ref:i};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,n,r)=>{var s,i,o,l,c,u,d;const h=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,r))return!1;const f=(s=this.bindings[h])===null||s===void 0?void 0:s.find(p=>p.ref===t.ref);if(!f)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in f){const p=f.id,g=(i=f.filter)===null||i===void 0?void 0:i.event;return p&&((o=n.ids)===null||o===void 0?void 0:o.includes(p))&&(g==="*"||(g==null?void 0:g.toLocaleLowerCase())===((l=n.data)===null||l===void 0?void 0:l.type.toLocaleLowerCase()))}else{const p=(u=(c=f==null?void 0:f.filter)===null||c===void 0?void 0:c.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return p==="*"||p===((d=n==null?void 0:n.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===h})}_notThisChannelEvent(t,n){const{close:r,error:s,leave:i,join:o}=gk;return n&&[r,s,i,o].includes(t)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,n,r)=>{if(typeof n=="object"&&"ids"in n){const s=n.data,{schema:i,table:o,commit_timestamp:l,type:c,errors:u}=s;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:l,eventType:c,new:{},old:{},errors:u}),this._getPayloadRecords(s))}return n})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in t.bindings)for(const r of t.bindings[n])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=T0(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=T0(t.columns,t.old_record)),n}}class AL{constructor(t,n){this.socket=new jL(t,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,n,r,s=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),s),this.socket.disconnect(()=>{t(),i("ok")},n,r)})}push(t){this.socket.push(t)}log(t,n,r){this.socket.log(t,n,r)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==pm.connecting}isDisconnecting(){return this.socket.connectionState()==pm.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const R0={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},RL=[1e3,2e3,5e3,1e4],OL=1e4;function IL(){const e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){var n;return(n=Array.from(e.keys())[t])!==null&&n!==void 0?n:null},removeItem(t){e.delete(t)},setItem(t,n){e.set(t,String(n))}}}function ML(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return IL()}const DL=`
492  addEventListener("message", (e) => {
493    if (e.data.event === "start") {
494      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
495    }
496  });`;class LL{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,n){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
496,this.ref=0,this.serializer=new cL,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=i=>i?(...o)=>i(...o):(...o)=>fetch(...o),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const s=this._initializeOptions(n);this.socketAdapter=new AL(t,s),this.httpEndpoint=yk(t),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const n=t.message;throw n.includes("Node.js")?new Error(`${n}
497
498To use Realtime in Node.js, you need to provide a WebSocket implementation:
499
500Option 1: Use Node.js 22+ which has native WebSocket support
501Option 2: Install and provide the "ws" package:
502
503  npm install ws
504
505  import ws from "ws"
506  const client = new RealtimeClient(url, {
507    ...options,
508    transport: ws
509  })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,n){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,n)}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return n==="ok"&&t.teardown(),n}async removeAllChannels(){const t=this.channels.map(async r=>{const s=await r.unsubscribe();return r.teardown(),s}),n=await Promise.all(t);return await this.disconnect(),n}log(t,n,r){this.socketAdapter.log(t,n,r)}connectionState(){return this.socketAdapter.connectionState()||pm.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,n={config:{}}){const r=`realtime:${t}`,s=this.getChannels().find(i=>i.topic===r);if(s)return s;{const i=new fl(`realtime:${t}`,n,this);return this._cancelPendingDisconnect(),this.channels.push(i),i}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
509this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(s=>{const i={access_token:n,version:sL};n&&s.updateJoinPayload(i),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(gk.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(n,r)=>{n=="sent"&&this._setAuthSafely(),t&&t(n,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([DL],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(t){var n,r,s,i,o,l,c,u,d,h,f,p;this.worker=(n=t==null?void 0:t.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=t==null?void 0:t.accessToken)!==null&&r!==void 0?r:null;const g={};g.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:aL,g.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:R0.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(o=t==null?void 0:t.disconnectOnEmptyChannelsAfterMs)!==null&&o!==void 0?o:2*((l=t==null?void 0:t.heartbeatIntervalMs)!==null&&l!==void 0?l:R0.HEARTBEAT_INTERVAL),g.transport=(c=t==null?void 0:t.transport)!==null&&c!==void 0?c:nL.getWebSocketConstructor(),g.params=t==null?void 0:t.params,g.logger=t==null?void 0:t.logger,g.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),g.sessionStorage=(u=t==null?void 0:t.sessionStorage)!==null&&u!==void 0?u:ML(),g.reconnectAfterMs=(d=t==null?void 0:t.reconnectAfterMs)!==null&&d!==void 0?d:w=>RL[w-1]||OL;let v,x;const b=(h=t==null?void 0:t.vsn)!==null&&h!==void 0?h:oL;switch(b){case iL:v=(w,y)=>y(JSON.stringify(w)),x=(w,y)=>y(JSON.parse(w));break;case mk:v=this.serializer.encode.bind(this.serializer),x=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${g.vsn}`)}if(g.vsn=b,g.encode=(f=t==null?void 0:t.encode)!==null&&f!==void 0?f:v,g.decode=(p=t==null?void 0:t.decode)!==null&&p!==void 0?p:x,g.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,g.params=Object.assign(Object.assign({},g.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,g.autoSendHeartbeat=!this.worker}return g}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
509var Hl=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function $L(e,t,n){const r=new URL(t,e);if(n)for(const[s,i]of Object.entries(n))i!==void 0&&r.searchParams.set(s,i);return r.toString()}async function FL(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function VL(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:i,headers:o}){const l=$L(e.baseUrl,r,s),c=await FL(e.auth),u=await t(l,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...c,...o},body:i?JSON.stringify(i):void 0}),d=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),f=h&&d?JSON.parse(d):d;if(!u.ok){const p=h?f:void 0,g=p==null?void 0:p.error;throw new Hl((g==null?void 0:g.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:g==null?void 0:g.type,icebergCode:g==null?void 0:g.code,details:p})}return{status:u.status,headers:u.headers,data:f}}}}function Qc(e){return e.join("�")}var UL=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Qc(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Qc(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Qc(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Qc(e.namespace)}`}),!0}catch(t){if(t instanceof Hl&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof Hl&&n.status===409)return;throw n}}};function Xi(e){return e.join("�")}var BL=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xi(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Xi(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Xi(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Xi(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xi(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Xi(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof Hl&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof Hl&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},zL=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=VL({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new UL(this.client,t),this.tableOps=new BL(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
509async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function Wl(e){"@babel/helpers - typeof";return Wl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wl(e)}function HL(e,t){if(Wl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Wl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WL(e){var t=HL(e,"string");return Wl(t)=="symbol"?t:t+""}function qL(e,t,n){return(t=WL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O0(Object(n),!0).forEach(function(r){qL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var xh=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function wh(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var ym=class extends xh{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return ce({},super.toJSON())}},wk=class extends xh{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function xd(e,t,n){const r=ce({},e),s=t.toLowerCase();for(const i of Object.keys(r))i.toLowerCase()===s&&delete r[i];return r[s]=n,r}function KL(e){const t={};for(const[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}const GL=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),YL=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},xm=e=>{if(Array.isArray(e))return e.map(n=>xm(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[s]=xm(r)}),t},ZL=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),I0=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const n=t.error;if(typeof n.message=="string")return n.message}}return JSON.stringify(e)},JL=async(e,t,n,r)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const s=e;let i=parseInt(String(s.status),10);Number.isFinite(i)||(i=500),s.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";t(new ym(I0(o),i,l,r))}).catch(()=>{const o=i+"";t(new ym(s.statusText||`HTTP ${i} error`,i,o,r))})}else t(new wk(I0(e),e,r))},QL=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!r)return ce(ce({},s),n);if(YL(r)){var i;const o=(t==null?void 0:t.headers)||{};let l;for(const[c,u]of Object.entries(o))c.toLowerCase()==="content-type"&&(l=u);s.headers=xd(o,"Content-Type",(i=l)!==null&&i!==void 0?i:"application/json"),s.body=JSON.stringify(r)}else s.body=r;return t!=null&&t.duplex&&(s.duplex=t.duplex),ce(ce({},s),n)};async function Ba(e,t,n,r,s,i,o){return new Promise((l,c)=>{e(n,QL(t,r,s,i)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(o==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>l(u)).catch(u=>JL(u,c,r,o))})}function bk(e="storage"){return{get:async(t,n,r,s)=>Ba(t,"GET",n,r,s,void 0,e),post:async(t,n,r,s,i)=>Ba(t,"POST",n,s,i,r,e),put:async(t,n,r,s,i)=>Ba(t,"PUT",n,s,i,r,e),head:async(t,n,r,s)=>Ba(t,"HEAD",n,ce(ce({},r),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,n,r,s,i)=>Ba(t,"DELETE",n,s,i,r,e)}}const XL=bk("storage"),{get:ql,post:Vn,put:wm,head:e$,remove:Av}=XL,rn=bk("vectors");var Sa=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=KL(t),this.fetch=GL(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=xd(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(wh(n))return{data:null,error:n};throw n}}};let _k;_k=Symbol.toStringTag;var t$=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[_k]="StreamDownloadBuilder",this.promise=null}
509then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(wh(t))return{data:null,error:t};throw t}}};let Sk;Sk=Symbol.toStringTag;var n$=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Sk]="BlobDownloadBuilder",this.promise=null}asStream(){return new t$(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(wh(t))return{data:null,error:t};throw t}}};const r$={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},M0={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var s$=class extends Sa{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var s=this;return s.handleOperation(async()=>{let i;const o=ce(ce({},M0),r);let l=ce(ce({},s.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;if(typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",s.encodeMetadata(c)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),c&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(c))):(i=n,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=s.toBase64(s.encodeMetadata(c))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),r!=null&&r.headers)for(const[f,p]of Object.entries(r.headers))l=xd(l,f,p);const u=s._removeEmptyFolders(t),d=s._getFinalPath(u),h=await(e=="PUT"?wm:Vn)(s.fetch,`${s.url}/object/${d}`,i,ce({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var s=this;const i=s._removeEmptyFolders(e),o=s._getFinalPath(i),l=new URL(s.url+`/object/upload/sign/${o}`);return l.searchParams.set("token",t),s.handleOperation(async()=>{let c;const u=ce(ce({},M0),r);let d=ce(ce({},s.headers),{"x-upsert":String(u.upsert)});const h=u.metadata;if(typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),h&&c.append("metadata",s.encodeMetadata(h)),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.has("cacheControl")||c.append("cacheControl",u.cacheControl),h&&!c.has("metadata")&&c.append("metadata",s.encodeMetadata(h))):(c=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType,h&&(d["x-metadata"]=s.toBase64(s.encodeMetadata(h))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!u.duplex&&(u.duplex="half")),r!=null&&r.headers)for(const[f,p]of Object.entries(r.headers))d=xd(d,f,p);return{path:i,fullPath:(await wm(s.fetch,l.toString(),c,ce({headers:d},u!=null&&u.duplex?{duplex:u.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const s=ce({},n.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const i=await Vn(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(n.url+i.url),l=o.searchParams.get("token");if(!l)throw new xh("No token returned by API");return{signedUrl:o.toString(),path:e,token:l}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await Vn(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
509stinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Vn(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(e);const i=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let o=await Vn(r.fetch,`${r.url}/object/sign/${s}`,ce({expiresIn:t},i?{transform:n.transform}:{}),{headers:r.headers});const l=new URLSearchParams;n!=null&&n.download&&l.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&l.set("cacheNonce",String(n.cacheNonce));const c=l.toString();return{signedUrl:encodeURI(`${r.url}${o.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const s=await Vn(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),i=new URLSearchParams;n!=null&&n.download&&i.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&i.set("cacheNonce",String(n.cacheNonce));const o=i.toString();return s.map(l=>ce(ce({},l),{},{signedUrl:l.signedURL?encodeURI(`${r.url}${l.signedURL}${o?`&${o}`:""}`):null}))})}download(e,t,n){const r=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const i=s.toString(),o=this._getFinalPath(e),l=()=>ql(this.fetch,`${this.url}/${r}/${o}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new n$(l,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>xm(await ql(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await e$(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(wh(s)){var r;const i=s instanceof ym?s.status:s instanceof wk?(r=s.originalError)===null||r===void 0?void 0:r.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=new URLSearchParams;t!=null&&t.download&&r.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(r,t.transform),(t==null?void 0:t.cacheNonce)!=null&&r.set("cacheNonce",String(t.cacheNonce));const s=r.toString(),i=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${n}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await Av(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const s=ce(ce(ce({},r$),t),{},{prefix:e||""});return await Vn(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=ce({},e);return await Vn(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}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.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const i$="2.106.2",yc={"X-Client-Info":`storage-js/${i$}`};var o$=class extends Sa{constructor(e,t={},n,r){const s=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const i=s.href.replace(/\/$/,""),o=ce(ce({},yc),t);super(i,o,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await ql(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await ql(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Vn(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await wm(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Vn(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Av(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},a$=class extends Sa{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ce(ce({},yc),t);super(r,s,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Vn(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),s=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await ql(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Av(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;
509if(!ZL(e))throw new xh("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new zL({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(s,i){const o=s[i];return typeof o!="function"?o:async(...l)=>{try{return{data:await o.apply(s,l),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},l$=class extends Sa{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ce(ce({},yc),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await rn.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await rn.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await rn.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await rn.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},c$=class extends Sa{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ce(ce({},yc),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await rn.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await rn.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await rn.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await rn.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await rn.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},u$=class extends Sa{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ce(ce({},yc),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await rn.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await rn.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await rn.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await rn.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},d$=class extends u${constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new h$(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},h$=class extends l${constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new f$(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}
509,f$=class extends c${constructor(e,t,n,r,s){super(e,t,s),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,ce(ce({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},p$=class extends o${constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new s$(this.url,this.headers,e,this.fetch)}get vectors(){return new d$(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new a$(this.url+"/iceberg",this.headers,this.fetch)}};function bh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}const jk="2.106.2",uo=30*1e3,bm=3,Tf=bm*uo,m$="http://localhost:9999",g$="supabase.auth.token",v$={"X-Client-Info":`gotrue-js/${jk}`},_m="X-Supabase-Api-Version",kk={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},y$=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,x$=10*60*1e3;class aa extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function X(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class w$ extends aa{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function b$(e){return X(e)&&e.name==="AuthApiError"}class Wn extends aa{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Hr extends aa{constructor(t,n,r,s){super(t,r,s),this.name=n,this.status=r}}class gt extends Hr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Xc(e){return X(e)&&e.name==="AuthSessionMissingError"}class eo extends Hr{constructor(){super("Auth session or user missing","AuthInvalidToken
509ResponseError",500,void 0)}}class eu extends Hr{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class tu extends Hr{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function _$(e){return X(e)&&e.name==="AuthImplicitGrantRedirectError"}class D0 extends Hr{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class S$ extends Hr{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Sm extends Hr{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Nf(e){return X(e)&&e.name==="AuthRetryableFetchError"}class L0 extends Hr{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class jm extends Hr{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const wd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),$0=` 	
510\r=`.split(""),j$=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<$0.length;t+=1)e[$0[t].charCodeAt(0)]=-2;for(let t=0;t<wd.length;t+=1)e[wd[t].charCodeAt(0)]=t;return e})();function F0(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(wd[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(wd[r]),t.queuedBits-=6}}function Ck(e,t,n){const r=j$[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function V0(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{E$(o,r,n)};for(let o=0;o<e.length;o+=1)Ck(e.charCodeAt(o),s,i);return t.join("")}function k$(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function C$(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}k$(r,t)}}function E$(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function Fo(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)Ck(e.charCodeAt(s),n,r);return new Uint8Array(t)}function T$(e){const t=[];return C$(e,n=>t.push(n)),new Uint8Array(t)}function hi(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};return e.forEach(s=>F0(s,n,r)),F0(null,n,r),t.join("")}function N$(e){return Math.round(Date.now()/1e3)+e}function P$(){return Symbol("auth-callback")}const wt=()=>typeof window<"u"&&typeof document<"u",ni={tested:!1,writable:!1},Ek=()=>{if(!wt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ni.tested)return ni.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),ni.tested=!0,ni.writable=!0}catch{ni.tested=!0,ni.writable=!1}return ni.writable};function A$(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,i)=>{t[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{t[s]=r}),t}const Tk=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),R$=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",ho=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},ri=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},xt=async(e,t)=>{await e.removeItem(t)};class _h{constructor(){this.promise=new _h.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}_h.promiseConstructor=Promise;function nu(e){const t=e.split(".");if(t.length!==3)throw new jm("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!y$.test(t[r]))throw new jm("JWT not in base64url format");return{header:JSON.parse(V0(t[0])),payload:JSON.parse(V0(t[1])),signature:Fo(t[2]),raw:{header:t[0],payload:t[1]}}}async function O$(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function I$(e,t){return new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){r(o);return}}catch(o){if(!t(i,o)){s(o);return}}})()})}function M$(e){return("0"+e.toString(16)).substr(-2)}function D$(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let i=0;i<56;i++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(t),Array.from(t,M$).join("")}async function L$(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",
510n),s=new Uint8Array(r);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function $$(e){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."),e;const n=await L$(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function to(e,t,n=!1){const r=D$();let s=r;n&&(s+="/recovery"),await ho(e,`${t}-code-verifier`,s);const i=await $$(r);return[i,r===i?"plain":"s256"]}const F$=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function V$(e){const t=e.headers.get(_m);if(!t||!t.match(F$))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function U$(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function B$(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const z$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function _r(e){if(!z$.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Mn(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function Pf(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function H$(e,t){return new Proxy(e,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const i=r.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!t.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,r,s)}})}function U0(e){return JSON.parse(JSON.stringify(e))}const ai=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},W$=[502,503,504,520,521,522,523,524,530];async function B0(e){var t;if(!R$(e))throw new Sm(ai(e),0);if(W$.includes(e.status))throw new Sm(ai(e),e.status);let n;try{n=await e.json()}catch(i){throw new Wn(ai(i),i)}let r;const s=V$(e);if(s&&s.getTime()>=kk["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 L0(ai(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new gt}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((i,o)=>
510i&&typeof o=="string",!0))throw new L0(ai(n),e.status,n.weak_password.reasons);throw new w$(ai(n),e.status||500,r)}const q$=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function re(e,t,n,r){var s;const i=Object.assign({},r==null?void 0:r.headers);i[_m]||(i[_m]=kk["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await K$(e,t,n+l,{headers:i,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 K$(e,t,n,r,s,i){const o=q$(t,r,s,i);let l;try{l=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new Sm(ai(c),0)}if(l.ok||await B0(l),r!=null&&r.noResolveJson)return l;try{return await l.json()}catch(c){await B0(c)}}function mn(e){var t;let n=null;Z$(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=N$(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:typeof(e==null?void 0:e.id)=="string"?e:null;return{data:{session:n,user:r},error:null}}function z0(e){const t=mn(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function ls(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function G$(e){return{data:e,error:null}}function Y$(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=e,o=bh(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function H0(e){return e}function Z$(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const Af=["global","local","others"];class J${_encodePathSegment(t){if(t==="."||t==="..")throw new aa("Invalid path segment");return encodeURIComponent(t)}constructor({url:t="",headers:n={},fetch:r,experimental:s}){this.url=t,this.headers=n,this.fetch=Tk(r),this.experimental=s??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(t,n=Af[0]){if(Af.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Af.join(", ")}`);try{return await re(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(X(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await re(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:ls})}catch(r){if(X(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=bh(t,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await re(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:Y$,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(X(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await re(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:ls})}catch(n){if(X(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,s,i,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await re(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:H0});if(d.error)throw d.error;const h=await d.json(),f=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>
5100&&(p.forEach(g=>{const v=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(g.split(";")[1].split("=")[1]);u[`${x}Page`]=v}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(X(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){_r(t);try{return await re(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:ls})}catch(n){if(X(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){_r(t);try{return await re(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:ls})}catch(r){if(X(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){_r(t);try{return await re(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:ls})}catch(r){if(X(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){_r(t.userId);try{const{data:n,error:r}=await re(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(X(n))return{data:null,error:n};throw n}}async _deleteFactor(t){_r(t.userId),_r(t.id);try{return{data:await re(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(X(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,s,i,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await re(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:H0});if(d.error)throw d.error;const h=await d.json(),f=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(g=>{const v=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(g.split(";")[1].split("=")[1]);u[`${x}Page`]=v}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(X(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await re(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(X(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{const n=this._encodePathSegment(t);return await re(this.fetch,"GET",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(n){if(X(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{const r=this._encodePathSegment(t);return await re(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${r}`,{body:n,headers:this.headers,xform:s=>({data:s,error:null})})}catch(r){if(X(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{const n=this._encodePathSegment(t);return await re(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(X(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{const n=this._encodePathSegment(t);return await re(this.fetch,"POST",`${this.url}/admin/oauth/clients/${n}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(n){if(X(n))return{data:null,error:n};throw n}}async _listCustomProviders(t){try{const n={};return t!=null&&t.type&&(n.type=t.type),await re(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var s;return{data:{providers:(s=r==null?void 0:r.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(n){if(X(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(t){try{return await re(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(X(n))return{data:null,error:n};throw n}}async _getCustomProvider(t){try{const n=this._encodePathSegment(t);return await re(this.fetch,"GET",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(n){if(X(n))return{data:null,error:n};throw n}}async _updateCustomProvider(t,n){try{const r=this._encodePathSegment(t);return await re(this.fetch,"PUT",`${this.url}/admin/custom-providers/${r}`,{body:n,headers:this.headers,xform:s=>({data:s,error:null})})}catch(r){if(X(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(t){try{const n=this._encodePathSegment(t);
510return await re(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(X(n))return{data:null,error:n};throw n}}async _adminListPasskeys(t){Mn(this.experimental),_r(t.userId);try{return await re(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(X(n))return{data:null,error:n};throw n}}async _adminDeletePasskey(t){Mn(this.experimental),_r(t.userId),_r(t.passkeyId);try{return await re(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(X(n))return{data:null,error:n};throw n}}}function W0(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const tr={debug:!!(globalThis&&Ek()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Nk extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class q0 extends Nk{}async function Q$(e,t,n){tr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;let s;t>0&&(s=setTimeout(()=>{r.abort(),tr.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){clearTimeout(s),tr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await n()}finally{tr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw tr.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new q0(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(tr.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null,"  "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}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"),clearTimeout(s),await n()}})}catch(i){if(t>0&&clearTimeout(s),i!==null&&typeof i=="object"&&"name"in i&&i.name==="AbortError"&&t>0){if(r.signal.aborted)return tr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async o=>{if(o){tr.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,o.name);try{return await n()}finally{tr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw tr.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new q0(`Lock "${e}" was released because another request stole it`)}throw i}}function X$(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Pk(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function e5(e){return parseInt(e,16)}function t5(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function n5(e){var t;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:l,requestId:c,resources:u,scheme:d,uri:h,version:f}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
511`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=Pk(e.address),g=d?`${d}://${r}`:r,v=e.statement?`${e.statement}
512`:"",x=`${g} wants you to sign in with your Ethereum account:
513${p}
514
515${v}`;let b=`URI: ${h}
516Version: ${f}
517Chain ID: ${n}${o?`
518Nonce: ${o}`:""}
519Issued At: ${i.toISOString()}`;if(s&&(b+=`
520Expiration Time: ${s.toISOString()}`),l&&(b+=`
521Not Before: ${l.toISOString()}
521`),c&&(b+=`
522Request ID: ${c}`),u){let w=`
523Resources:`;for(const y of u){if(!y||typeof y!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${y}`);w+=`
524- ${y}`}b+=w}return`${x}
525${b}`}class it extends Error{constructor({message:t,code:n,cause:r,name:s}){var i;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(i=s??(r instanceof Error?r.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=n}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class bd extends it{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function r5({error:e,options:t}){var n,r,s;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new it({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=i.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new it({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=i.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new it({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new it({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new it({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new it({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return i.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new it({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new it({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(Ak(o)){if(i.rp.id!==o)return new it({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new it({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new it({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new it({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new it({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function s5({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new it({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new it({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(Ak(r)){if(n.rpId!==r)return new it({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new it({message:`${window.location.hostname}
525 is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new it({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new it({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class i5{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const km=new i5;function K0(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,s=bh(e,["challenge","user","excludeCredentials"]),i=Fo(t).buffer,o=Object.assign(Object.assign({},n),{id:Fo(n.id).buffer}),l=Object.assign(Object.assign({},s),{challenge:i,user:o});if(r&&r.length>0){l.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const u=r[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Fo(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function G0(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=bh(e,["challenge","allowCredentials"]),s=Fo(t).buffer,i=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let o=0;o<n.length;o++){const l=n[o];i.allowCredentials[o]=Object.assign(Object.assign({},l),{id:Fo(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return i}function Y0(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:hi(new Uint8Array(e.response.attestationObject)),clientDataJSON:hi(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Z0(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:hi(new Uint8Array(s.authenticatorData)),clientDataJSON:hi(new Uint8Array(s.clientDataJSON)),signature:hi(new Uint8Array(s.signature)),userHandle:s.userHandle?hi(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Ak(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function _d(){var e,t;return!!(wt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function Rk(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new bd("Browser returned unexpected credential type",t)}:{data:null,error:new bd("Empty credential response",t)}}catch(t){return{data:null,error:r5({error:t,options:e})}}}async function Ok(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new bd("Browser returned unexpected credential type",t)}:{data:null,error:new bd("Empty credential response",t)}}
525catch(t){return{data:null,error:s5({error:t,options:e})}}}const o5={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},a5={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Sd(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of e)if(s)for(const i in s){const o=s[i];if(o!==void 0)if(Array.isArray(o))r[i]=o;else if(n(o))r[i]=o;else if(t(o)){const l=r[i];t(l)?r[i]=Sd(l,o):r[i]=Sd(o)}else r[i]=o}return r}function l5(e,t){return Sd(o5,e,t||{})}function c5(e,t){return Sd(a5,e,t||{})}class u5{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:s},i){var o;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!l)return{data:null,error:c};const u=s??km.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:d}=l.webauthn.credential_options.publicKey;if(!d.name){const h=r;if(h)d.name=`${d.id}:${h}`;else{const p=(await this.client.getUser()).data.user,g=((o=p==null?void 0:p.user_metadata)===null||o===void 0?void 0:o.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";d.name=`${d.id}:${g}`}}d.displayName||(d.displayName=d.name)}switch(l.webauthn.type){case"create":{const d=l5(l.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:h,error:f}=await Rk({publicKey:d,signal:u});return h?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:h}},error:null}:{data:null,error:f}}case"request":{const d=c5(l.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:h,error:f}=await Ok(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:d,signal:u}));return h?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:h}},error:null}:{data:null,error:f}}}}catch(l){return X(l)?{data:null,error:l}:{data:null,error:new Wn("Unexpected error in challenge",l)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new aa("rpId is required for WebAuthn authentication")};try{if(!_d())return{data:null,error:new Wn("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:i});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(o){return X(o)?{data:null,error:o}:{data:null,error:new Wn("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new aa("rpId is required for WebAuthn registration")};try{if(!_d())return{data:null,error:new Wn("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(d=>{var h;return(h=d.data)===null||h===void 0?void 0:h.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:i});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(o){return X(o)?{data:null,error:o}:{data:null,error:new Wn("Unexpected error in register",o)}}}}
525X$();const d5={url:m$,storageKey:g$,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:v$,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function J0(e,t,n){return await n()}const no={};class Kl{get jwks(){var t,n;return(n=(t=no[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){no[this.storageKey]=Object.assign(Object.assign({},no[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=no[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){no[this.storageKey]=Object.assign(Object.assign({},no[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,s,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=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;const o=Object.assign(Object.assign({},d5),t);if(this.storageKey=o.storageKey,this.instanceID=(n=Kl.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Kl.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&wt()){const l=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(l),this.logDebugMessages&&console.trace(l)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(r=o.experimental)!==null&&r!==void 0?r:{},this.admin=new J$({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=Tk(o.fetch),this.lock=o.lock||J0,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock?this.lock=o.lock:this.persistSession&&wt()&&(!((s=globalThis==null?void 0:globalThis.navigator)===null||s===void 0)&&s.locks)?this.lock=Q$:this.lock=J0,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new u5(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:Ek()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=W0(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=W0(this.memoryStorage)),wt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(l){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",l)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async l=>{this._debug("received broadcast notification from other tab or client",l);try{await this._notifyAllSubscribers(l.data.event,l.data.session,!1)}catch(c){this._debug("#broadcastChannel","error",c)}})}o.skipAutoInitialize||this.initialize().catch(l=>{this._debug("#initialize()","error",l)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${jk}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let n={},r="none";if(wt()&&(n=A$(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),wt()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),_$(i)){const c=(t=i.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:o,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return X(n)?this._returnResult({error:n}):this._returnResult({error:new Wn("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,s;try{const i=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:mn}),{data:o,error:l}=i;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(X(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var n,r,s;try{let i;if("email"in t){const{email:d,password:h,options:f}=t;let p=null,g=null;this.flowType==="pkce"&&([p,g]=await to(this.storage,this.storageKey)),i=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:d,password:h,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:p,code_challenge_method:g},xform:mn})}else if("phone"in t){const{phone:d,password:h,options:f}=t;i=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},channel:(s=f==null?void 0:f.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:mn})}else throw new eu("You must provide either an email or phone number and a password");const{data:o,error:l}=i;if(l||!o)return await xt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(await xt(this.storage,`${this.storageKey}-code-verifier`),X(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(t){try{let n;if("email"in t){const{email:i,password:o,options:l}=t;n=await re(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:z0})}else if("phone"in t){const{phone:i,password:o,options:l}=t;n=await re(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:z0})}else throw new eu("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const i=new eo;return this._returnResult({data:{user:null,session:null},error:i})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(X(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,s,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,s,i,o,l,c,u,d,h,f;let p,g;if("message"in t)p=t.message,g=t.signature;else{const{chain:v,wallet:x,statement:b,options:w}=t;let y;if(wt())if(typeof x=="object")y=x;else{const P=window;if("ethereum"in P&&typeof P.ethereum=="object"&&"request"in P.ethereum&&typeof P.ethereum.request=="function")y=P.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=x}const _=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href),j=await y.request({method:"eth_requestAccounts"}).then(P=>P).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!j||j.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const C=Pk(j[0]);let k=(r=w==null?void 0:w.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!k){const P=await y.request({method:"eth_chainId"});k=e5(P)}const S={domain:_.host,address:C,statement:b,uri:_.href,version:"1",chainId:k,nonce:(s=w==null?void 0:w.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=w==null?void 0:w.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=w==null?void 0:w.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=w==null?void 0:w.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=w==null?void 0:w.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=w==null?void 0:w.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=n5(S),g=await y.request({method:"personal_sign",params:[t5(p),C]})}try{const{data:v,error:x}=await re(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:g}
525,!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:mn});if(x)throw x;if(!v||!v.session||!v.user){const b=new eo;return this._returnResult({data:{user:null,session:null},error:b})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:x})}catch(v){if(X(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async signInWithSolana(t){var n,r,s,i,o,l,c,u,d,h,f,p;let g,v;if("message"in t)g=t.message,v=t.signature;else{const{chain:x,wallet:b,statement:w,options:y}=t;let _;if(wt())if(typeof b=="object")_=b;else{const C=window;if("solana"in C&&typeof C.solana=="object"&&("signIn"in C.solana&&typeof C.solana.signIn=="function"||"signMessage"in C.solana&&typeof C.solana.signMessage=="function"))_=C.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=b}const j=new URL((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in _&&_.signIn){const C=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y==null?void 0:y.signInWithSolana),{version:"1",domain:j.host,uri:j.href}),w?{statement:w}:null));let k;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")k=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)k=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in k&&"signature"in k&&(typeof k.signedMessage=="string"||k.signedMessage instanceof Uint8Array)&&k.signature instanceof Uint8Array)g=typeof k.signedMessage=="string"?k.signedMessage:new TextDecoder().decode(k.signedMessage),v=k.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in _)||typeof _.signMessage!="function"||!("publicKey"in _)||typeof _!="object"||!_.publicKey||!("toBase58"in _.publicKey)||typeof _.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${j.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...w?["",w,""]:[""],"Version: 1",`URI: ${j.href}`,`Issued At: ${(s=(r=y==null?void 0:y.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=y==null?void 0:y.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((o=y==null?void 0:y.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((l=y==null?void 0:y.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((c=y==null?void 0:y.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((u=y==null?void 0:y.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((h=(d=y==null?void 0:y.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...y.signInWithSolana.resources.map(k=>`- ${k}`)]:[]].join(`
526`);const C=await _.signMessage(new TextEncoder().encode(g),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=C}}try{const{data:x,error:b}=await re(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:hi(v)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:mn});if(b)throw b;if(!x||!x.session||!x.user){const w=new eo;return this._returnResult({data:{user:null,session:null},error:w})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:b})}
526catch(x){if(X(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async _exchangeCodeForSession(t){const n=await ri(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new S$;const{data:i,error:o}=await re(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:mn});if(await xt(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const l=new eo;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(await xt(this.storage,`${this.storageKey}-code-verifier`),X(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(t){try{const{options:n,provider:r,token:s,access_token:i,nonce:o}=t,l=await re(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:mn}),{data:c,error:u}=l;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new eo;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(n){if(X(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,s,i,o;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await to(this.storage,this.storageKey));const{error:h}=await re(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:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await re(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new eu("You must provide either an email or phone number.")}catch(l){if(await xt(this.storage,`${this.storageKey}-code-verifier`),X(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var n,r;try{let s,i;"options"in t&&(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo,i=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:l}=await re(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:mn});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(X(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var n,r,s,i,o;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await to(this.storage,this.storageKey));const u=await re(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:G$});return!((i=u.data)===null||i===void 0)&&i.url&&wt()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await xt(this.storage,`${this.storageKey}-code-verifier`),X(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new gt;const{error:s}=await re(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(X(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:s,options:i}=t,{error:o}=await re(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:r,type:s,options:i}=t,{data:o,error:l}=await re(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new eu("You must provide either an email or phone number and a type")}catch(n){if(X(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,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 s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.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(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(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 t=null;const n=await ri(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not val
526id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<Tf:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const o=await ri(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=Pf()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=H$(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await re(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:ls}):await this._useSession(async n=>{var r,s,i;const{data:o,error:l}=n;if(l)throw l;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new gt}:await re(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:ls})})}catch(n){if(X(n))return Xc(n)&&(await this._removeSession(),await xt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new gt;const o=s.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await to(this.storage,this.storageKey));const{data:u,error:d}=await re(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:ls});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(r){if(await xt(this.storage,`${this.storageKey}-code-verifier`),X(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new gt;const n=Date.now()/1e3;let r=n,s=!0,i=null;const{payload:o}=nu(t.access_token);if(o.exp&&(r=o.exp,s=r<=n),s){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};i=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});i={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(n){if(X(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:o,error:l}=n;if(l)throw l;t=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new gt;const{data:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(X(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){var r;try{if(!wt())throw new tu("No browser detected.");
526if(t.error||t.error_description||t.error_code)throw new tu(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new D0("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new tu("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new D0("No code detected.");const{data:y,error:_}=await this._exchangeCodeForSession(t.code);if(_)throw _;const j=new URL(window.location.href);return j.searchParams.delete("code"),window.history.replaceState(window.history.state,"",j.toString()),{data:{session:y.session,redirectType:(r=y.redirectType)!==null&&r!==void 0?r:null},error:null}}const{provider_token:s,provider_refresh_token:i,access_token:o,refresh_token:l,expires_in:c,expires_at:u,token_type:d}=t;if(!o||!c||!l||!d)throw new tu("No session defined in URL");const h=Math.round(Date.now()/1e3),f=parseInt(c);let p=h+f;u&&(p=parseInt(u));const g=p-h;g*1e3<=uo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${f}s`);const v=p-f;h-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,p,h):h-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,p,h);const{data:x,error:b}=await this._getUser(o);if(b)throw b;const w={provider_token:s,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:p,refresh_token:l,token_type:d,user:x.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:w,redirectType:t.type},error:null})}catch(s){if(X(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await ri(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i&&!Xc(i))return this._returnResult({error:i});const o=(r=s.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(b$(l)&&(l.status===404||l.status===401||l.status===403)||Xc(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await xt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=P$(),r={id:n,callback:t,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(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,s;try{const{data:{session:i},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),Xc(i)?console.warn(i):console.error(i)}})}async resetPasswordForEmail(t,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await to(this.storage,this.storageKey,!0));try{return await re(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(await xt(this.storage,`${this.storageKey}-code-verifier`),X(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:s}=await this._useSession(async i=>{var o,l,c,u,d;const{data:h,error:f}=i;if(f)throw f;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await re(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return wt()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(X(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:i}}=n;
526if(s)throw s;const{options:o,provider:l,token:c,access_token:u,nonce:d}=t,h=await re(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=i==null?void 0:i.access_token)!==null&&r!==void 0?r:void 0,body:{provider:l,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:mn}),{data:f,error:p}=h;return p?this._returnResult({data:{user:null,session:null},error:p}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new eo}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:p}))}catch(s){if(await xt(this.storage,`${this.storageKey}-code-verifier`),X(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;if(o)throw o;return await re(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await I$(async s=>(s>0&&await O$(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await re(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:mn})),(s,i)=>{const o=200*Math.pow(2,s);return i&&Nf(i)&&Date.now()+o-r<uo})}catch(r){if(this._debug(n,"error",r),X(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),wt()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await ri(this.storage,this.storageKey);if(s&&this.userStorage){let o=await ri(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await ho(this.userStorage,this.storageKey+"-user",o)),s.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:Pf()}else if(s&&!s.user&&!s.user){const o=await ri(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await xt(this.storage,this.storageKey+"-user"),await ho(this.storage,this.storageKey,s)):s.user=Pf()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const i=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<Tf;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${Tf}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),Nf(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(s.access_token);!l&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new gt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new _h;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new gt;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const l={data:i.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(i){if(this._debug(s,"error",i),X(i)){const o={data:null,error:i};return Nf(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,n,r=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let l=0;l<i.length;l+=1)console.error(i[l]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await xt(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await ho(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const i=U0(s);await ho(this.storage,this.storageKey,i)}else{const s=U0(n);await ho(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await xt(this.storage,this.storageKey),await xt(this.storage,this.storageKey+"-code-verifier"),await xt(this.storage,this.storageKey+"-user"),this.userStorage&&await xt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;
526try{t&&wt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),uo);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}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 t=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 s=Math.floor((r.expires_at*1e3-t)/uo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${uo}ms, refresh threshold is ${bm} ticks`),s<=bm&&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(t){if(t instanceof Nk)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!wt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,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(t,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await to(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(l.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);s.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;return i?this._returnResult({data:null,error:i}):await re(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;
526if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await re(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?Y0(t.webauthn.credential_response):Z0(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await re(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=await re(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:K0(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:G0(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,s,i;if(t)try{const{payload:p}=nu(t);let g=null;p.aal&&(g=p.aal);let v=g;const{data:{user:x},error:b}=await this.getUser(t);if(b)return this._returnResult({data:null,error:b});((r=(n=x==null?void 0:x.factors)===null||n===void 0?void 0:n.filter(_=>_.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(v="aal2");const y=p.amr||[];return{data:{currentLevel:g,nextLevel:v,currentAuthenticationMethods:y},error:null}}catch(p){if(X(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:o},error:l}
526=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=nu(o.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((i=(s=o.user.factors)===null||s===void 0?void 0:s.filter(p=>p.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(d="aal2");const f=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:f},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await re(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new gt})})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new gt});const o=await re(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&wt()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new gt});const o=await re(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&wt()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await re(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new gt})})}catch(t){if(X(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await re(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new gt})})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(l=>l.kid===t);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(l=>l.kid===t),r&&this.jwks_cached_at+x$>s)return r;const{data:i,error:o}=await re(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,r=i.keys.find(l=>l.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:p,error:g}
526=await this.getSession();if(g||!p.session)return this._returnResult({data:null,error:g});r=p.session.access_token}const{header:s,payload:i,signature:o,raw:{header:l,payload:c}}=nu(r);n!=null&&n.allowExpired||U$(i.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:i,header:s,signature:o},error:null}}const d=B$(s.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,o,T$(`${l}.${c}`)))throw new jm("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async signInWithPasskey(t){var n,r,s;Mn(this.experimental);try{if(!_d())return this._returnResult({data:null,error:new Wn("Browser does not support WebAuthn",null)});const{data:i,error:o}=await this._startPasskeyAuthentication({options:{captchaToken:(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.captchaToken}});if(o||!i)return this._returnResult({data:null,error:o});const l=G0(i.options),c=(s=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.signal)!==null&&s!==void 0?s:km.createNewAbortSignal(),{data:u,error:d}=await Ok({publicKey:l,signal:c});if(d||!u)return this._returnResult({data:null,error:d??new Wn("WebAuthn ceremony failed",null)});const h=Z0(u);return this._verifyPasskeyAuthentication({challengeId:i.challenge_id,credential:h})}catch(i){if(X(i))return this._returnResult({data:null,error:i});throw i}}async registerPasskey(t){var n,r;Mn(this.experimental);try{if(!_d())return this._returnResult({data:null,error:new Wn("Browser does not support WebAuthn",null)});const{data:s,error:i}=await this._startPasskeyRegistration();if(i||!s)return this._returnResult({data:null,error:i});const o=K0(s.options),l=(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.signal)!==null&&r!==void 0?r:km.createNewAbortSignal(),{data:c,error:u}=await Rk({publicKey:o,signal:l});if(u||!c)return this._returnResult({data:null,error:u??new Wn("WebAuthn ceremony failed",null)});const d=Y0(c);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:d})}catch(s){if(X(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){Mn(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new gt});const{data:s,error:i}=await re(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:n.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(t){if(X(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){Mn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new gt});const{data:i,error:o}=await re(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyAuthentication(t){var n;Mn(this.experimental);try{const{data:r,error:s}=await re(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:r,error:null})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async _verifyPasskeyAuthentication(t){Mn(this.experimental);try{const{data:n,error:r}=await re(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:mn});return r?this._returnResult({data:null,error:r}):(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:n,error:null}))}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async _listPasskeys(){Mn(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new gt});const{data:s,error:i}=await re(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(t){if(X(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){Mn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new gt});const{data:i,error:o}=await re(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:t.friendlyName}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async _deletePasskey(t){Mn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new gt});const{error:i}
526=await re(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}}Kl.nextInstanceID={};const h5=Kl,f5="2.106.2";let Za="";typeof Deno<"u"?Za="deno":typeof document<"u"?Za="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Za="react-native":Za="node";const p5={"X-Client-Info":`supabase-js-${Za}/${f5}`},m5={headers:p5},g5={schema:"public"},v5={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},y5={},x5={enabled:!1,respectSamplingDecision:!0};function w5(e,t,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?i(d.value):s(d.value).then(l,c)}u((r=r.apply(e,[])).next())})}let Rf=null;const b5="@opentelemetry/api";function _5(){return Rf===null&&(Rf=import(b5).catch(()=>null)),Rf}function S5(){return w5(this,void 0,void 0,function*(){try{const e=yield _5();if(!e||!e.propagation||!e.context)return null;const t={};e.propagation.inject(e.context.active(),t);const n=t.traceparent;return n?{traceparent:n,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function j5(e){if(!e||typeof e!="string")return null;const t=e.split("-");if(t.length!==4)return null;const[n,r,s,i]=t;if(n.length!==2||r.length!==32||s.length!==16||i.length!==2)return null;const o=/^[0-9a-f]+$/i;return!o.test(n)||!o.test(r)||!o.test(s)||!o.test(i)||r==="00000000000000000000000000000000"||s==="0000000000000000"?null:{version:n,traceId:r,parentId:s,traceFlags:i,isSampled:(parseInt(i,16)&1)===1}}function k5(e,t){if(!e||!t||t.length===0)return!1;let n;if(e instanceof URL)n=e;else try{n=new URL(e)}catch{return!1}for(const r of t)try{if(typeof r=="string"){if(C5(n.hostname,r))return!0}else if(r instanceof RegExp){if(r.test(n.hostname))return!0}else if(typeof r=="function"&&r(n))return!0}catch{continue}return!1}function C5(e,t){if(t===e)return!0;if(t.startsWith("*.")){const n=t.slice(2);if(e.endsWith(n)&&(e===n||e.endsWith("."+n)))return!0}return!1}function E5(e){const t=[];try{const n=new URL(e);t.push(n.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function Gl(e){"@babel/helpers - typeof";return Gl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gl(e)}function T5(e,t){if(Gl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function N5(e){var t=T5(e,"string");
526return Gl(t)=="symbol"?t:t+""}function P5(e,t,n){return(t=N5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function et(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q0(Object(n),!0).forEach(function(r){P5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const A5=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),R5=()=>Headers,O5=(e,t,n,r,s)=>{const i=A5(r),o=R5(),l=(s==null?void 0:s.enabled)===!0,c=(s==null?void 0:s.respectSamplingDecision)!==!1,u=l?E5(t):null;return async(d,h)=>{var f;const p=(f=await n())!==null&&f!==void 0?f:e;let g=new o(h==null?void 0:h.headers);if(g.has("apikey")||g.set("apikey",e),g.has("Authorization")||g.set("Authorization",`Bearer ${p}`),u){const v=await I5(d,u,c);v&&(v.traceparent&&!g.has("traceparent")&&g.set("traceparent",v.traceparent),v.tracestate&&!g.has("tracestate")&&g.set("tracestate",v.tracestate),v.baggage&&!g.has("baggage")&&g.set("baggage",v.baggage))}return i(d,et(et({},h),{},{headers:g}))}};async function I5(e,t,n){if(!k5(typeof e=="string"||e instanceof URL?e:e.url,t))return null;const r=await S5();if(!r||!r.traceparent)return null;if(n){const s=j5(r.traceparent);if(s&&!s.isSampled)return null}return r}function X0(e){return typeof e=="boolean"?{enabled:e}:e}function M5(e){return e.endsWith("/")?e:e+"/"}function D5(e,t){var n,r,s,i,o,l;const{db:c,auth:u,realtime:d,global:h}=e,{db:f,auth:p,realtime:g,global:v}=t,x=X0(e.tracePropagation),b=X0(t.tracePropagation),w={db:et(et({},f),c),auth:et(et({},p),u),realtime:et(et({},g),d),storage:{},global:et(et(et({},v),h),{},{headers:et(et({},(n=v==null?void 0:v.headers)!==null&&n!==void 0?n:{}),(r=h==null?void 0:h.headers)!==null&&r!==void 0?r:{})}),tracePropagation:{enabled:(s=(i=x==null?void 0:x.enabled)!==null&&i!==void 0?i:b==null?void 0:b.enabled)!==null&&s!==void 0?s:!1,respectSamplingDecision:(o=(l=x==null?void 0:x.respectSamplingDecision)!==null&&l!==void 0?l:b==null?void 0:b.respectSamplingDecision)!==null&&o!==void 0?o:!0},accessToken:async()=>""};return e.accessToken?w.accessToken=e.accessToken:delete w.accessToken,w}function L5(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(M5(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var $5=class extends h5{constructor(e){super(e)}},F5=class{constructor(e,t,n){var r,s;this.supabaseUrl=e,this.supabaseKey=t;const i=L5(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,l={db:g5,realtime:y5,auth:et(et({},v5),{},{storageKey:o}),global:m5,tracePropagation:x5},c=D5(n??{},l);if(this.settings=c,this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=c.global.headers)!==null&&s!==void 0?s:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=O5(t,e,this._getAccessToken.bind(this),c.global.fetch,c.tracePropagation),this.realtime=this._initRealtimeClient(et({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new tL(new URL("rest/v1",i).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new p$(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new WD(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}
526channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:i,flowType:o,lock:l,debug:c,throwOnError:u,experimental:d,lockAcquireTimeout:h,skipAutoInitialize:f},p,g){const v={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new $5({url:this.authUrl.href,headers:et(et({},v),p),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:l,debug:c,throwOnError:u,experimental:d,fetch:g,lockAcquireTimeout:h,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(x=>x.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new LL(this.realtimeUrl.href,et(et({},e),{},{params:et(et({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const V5=(e,t,n)=>new F5(e,t,n);function U5(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}U5()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function B5(){var x,b;if(typeof window>"u")return;const e=location.hostname,n=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(w=>e===w||e.endsWith("."+w)),r="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",s=n?((x=e.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+r+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:x[1])??((b=e.match(new RegExp("^("+r+")(?=[.-])","i")))==null?void 0:b[1]):void 0,i=window.parent&&window.parent!==window;if(!s||!i)return localStorage;const o=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),l=o?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),u=c&&l.test(c)?[c]:o?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],d="lovable-preview-auth:result",h=2e3,f=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),p=(w,y,_)=>new Promise(j=>{const C=f();let k=!1,S;const P=R=>{k||(k=!0,clearTimeout(S),window.removeEventListener("message",E),j(R))},E=R=>
526{if(u.indexOf(R.origin)<0)return;const $=R.data;$&&$.type===d&&$.requestId===C&&P($)};window.addEventListener("message",E);const I={type:w,requestId:C,projectId:s,key:y};_!==void 0&&(I.value=_);for(const R of u)window.parent.postMessage(I,R);S=setTimeout(()=>P(null),h)});let g=!0;const v=250;return{getItem:async w=>{let y=await p("lovable-preview-auth:get",w);return!y&&g&&(await new Promise(_=>setTimeout(_,v)),y=await p("lovable-preview-auth:get",w)),g=!1,y&&y.ok&&typeof y.value=="string"?y.value===""?(localStorage.removeItem(w),null):y.value:localStorage.getItem(w)},setItem:(w,y)=>(localStorage.setItem(w,y),p("lovable-preview-auth:set",w,y).then(()=>{})),removeItem:w=>(localStorage.removeItem(w),p("lovable-preview-auth:remove",w).then(()=>{}))}}const z5="https://wihmguamhmtwqgiujzfo.supabase.co",H5="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6IndpaG1ndWFtaG10d3FnaXVqemZvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjkzODY0NDMsImV4cCI6MjA4NDk2MjQ0M30.1Yrt0AlPzlKsqVa3LCqMjVtWWbiVJ52sdXajcP4eVb8",W=V5(z5,H5,{auth:{storage:B5(),persistSession:!0,autoRefreshToken:!0}}),Ik=m.createContext(void 0);function W5({children:e}){const[t,n]=m.useState(null),[r,s]=m.useState(null),[i,o]=m.useState(null),[l,c]=m.useState(!0),u=async p=>{const{data:g,error:v}=await W.from("user_roles").select("role").eq("user_id",p).maybeSingle();return v?(console.error("Error fetching user role:",v),null):g==null?void 0:g.role};m.useEffect(()=>{const{data:{subscription:p}}=W.auth.onAuthStateChange(async(g,v)=>{s(v),n((v==null?void 0:v.user)??null),v!=null&&v.user?setTimeout(async()=>{const x=await u(v.user.id);o(x)},0):o(null),c(!1)});return W.auth.getSession().then(async({data:{session:g}})=>{if(s(g),n((g==null?void 0:g.user)??null),g!=null&&g.user){const v=await u(g.user.id);o(v)}c(!1)}),()=>p.unsubscribe()},[]);const d=async(p,g)=>{const{error:v}=await W.auth.signInWithPassword({email:p,password:g});return{error:v}},h=async(p,g,v,x)=>{const{data:b,error:w}=await W.auth.signUp({email:p,password:g,options:{emailRedirectTo:window.location.origin}});if(w||!b.user)return{error:w};const y=b.user.id,{error:_}=await W.rpc("assign_self_role",{_role:v});if(_)return console.error("Error assigning role:",_),{error:_};if(v==="consultant"){const j=x,{error:C}=await W.from("consultant_profiles").insert({user_id:y,full_name:j.full_name,expertise:j.expertise,experience_years:j.experience_years,skills:j.skills,photo_url:j.photo_url||null,bio:j.bio||null,is_public:!0,is_featured:!1});if(C)return console.error("Error inserting consultant profile:",C),{error:C}}else{const j=x,{error:C}=await W.from("hiring_professional_profiles").insert({user_id:y,full_name:j.full_name,company_name:j.company_name||null,position:j.position||null});if(C)return console.error("Error inserting hiring profile:",C),{error:C}}return{error:null}},f=async()=>{await W.auth.signOut(),o(null)};return a.jsx(Ik.Provider,{value:{user:t,session:r,userRole:i,isLoading:l,signIn:d,signUp:h,signOut:f},children:e})}function Sh(){const e=m.useContext(Ik);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}const Mk=m.createContext(void 0),q5=({children:e})=>{const[t,n]=m.useState([]),[r,s]=m.useState([]),[i,o]=m.useState(null),[l,c]=m.useState(!0),u=m.useCallback(async()=>{var p;const[d,h,f]=await Promise.all([W.from("site_services").select("*").order("sort_order"),W.from("site_metrics").select("*").order("sort_order"),W.from("site_settings").select("value").eq("key","story").maybeSingle()]);d.data&&n(d.data),h.data&&s(h.data),(p=f.data)!=null&&p.value&&o(f.data.value),c(!1)},[]);return m.useEffect(()=>{u()},[u]),a.jsx(Mk.Provider,{value:{services:t,metrics:r,story:i,isLoading:l,refresh:u},children:e})},Gs=()=>{const e=m.useContext(Mk);if(!e)throw new Error("useSiteContent must be used within SiteContentProvider");return e},Rv=m.createContext({});function Ov(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const K5=typeof window<"u",Dk=K5?m.useLayoutEffect:m.useEffect,jh=m.createContext(null);function Iv(e,t){e.indexOf(t)===-1&&e.push(t)}
vendor: 9,316 bytes, line 526
526function jd(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const yr=(e,t,n)=>n>t?t:n<e?e:n;let kh=()=>{},la=()=>{};const Fs={},Lk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),$k=e=>typeof e=="object"&&e!==null,Fk=e=>/^0[^.\s]+$/u.test(e);function Vk(e){let t;return()=>(t===void 0&&(t=e()),t)}const _n=e=>e,xc=(...e)=>e.reduce((t,n)=>r=>n(t(r))),Yl=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Mv{constructor(){this.subscriptions=[]}add(t){return Iv(this.subscriptions,t),()=>jd(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Xt=e=>e*1e3,wn=e=>e/1e3,Uk=(e,t)=>t?e*(1e3/t):0,Bk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,G5=1e-7,Y5=12;function Z5(e,t,n,r,s){let i,o,l=0;do o=t+(n-t)/2,i=Bk(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>G5&&++l<Y5);return o}function wc(e,t,n,r){if(e===t&&n===r)return _n;const s=i=>Z5(i,0,1,e,n);return i=>i===0||i===1?i:Bk(s(i),t,r)}const zk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Hk=e=>t=>1-e(1-t),Wk=wc(.33,1.53,.69,.99),Dv=Hk(Wk),qk=zk(Dv),Kk=e=>e>=1?1:(e*=2)<1?.5*Dv(e):.5*(2-Math.pow(2,-10*(e-1))),Lv=e=>1-Math.sin(Math.acos(e)),Gk=Hk(Lv),Yk=zk(Lv),J5=wc(.42,0,1,1),Q5=wc(0,0,.58,1),Zk=wc(.42,0,.58,1),X5=e=>Array.isArray(e)&&typeof e[0]!="number",Jk=e=>Array.isArray(e)&&typeof e[0]=="number",ew={linear:_n,easeIn:J5,easeInOut:Zk,easeOut:Q5,circIn:Lv,circInOut:Yk,circOut:Gk,backIn:Dv,backInOut:qk,backOut:Wk,anticipate:Kk},e3=e=>typeof e=="string",tw=e=>{if(Jk(e)){la(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return wc(t,n,r,s)}else if(e3(e))return la(ew[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),ew[e];return e},ru=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],nw={value:null,addProjectionMetrics:null};function t3(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(h){o.has(h)&&(d.schedule(h),e()),c++,h(l)}const d={schedule:(h,f=!1,p=!1)=>{const v=p&&s?n:r;return f&&o.add(h),v.add(h),h},cancel:h=>{r.delete(h),o.delete(h)},process:h=>{if(l=h,s){i=!0;return}s=!0;const f=n;n=r,r=f,n.forEach(u),t&&nw.value&&nw.value.frameloop[t].push(c),c=0,n.clear(),s=!1,i&&(i=!1,d.process(h))}};return d}const n3=40;function Qk(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=ru.reduce((y,_)=>(y[_]=t3(i,t?_:void 0),y),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:h,preRender:f,render:p,postRender:g}=o,v=()=>{const y=Fs.useManualTiming,_=y?s.timestamp:performance.now();n=!1,y||(s.delta=r?1e3/60:Math.max(Math.min(_-s.timestamp,n3),1)),s.timestamp=_,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),h.process(s),f.process(s),p.process(s),g.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(v))},x=()=>{n=!0,r=!0,s.isProcessing||e(v)};return{schedule:ru.reduce((y,_)=>{const j=o[_];return y[_]=(C,k=!1,S=!1)=>(n||x(),j.schedule(C,k,S)),y},{}),cancel:y=>{for(let _=0;_<ru.length;_++)o[ru[_]].cancel(y)},state:s,steps:o}}const{schedule:Ie,cancel:Vs,state:_t,steps:Of}=Qk(typeof requestAnimationFrame<"u"?requestAnimationFrame:_n,!0);let Pu;function r3(){Pu=void 0}const $t={now:()=>(Pu===void 0&&$t.set(_t.isProcessing||Fs.useManualTiming?_t.timestamp:performance.now()),Pu),set:e=>{Pu=e,queueMicrotask(r3)}},Xk=e=>t=>typeof t=="string"&&t.startsWith(e),eC=Xk("--"),s3=Xk("var(--"),$v=e=>s3(e)?i3.test(e.split("/*")[0].trim()):!1,i3=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function rw(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ja={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Zl={...ja,transform:e=>yr(0,1,e)},su={...ja,default:1},pl=e=>Math.round(e*1e5)/1e5,Fv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function o3(e){return e==null}const a3=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Vv=(e,t)=>n=>!!(typeof n=="string"&&a3.test(n)&&n.startsWith(e)||t&&!o3(n)&&Object.prototype.hasOwnProperty.call(n,t)),tC=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(Fv);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},l3=e=>yr(0,255,e),If={...ja,transform:e=>Math.round(l3(e))},fi={test:Vv("rgb","red"),parse:tC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+If.transform(e)+", "+If.transform(t)+", "+If.transform(n)+", "+pl(Zl.transform(r))+")"};function c3(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Cm={test:Vv("#"),parse:c3,transform:fi.transform},bc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),jr=bc("deg"),pr=bc("%"),ne=bc("px"),u3=bc("vh"),d3=bc("vw"),sw={...pr,parse:e=>pr.parse(e)/100,transform:e=>pr.transform(e*100)},To={test:Vv("hsl","hue"),parse:tC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+pr.transform(pl(t))+", "+pr.transform(pl(n))+", "+pl(Zl.transform(r))+")"},ot={test:e=>fi.test(e)||Cm.test(e)||To.test(e),parse:e=>fi.test(e)?fi.parse(e):To.test(e)?To.parse(e):Cm.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?fi.transform(e):To.transform(e),getAnimatableNone:e=>{const t=ot.parse(e);return t.alpha=0,ot.transform(t)}},h3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function f3(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Fv))==null?void 0:t.length)||0)+(((n=e.match(h3))==null?void 0:n.length)||0)>0}const nC="number",rC="color",p3="var",m3="var(",iw="${}",g3=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ca(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(g3,c=>(ot.test(c)?(r.color.push(i),s.push(rC),n.push(ot.parse(c))):c.startsWith(m3)?(r.var.push(i),s.push(p3),n.push(c)):(r.number.push(i),s.push(nC),n.push(parseFloat(c))),++i,iw)).split(iw);return{values:n,split:l,indexes:r,types:s}}function v3(e){return ca(e).values}function sC({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=e[i],r[i]!==void 0){const o=t[i];o===nC?s+=pl(r[i]):o===rC?s+=ot.transform(r[i]):s+=r[i]}return s}}function y3(e){return sC(ca(e))}const x3=e=>typeof e=="number"?0:ot.test(e)?ot.getAnimatableNone(e):e,w3=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:x3(e);function b3(e){const t=ca(e);return sC(t)(t.values.map((r,s)=>w3(r,t.split[s])))}const Gn={test:f3,parse:v3,createTransformer:y3,getAnimatableNone:b3};function Mf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _3({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=Mf(c,l,e+1/3),i=Mf(c,l,e),o=Mf(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function kd(e,t){return n=>n>0?t:e}const Oe=(e,t,n)=>e+(t-e)*n,Df=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},S3=[Cm,fi,To],j3=e=>S3.find(t=>t.test(e));function ow(e){const t=j3(e);if(kh(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===To&&(n=_3(n)),n}const aw=(e,t)=>{const n=ow(e),r=ow(t);if(!n||!r)return kd(e,t);const s={...n};return i=>(s.red=Df(n.red,r.red,i),s.green=Df(n.green,r.green,i),s.blue=Df(n.blue,r.blue,i),s.alpha=Oe(n.alpha,r.alpha,i),fi.transform(s))},Em=new Set(["none","hidden"]);function k3(e,t){return Em.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function C3(e,t){return n=>Oe(e,t,n)}function Uv(e){return typeof e=="number"?C3:typeof e=="string"?$v(e)?kd:ot.test(e)?aw:N3:Array.isArray(e)?iC:typeof e=="object"?ot.test(e)?aw:E3:kd}function iC(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Uv(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function E3(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Uv(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function T3(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],o=e.indexes[i][r[i]],l=e.values[o]??0;n[s]=l,r[i]++}return n}const N3=(e,t)=>{const n=Gn.createTransformer(t),r=ca(e),s=ca(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Em.has(e)&&!s.values.length||Em.has(t)&&!r.values.length?k3(e,t):xc(iC(T3(r,s),s.values),n):(kh(!0,`Complex values '${e}' and '${t}
526' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),kd(e,t))};function oC(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Oe(e,t,n):Uv(e)(e,t)}const P3=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Ie.update(t,n),stop:()=>Vs(t),now:()=>_t.isProcessing?_t.timestamp:$t.now()}},aC=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Cd=2e4;function Bv(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Cd;)t+=n,r=e.next(t);return t>=Cd?1/0:t}function A3(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Bv(r),Cd);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:wn(s)}}const Ge={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Tm(e,t){return e*Math.sqrt(1-t*t)}const R3=12;function O3(e,t,n){let r=n;for(let s=1;s<R3;s++)r=r-e(r)/t(r);return r}const Lf=.001;function I3({duration:e=Ge.duration,bounce:t=Ge.bounce,velocity:n=Ge.velocity,mass:r=Ge.mass}){let s,i;kh(e<=Xt(Ge.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=yr(Ge.minDamping,Ge.maxDamping,o),e=yr(Ge.minDuration,Ge.maxDuration,wn(e)),o<1?(s=u=>{const d=u*o,h=d*e,f=d-n,p=Tm(u,o),g=Math.exp(-h);return Lf-f/p*g},i=u=>{const h=u*o*e,f=h*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-h),v=Tm(Math.pow(u,2),o);return(-s(u)+Lf>0?-1:1)*((f-p)*g)/v}):(s=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-Lf+d*h},i=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const l=5/e,c=O3(s,i,l);if(e=Xt(e),isNaN(c))return{stiffness:Ge.stiffness,damping:Ge.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const M3=["duration","bounce"],D3=["stiffness","damping","mass"];function lw(e,t){return t.some(n=>e[n]!==void 0)}function L3(e){let t={velocity:Ge.velocity,stiffness:Ge.stiffness,damping:Ge.damping,mass:Ge.mass,isResolvedFromDuration:!1,...e};if(!lw(e,D3)&&lw(e,M3))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*yr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ge.mass,stiffness:s,damping:i}}else{const n=I3({...e,velocity:0});t={...t,...n,mass:Ge.mass},t.isResolvedFromDuration=!0}return t}function Ed(e=Ge.visualDuration,t=Ge.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:h,velocity:f,isResolvedFromDuration:p}=L3({...n,velocity:-wn(n.velocity||0)}),g=f||0,v=u/(2*Math.sqrt(c*d)),x=o-i,b=wn(Math.sqrt(c/d)),w=Math.abs(x)<5;r||(r=w?Ge.restSpeed.granular:Ge.restSpeed.default),s||(s=w?Ge.restDelta.granular:Ge.restDelta.default);let y,_,j,C,k,S;if(v<1)j=Tm(b,v),C=(g+v*b*x)/j,y=E=>{const I=Math.exp(-v*b*E);return o-I*(C*Math.sin(j*E)+x*Math.cos(j*E))},k=v*b*C+x*j,S=v*b*x-C*j,_=E=>Math.exp(-v*b*E)*(k*Math.sin(j*E)+S*Math.cos(j*E));else if(v===1){y=I=>o-Math.exp(-b*I)*(x+(g+b*x)*I);const E=g+b*x;_=I=>Math.exp(-b*I)*(b*E*I-g)}else{const E=b*Math.sqrt(v*v-1);y=T=>{const U=Math.exp(-v*b*T),D=Math.min(E*T,300);return o-U*((g+v*b*x)*Math.sinh(D)+E*x*Math.cosh(D))/E};const I=(g+v*b*x)/E,R=v*b*I-x*E,$=v*b*x-I*E;_=T=>{const U=Math.exp(-v*b*T),D=Math.min(E*T,300);return U*(R*Math.sinh(D)+$*Math.cosh(D))}}const P={calculatedDuration:p&&h||null,velocity:E=>Xt(_(E)),next:E=>{if(!p&&v<1){const R=Math.exp(-v*b*E),$=Math.sin(j*E),T=Math.cos(j*E),U=o-R*(C*$+x*T),D=Xt(R*(k*$+S*T));return l.done=Math.abs(D)<=r&&Math.abs(o-U)<=s,l.value=l.done?o:U,l}const I=y(E);if(p)l.done=E>=h;else{const R=Xt(_(E));l.done=Math.abs(R)<=r&&Math.abs(o-I)<=s}return l.value=l.done?o:I,l},toString:()=>{const E=Math.min(Bv(P),Cd),I=aC(R=>P.next(E*R).value,E,30);return E+"ms "+I},toTransition:()=>{}};return P}Ed.applyToOptions=e=>
vendor: 16,265 bytes, line 526
526{const t=A3(e,100,Ed);return e.ease=t.ease,e.duration=Xt(t.duration),e.type="keyframes",e};const $3=5;function lC(e,t,n){const r=Math.max(t-$3,0);return Uk(n-e(r),t-r)}function Nm({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const h=e[0],f={done:!1,value:h},p=S=>l!==void 0&&S<l||c!==void 0&&S>c,g=S=>l===void 0?c:c===void 0||Math.abs(l-S)<Math.abs(c-S)?l:c;let v=n*t;const x=h+v,b=o===void 0?x:o(x);b!==x&&(v=b-h);const w=S=>-v*Math.exp(-S/r),y=S=>b+w(S),_=S=>{const P=w(S),E=y(S);f.done=Math.abs(P)<=u,f.value=f.done?b:E};let j,C;const k=S=>{p(f.value)&&(j=S,C=Ed({keyframes:[f.value,g(f.value)],velocity:lC(y,S,f.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return k(0),{calculatedDuration:null,next:S=>{let P=!1;return!C&&j===void 0&&(P=!0,_(S),k(S)),j!==void 0&&S>=j?C.next(S-j):(!P&&_(S),f)}}}function F3(e,t,n){const r=[],s=n||Fs.mix||oC,i=e.length-1;for(let o=0;o<i;o++){let l=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||_n:t;l=xc(c,l)}r.push(l)}return r}function V3(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(la(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=F3(t,r,s),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(d<e[h+1]);h++);const f=Yl(e[h],e[h+1],d);return l[h](f)};return n?d=>u(yr(e[0],e[i-1],d)):u}function U3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Yl(0,t,r);e.push(Oe(n,1,s))}}function B3(e){const t=[0];return U3(t,e.length-1),t}function z3(e,t){return e.map(n=>n*t)}function H3(e,t){return e.map(()=>t||Zk).splice(0,e.length-1)}function ml({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=X5(r)?r.map(tw):tw(r),i={done:!1,value:t[0]},o=z3(n&&n.length===t.length?n:B3(t),e),l=V3(o,t,{ease:Array.isArray(s)?s:H3(t,s)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const W3=e=>e!==null;function Ch(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(W3),l=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const q3={decay:Nm,inertia:Nm,tween:ml,keyframes:ml,spring:Ed};function cC(e){typeof e.type=="string"&&(e.type=q3[e.type])}class zv{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const K3=e=>e/100;class Td extends zv{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==$t.now()&&this.tick($t.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;cC(t);const{type:n=ml,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:l}=t;const c=n||ml;c!==ml&&typeof l[0]!="number"&&(this.mixKeyframes=xc(K3,oC(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Bv(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:f,repeatDelay:p,type:g,onUpdate:v,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const b=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let y=this.currentTime,_=r;if(h){const S=Math.min(this.currentTime,s)/l;let P=Math.floor(S),E=S%1;!E&&S>=1&&(E=1),E===1&&P--,P=Math.min(P,h+1),!!(P%2)&&(f==="reverse"?(E=1-E,p&&(E-=p/l)):f==="mirror"&&(_=o)),y=yr(0,1,E)*l}let j;w?(this.delayState.value=d[0],j=this.delayState):j=_.next(y),i&&!w&&(j.value=i(j.value));let{done:C}=j;!w&&c!==null&&(C=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return k&&g!==Nm&&(j.value=Ch(d,this.options,x,this.speed)),v&&v(j.value),k&&this.finish(),j}then(t,n){return this.finished.then(t,n)}get duration(){return wn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+wn(t)}get time(){return wn(this.currentTime)}set time(t){t=Xt(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return lC(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime($t.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=wn(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=P3,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime($t.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function G3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const pi=e=>e*180/Math.PI,Pm=e=>{const t=pi(Math.atan2(e[1],e[0]));return Am(t)},Y3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Pm,rotateZ:Pm,skewX:e=>pi(Math.atan(e[1])),skewY:e=>pi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Am=e=>(e=e%360,e<0&&(e+=360),e),cw=Pm,uw=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),dw=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Z3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:uw,scaleY:dw,scale:e=>(uw(e)+dw(e))/2,rotateX:e=>Am(pi(Math.atan2(e[6],e[5]))),rotateY:e=>Am(pi(Math.atan2(-e[2],e[0]))),rotateZ:cw,rotate:cw,skewX:e=>pi(Math.atan(e[4])),skewY:e=>pi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Rm(e){return e.includes("scale")?1:0}function Om(e,t){if(!e||e==="none")return Rm(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Z3,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Y3,s=l}if(!s)return Rm(t);const i=r[t],o=s[1].split(",").map(Q3);return typeof i=="function"?i(o):o[i]}const J3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Om(n,t)};function Q3(e){return parseFloat(e.trim())}const ka=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ca=new Set([...ka,"pathRotation"]),hw=e=>e===ja||e===ne,X3=new Set(["x","y","z"]),eF=ka.filter(e=>!X3.has(e));function tF(e){const t=[];return eF.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const vs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Om(t,"x"),y:(e,{transform:t})=>Om(t,"y")};vs.translateX=vs.x;vs.translateY=vs.y;const Si=new Set;let Im=!1,Mm=!1,Dm=!1;function uC(){if(Mm){const e=Array.from(Si).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=tF(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))==null||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Mm=!1,Im=!1,Si.forEach(e=>e.complete(Dm)),Si.clear()}function dC(){Si.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Mm=!0)})}function nF(){Dm=!0,dC(),uC(),Dm=!1}class Hv{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Si.add(this),Im||(Im=!0,Ie.read(dC),Ie.resolveKeyframes(uC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const l=r.readValue(n,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}G3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Si.delete(this)}cancel(){this.state==="scheduled"&&(Si.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const rF=e=>e.startsWith("--");function hC(e,t,n){rF(t)?e.style.setProperty(t,n):e.style[t]=n}const sF={};function fC(e,t){const n=Vk(e);return()=>sF[t]??n()}const iF=fC(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),pC=fC(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ja=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,fw={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ja([0,.65,.55,1]),circOut:Ja([.55,0,1,.45]),backIn:Ja([.31,.01,.66,-.59]),backOut:Ja([.33,1.53,.69,.99])};function mC(e,t){if(e)return typeof e=="function"?pC()?aC(e,t):"ease-out":Jk(e)?Ja(e):Array.isArray(e)?e.map(n=>mC(n,t)||fw.easeOut):fw[e]}function oF(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const h=mC(l,s);Array.isArray(h)&&(d.easing=h);const f={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),e.animate(d,f)}function gC(e){return typeof e=="function"&&"applyToOptions"in e}function aF({type:e,...t}){return gC(e)&&pC()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class vC extends zv{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,la(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=aF(t);this.animation=oF(n,r,s,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=Ch(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(d),hC(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return wn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+wn(t)}get time(){return wn(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Xt(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&iF()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),_n):s(this)}}const yC={anticipate:Kk,backInOut:qk,circInOut:Yk};function lF(e){return e in yC}function cF(e){typeof e.ease=="string"&&lF(e.ease)&&(e.ease=yC[e.ease])}const $f=10;class uF extends vC{constructor(t){cF(t),cC(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new Td({...o,autoplay:!1}),c=Math.max($f,$t.now()-this.startTime),u=yr(0,$f,c-$f),d=l.sample(c).value,{name:h}=this.options;i&&h&&hC(i,h,d),n.setWithVelocity(l.sample(Math.max(0,c-u)).value,d,u),l.stop()}}const pw=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Gn.test(e)||e==="0")&&!e.startsWith("url("));function dF(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function hF(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=pw(s,t),l=pw(i,t);return kh(o===l,`You are trying to animate ${t} from "${s}" to "${i}". "${o?i:s}" is not an animatable value.`,"value-not-animatable"),!o||!l?!1:dF(e)||(n==="spring"||gC(n))&&r}function Lm(e){e.duration=0,e.type="keyframes"}const xC=new Set(["opacity","clipPath","filter","transform"]),fF=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function pF(e){for(let t=0;t<e.length;
526t++)if(typeof e[t]=="string"&&fF.test(e[t]))return!0;return!1}const mF=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),gF=Vk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function vF(e){var h;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=e;if(!(((h=t==null?void 0:t.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=t.owner.getProps();return gF()&&n&&(xC.has(n)||mF.has(n)&&pF(l))&&(n!=="transform"||!d)&&!u&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const yF=40;class xF extends zv{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...h}){var g;super(),this.stop=()=>{var v,x;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=$t.now();const f={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:c,motionValue:u,element:d,...h},p=(d==null?void 0:d.KeyframeResolver)||Hv;this.keyframeResolver=new p(l,(v,x,b)=>this.onKeyframesResolved(v,x,f,!b),c,u,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,s){var b,w;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=$t.now();let h=!0;hF(t,i,o,l)||(h=!1,(Fs.instantAnimations||!c)&&(d==null||d(Ch(t,r,n))),t[0]=t[t.length-1],Lm(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>yF?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=h&&!u&&vF(p),v=(w=(b=p.motionValue)==null?void 0:b.owner)==null?void 0:w.current;let x;if(g)try{x=new uF({...p,element:v})}catch{x=new Td(p)}else x=new Td(p);x.finished.then(()=>{this.notifyFinished()}).catch(_n),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),nF()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function wC(e,t,n,r=0,s=1){const i=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),o=e.size,l=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:l-i*r}const mw=30,wF=e=>!isNaN(parseFloat(e));class bF{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=$t.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=$t.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=wF(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Mv);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ie.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=$t.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>mw)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,mw);return Uk(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ua(e,t){return new bF(e,t)}function bC(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Wv(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?bC(n,e):n}const _F={type:"spring",stiffness:500,damping:25,restSpeed:10},SF=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),jF={type:"keyframes",duration:.8},kF={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},CF=(e,{keyframes:t})=>t.length>2?jF:Ca.has(e)?e.startsWith("scale")?SF(t[1]):_F:kF,EF=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function TF(e){for(const t in e)if(!EF.has(t))return!0;return!1}const qv=(e,t,n,r={},s,i)=>o=>{const l=Wv(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Xt(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:f=>{t.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};TF(l)||Object.assign(d,CF(e,d)),d.duration&&(d.duration=Xt(d.duration)),d.repeatDelay&&(d.repeatDelay=Xt(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Lm(d),d.delay===0&&(h=!0)),(Fs.instantAnimations||Fs.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(h=!0,Lm(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,h&&!i&&t.get()!==void 0){const f=Ch(d.keyframes,l);if(f!==void 0){Ie.update(()=>{d.onUpdate(f),d.onComplete()});return}}return l.isSync?new Td(d):new xF(d)},NF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function PF(e){const t=NF.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const AF=4;function _C(e,t,n=1){la(n<=AF,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=PF(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Lk(o)?parseFloat(o):o}return $v(s)?_C(s,t,n+1):s}function gw(e){const t=[{},{}];
vendor: 5,633 bytes, line 526
526return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Kv(e,t,n,r){if(typeof t=="function"){const[s,i]=gw(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=gw(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function ji(e,t,n){const r=e.getProps();return Kv(r,t,n!==void 0?n:r.custom,e)}const SC=new Set(["width","height","top","left","right","bottom",...ka]),$m=e=>Array.isArray(e);function RF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ua(n))}function OF(e){return $m(e)?e[e.length-1]||0:e}function IF(e,t){const n=ji(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=OF(i[o]);RF(e,o,l)}}const St=e=>!!(e&&e.getVelocity);function MF(e){return!!(St(e)&&e.add)}function Fm(e,t){const n=e.getValue("willChange");if(MF(n))return n.add(t);if(!n&&Fs.WillChange){const r=new Fs.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Gv(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const DF="framerAppearId",jC="data-"+Gv(DF);function kC(e){return e.props[jC]}function LF({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function CC(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=t;const c=e.getDefaultTransition();i=i?bC(i,c):c;const u=i==null?void 0:i.reduceMotion,d=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],f=s&&e.animationState&&e.animationState.getState()[s],p=i==null?void 0:i.path;p&&p.animateVisualElement(e,l,i,n,h);for(const g in l){const v=e.getValue(g,e.latestValues[g]??null),x=l[g];if(x===void 0||f&&LF(f,g))continue;const b={delay:n,...Wv(i||{},g)};d&&(b.skipAnimations=!0);const w=v.get();if(w!==void 0&&!v.isAnimating()&&!Array.isArray(x)&&x===w&&!b.velocity){Ie.update(()=>v.set(x));continue}let y=!1;if(window.MotionHandoffAnimation){const C=kC(e);if(C){const k=window.MotionHandoffAnimation(C,g,Ie);k!==null&&(b.startTime=k,y=!0)}}Fm(e,g);const _=u??e.shouldReduceMotion;v.start(qv(g,v,x,_&&SC.has(g)?{type:!1}:b,e,y));const j=v.animation;j&&h.push(j)}if(o){const g=()=>Ie.update(()=>{o&&IF(e,o)});h.length?Promise.all(h).then(g):g()}return h}function Vm(e,t,n={}){var c;const r=ji(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(CC(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:f}=s;return $F(e,t,u,d,h,f,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[i,o]:[o,i];return u().then(()=>d())}else return Promise.all([i(),o(n.delay)])}function $F(e,t,n=0,r=0,s=0,i=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(Vm(c,t,{...o,delay:n+(typeof r=="function"?0:r)+wC(e.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function FF(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Vm(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Vm(e,t,n);else{const s=typeof t=="function"?ji(e,t,n.custom):t;r=Promise.all(CC(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const VF={test:e=>e==="auto",parse:e=>e},EC=e=>t=>t.test(e),TC=[ja,ne,pr,jr,d3,u3,VF],vw=e=>TC.find(EC(e));function UF(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Fk(e):!0}const BF=new Set(["brightness","contrast","saturate","opacity"]);function zF(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Fv)||[];if(!r)return e;const s=n.replace(r,"");let i=BF.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const HF=/\b([a-z-]*)\(.*?\)/gu,Um={...Gn,getAnimatableNone:e=>{const t=e.match(HF);return t?t.map(zF).join(" "):e}},Bm={...Gn,getAnimatableNone:e=>{const t=Gn.parse(e);return Gn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},yw={...ja,transform:Math.round},WF={rotate:jr,pathRotation:jr,rotateX:jr,rotateY:jr,rotateZ:jr,scale:su,scaleX:su,scaleY:su,scaleZ:su,skew:jr,skewX:jr,skewY:jr,distance:ne,translateX:ne,translateY:ne,translateZ:ne,x:ne,y:ne,z:ne,perspective:ne,transformPerspective:ne,opacity:Zl,originX:sw,originY:sw,originZ:ne},Nd={borderWidth:ne,borderTopWidth:ne,borderRightWidth:ne,borderBottomWidth:ne,borderLeftWidth:ne,borderRadius:ne,borderTopLeftRadius:ne,borderTopRightRadius:ne,borderBottomRightRadius:ne,borderBottomLeftRadius:ne,width:ne,maxWidth:ne,height:ne,maxHeight:ne,top:ne,right:ne,bottom:ne,left:ne,inset:ne,insetBlock:ne,insetBlockStart:ne,insetBlockEnd:ne,insetInline:ne,insetInlineStart:ne,insetInlineEnd:ne,padding:ne,paddingTop:ne,paddingRight:ne,paddingBottom:ne,paddingLeft:ne,paddingBlock:ne,paddingBlockStart:ne,paddingBlockEnd:ne,paddingInline:ne,paddingInlineStart:ne,paddingInlineEnd:ne,margin:ne,marginTop:ne,marginRight:ne,marginBottom:ne,marginLeft:ne,marginBlock:ne,marginBlockStart:ne,marginBlockEnd:ne,marginInline:ne,marginInlineStart:ne,marginInlineEnd:ne,fontSize:ne,backgroundPositionX:ne,backgroundPositionY:ne,...WF,zIndex:yw,fillOpacity:Zl,strokeOpacity:Zl,numOctaves:yw},qF={...Nd,color:ot,backgroundColor:ot,outlineColor:ot,fill:ot,stroke:ot,borderColor:ot,borderTopColor:ot,borderRightColor:ot,borderBottomColor:ot,borderLeftColor:ot,filter:Um,WebkitFilter:Um,mask:Bm,WebkitMask:Bm},NC=e=>qF[e],KF=new Set([Um,Bm]);function PC(e,t){let n=NC(e);return KF.has(n)||(n=Gn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}
vendor: 1,717 bytes, line 526
526const GF=new Set(["auto","none","0"]);function YF(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!GF.has(i)&&ca(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=PC(n,s)}class ZF extends Hv{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let h=t[d];if(typeof h=="string"&&(h=h.trim(),$v(h))){const f=_C(h,n.current);f!==void 0&&(t[d]=f),d===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!SC.has(r)||t.length!==2)return;const[s,i]=t,o=vw(s),l=vw(i),c=rw(s),u=rw(i);if(c!==u&&vs[r]){this.needsMeasurement=!0;return}if(o!==l)if(hw(o)&&hw(l))for(let d=0;d<t.length;d++){const h=t[d];typeof h=="string"&&(t[d]=parseFloat(h))}else vs[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||UF(t[s]))&&r.push(s);r.length&&YF(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=vs[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=vs[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEac
vendor: 45,571 bytes, line 526
526h(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function AC(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const zm=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Au(e){return $k(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Yv,cancel:V9}=Qk(queueMicrotask,!1),Dn={x:!1,y:!1};function RC(){return Dn.x||Dn.y}function JF(e){return e==="x"||e==="y"?Dn[e]?null:(Dn[e]=!0,()=>{Dn[e]=!1}):Dn.x||Dn.y?null:(Dn.x=Dn.y=!0,()=>{Dn.x=Dn.y=!1})}function OC(e,t){const n=AC(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function QF(e){return!(e.pointerType==="touch"||RC())}function XF(e,t,n={}){const[r,s,i]=OC(e,n);return r.forEach(o=>{let l=!1,c=!1,u;const d=()=>{o.removeEventListener("pointerleave",g)},h=x=>{u&&(u(x),u=void 0),d()},f=x=>{l=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,h(x))},p=()=>{l=!0,window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",f,s)},g=x=>{if(x.pointerType!=="touch"){if(l){c=!0;return}h(x)}},v=x=>{if(!QF(x))return;c=!1;const b=t(o,x);typeof b=="function"&&(u=b,o.addEventListener("pointerleave",g,s))};o.addEventListener("pointerenter",v,s),o.addEventListener("pointerdown",p,s)}),i}const IC=(e,t)=>t?e===t?!0:IC(e,t.parentElement):!1,Zv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,eV=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function tV(e){return eV.has(e.tagName)||e.isContentEditable===!0}const nV=new Set(["INPUT","SELECT","TEXTAREA"]);function rV(e){return nV.has(e.tagName)||e.isContentEditable===!0}const Ru=new WeakSet;function xw(e){return t=>{t.key==="Enter"&&e(t)}}function Ff(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const sV=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=xw(()=>{if(Ru.has(n))return;Ff(n,"down");const s=xw(()=>{Ff(n,"up")}),i=()=>Ff(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ww(e){return Zv(e)&&!RC()}const bw=new WeakSet;function iV(e,t,n={}){const[r,s,i]=OC(e,n),o=l=>{const c=l.currentTarget;if(!ww(l)||bw.has(l))return;Ru.add(c),n.stopPropagation&&bw.add(l);const u=t(c,l),d=(p,g)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),Ru.has(c)&&Ru.delete(c),ww(p)&&typeof u=="function"&&u(p,{success:g})},h=p=>{d(p,c===window||c===document||n.useGlobalTarget||IC(c,p.target))},f=p=>{d(p,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",f,s)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),Au(l)&&(l.addEventListener("focus",u=>sV(u,s)),!tV(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function Jv(e){return $k(e)&&"ownerSVGElement"in e}const Ou=new WeakMap;let es;const MC=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Jv(r)&&"getBBox"in r?r.getBBox()[t]:r[n],oV=MC("inline","width","offsetWidth"),aV=MC("block","height","offsetHeight");function lV({target:e,borderBoxSize:t}){var n;(n=Ou.get(e))==null||n.forEach(r=>{r(e,{get width(){return oV(e,t)},get height(){return aV(e,t)}})})}function cV(e){e.forEach(lV)}function uV(){typeof ResizeObserver>"u"||(es=new ResizeObserver(cV))}function dV(e,t){es||uV();const n=AC(e);return n.forEach(r=>{let s=Ou.get(r);s||(s=new Set,Ou.set(r,s)),s.add(t),es==null||es.observe(r)}),()=>{n.forEach(r=>{const s=Ou.get(r);s==null||s.delete(t),s!=null&&s.size||es==null||es.unobserve(r)})}}const Iu=new Set;let No;function hV(){No=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Iu.forEach(t=>t(e))},window.addEventListener("resize",No)}function fV(e){return Iu.add(e),No||hV(),()=>{Iu.delete(e),!Iu.size&&typeof No=="function"&&(window.removeEventListener("resize",No),No=void 0)}}function _w(e,t){return typeof e=="function"?fV(e):dV(e,t)}function pV(e){return Jv(e)&&e.tagName==="svg"}const mV=[...TC,ot,Gn],gV=e=>mV.find(EC(e)),Sw=()=>({translate:0,scale:1,origin:0,originPoint:0}),Po=()=>({x:Sw(),y:Sw()}),jw=()=>({min:0,max:0}),ct=()=>({x:jw(),y:jw()}),vV=new WeakMap;function Eh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Jl(e){return typeof e=="string"||Array.isArray(e)}const Qv=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Xv=["initial",...Qv];function Th(e){return Eh(e.animate)||Xv.some(t=>Jl(e[t]))}function DC(e){return!!(Th(e)||e.variants)}function yV(e,t,n){for(const r in t){const s=t[r],i=n[r];if(St(s))e.addValue(r,s);else if(St(i))e.addValue(r,ua(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,ua(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Hm={current:null},LC={current:!1},xV=typeof window<"u";function wV(){if(LC.current=!0,!!xV)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Hm.current=e.matches;e.addEventListener("change",t),t()}else Hm.current=!1}const kw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Pd={};function $C(e){Pd=e}function bV(){return Pd}class _V{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Hv,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=$t.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,Ie.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=l;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=Th(n),this.isVariantNode=DC(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const g=f[p];u[p]!==void 0&&St(g)&&g.set(u[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,vV.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(LC.current||wV(),this.shouldReduceMotion=Hm.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Vs(this.notifyUpdate),Vs(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&xC.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:u,duration:d}=n.accelerate,h=new vC({element:this.current,name:t,keyframes:l,times:c,ease:u,duration:Xt(d)}),f=o(h);this.valueSubscriptions.set(t,()=>{f(),h.cancel()});return}const r=Ca.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Ie.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Pd){const n=Pd[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ct()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<kw.length;r++){const s=kw[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=yV(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=ua(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Lk(r)||Fk(r))?r=parseFloat(r):!gV(r)&&Gn.test(n)&&(r=PC(t,n)),this.setBaseTarget(t,St(r)?r.get():r)),St(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Kv(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!St(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Mv),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Yv.render(this.render)}}class FC extends _V{constructor(){super(...arguments),this.KeyframeResolver=ZF}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;St(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ys{constructor(t){this.isMounted=!1,this.node=t}update(){}}function VC({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function SV({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function jV(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Vf(e){return e===void 0||e===1}function Wm({scale:e,scaleX:t,scaleY:n}){return!Vf(e)||!Vf(t)||!Vf(n)}function li(e){return Wm(e)||UC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function UC(e){return Cw(e.x)||Cw(e.y)}function Cw(e){return e&&e!=="0%"}function Ad(e,t,n){const r=e-n,s=t*r;return n+s}function Ew(e,t,n,r,s){return s!==void 0&&(e=Ad(e,s,r)),Ad(e,n,r)+t}function qm(e,t=0,n=1,r,s){e.min=Ew(e.min,t,n,r,s),e.max=Ew(e.max,t,n,r,s)}function BC(e,{x:t,y:n}){qm(e.x,t.translate,t.scale,t.originPoint),qm(e.y,n.translate,n.scale,n.originPoint)}const Tw=.999999999999,Nw=1.0000000000001;function kV(e,t,n,r=!1){var l;const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let c=0;c<s;c++){i=n[c],o=i.projectionDelta;const{visualElement:u}=i.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(cr(e.x,-i.scroll.offset.x),cr(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,BC(e,o)),r&&li(i.latestValues)&&Mu(e,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}t.x<Nw&&t.x>Tw&&(t.x=1),t.y<Nw&&t.y>Tw&&(t.y=1)}function cr(e,t){e.min+=t,e.max+=t}function Pw(e,t,n,r,s=.5){const i=Oe(e.min,e.max,s);qm(e,t,n,i,r)}function Aw(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Mu(e,t,n){const r=n??e;Pw(e.x,Aw(t.x,r.x),t.scaleX,t.scale,t.originX),Pw(e.y,Aw(t.y,r.y),t.scaleY,t.scale,t.originY)}function zC(e,t){return VC(jV(e.getBoundingClientRect(),t))}function CV(e,t,n){const r=zC(e,n),{scroll:s}=t;return s&&(cr(r.x,s.offset.x),cr(r.y,s.offset.y)),r}const EV={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},TV=ka.length;function NV(e,t,n){let r="",s=!0;for(let o=0;o<TV;o++){const l=ka[o],c=e[l];if(c===void 0)continue;let u=!0;if(typeof c=="number")u=c===(l.startsWith("scale")?1:0);else{const d=parseFloat(c);u=l.startsWith("scale")?d===1:d===0}if(!u||n){const d=zm(c,Nd[l]);if(!u){s=!1;const h=EV[l]||l;r+=`${h}(${d}) `}n&&(t[l]=d)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${zm(i,Nd.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function ey(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(Ca.has(c)){o=!0;continue}else if(eC(c)){s[c]=u;continue}else{const d=zm(u,Nd[c]);c.startsWith("origin")?(l=!0,i[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=NV(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=i;r.transformOrigin=`${c} ${u} ${d}`}}function HC(e,{style:t,vars:n},r,s){const i=e.style;let o;for(o in t)i[o]=t[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function Rw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const za={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ne.test(e))e=parseFloat(e);else return e;const n=Rw(e,t.target.x),r=Rw(e,t.target.y);return`${n}% ${r}%`}},PV={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Gn.parse(e);if(s.length>5)return r;const i=Gn.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const u=Oe(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}},Km={borderRadius:{...za,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:za,borderTopRightRadius:za,borderBottomLeftRadius:za,borderBottomRightRadius:za,boxShadow:PV};function WC(e,{layout:t,layoutId:n}){return Ca.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Km[e]||e==="opacity")}function ty(e,t,n){var o;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const l in r)(St(r[l])||s&&St(s[l])||WC(l,e)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function AV(e){return window.getComputedStyle(e)}class RV extends FC{constructor(){super(...arguments),this.type="html",this.renderInstance=HC}readValueFromInstance(t,n){var r;if(Ca.has(n))return(r=this.projection)!=null&&r.isProjecting?Rm(n):J3(t,n);{const s=AV(t),i=(eC(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return zC(t,n)}build(t,n,r){ey(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return ty(t,n,r)}}const OV={offset:"stroke-dashoffset",array:"stroke-dasharray"},IV={offset:"strokeDashoffset",array:"strokeDasharray"};function MV(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?OV:IV;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const DV=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qC(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},c,u,d){if(ey(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:f}=e;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox);for(const p of DV)h[p]!==void 0&&(f[p]=h[p],delete h[p]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&MV(h,s,i,o,!1)}const KC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),GC=e=>typeof e=="string"&&e.toLowerCase()==="svg";function LV(e,t,n,r){HC(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(KC.has(s)?s:Gv(s),t.attrs[s])}function YC(e,t,n){const r=ty(e,t,n);for(const s in e)if(St(e[s])||St(t[s])){const i=ka.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class $V extends FC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ct}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ca.has(n)){const r=NC(n);return r&&r.default||0}return n=KC.has(n)?n:Gv(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return YC(t,n,r)}build(t,n,r){qC(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){LV(t,n,r,s)}mount(t){this.isSVGTag=GC(t.tagName),super.mount(t)}}const FV=Xv.length;function ZC(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ZC(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<FV;n++){const r=Xv[n],s=e.props[r];(Jl(s)||s===!1)&&(t[r]=s)}return t}function JC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const VV=[...Qv].reverse(),UV=Qv.length;function BV(e){return t=>Promise.all(t.map(({animation:n,options:r})=>FF(e,n,r)))}function zV(e){let t=BV(e),n=Ow(),r=!0,s=!1;const i=u=>(d,h)=>{var p;const f=ji(e,h,u==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:g,transitionEnd:v,...x}=f;d={...d,...x,...v}}return d};function o(u){t=u(e)}function l(u){const{props:d}=e,h=ZC(e.parent)||{},f=[],p=new Set;let g={},v=1/0;for(let b=0;b<UV;b++){const w=VV[b],y=n[w],_=d[w]!==void 0?d[w]:h[w],j=Jl(_),C=w===u?y.isActive:null;C===!1&&(v=b);let k=_===h[w]&&_!==d[w]&&j;if(k&&(r||s)&&e.manuallyAnimateOnMount&&(k=!1),y.protectedKeys={...g},!y.isActive&&C===null||!_&&!y.prevProp||Eh(_)||typeof _=="boolean")continue;if(w==="exit"&&y.isActive&&C!==!0){y.prevResolvedValues&&(g={...g,...y.prevResolvedValues});continue}const S=HV(y.prevProp,_);let P=S||w===u&&y.isActive&&!k&&j||b>v&&j,E=!1;const I=Array.isArray(_)?_:[_];let R=I.reduce(i(w),{});C===!1&&(R={});const{prevResolvedValues:$={}}=y,T={...$,...R},U=N=>{P=!0,p.has(N)&&(E=!0,p.delete(N)),y.needsAnimating[N]=!0;const O=e.getValue(N);O&&(O.liveStyle=!1)};for(const N in T){const O=R[N],V=$[N];if(g.hasOwnProperty(N))continue;let H=!1;$m(O)&&$m(V)?H=!JC(O,V)||S:H=O!==V,H?O!=null?U(N):p.add(N):O!==void 0&&p.has(N)?U(N):y.protectedKeys[N]=!0}y.prevProp=_,y.prevResolvedValues=R,y.isActive&&(g={...g,...R}),(r||s)&&e.blockInitialAnimation&&(P=!1);const D=k&&S;P&&(!D||E)&&f.push(...I.map(N=>{const O={type:w};if(typeof N=="string"&&(r||s)&&!D&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,H=ji(V,N);if(V.enteringChildren&&H){const{delayChildren:Z}=H.transition||{};O.delay=wC(V.enteringChildren,e,Z)}}return{animation:N,options:O}}))}if(p.size){const b={};if(typeof d.initial!="boolean"){const w=ji(e,Array.isArray(d.initial)?d.initial[0]:d.initial);w&&w.transition&&(b.transition=w.transition)}p.forEach(w=>{const y=e.getBaseTarget(w),_=e.getValue(w);_&&(_.liveStyle=!0),b[w]=y??null}),f.push({animation:b})}let x=!!f.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?t(f):Promise.resolve()}function c(u,d){var f;if(n[u].isActive===d)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(p=>{var g;return(g=p.animationState)==null?void 0:g.setActive(u,d)}),n[u].isActive=d;const h=l(u);for(const p in n)n[p].protectedKeys={};return h}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Ow(),s=!0}}}function HV(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!JC(t,e):!1}function si(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ow(){return{animate:si(!0),whileInView:si(),whileHover:si(),whileTap:si(),whileDrag:si(),whileFocus:si(),exit:si()}}function Gm(e,t){e.min=t.min,e.max=t.max}function In(e,t){Gm(e.x,t.x),Gm(e.y,t.y)}function Iw(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const QC=1e-4,WV=1-QC,qV=1+QC,XC=.01,KV=0-XC,GV=0+XC;function Ft(e){return e.max-e.min}function YV(e,t,n){return Math.abs(e-t)<=n}function Mw(e,t,n,r=.5){e.origin=r,e.originPoint=Oe(t.min,t.max,e.origin),e.scale=Ft(n)/Ft(t),e.translate=Oe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=WV&&e.scale<=qV||isNaN(e.scale))&&(e.scale=1),(e.translate>=KV&&e.translate<=GV||isNaN(e.translate))&&(e.translate=0)}function gl(e,t,n,r){Mw(e.x,t.x,n.x,r?r.originX:void 0),Mw(e.y,t.y,n.y,r?r.originY:void 0)}function Dw(e,t,n,r=0){const s=r?Oe(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+Ft(t)}function ZV(e,t,n,r){Dw(e.x,t.x,n.x,r==null?void 0:r.x),Dw(e.y,t.y,n.y,r==null?void 0:r.y)}function Lw(e,t,n,r=0){const s=r?Oe(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+Ft(t)}function Rd(e,t,n,r){Lw(e.x,t.x,n.x,r==null?void 0:r.x),Lw(e.y,t.y,n.y,r==null?void 0:r.y)}function $w(e,t,n,r,s){return e-=t,e=Ad(e,1/n,r),s!==void 0&&(e=Ad(e,1/s,r)),e}function JV(e,t=0,n=1,r=.5,s,i=e,o=e){if(pr.test(t)&&(t=parseFloat(t),t=Oe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Oe(i.min,i.max,r);e===i&&(l-=t),e.min=$w(e.min,t,n,l,s),e.max=$w(e.max,t,n,l,s)}function Fw(e,t,[n,r,s],i,o){JV(e,t[n],t[r],t[s],t.scale,i,o)}const QV=["x","scaleX","originX"],XV=["y","scaleY","originY"];function Vw(e,t,n,r){Fw(e.x,t,QV,n?n.x:void 0,r?r.x:void 0),Fw(e.y,t,XV,n?n.y:void 0,r?r.y:void 0)}function Uw(e){return e.translate===0&&e.scale===1}function eE(e){return Uw(e.x)&&Uw(e.y)}function Bw(e,t){return e.min===t.min&&e.max===t.max}function eU(e,t){return Bw(e.x,t.x)&&Bw(e.y,t.y)}function zw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function tE(e,t){return zw(e.x,t.x)&&zw(e.y,t.y)}function Hw(e){return Ft(e.x)/Ft(e.y)}function Ww(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function rr(e){return[e("x"),e("y")]}function tU(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,pathRotation:h,rotateX:f,rotateY:p,skewX:g,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotate(${h}deg) `),f&&(r+=`rotateX(${f}deg) `),p&&(r+=`rotateY(${p}deg) `),g&&(r+=`skewX(${g}deg) `),v&&(r+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const nE=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],nU=nE.length,qw=e=>typeof e=="string"?parseFloat(e):e,Kw=e=>typeof e=="number"||ne.test(e);function rU(e,t,n,r,s,i){s?(e.opacity=Oe(0,n.opacity??1,sU(r)),e.opacityExit=Oe(t.opacity??1,0,iU(r))):i&&(e.opacity=Oe(t.opacity??1,n.opacity??1,r));for(let o=0;o<nU;o++){const l=nE[o];let c=Gw(t,l),u=Gw(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Kw(c)===Kw(u)?(e[l]=Math.max(Oe(qw(c),qw(u),r),0),(pr.test(u)||pr.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=Oe(t.rotate||0,n.rotate||0,r))}function Gw(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const sU=rE(0,.5,Gk),iU=rE(.5,.95,_n);function rE(e,t,n){return r=>r<e?0:r>t?1:n(Yl(e,t,r))}function oU(e,t,n){const r=St(e)?e:ua(e);return r.start(qv("",r,t,n)),r.animation}function Ql(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const aU=(e,t)=>e.depth-t.depth;class lU{constructor(){this.children=[],this.isDirty=!1}add(t){Iv(this.children,t),this.isDirty=!0}remove(t){jd(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(aU),this.isDirty=!1,this.children.forEach(t)}}function cU(e,t){const n=$t.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Vs(r),e(i-t))};return Ie.setup(r,!0),()=>Vs(r)}function Du(e){return St(e)?e.get():e}class uU{constructor(){this.members=[]}add(t){Iv(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(jd(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(jd(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=t.options;(i===void 0||i!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Lu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Uf=["","X","Y","Z"],dU=1e3;let hU=0;function Bf(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function sE(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=kC(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ie,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&sE(r)}function iE({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=hU++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(mU),this.nodes.forEach(bU),this.nodes.forEach(_U),this.nodes.forEach(gU)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new lU)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Mv),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Jv(o)&&!pV(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let d,h=0;const f=()=>this.root.updateBlockedByResize=!1;Ie.read(()=>{h=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,d&&d(),d=cU(f,250),Lu.hasAnimatedSinceResize&&(Lu.hasAnimatedSinceResize=!1,this.nodes.forEach(Jw)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||EU,{onLayoutAnimationStart:v,onLayoutAnimationComplete:x}=u.getProps(),b=!this.targetLayout||!tE(this.targetLayout,p),w=!h&&f;if(this.options.layoutRoot||this.resumeFrom||w||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...Wv(g,"layout"),onPlay:v,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(d,w,y.path)}else h||Jw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Vs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(SU),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sE(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const h=this.path[d];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(yU),this.nodes.forEach(Yw);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Zw);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(xU),this.nodes.forEach(wU),this.nodes.forEach(fU),this.nodes.forEach(pU)):this.nodes.forEach(Zw),this.clearAllSnapshots();const l=$t.now();_t.delta=yr(0,1e3/60,l-_t.timestamp),_t.timestamp=l,_t.isProcessing=!0,Of.update.process(_t),Of.preRender.process(_t),Of.render.process(_t),_t.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Yv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(vU),this.sharedNodes.forEach(jU)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ie.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ie.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ft(this.snapshot.measuredBox.x)&&!Ft(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ct()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!eE(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||li(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),TU(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return ct();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(NU))){const{scroll:d}=this.root;d&&(cr(l.x,d.offset.x),cr(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=ct();if(In(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:h,options:f}=d;d!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&In(l,o),cr(l.x,h.offset.x),cr(l.y,h.offset.y))}return l}applyTransform(o,l=!1,c){var d,h;const u=c||ct();In(u,o);for(let f=0;f<this.path.length;f++){const p=this.path[f];!l&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(cr(u.x,-p.scroll.offset.x),cr(u.y,-p.scroll.offset.y)),li(p.latestValues)&&Mu(u,p.latestValues,(d=p.layout)==null?void 0:d.layoutBox)}return li(this.latestValues)&&Mu(u,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),u}removeTransform(o){var c;const l=ct();In(l,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!li(d.latestValues))continue;let h;d.instance&&(Wm(d.latestValues)&&d.updateSnapshot(),h=ct(),In(h,d.measurePageBox())),Vw(l,d.latestValues,(c=d.snapshot)==null?void 0:c.layoutBox,h)}return li(this.latestValues)&&Vw(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==_t.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!this.layout||!(d||h))return;this.resolvedRelativeTargetAt=_t.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ct(),this.targetWithTransforms=ct()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ZV(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):In(this.target,this.layout.layoutBox),BC(this.target,this.targetDelta)):In(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Wm(this.parent.latestValues)||UC(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ct(),this.relativeTargetOrigin=ct(),Rd(this.relativeTargetOrigin,l,c,this.options.layoutAnchor||void 0),In(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var g;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===_t.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;In(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;kV(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=ct());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Iw(this.prevProjectionDelta.x,this.projectionDelta.x),Iw(this.prevProjectionDelta.y,this.projectionDelta.y)),gl(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Ww(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ww(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Po(),this.projectionDelta=Po(),this.projectionDeltaWithTransform=Po()}setAnimationOrigin(o,l=!1,c){const u=this.snapshot,d=u?u.latestValues:{},h={...this.latestValues},f=Po();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=ct(),g=u?u.source:void 0,v=this.layout?this.layout.source:void 0,x=g!==v,b=this.getStack(),w=!b||b.members.length<=1,y=!!(x&&!w&&this.options.crossfade===!0&&!this.path.some(CU));this.animationProgress=0;let _;const j=c==null?void 0:c.interpolateProjection(o);this.mixTargetDelta=C=>{const k=C/1e3,S=j==null?void 0:j(k);S?(f.x.translate=S.x,f.x.scale=Oe(o.x.scale,1,k),f.x.origin=o.x.origin,f.x.originPoint=o.x.originPoint,f.y.translate=S.y,f.y.scale=Oe(o.y.scale,1,k),f.y.origin=o.y.origin,f.y.originPoint=o.y.originPoint):(Qw(f.x,o.x,k),Qw(f.y,o.y,k)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Rd(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),kU(this.relativeTarget,this.relativeTargetOrigin,p,k),_&&eU(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=ct()),In(_,this.relativeTarget)),x&&(this.animationValues=h,rU(h,d,this.latestValues,k,y,w)),S&&S.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=S.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Vs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ie.update(()=>{Lu.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ua(0)),this.motionValue.jump(0,!1),this.currentAnimation=oU(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(dU),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&oE(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||ct();const h=Ft(this.layout.layoutBox.x);
vendor: 1,379 bytes, line 526
526c.x.min=o.target.x.min,c.x.max=c.x.min+h;const f=Ft(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}In(l,c),Mu(l,d),gl(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new uU),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Bf("z",o,u,this.animationValues);for(let d=0;d<Uf.length;
vendor: 4,240 bytes, line 526
526d++)Bf(`rotate${Uf[d]}`,o,u,this.animationValues),Bf(`skew${Uf[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Du(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Du(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!li(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=tU(this.projectionDeltaWithTransform,this.treeScale,d);c&&(h=c(d,h)),o.transform=h;const{x:f,y:p}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const g in Km){if(d[g]===void 0)continue;const{correct:v,applyTo:x,isCSSVariable:b}=Km[g],w=h==="none"?d[g]:v(d[g],u);if(x){const y=x.length;for(let _=0;_<y;_++)o[x[_]]=w}else b?this.options.visualElement.renderState.vars[g]=w:o[g]=w}this.options.layoutId&&(o.pointerEvents=u===this?Du(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(Yw),this.root.sharedNodes.clear()}}}function fU(e){e.updateLayout()}function pU(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;if(i==="size")rr(h=>{const f=o?t.measuredBox[h]:t.layoutBox[h],p=Ft(f);f.min=r[h].min,f.max=f.min+p});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";Gm(o?t.measuredBox[h]:t.layoutBox[h],r[h])}else oE(i,t.layoutBox,r)&&rr(h=>{const f=o?t.measuredBox[h]:t.layoutBox[h],p=Ft(r[h]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+p)});const l=Po();gl(l,r,t.layoutBox);const c=Po();o?gl(c,e.applyTransform(s,!0),t.measuredBox):gl(c,r,t.layoutBox);const u=!eE(l);let d=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:p}=h;if(f&&p){const g=e.options.layoutAnchor||void 0,v=ct();Rd(v,t.layoutBox,f.layoutBox,g);const x=ct();Rd(x,r,p.layoutBox,g),tE(v,x)||(d=!0),h.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=v,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function mU(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function gU(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function vU(e){e.clearSnapshot()}function Yw(e){e.clearMeasurements()}function yU(e){e.isLayoutDirty=!0,e.updateLayout()}function Zw(e){e.isLayoutDirty=!1}function xU(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function wU(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Jw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function bU(e){e.resolveTargetDelta()}function _U(e){e.calcProjection()}
526function SU(e){e.resetSkewAndRotation()}function jU(e){e.removeLeadSnapshot()}function Qw(e,t,n){e.translate=Oe(t.translate,0,n),e.scale=Oe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Xw(e,t,n,r){e.min=Oe(t.min,n.min,r),e.max=Oe(t.max,n.max,r)}function kU(e,t,n,r){Xw(e.x,t.x,n.x,r),Xw(e.y,t.y,n.y,r)}function CU(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const EU={duration:.45,ease:[.4,0,.1,1]},eb=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),tb=eb("applewebkit/")&&!eb("chrome/")?Math.round:_n;function nb(e){e.min=tb(e.min),e.max=tb(e.max)}function TU(e){nb(e.x),nb(e.y)}function oE(e,t,n){return e==="position"||e==="preserve-aspect"&&!YV(Hw(t),Hw(n),.2)}function NU(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const PU=iE({attachResizeListener:(e,t)=>Ql(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),zf={current:void 0},aE=iE({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!zf.current){const e=new PU({});e.mount(window),e.setOptions({layoutScroll:!0}),zf.current=e}return zf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ny=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function rb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function AU(...e){return t=>{let n=!1;const r=e.map(s=>{const i=rb(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():rb(e[s],null)}}}}function RU(...e){return m.useCallback(AU(...e),e)}class OU extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Au(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Au(r)&&r.offsetWidth||0,i=Au(r)&&r.offsetHeight||0,o=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=i-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function IU({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var f;const o=m.useId(),l=m.useRef(null),c=m.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:u}=m.useContext(ny),d=((f=e.props)==null?void 0:f.ref)??(e==null?void 0:e.ref),h=RU(l,d);return m.useInsertionEffect(()=>{const{width:p,height:g,top:v,left:x,right:b,bottom:w,direction:y}=c.current;if(t||i===!1||!l.current||!p||!g)return;const _=y==="rtl",j=n==="left"?_?`right: ${b}`:`left: ${x}`:_?`left: ${x}`:`right: ${b}`,C=r==="bottom"?`bottom: ${w}`:`top: ${v}`;l.current.dataset.motionPopId=o;const k=document.createElement("style");u&&(k.nonce=u);const S=s??document.head;return S.appendChild(k),k.sheet&&k.sheet.insertRule(`
527          [data-motion-pop-id="${o}"] {
528            position: absolute !important;
529            width: ${p}px !important;
530            height: ${g}px !important;
531            ${j}px !important;
532            ${C}px !important;
533          }
534        `),()=>{var P;(P=l.current)==null||P.removeAttribute("data-motion-pop-id"),S.contains(k)&&S.removeChild(k)}},[t]),a.jsx(OU,{isPresent:t,childRef:l,sizeRef:c,pop:i,children:i===!1?e:m.cloneElement(e,{ref:h})})}const MU=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:c,root:u})=>{const d=Ov(DU),h=m.useId();let f=!0,p=m.useMemo(()=>(f=!1,{id:h,initial:t,isPresent:n,custom:s,onExitComplete:g=>{d.set(g,!0);for(const v of d.values())if(!v)return;r&&r()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,r]);return i&&f&&(p={...p}),m.useMemo(()=>{d.forEach((g,v)=>d.set(v,!1))},[n]),m.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=a.jsx(IU,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:c,root:u,children:e}),a.jsx(jh.Provider,{value:p,children:e})};function DU(){return new Map}function lE(e=!0){const t=m.useContext(jh);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=m.useId();m.useEffect(()=>{if(e)return s(i)},[e]);const o=m.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const iu=e=>e.key||"";
vendor: 5,273 bytes, line 534
534function sb(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const LU=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[d,h]=lE(o),f=m.useMemo(()=>sb(e),[e]),p=o&&!d?[]:f.map(iu),g=m.useRef(!0),v=m.useRef(f),x=Ov(()=>new Map),b=m.useRef(new Set),[w,y]=m.useState(f),[_,j]=m.useState(f);Dk(()=>{g.current=!1,v.current=f;for(let S=0;S<_.length;S++){const P=iu(_[S]);p.includes(P)?(x.delete(P),b.current.delete(P)):x.get(P)!==!0&&x.set(P,!1)}},[_,p.length,p.join("-")]);const C=[];if(f!==w){let S=[...f];for(let P=0;P<_.length;P++){const E=_[P],I=iu(E);p.includes(I)||(S.splice(P,0,E),C.push(E))}return i==="wait"&&C.length&&(S=C),j(sb(S)),y(f),null}const{forceRender:k}=m.useContext(Rv);return a.jsx(a.Fragment,{children:_.map(S=>{const P=iu(S),E=o&&!d?!1:f===_||p.includes(P),I=()=>{if(b.current.has(P))return;if(x.has(P))b.current.add(P),x.set(P,!0);else return;let R=!0;x.forEach($=>{$||(R=!1)}),R&&(k==null||k(),j(v.current),o&&(h==null||h()),r&&r())};return a.jsx(MU,{isPresent:E,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:u,onExitComplete:E?void 0:I,anchorX:l,anchorY:c,children:S},P)})})},cE=m.createContext({strict:!1}),ib={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let ob=!1;function $U(){if(ob)return;const e={};for(const t in ib)e[t]={isEnabled:n=>ib[t].some(r=>!!n[r])};$C(e),ob=!0}function uE(){return $U(),bV()}function FU(e){const t=uE();for(const n in e)t[n]={...t[n],...e[n]};$C(t)}const VU=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Od(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||VU.has(e)}let dE=e=>!Od(e);function UU(e){typeof e=="function"&&(dE=t=>t.startsWith("on")?!Od(t):e(t))}try{UU(require("@emotion/is-prop-valid").default)}catch{}function BU(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||St(e[s])||(dE(s)||n===!0&&Od(s)||!t&&!Od(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Nh=m.createContext({});function zU(e,t){if(Th(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Jl(n)?n:void 0,animate:Jl(r)?r:void 0}}return e.inherit!==!1?t:{}}function HU(e){const{initial:t,animate:n}=zU(e,m.useContext(Nh));return m.useMemo(()=>({initial:t,animate:n}),[ab(t),ab(n)])}function ab(e){return Array.isArray(e)?e.join(" "):e}const ry=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function hE(e,t,n){for(const r in t)!St(t[r])&&!WC(r,n)&&(e[r]=t[r])}function WU({transformTemplate:e},t){return m.useMemo(()=>{const n=ry();return ey(n,t,e),Object.assign({},n.vars,n.style)},[t])}function qU(e,t){const n=e.style||{},r={};return hE(r,n,e),Object.assign(r,WU(e,t)),r}function KU(e,t){const n={},r=qU(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const fE=()=>({...ry(),attrs:{}});function GU(e,t,n,r){const s=m.useMemo(()=>{const i=fE();return qC(i,t,GC(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};hE(i,e.style,e),s.style={...i,...s.style}}return s}const YU=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function sy(e){return typeof e!="string"||e.includes("-")?!1:!!(YU.indexOf(e)>-1||/[A-Z]/u.test(e))}function ZU(e,t,n,{latestValues:r},s,i=!1,o){const c=(o??sy(e)?GU:KU)(t,r,s,e),u=BU(t,typeof e=="string",i),d=e!==m.Fragment?{...u,...c,ref:n}:{},{children:h}=t,f=m.useMemo(()=>St(h)?h.get():h,[h]);return m.createElement(e,{...d,children:f})}function JU({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:QU(n,r,s,e),renderState:t()}}function QU(e,t,n,r){const s={},i=r(e,{});for(const f in i)s[f]=Du(i[f]);let{initial:o,animate:l}=e;const c=Th(e),u=DC(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const h=d?l:o;if(h&&typeof h!="boolean"&&!Eh(h)){const f=Array.isArray(h)?h:[h];for(let p=0;p<f.length;p++){const g=Kv(e,f[p]);if(g){const{transitionEnd:v,transition:x,...b}=g;
vendor: 22,192 bytes, line 534
534for(const w in b){let y=b[w];if(Array.isArray(y)){const _=d?y.length-1:0;y=y[_]}y!==null&&(s[w]=y)}for(const w in v)s[w]=v[w]}}}return s}const pE=e=>(t,n)=>{const r=m.useContext(Nh),s=m.useContext(jh),i=()=>JU(e,t,r,s);return n?i():Ov(i)},XU=pE({scrapeMotionValuesFromProps:ty,createRenderState:ry}),eB=pE({scrapeMotionValuesFromProps:YC,createRenderState:fE}),tB=Symbol.for("motionComponentSymbol");function nB(e,t,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.useCallback(i=>{var l;i&&((l=e.onMount)==null||l.call(e,i)),t&&(i?t.mount(i):t.unmount());const o=r.current;if(typeof o=="function")if(i){const c=o(i);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[t])}const mE=m.createContext({});function fo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function rB(e,t,n,r,s,i){var y,_;const{visualElement:o}=m.useContext(Nh),l=m.useContext(cE),c=m.useContext(jh),u=m.useContext(ny),d=u.reducedMotion,h=u.skipAnimations,f=m.useRef(null),p=m.useRef(!1);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:h,isSVG:i}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const g=f.current,v=m.useContext(mE);g&&!g.projection&&s&&(g.type==="html"||g.type==="svg")&&sB(f.current,n,s,v);const x=m.useRef(!1);m.useInsertionEffect(()=>{g&&x.current&&g.update(n,c)});const b=n[jC],w=m.useRef(!!b&&typeof window<"u"&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,b))&&((_=window.MotionHasOptimisedAnimation)==null?void 0:_.call(window,b)));return Dk(()=>{p.current=!0,g&&(x.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),w.current&&g.animationState&&g.animationState.animateChanges())}),m.useEffect(()=>{g&&(!w.current&&g.animationState&&g.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var j;(j=window.MotionHandoffMarkAsComplete)==null||j.call(window,b)}),w.current=!1),g.enteringChildren=void 0)}),g}function sB(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:gE(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&fo(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function gE(e){if(e)return e.options.allowProjection!==!1?e.projection:gE(e.parent)}function Hf(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&FU(r);const i=n?n==="svg":sy(e),o=i?eB:XU;function l(u,d){let h;const f={...m.useContext(ny),...u,layoutId:iB(u)},{isStatic:p}=f,g=HU(u),v=o(u,p);if(!p&&typeof window<"u"){oB();const x=aB(f);h=x.MeasureLayout,g.visualElement=rB(e,v,f,s,x.ProjectionNode,i)}return a.jsxs(Nh.Provider,{value:g,children:[h&&g.visualElement?a.jsx(h,{visualElement:g.visualElement,...f}):null,ZU(e,u,nB(v,g.visualElement,d),v,p,t,i)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=m.forwardRef(l);return c[tB]=e,c}function iB({layoutId:e}){const t=m.useContext(Rv).id;return t&&e!==void 0?t+"-"+e:e}function oB(e,t){m.useContext(cE).strict}function aB(e){const t=uE(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function lB(e,t){if(typeof Proxy>"u")return Hf;const n=new Map,r=(i,o)=>Hf(i,o,e,t),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Hf(o,void 0,e,t)),n.get(o))})}const cB=(e,t)=>t.isSVG??sy(e)?new $V(t):new RV(t,{allowProjection:e!==m.Fragment});class uB extends Ys{constructor(t){super(t),t.animationState||(t.animationState=zV(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Eh(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let dB=0;class hB extends Ys{constructor(){super(...arguments),this.id=dB++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const c=ji(this.node,o,l);if(c){const{transition:u,transitionEnd:d,...h}=c;for(const f in h)(i=this.node.getValue(f))==null||i.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const fB={animation:{Feature:uB},exit:{Feature:hB}};function _c(e){return{point:{x:e.pageX,y:e.pageY}}}const pB=e=>t=>Zv(t)&&e(t,_c(t));function vl(e,t,n,r){return Ql(e,t,pB(n),r)}const vE=({current:e})=>e?e.ownerDocument.defaultView:null,lb=(e,t)=>Math.abs(e-t);function mB(e,t){const n=lb(e.x,t.x),r=lb(e.y,t.y);return Math.sqrt(n**2+r**2)}const cb=new Set(["auto","scroll"]);class yE{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ou(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Wf(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,v=mB(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!v)return;const{point:x}=p,{timestamp:b}=_t;this.history.push({...x,timestamp:b});const{onStart:w,onMove:y}=this.handlers;g||(w&&w(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,p)},this.handlePointerMove=(p,g)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=ou(g,this.transformPagePoint),Ie.update(this.updatePoint,!0)},this.handlePointerUp=(p,g)=>{this.end();const{onEnd:v,onSessionEnd:x,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Wf(p.type==="pointercancel"?this.lastMoveEventInfo:ou(g,this.transformPagePoint),this.history);this.startEvent&&v&&v(p,w),x&&x(p,w)},!Zv(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const c=_c(t),u=ou(c,this.transformPagePoint),{point:d}=u,{timestamp:h}=_t;this.history=[{...d,timestamp:h}];const{onSessionStart:f}=n;f&&f(t,Wf(u,this.history)),this.removeListeners=xc(vl(this.contextWindow,"pointermove",this.handlePointerMove),vl(this.contextWindow,"pointerup",this.handlePointerUp),vl(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(cb.has(r.overflowX)||cb.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),Ie.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Vs(this.updatePoint)}}function ou(e,t){return t?{point:t(e.point)}:e}function ub(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Wf({point:e},t){return{point:e,delta:ub(e,xE(t)),offset:ub(e,gB(t)),velocity:vB(t,.1)}}function gB(e){return e[0]}function xE(e){return e[e.length-1]}function vB(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=xE(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Xt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Xt(t)*2&&(r=e[1]);const i=wn(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function yB(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Oe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Oe(n,e,r.max):Math.min(e,n)),e}function db(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function xB(e,{top:t,left:n,bottom:r,right:s}){return{x:db(e.x,n,s),y:db(e.y,t,r)}}function hb(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function wB(e,t){return{x:hb(e.x,t.x),y:hb(e.y,t.y)}}function bB(e,t){let n=.5;const r=Ft(e),s=Ft(t);return s>r?n=Yl(t.min,t.max-r,e.min):r>s&&(n=Yl(e.min,e.max-s,t.min)),yr(0,1,n)}function _B(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ym=.35;function SB(e=Ym){return e===!1?e=0:e===!0&&(e=Ym),{x:fb(e,"left","right"),y:fb(e,"top","bottom")}}function fb(e,t,n){return{min:pb(e,t),max:pb(e,n)}}function pb(e,t){return typeof e=="number"?e:e[t]||0}const jB=new WeakMap;class kB{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ct(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=h=>{n&&this.snapToCursor(_c(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:p,dragPropagation:g,onDragStart:v}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=JF(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rr(b=>{let w=this.getAxisMotionValue(b).get()||0;if(pr.test(w)){const{projection:y}=this.visualElement;if(y&&y.layout){const _=y.layout.layoutBox[b];_&&(w=Ft(_)*(parseFloat(w)/100))}}this.originPoint[b]=w}),v&&Ie.update(()=>v(h,f),!1,!0),Fm(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:v,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=f;if(g&&this.currentDirection===null){this.currentDirection=EB(b),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),x&&Ie.update(()=>x(h,f),!1,!0)},c=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new yE(t,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:vE(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Ie.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!au(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=yB(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&fo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=xB(r.layoutBox,t):this.constraints=!1,this.elastic=SB(n),s!==this.constraints&&!fo(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&rr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=_B(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!fo(t))return!1;const r=t.current;la(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=CV(r,s.root,this.visualElement.getTransformPagePoint());let o=wB(s.layout.layoutBox,i);if(n){const l=n(SV(o));this.hasMutatedConstraints=!!l,l&&(o=VC(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=rr(d=>{if(!au(d,n,this.currentDirection))return;let h=c&&c[d]||{};(o===!0||o===d)&&(h={min:0,max:0});const f=s?200:1e6,p=s?40:1e7,g={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Fm(this.visualElement,t),r.start(qv(t,r,0,n,this.visualElement,!1))}stopAnimation(){rr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){rr(n=>{const{drag:r}=this.getProps();if(!au(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n],c=i.get()||0;i.set(t[n]-Oe(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!fo(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};rr(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=bB({min:c,max:c},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),rr(o=>{if(!au(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Oe(c,u,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;jB.set(this.visualElement,this);const t=this.visualElement.current,n=vl(t,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps(),f=u.target,p=f!==t&&rV(f);d&&h&&!p&&this.start(u)});let r;const s=()=>{const{dragConstraints:u}=this.getProps();fo(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=CB(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ie.read(s);const l=Ql(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(rr(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].translate))}),this.visualElement.render())});return()=>{l(),n(),o(),c&&c(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Ym,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function mb(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function CB(e,t,n){const r=_w(e,mb(n)),s=_w(t,mb(n));return()=>{r(),s()}}function au(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function EB(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class TB extends Ys{constructor(t){super(t),this.removeGroupControls=_n,this.removeListeners=_n,this.controls=new kB(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_n}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const qf=e=>(t,n)=>{e&&Ie.update(()=>e(t,n),!1,!0)};class NB extends Ys{constructor(){super(...arguments),this.removePointerDownListener=_n}onPointerDown(t){this.session=new yE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vE(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:qf(t),onStart:qf(n),onMove:qf(r),onEnd:(i,o)=>{delete this.session,s&&Ie.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=vl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Kf=!1;class PB extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),Kf&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Lu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Kf=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||Ie.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Yv.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Kf=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function wE(e){const[t,n]=lE(),r=m.useContext(Rv);return a.jsx(PB,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(mE),isPresent:t,safeToRemove:n})}const AB={pan:{Feature:NB},drag:{Feature:TB,ProjectionNode:aE,MeasureLayout:wE}};function gb(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Ie.postRender(()=>i(t,_c(t)))}class RB extends Ys{mount(){const{current:t}=this.node;t&&(this.unmount=XF(t,(n,r)=>(gb(this.node,r,"Start"),s=>gb(this.node,s,"End"))))}unmount(){}}class OB extends Ys{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=xc(Ql(this.node.current,"focus",()=>this.onFocus()),Ql(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function vb(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Ie.postRender(()=>i(t,_c(t)))}class IB extends Ys{mount(){const{current:t}=this.node;if(!t)return;
534const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=iV(t,(s,i)=>(vb(this.node,i,"Start"),(o,{success:l})=>vb(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Zm=new WeakMap,Gf=new WeakMap,MB=e=>{const t=Zm.get(e.target);t&&t(e)},DB=e=>{e.forEach(MB)};function LB({root:e,...t}){const n=e||document;Gf.has(n)||Gf.set(n,{});const r=Gf.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(DB,{root:e,...t})),r[s]}function $B(e,t,n){const r=LB(t);return Zm.set(e,n),r.observe(e),()=>{Zm.delete(e),r.unobserve(e)}}const FB={some:0,all:1};class VB extends Ys{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:FB[s]},l=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,i&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),p=d?h:f;p&&p(u)};this.stopObserver=$B(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(UB(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function UB({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const BB={inView:{Feature:VB},tap:{Feature:IB},focus:{Feature:OB},hover:{Feature:RB}},zB={layout:{ProjectionNode:aE,MeasureLayout:wE}},HB={...fB,...BB,...AB,...zB},Ze=lB(HB,cB),iy=oh("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"}}),z=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?WA:"button";return a.jsx(o,{className:de(iy({variant:t,size:n,className:e})),ref:i,...s})});z.displayName="Button";function yb(e,[t,n]){return Math.min(n,Math.max(t,e))}var WB=m.createContext(void 0);function Ph(e){const t=m.useContext(WB);return e||t||"ltr"}var Yf=0;function bE(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xb()),document.body.insertAdjacentElement("beforeend",e[1]??xb()),Yf++,()=>{Yf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Yf--}},[])}function xb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Zf="focusScope.autoFocusOnMount",Jf="focusScope.autoFocusOnUnmount",wb={bubbles:!1,cancelable:!0},qB="FocusScope",oy=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[l,c]=m.useState(null),u=kn(s),d=kn(i),h=m.useRef(null),f=Se(t,v=>c(v)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=function(y){if(p.paused||!l)return;const _=y.target;l.contains(_)?h.current=_:ts(h.current,{select:!0})},x=function(y){if(p.paused||!l)return;const _=y.relatedTarget;_!==null&&(l.contains(_)||ts(h.current,{select:!0}))},b=function(y){if(document.activeElement===document.body)for(const j of y)j.removedNodes.length>0&&ts(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",x);const w=new MutationObserver(b);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),w.disconnect()}}},[r,l,p.paused]),m.useEffect(()=>{if(l){_b.add(p);const v=document.activeElement;if(!l.contains(v)){const b=new CustomEvent(Zf,wb);l.addEventListener(Zf,u),l.dispatchEvent(b),b.defaultPrevented||(KB(QB(_E(l)),{select:!0}),document.activeElement===v&&ts(l))}return()=>{l.removeEventListener(Zf,u),setTimeout(()=>{const b=new CustomEvent(Jf,wb);l.addEventListener(Jf,d),l.dispatchEvent(b),b.defaultPrevented||ts(v??document.body,{select:!0}),l.removeEventListener(Jf,d),_b.remove(p)}
vendor: 4,771 bytes, line 534
534,0)}}},[l,u,d,p]);const g=m.useCallback(v=>{if(!n&&!r||p.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(x&&b){const w=v.currentTarget,[y,_]=GB(w);y&&_?!v.shiftKey&&b===_?(v.preventDefault(),n&&ts(y,{select:!0})):v.shiftKey&&b===y&&(v.preventDefault(),n&&ts(_,{select:!0})):b===w&&v.preventDefault()}},[n,r,p.paused]);return a.jsx(he.div,{tabIndex:-1,...o,ref:f,onKeyDown:g})});oy.displayName=qB;function KB(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ts(r,{select:t}),document.activeElement!==n)return}function GB(e){const t=_E(e),n=bb(t,e),r=bb(t.reverse(),e);return[n,r]}function _E(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function bb(e,t){for(const n of e)if(!YB(n,{upTo:t}))return n}function YB(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ZB(e){return e instanceof HTMLInputElement&&"select"in e}function ts(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ZB(e)&&t&&e.select()}}var _b=JB();function JB(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Sb(e,t),e.unshift(t)},remove(t){var n;e=Sb(e,t),(n=e[0])==null||n.resume()}}}function Sb(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function QB(e){return e.filter(t=>t.tagName!=="A")}function Ah(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var XB=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ro=new WeakMap,lu=new WeakMap,cu={},Qf=0,SE=function(e){return e&&(e.host||SE(e.parentNode))},ez=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=SE(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},tz=function(e,t,n,r){var s=ez(t,Array.isArray(e)?e:[e]);cu[n]||(cu[n]=new WeakMap);var i=cu[n],o=[],l=new Set,c=new Set(s),u=function(h){!h||l.has(h)||(l.add(h),u(h.parentNode))};s.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(f){if(l.has(f))d(f);else try{var p=f.getAttribute(r),g=p!==null&&p!=="false",v=(ro.get(f)||0)+1,x=(i.get(f)||0)+1;ro.set(f,v),i.set(f,x),o.push(f),v===1&&g&&lu.set(f,!0),x===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),l.clear(),Qf++,function(){o.forEach(function(h){var f=ro.get(h)-1,p=i.get(h)-1;ro.set(h,f),i.set(h,p),f||(lu.has(h)||h.removeAttribute(r),lu.delete(h)),p||h.removeAttribute(n)}),Qf--,Qf||(ro=new WeakMap,ro=new WeakMap,lu=new WeakMap,cu={})}},jE=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=XB(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),tz(r,s,n,"aria-hidden")):function(){return null}},dr=function(){return dr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},dr.apply(this,arguments)};function kE(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function nz(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var $u="right-scroll-bar-position",Fu="width-before-scroll-bar",rz="with-scroll-bars-hidden",sz="--removed-body-scroll-bar-size";function Xf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function iz(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var oz=typeof window<"u"?m.useLayoutEffect:m.useEffect,jb=new WeakMap;function az(e,t){var n=iz(null,function(r){return e.forEach(function(s){return Xf(s,r)})});return oz(function(){var r=jb.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;
vendor: 4,196 bytes, lines 534-549
534s.forEach(function(l){i.has(l)||Xf(l,null)}),i.forEach(function(l){s.has(l)||Xf(l,o)})}jb.set(n,e)},[e]),n}function lz(e){return e}function cz(e,t){t===void 0&&(t=lz);var n=[],r=!1,s={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]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var d=o;o=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return s}function uz(e){e===void 0&&(e={});var t=cz(null);return t.options=dr({async:!0,ssr:!1},e),t}var CE=function(e){var t=e.sideCar,n=kE(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,dr({},n))};CE.isSideCarExport=!0;function dz(e,t){return e.useMedium(t),CE}var EE=uz(),ep=function(){},Rh=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:ep,onWheelCapture:ep,onTouchMoveCapture:ep}),s=r[0],i=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noRelative,g=e.noIsolation,v=e.inert,x=e.allowPinchZoom,b=e.as,w=b===void 0?"div":b,y=e.gapMode,_=kE(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,C=az([n,t]),k=dr(dr({},_),s);return m.createElement(m.Fragment,null,d&&m.createElement(j,{sideCar:EE,removeScrollBar:u,shards:h,noRelative:p,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:y}),o?m.cloneElement(m.Children.only(l),dr(dr({},k),{ref:C})):m.createElement(w,dr({},k,{className:c,ref:C}),l))});Rh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Rh.classNames={fullWidth:Fu,zeroRight:$u};var hz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hz();return t&&e.setAttribute("nonce",t),e}function pz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fz())&&(pz(t,n),mz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vz=function(){var e=gz();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},TE=function(){var e=vz(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},yz={left:0,top:0,right:0,gap:0},tp=function(e){return parseInt(e||"",10)||0},xz=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[tp(n),tp(r),tp(s)]},wz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return yz;var t=xz(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},bz=TE(),Vo="data-scroll-locked",_z=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
535  .`.concat(rz,` {
536   overflow: hidden `).concat(r,`;
537   padding-right: `).concat(l,"px ").concat(r,`;
538  }
539  body[`).concat(Vo,`] {
540    overflow: hidden `).concat(r,`;
541    overscroll-behavior: contain;
542    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
543    padding-left: `.concat(s,`px;
544    padding-top: `).concat(i,`px;
545    padding-right: `).concat(o,`px;
546    margin-left:0;
547    margin-top:0;
548    margin-right: `).concat(l,"px ").concat(r,`;
549    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";
549")].filter(Boolean).join(""),`
550  }
551  
552  .`).concat($u,` {
553    right: `).concat(l,"px ").concat(r,`;
554  }
555  
556  .`).concat(Fu,` {
557    margin-right: `).concat(l,"px ").concat(r,`;
558  }
559  
560  .`).concat($u," .").concat($u,` {
561    right: 0 `).concat(r,`;
562  }
563  
564  .`).concat(Fu," .").concat(Fu,` {
565    margin-right: 0 `).concat(r,`;
566  }
567  
568  body[`).concat(Vo,`] {
569    `).concat(sz,": ").concat(l,`px;
570  }
571`)},kb=function(){var e=parseInt(document.body.getAttribute(Vo)||"0",10);return isFinite(e)?e:0},Sz=function(){m.useEffect(function(){return document.body.setAttribute(Vo,(kb()+1).toString()),function(){var e=kb()-1;e<=0?document.body.removeAttribute(Vo):document.body.setAttribute(Vo,e.toString())}},[])},jz=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Sz();var i=m.useMemo(function(){return wz(s)},[s]);return m.createElement(bz,{styles:_z(i,!t,s,n?"":"!important")})},Jm=!1;if(typeof window<"u")try{var uu=Object.defineProperty({},"passive",{get:function(){return Jm=!0,!0}});window.addEventListener("test",uu,uu),window.removeEventListener("test",uu,uu)}catch{Jm=!1}var so=Jm?{passive:!1}:!1,kz=function(e){return e.tagName==="TEXTAREA"},NE=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!kz(e)&&n[t]==="visible")},Cz=function(e){return NE(e,"overflowY")},Ez=function(e){return NE(e,"overflowX")},Cb=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=PE(e,r);if(s){var i=AE(e,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Tz=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Nz=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},PE=function(e,t){return e==="v"?Cz(t):Ez(t)},AE=function(e,t){return e==="v"?Tz(t):Nz(t)},Pz=function(e,t){return e==="h"&&t==="rtl"?-1:1},Az=function(e,t,n,r,s){var i=Pz(e,window.getComputedStyle(t).direction),o=i*r,l=n.target,c=t.contains(l),u=!1,d=o>0,h=0,f=0;do{if(!l)break;var p=AE(e,l),g=p[0],v=p[1],x=p[2],b=v-x-i*g;(g||b)&&PE(e,l)&&(h+=b,f+=g);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(u=!0),u},du=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Eb=function(e){return[e.deltaX,e.deltaY]},Tb=function(e){return e&&"current"in e?e.current:e},Rz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Oz=function(e){return`
572  .block-interactivity-`.concat(e,` {pointer-events: none;}
573  .allow-interactivity-`).concat(e,` {pointer-events: all;}
574`)},Iz=0,io=[];function Mz(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(Iz++)[0],i=m.useState(TE)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var v=nz([e.lockRef.current],(e.shards||[]).map(Tb),!0).filter(Boolean);return v.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),v.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(v,x){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var b=du(v),w=n.current,y="deltaX"in v?v.deltaX:w[0]-b[0],_="deltaY"in v?v.deltaY:w[1]-b[1],j,C=v.target,k=Math.abs(y)>Math.abs(_)?"h":"v";if("touches"in v&&k==="h"&&C.type==="range")return!1;var S=Cb(k,C);if(!S)return!0;if(S?j=k:(j=k==="v"?"h":"v",S=Cb(k,C)),!S)return!1;if(!r.current&&"changedTouches"in v&&(y||_)&&(r.current=j),!j)return!0;var P=r.current||j;return Az(P,x,v,P==="h"?y:_,!0)},[]),c=m.useCallback(function(v){var x=v;if(!(!io.length||io[io.length-1]!==i)){var b="deltaY"in x?Eb(x):du(x),w=t.current.filter(function(j){return j.name===x.type&&(j.target===x.target||x.target===j.shadowParent)&&Rz(j.delta,b)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}
vendor: 4,125 bytes, line 574
574if(!w){var y=(o.current.shards||[]).map(Tb).filter(Boolean).filter(function(j){return j.contains(x.target)}),_=y.length>0?l(x,y[0]):!o.current.noIsolation;_&&x.cancelable&&x.preventDefault()}}},[]),u=m.useCallback(function(v,x,b,w){var y={name:v,delta:x,target:b,should:w,shadowParent:Dz(b)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(_){return _!==y})},1)},[]),d=m.useCallback(function(v){n.current=du(v),r.current=void 0},[]),h=m.useCallback(function(v){u(v.type,Eb(v),v.target,l(v,e.lockRef.current))},[]),f=m.useCallback(function(v){u(v.type,du(v),v.target,l(v,e.lockRef.current))},[]);m.useEffect(function(){return io.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,so),document.addEventListener("touchmove",c,so),document.addEventListener("touchstart",d,so),function(){io=io.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,so),document.removeEventListener("touchmove",c,so),document.removeEventListener("touchstart",d,so)}},[]);var p=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(i,{styles:Oz(s)}):null,p?m.createElement(jz,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Dz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Lz=dz(EE,Mz);var ay=m.forwardRef(function(e,t){return m.createElement(Rh,dr({},e,{ref:t,sideCar:Lz}))});ay.classNames=Rh.classNames;var $z=[" ","Enter","ArrowUp","ArrowDown"],Fz=[" ","Enter"],Ai="Select",[Oh,Ih,Vz]=av(Ai),[Ea,B9]=hn(Ai,[Vz,fh]),Mh=fh(),[Uz,Zs]=Ea(Ai),[Bz,zz]=Ea(Ai),RE=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:f,required:p,form:g}=e,v=Mh(t),[x,b]=m.useState(null),[w,y]=m.useState(null),[_,j]=m.useState(!1),C=Ph(u),[k,S]=Lr({prop:r,defaultProp:s??!1,onChange:i,caller:Ai}),[P,E]=Lr({prop:o,defaultProp:l,onChange:c,caller:Ai}),I=m.useRef(null),R=x?g||!!x.closest("form"):!0,[$,T]=m.useState(new Set),U=Array.from($).map(D=>D.props.value).join(";");return a.jsx(ZM,{...v,children:a.jsxs(Uz,{required:p,scope:t,trigger:x,onTriggerChange:b,valueNode:w,onValueNodeChange:y,valueNodeHasChildren:_,onValueNodeHasChildrenChange:j,contentId:Es(),value:P,onValueChange:E,open:k,onOpenChange:S,dir:C,triggerPointerDownPosRef:I,disabled:f,children:[a.jsx(Oh.Provider,{scope:t,children:a.jsx(Bz,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(D=>{T(A=>new Set(A).add(D))},[]),onNativeOptionRemove:m.useCallback(D=>{T(A=>{const N=new Set(A);return N.delete(D),N})},[]),children:n})}),R?a.jsxs(nT,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:P,onChange:D=>E(D.target.value),disabled:f,form:g,children:[P===void 0?a.jsx("option",{value:""}):null,Array.from($)]},U):null]})})};RE.displayName=Ai;var OE="SelectTrigger",IE=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=Mh(n),o=Zs(OE,n),l=o.disabled||r,c=Se(t,o.onTriggerChange),u=Ih(n),d=m.useRef("touch"),[h,f,p]=sT(v=>{const x=u().filter(y=>!y.disabled),b=x.find(y=>y.value===o.value),w=iT(x,v,b);w!==void 0&&o.onValueChange(w.value)}),g=v=>{l||(o.onOpenChange(!0),p()),v&&(o.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return a.jsx(Dj,{asChild:!0,...i,children:a.jsx(he.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":rT(o.value)?"":void 0,...s,ref:c,onClick:ae(s.onClick,v=>{v.currentTarget.focus(),d.current!=="mouse"&&g(v)}),onPointerDown:ae(s.onPointerDown,v=>{d.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(g(v),v.preventDefault())}),onKeyDown:ae(s.onKeyDown,v=>{const x=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(x&&v.key===" ")&&$z.includes(v.key)&&
vendor: 15,616 bytes, line 574
574(g(),v.preventDefault())})})})});IE.displayName=OE;var ME="SelectValue",DE=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...l}=e,c=Zs(ME,n),{onValueNodeHasChildrenChange:u}=c,d=i!==void 0,h=Se(t,c.onValueNodeChange);return Ct(()=>{u(d)},[u,d]),a.jsx(he.span,{...l,ref:h,style:{pointerEvents:"none"},children:rT(c.value)?a.jsx(a.Fragment,{children:o}):i})});DE.displayName=ME;var Hz="SelectIcon",LE=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(he.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});LE.displayName=Hz;var Wz="SelectPortal",$E=e=>a.jsx(rh,{asChild:!0,...e});$E.displayName=Wz;var Ri="SelectContent",FE=m.forwardRef((e,t)=>{const n=Zs(Ri,e.__scopeSelect),[r,s]=m.useState();if(Ct(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Li.createPortal(a.jsx(VE,{scope:e.__scopeSelect,children:a.jsx(Oh.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(UE,{...e,ref:t})});FE.displayName=Ri;var Ln=10,[VE,Js]=Ea(Ri),qz="SelectContentImpl",Kz=ra("SelectContent.RemoveScroll"),UE=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:v,avoidCollisions:x,...b}=e,w=Zs(Ri,n),[y,_]=m.useState(null),[j,C]=m.useState(null),k=Se(t,Q=>_(Q)),[S,P]=m.useState(null),[E,I]=m.useState(null),R=Ih(n),[$,T]=m.useState(!1),U=m.useRef(!1);m.useEffect(()=>{if(y)return jE(y)},[y]),bE();const D=m.useCallback(Q=>{const[M,...ie]=R().map(we=>we.ref.current),[fe]=ie.slice(-1),pe=document.activeElement;for(const we of Q)if(we===pe||(we==null||we.scrollIntoView({block:"nearest"}),we===M&&j&&(j.scrollTop=0),we===fe&&j&&(j.scrollTop=j.scrollHeight),we==null||we.focus(),document.activeElement!==pe))return},[R,j]),A=m.useCallback(()=>D([S,y]),[D,S,y]);m.useEffect(()=>{$&&A()},[$,A]);const{onOpenChange:N,triggerPointerDownPosRef:O}=w;m.useEffect(()=>{if(y){let Q={x:0,y:0};const M=fe=>{var pe,we;Q={x:Math.abs(Math.round(fe.pageX)-(((pe=O.current)==null?void 0:pe.x)??0)),y:Math.abs(Math.round(fe.pageY)-(((we=O.current)==null?void 0:we.y)??0))}},ie=fe=>{Q.x<=10&&Q.y<=10?fe.preventDefault():y.contains(fe.target)||N(!1),document.removeEventListener("pointermove",M),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",M),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",M),document.removeEventListener("pointerup",ie,{capture:!0})}}},[y,N,O]),m.useEffect(()=>{const Q=()=>N(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[N]);const[V,H]=sT(Q=>{const M=R().filter(pe=>!pe.disabled),ie=M.find(pe=>pe.ref.current===document.activeElement),fe=iT(M,Q,ie);fe&&setTimeout(()=>fe.ref.current.focus())}),Z=m.useCallback((Q,M,ie)=>{const fe=!U.current&&!ie;(w.value!==void 0&&w.value===M||fe)&&(P(Q),fe&&(U.current=!0))},[w.value]),B=m.useCallback(()=>y==null?void 0:y.focus(),[y]),le=m.useCallback((Q,M,ie)=>{const fe=!U.current&&!ie;(w.value!==void 0&&w.value===M||fe)&&I(Q)},[w.value]),Pe=r==="popper"?Qm:BE,Me=Pe===Qm?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:v,avoidCollisions:x}:{};return a.jsx(VE,{scope:n,content:y,viewport:j,onViewportChange:C,itemRefCallback:Z,selectedItem:S,onItemLeave:B,itemTextRefCallback:le,focusSelectedItem:A,selectedItemText:E,position:r,isPositioned:$,searchRef:V,children:a.jsx(ay,{as:Kz,allowPinchZoom:!0,children:a.jsx(oy,{asChild:!0,trapped:w.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:ae(s,Q=>{var M;(M=w.trigger)==null||M.focus({preventScroll:!0}),Q.preventDefault()}),children:a.jsx(dc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:a.jsx(Pe,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Q=>Q.preventDefault(),...b,...Me,onPlaced:()=>T(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ae(b.onKeyDown,Q=>{const M=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!M&&Q.key.length===1&&H(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let fe=R().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const pe=Q.target,we=fe.indexOf(pe);fe=fe.slice(we+1)}setTimeout(()=>D(fe)),Q.preventDefault()}})})})})})})});UE.displayName=qz;var Gz="SelectItemAlignedPosition",BE=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Zs(Ri,n),o=Js(Ri,n),[l,c]=m.useState(null),[u,d]=m.useState(null),h=Se(t,k=>d(k)),f=Ih(n),p=m.useRef(!1),g=m.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:b,focusSelectedItem:w}=o,y=m.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&v&&x&&b){const k=i.trigger.getBoundingClientRect(),S=u.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),E=b.getBoundingClientRect();if(i.dir!=="rtl"){const pe=E.left-S.left,we=P.left-pe,mt=k.left-we,fn=k.width+mt,Qs=Math.max(fn,S.width),qr=window.innerWidth-Ln,Xs=yb(we,[Ln,Math.max(Ln,qr-Qs)]);l.style.minWidth=fn+"px",l.style.left=Xs+"px"}else{const pe=S.right-E.right,we=window.innerWidth-P.right-pe,mt=window.innerWidth-k.right-we,fn=k.width+mt,Qs=Math.max(fn,S.width),qr=window.innerWidth-Ln,Xs=yb(we,[Ln,Math.max(Ln,qr-Qs)]);l.style.minWidth=fn+"px",l.style.right=Xs+"px"}const I=f(),R=window.innerHeight-Ln*2,$=v.scrollHeight,T=window.getComputedStyle(u),U=parseInt(T.borderTopWidth,10),D=parseInt(T.paddingTop,10),A=parseInt(T.borderBottomWidth,10),N=parseInt(T.paddingBottom,10),O=U+D+$+N+A,V=Math.min(x.offsetHeight*5,O),H=window.getComputedStyle(v),Z=parseInt(H.paddingTop,10),B=parseInt(H.paddingBottom,10),le=k.top+k.height/2-Ln,Pe=R-le,Me=x.offsetHeight/2,Q=x.offsetTop+Me,M=U+D+Q,ie=O-M;if(M<=le){const pe=I.length>0&&x===I[I.length-1].ref.current;l.style.bottom="0px";const we=u.clientHeight-v.offsetTop-v.offsetHeight,mt=Math.max(Pe,Me+(pe?B:0)+we+A),fn=M+mt;l.style.height=fn+"px"}else{const pe=I.length>0&&x===I[0].ref.current;l.style.top="0px";const mt=Math.max(le,U+v.offsetTop+(pe?Z:0)+Me)+ie;l.style.height=mt+"px",v.scrollTop=M-le+v.offsetTop}l.style.margin=`${Ln}px 0`,l.style.minHeight=V+"px",l.style.maxHeight=R+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,i.trigger,i.valueNode,l,u,v,x,b,i.dir,r]);Ct(()=>y(),[y]);const[_,j]=m.useState();Ct(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const C=m.useCallback(k=>{k&&g.current===!0&&(y(),w==null||w(),g.current=!1)},[y,w]);return a.jsx(Zz,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:a.jsx(he.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});BE.displayName=Gz;var Yz="SelectPopperPosition",Qm=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ln,...i}=e,o=Mh(n);return a.jsx(Lj,{...o,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.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)"}})});Qm.displayName=Yz;var[Zz,ly]=Ea(Ri,{}),Xm="SelectViewport",zE=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Js(Xm,n),o=ly(Xm,n),l=Se(t,i.onViewportChange),c=m.useRef(0);return a.jsxs(a.Fragment,{children:[a.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}),a.jsx(Oh.Slot,{scope:n,children:a.jsx(he.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ae(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&h){const p=Math.abs(c.current-d.scrollTop);if(p>0){const g=window.innerHeight-Ln*2,v=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),b=Math.max(v,x);if(b<g){const w=b+p,y=Math.min(g,w),_=w-y;h.style.height=y+"px",h.style.bottom==="0px"&&(d.scrollTop=_>0?_:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});zE.displayName=Xm;var HE="SelectGroup",[Jz,Qz]=Ea(HE),Xz=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Es();return a.jsx(Jz,{scope:n,id:s,children:a.jsx(he.div,{role:"group","aria-labelledby":s,...r,ref:t})})});Xz.displayName=HE;var WE="SelectLabel",qE=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Qz(WE,n);return a.jsx(he.div,{id:s.id,...r,ref:t})});qE.displayName=WE;var Id="SelectItem",[e6,KE]=Ea(Id),GE=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,l=Zs(Id,n),c=Js(Id,n),u=l.value===r,[d,h]=m.useState(i??""),[f,p]=m.useState(!1),g=Se(t,w=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,w,r,s)}),v=Es(),x=m.useRef("touch"),b=()=>{s||(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 a.jsx(e6,{scope:n,value:r,disabled:s,textId:v,isSelected:u,onItemTextChange:m.useCallback(w=>{h(y=>y||((w==null?void 0:w.textContent)??"").trim())},[]),children:a.jsx(Oh.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:a.jsx(he.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:g,onFocus:ae(o.onFocus,()=>p(!0)),onBlur:ae(o.onBlur,()=>p(!1)),onClick:ae(o.onClick,()=>{x.current!=="mouse"&&b()}),onPointerUp:ae(o.onPointerUp,()=>{x.current==="mouse"&&b()}),onPointerDown:ae(o.onPointerDown,w=>{x.current=w.pointerType}),onPointerMove:ae(o.onPointerMove,w=>{var y;x.current=w.pointerType,s?(y=c.onItemLeave)==null||y.call(c):x.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ae(o.onPointerLeave,w=>{var y;w.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:ae(o.onKeyDown,w=>{var _;((_=c.searchRef)==null?void 0:_.current)!==""&&w.key===" "||(Fz.includes(w.key)&&b(),w.key===" "&&w.preventDefault())})})})})});GE.displayName=Id;var Qa="SelectItemText",YE=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=Zs(Qa,n),l=Js(Qa,n),c=KE(Qa,n),u=zz(Qa,n),[d,h]=m.useState(null),f=Se(t,b=>h(b),c.onItemTextChange,b=>{var w;return(w=l.itemTextRefCallback)==null?void 0:w.call(l,b,c.value,c.disabled)}),p=d==null?void 0:d.textContent,g=m.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:x}=u;return Ct(()=>(v(g),()=>x(g)),[v,x,g]),a.jsxs(a.Fragment,{children:[a.jsx(he.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Li.createPortal(i.children,o.valueNode):null]})});YE.displayName=Qa;var ZE="SelectItemIndicator",JE=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return KE(ZE,n).isSelected?a.jsx(he.span,{"aria-hidden":!0,...r,ref:t}):null});JE.displayName=ZE;var eg="SelectScrollUpButton",QE=m.forwardRef((e,t)=>{const n=Js(eg,e.__scopeSelect),r=ly(eg,e.__scopeSelect),[s,i]=m.useState(!1),o=Se(t,r.onScrollButtonChange);return Ct(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;i(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?a.jsx(eT,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});QE.displayName=eg;var tg="SelectScrollDownButton",XE=m.forwardRef((e,t)=>{const n=Js(tg,e.__scopeSelect),r=ly(tg,e.__scopeSelect),[s,i]=m.useState(!1),o=Se(t,r.onScrollButtonChange);return Ct(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;i(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?a.jsx(eT,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});XE.displayName=tg;var eT=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Js("SelectScrollButton",n),o=m.useRef(null),l=Ih(n),c=m.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),Ct(()=>{var d;const u=l().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),a.jsx(he.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ae(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:ae(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:ae(s.onPointerLeave,()=>{c()})})}),t6="SelectSeparator",tT=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(he.div,{"aria-hidden":!0,...r,ref:t})});tT.displayName=t6;var ng="SelectArrow",n6=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Mh(n),i=Zs(ng,n),o=Js(ng,n);return i.open&&o.position==="popper"?a.jsx($j,{...s,...r,ref:t}):null});n6.displayName=ng;var r6="SelectBubbleInput",nT=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=m.useRef(null),i=Se(r,s),o=Ah(t);return m.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const h=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(h)}},[o,t]),a.jsx(he.select,{...n,style:{...NS,...n.style},ref:i,defaultValue:t})});nT.displayName=r6;function rT(e){return e===""||e===void 0}function sT(e){const t=kn(e),n=m.useRef(""),r=m.useRef(0),s=m.useCallback(o=>{const l=n.current+o;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function iT(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=s6(e,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function s6(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var i6=RE,oT=IE,o6=DE,a6=LE,l6=$E,aT=FE,c6=zE,lT=qE,cT=GE,u6=YE,d6=JE,uT=QE,dT=XE,hT=tT;const ze=i6,He=o6,Le=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(oT,{ref:r,className:de("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
574ing-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",e),...n,children:[t,a.jsx(a6,{asChild:!0,children:a.jsx(lh,{className:"h-4 w-4 opacity-50"})})]}));Le.displayName=oT.displayName;const fT=m.forwardRef(({className:e,...t},n)=>a.jsx(uT,{ref:n,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(zR,{className:"h-4 w-4"})}));fT.displayName=uT.displayName;const pT=m.forwardRef(({className:e,...t},n)=>a.jsx(dT,{ref:n,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(lh,{className:"h-4 w-4"})}));pT.displayName=dT.displayName;const $e=m.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>a.jsx(l6,{children:a.jsxs(aT,{ref:s,className:de("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",e),position:n,...r,children:[a.jsx(fT,{}),a.jsx(c6,{className:de("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(pT,{})]})}));$e.displayName=aT.displayName;const h6=m.forwardRef(({className:e,...t},n)=>a.jsx(lT,{ref:n,className:de("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));h6.displayName=lT.displayName;const ue=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(cT,{ref:r,className:de("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(d6,{children:a.jsx(Dl,{className:"h-4 w-4"})})}),a.jsx(u6,{children:t})]}));ue.displayName=cT.displayName;const f6=m.forwardRef(({className:e,...t},n)=>a.jsx(hT,{ref:n,className:de("-mx-1 my-1 h-px bg-muted",e),...t}));f6.displayName=hT.displayName;const Nb=()=>{const{language:e,setLanguage:t}=Qn();return a.jsxs(ze,{value:e,onValueChange:n=>t(n),children:[a.jsxs(Le,{className:"w-[90px] h-9 bg-transparent border-border/50 text-sm",children:[a.jsx(tj,{className:"w-4 h-4 mr-1"}),a.jsx(He,{})]}),a.jsxs($e,{children:[a.jsx(ue,{value:"fr",children:"FR"}),a.jsx(ue,{value:"en",children:"EN"})]})]})},Sc="/assets/logo-sIeKae-4.png",p6=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),{t:s}=Qn(),{user:i,signOut:o}=Sh(),l=[{label:s.nav.home,href:"#"},{label:s.nav.services,href:"#services"},{label:s.nav.about,href:"#about"},{label:s.nav.consultants,href:"#consultants"},{label:s.nav.contact,href:"#contact"}];m.useEffect(()=>{const u=()=>{t(window.scrollY>50)};return window.addEventListener("scroll",u),()=>window.removeEventListener("scroll",u)},[]);const c=async()=>{await o()};return a.jsxs("header",{className:`fixed top-0 left-0 right-0 z-50 transition-all duration-300 ${e?"bg-background/90 backdrop-blur-md shadow-lg py-3":"bg-transparent py-6"}`,children:[a.jsx("div",{className:"container px-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("a",{href:"#",className:"flex items-center gap-3",children:a.jsx("img",{src:Sc,alt:"Rich Media Logo",className:"h-10 w-auto"})}),a.jsx("nav",{className:"hidden md:flex items-center gap-8",children:l.map(u=>a.jsx("a",{href:u.href,className:"text-sm font-medium text-muted-foreground hover:text-primary transition-colors",children:u.label},u.label))}),a.jsxs("div",{className:"hidden md:flex items-center gap-4",children:[a.jsx(Nb,{}),i?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Lt,{to:"/dashboard",children:a.jsxs(z,{variant:"ghost",size:"sm",className:"gap-2",children:[a.jsx(Is,{className:"w-4 h-4"}),s.nav.dashboard]})}),a.jsxs(z,{variant:"ghost",size:"sm",onClick:c,className:"gap-2",children:[a.jsx(qx,{className:"w-4 h-4"}),s.nav.logout]})]}):a.jsx(Lt,{to:"/auth",children:a.jsx(z,{variant:"ghost",size:"sm",children:s.nav.login})}),a.jsx(Lt,{to:"/quote",children:a.jsx(z,{className:"bg-gradient-hero text-primary-foreground hover:opacity-90 transition-opacity shadow-lg glow-blue",children:s.nav.getQuote})})]}),a.jsxs("div",{className:"md:hidden flex items-center gap-2",children:[a.jsx(Nb,{}),a.jsx("button",{onClick:()=>r(!n),className:"p-2 text-foreground",children:n?a.jsx(fc,{className:"w-6 h-6"}):a.jsx(uO,{className:"w-6 h-6"})})]})]})}),a.jsx(LU,{children:n&&a.jsx(Ze.div,{initial:{opacity:0,height:0}
574,animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"md:hidden bg-background border-t border-border",children:a.jsxs("nav",{className:"container px-4 py-6 flex flex-col gap-4",children:[l.map(u=>a.jsx("a",{href:u.href,onClick:()=>r(!1),className:"text-lg font-medium text-foreground hover:text-primary transition-colors",children:u.label},u.label)),i?a.jsxs(a.Fragment,{children:[a.jsxs(Lt,{to:"/dashboard",onClick:()=>r(!1),className:"text-lg font-medium text-foreground hover:text-primary transition-colors flex items-center gap-2",children:[a.jsx(Is,{className:"w-5 h-5"}),s.nav.dashboard]}),a.jsxs("button",{onClick:()=>{c(),r(!1)},className:"text-lg font-medium text-foreground hover:text-primary transition-colors flex items-center gap-2 text-left",children:[a.jsx(qx,{className:"w-5 h-5"}),s.nav.logout]})]}):a.jsx(Lt,{to:"/auth",onClick:()=>r(!1),className:"text-lg font-medium text-foreground hover:text-primary transition-colors",children:s.nav.login}),a.jsx(Lt,{to:"/quote",onClick:()=>r(!1),children:a.jsx(z,{className:"mt-4 bg-gradient-hero text-primary-foreground hover:opacity-90 w-full",children:s.nav.getQuote})})]})})})]})},mT={Brain:VR,Cpu:ZR,Sprout:vO,Wallet:EO,Building2:ah,Sun:yO,HeartPulse:nO,TrendingUp:wO,Fingerprint:eO,Truck:_O,Cloud:KR,Shield:pv,Settings:mO,Headphones:tO,Briefcase:hv,RefreshCw:fv,Sparkles:Os,Zap:TO,Globe:tj,Award:QS,Users:ud,Globe2:XS,Lightbulb:nj,Rocket:hO,Star:mv,Target:xO,Lock:lO,Database:JR,Code2:GR,Server:pO,Smartphone:gO},gT=Object.keys(mT).sort(),Ta=e=>e&&mT[e]||Os,m6=["from-primary to-secondary","from-secondary to-accent","from-sky-500 to-blue-400","from-red-500 to-rose-400","from-slate-500 to-gray-400","from-orange-500 to-amber-400","from-indigo-500 to-blue-400","from-teal-500 to-cyan-400","from-green-500 to-emerald-400","from-primary to-orange-400","from-accent to-blue-400","from-yellow-500 to-orange-400","from-rose-500 to-pink-400","from-indigo-500 to-purple-400","from-cyan-500 to-teal-400","from-violet-500 to-purple-400"],g6=()=>{const{t:e,language:t}=Qn(),{metrics:n}=Gs(),r=vc(),s=o=>{const l=document.getElementById(o);l&&l.scrollIntoView({behavior:"smooth"})},i=n.filter(o=>o.is_active).map(o=>({value:o.value,label:t==="fr"?o.label_fr:o.label_en,Icon:Ta(o.icon_name)}));return a.jsxs("section",{className:"relative min-h-screen flex items-center justify-center overflow-hidden bg-background",children:[a.jsx("div",{className:"absolute inset-0 bg-pattern-dots opacity-50"}),a.jsx("div",{className:"absolute top-20 left-10 w-72 h-72 bg-primary/20 rounded-full blur-3xl animate-float"}),a.jsx("div",{className:"absolute bottom-20 right-10 w-96 h-96 bg-secondary/20 rounded-full blur-3xl animate-float",style:{animationDelay:"-3s"}}),a.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-accent/10 rounded-full blur-3xl"}),a.jsx("div",{className:"container relative z-10 px-4 py-20",children:a.jsxs("div",{className:"max-w-5xl mx-auto text-center",children:[a.jsxs(Ze.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-8",children:[a.jsx(Os,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm font-medium text-primary",children:e.hero.badge})]}),a.jsxs(Ze.h1,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.6,delay:.1},className:"text-4xl sm:text-5xl md:text-6xl lg:text-7xl font-bold leading-tight mb-6",children:[a.jsx("span",{className:"text-foreground",children:e.hero.title1}),a.jsx("br",{}),a.jsx("span",{className:"text-gradient-hero",children:e.hero.title2}),a.jsx("br",{}),a.jsx("span",{className:"text-foreground",children:e.hero.title3})]}),a.jsx(Ze.p,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.6,delay:.2},className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto mb-10",children:e.hero.subtitle}),a.jsxs(Ze.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.6,delay:.3},className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[a.jsxs(z,{size:"lg",onClick:()=>r("/quote"),className:"bg-gradient-hero text-primary-foreground hover:opacity-90 transition-opacity shadow-lg glow-blue px-8 py-6 text-lg",children:[e.hero.cta1,a.jsx(Eu,{className:"ml-2 w-5 h-5"})]}),a.jsx(z,{size:"lg",variant:"outline",onClick:()=>
574s("services"),className:"border-2 border-foreground/20 hover:border-primary hover:text-primary transition-colors px-8 py-6 text-lg",children:e.hero.cta2})]}),a.jsx(Ze.div,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{duration:.6,delay:.5},className:"mt-20 grid grid-cols-2 md:grid-cols-4 gap-8",children:i.map((o,l)=>a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-xl bg-primary/10 mb-3",children:a.jsx(o.Icon,{className:"w-6 h-6 text-primary"})}),a.jsx("div",{className:"text-3xl md:text-4xl font-bold text-foreground mb-1",children:o.value}),a.jsx("div",{className:"text-sm text-muted-foreground",children:o.label})]},l))})]})}),a.jsx(Ze.button,{type:"button",onClick:()=>s("services"),"aria-label":"Scroll to services",initial:{opacity:0},animate:{opacity:1},transition:{delay:1,duration:.5},className:"absolute bottom-8 left-1/2 -translate-x-1/2 cursor-pointer group",children:a.jsx("div",{className:"w-6 h-10 rounded-full border-2 border-foreground
574/20 group-hover:border-primary transition-colors flex items-start justify-center p-2",children:a.jsx(Ze.div,{animate:{y:[0,12,0]},transition:{duration:1.5,repeat:1/0},className:"w-1.5 h-1.5 rounded-full bg-primary"})})})]})},v6=()=>{const{t:e,language:t}=Qn(),{services:n}=Gs(),r=n.filter(s=>s.is_active);return a.jsxs("section",{id:"services",className:"py-24 bg-muted/50 relative",children:[a.jsx("div",{className:"absolute inset-0 bg-pattern-grid opacity-30"}),a.jsxs("div",{className:"container relative z-10 px-4",children:[a.jsxs(Ze.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"text-center max-w-3xl mx-auto mb-16",children:[a.jsx("span",{className:"inline-block text-sm font-semibold text-primary uppercase tracking-wider mb-4",children:e.services.badge}),a.jsxs("h2",{className:"text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-6",children:[e.services.title,a.jsx("span",{className:"text-gradient-hero",children:e.services.titleHighlight})]}),a.jsx("p",{className:"text-lg text-muted-foreground",children:e.services.subtitle})]}),a.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-6",children:r.map((s,i)=>{const o=Ta(s.icon_name),l=t==="fr"?s.title_fr:s.title_en,c=t==="fr"?s.description_fr:s.description_en;return a.jsxs(Ze.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:i*.05},className:"group relative bg-card rounded-2xl p-6 shadow-card hover:shadow-elevated transition-all duration-300 border border-border/50 hover:border-primary/30",children:[a.jsx("div",{className:`w-14 h-14 rounded-xl bg-gradient-to-br ${s.color_gradient} flex items-center justify-center mb-5 group-hover:scale-110 transition-transform duration-300`,children:a.jsx(o,{className:"w-7 h-7 text-white"})}),a.jsx("h3",{className:"text-lg font-semibold text-foreground mb-3 group-hover:text-primary transition-colors",children:l}),a.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:c}),a.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-gradient-to-r opacity-0 group-hover:opacity-100 transition-opacity duration-300 rounded-b-2xl overflow-hidden",children:a.jsx("div",{className:`w-full h-full bg-gradient-to-r ${s.color_gradient}`})})]},s.id)})})]})]})},y6=[{key:"excellence",icon:QS},{key:"proximity",icon:ud},{key:"vision",icon:XS},{key:"innovation",icon:nj}],x6=()=>{const{t:e,language:t}=Qn(),{story:n}=Gs(),r=(f,p)=>t==="fr"?f:p,s=n?r(n.badge_fr,n.badge_en):e.about.badge,i=n?r(n.title1_fr,n.title1_en):e.about.title1,o=n?r(n.title_highlight_fr,n.title_highlight_en):e.about.titleHighlight,l=n?r(n.title2_fr,n.title2_en):e.about.title2,c=n?r(n.paragraph1_fr,n.paragraph1_en):e.about.paragraph1,u=n?r(n.paragraph2_fr,n.paragraph2_en):e.about.paragraph2,d=n?r(n.paragraph3_fr,n.paragraph3_en):e.about.paragraph3,h=n?r(n.since_fr,n.since_en):e.about.since;return a.jsxs("section",{id:"about",className:"py-24 bg-background relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 right-0 w-1/2 h-full bg-gradient-to-l from-primary/5 to-transparent"}),a.jsx("div",{className:"container relative z-10 px-4",children:a.jsxs("div",{className:"grid lg:grid-cols-2 gap-16 items-center",children:[a.jsxs(Ze.div,{initial:{opacity:0,x:-30},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.6},children:[a.jsx("span",{className:"inline-block text-sm font-semibold text-primary uppercase tracking-wider mb-4",children:s}),a.jsxs("h2",{className:"text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-6",children:[i,a.jsx("span",{className:"text-gradient-hero",children:o}),l]}),a.jsxs("div",{className:"space-y-6 text-muted-foreground",children:[a.jsx("p",{className:"text-lg",dangerouslySetInnerHTML:{__html:c}}),a.jsx("p",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("p",{children:d})]}),a.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[a.jsx("div",{className:"flex-1 h-px bg-gradient-to-r from-primary to-secondary"}),a.jsx("span",{className:"text-sm font-semibold text-primary",children:h}),a.jsx("div",{className:"flex-1 h-px bg-gradient-to-l from-primary to-secondary"})]})]}),a.jsx(Ze.div,{initial:{opacity:0,x:30},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.6,delay:.2},className:"grid sm:grid-cols-2 gap-6",children:y6.map((f,p)=>{const g=e.about.values[f.key];return a.jsxs(Ze.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:.3+p*.1},className:"bg-card rounded-2xl p-6 border border-border/50 shadow-card hover:shadow-elevated transition-shadow",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-hero flex items-center justify-center mb-4",children:a.jsx(f.icon,{className:"w-6 h-6 text-primary-foreground"})}),a.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:g==null?void 0:g.title}),a.jsx("p",{className:"text-sm text-muted-foreground",children:g==null?void 0:g.description})]},f.key)})})]})})]})},w6=()=>{const{t:e}=Qn(),{user:t,userRole:n}=Sh(),[r,s]=m.useState([]),[i,o]=m.useState(!0);return m.useEffect(()=>{(async()=>{o(!0);const{data:c,error:u}=await W.from("public_consultants").select("*").order("is_featured",{ascending:!1}).limit(4);c&&s(c),u&&console.error("Error fetching consultants:",u),o(!1)})()},[]),a.jsxs("section",{id:"consultants",className:"py-24 bg-muted/30 relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 left-0 w-1/3 h-full bg-gradient-to-r from-primary/5 to-transparent"}),a.jsxs("div",{className:"container relative z-10 px-4",children:[a.jsxs(Ze.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"text-center max-w-3xl mx-auto mb-16",children:[a.jsx("span",{className:"inline-block text-sm font-semibold text-primary uppercase tracking-wider mb-4",children:e.consultants.badge}),a.jsxs("h2",{className:"text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-6",children:[e.consultants.title,a.jsx("span",{className:"text-gradient-hero",children:e.consultants.titleHighlight})]}),a.jsx("p",{className:"text-lg text-muted-foreground",children:e.consultants.subtitle})]}),i?a.jsx("div",{className:"flex justify-center",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):r.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx("p",{className:"text-muted-foreground mb-6",children:e.consultants.noConsultants}),a.jsx(Lt,{to:"/auth",children:a.jsxs(z,{variant:"outline",children:[e.consultants.becomeConsultant,a.jsx(Eu,{className:"w-4 h-4 ml-2"})]})})]}):a.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-6 mb-12",children:r.map((l,c)=>
574a.jsx(Ze.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:c*.1},className:"group",children:a.jsxs("div",{className:"bg-card rounded-2xl overflow-hidden border border-border/50 shadow-card hover:shadow-elevated transition-all duration-300",children:[a.jsxs("div",{className:"aspect-square bg-muted relative overflow-hidden",children:[l.photo_url?a.jsx("img",{src:l.photo_url,alt:l.full_name,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/10 to-secondary/10",children:a.jsx(Is,{className:"w-20 h-20 text-muted-foreground/50"})}),l.is_featured&&a.jsxs("div",{className:"absolute top-3 right-3 bg-primary text-primary-foreground text-xs px-3 py-1 rounded-full flex items-center gap-1",children:[a.jsx(mv,{className:"w-3 h-3"}),e.consultants.featured]})]}),a.jsxs("div",{className:"p-5",children:[a.jsx("h3",{className:"font-semibold text-lg text-foreground group-hover:text-primary transition-colors",children:l.full_name}),a.jsx("p",{className:"text-primary text-sm font-medium mb-2",children:l.expertise}),l.experience_years>0&&a.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:[l.experience_years," ",e.consultants.yearsExp]}),l.bio&&a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:l.bio})]})]})},l.id))}),a.jsx(Ze.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:.4},className:"text-center",children:t&&n==="hiring_professional"?a.jsx(Lt,{to:"/dashboard",children:a.jsxs(z,{size:"lg",className:"gap-2",children:[e.consultants.viewAll,a.jsx(Eu,{className:"w-4 h-4"})]})}):t?null:a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-muted-foreground",children:e.consultants.loginToView}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[a.jsx(Lt,{to:"/auth",children:a.jsxs(z,{size:"lg",className:"gap-2",children:[e.nav.login,a.jsx(Eu,{className:"w-4 h-4"})]})}),a.jsx(Lt,{to:"/auth",children:a.jsx(z,{size:"lg",variant:"outline",className:"gap-2",children:e.consultants.becomeConsultant})})]})]})})]})]})},J=m.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:de("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",e),ref:r,...n}));J.displayName="Input";const rt=m.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:de("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
574ing-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",e),ref:n,...t}));rt.displayName="Textarea";const b6=()=>{const{t:e}=Qn(),[t,n]=m.useState({name:"",email:"",company:"",message:""}),r=i=>{i.preventDefault(),bS({title:e.contact.toast.title,description:e.contact.toast.description}),n({name:"",email:"",company:"",message:""})},s=[{icon:cO,label:e.contact.address,value:"Ouagadougou, Burkina Faso"},{icon:ya,label:e.contact.email,value:"[email protected]"},{icon:ij,label:e.contact.phone,value:"+226 78 80 10 80"}];return a.jsxs("section",{id:"contact",className:"py-24 bg-gradient-tech text-primary-foreground relative overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 bg-pattern-dots opacity-10"}),a.jsx("div",{className:"absolute top-0 left-0 w-96 h-96 bg-primary/20 rounded-full blur-3xl"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-96 h-96 bg-secondary/20 rounded-full blur-3xl"}),a.jsx("div",{className:"container relative z-10 px-4",children:a.jsxs("div",{className:"grid lg:grid-cols-2 gap-16",children:[a.jsxs(Ze.div,{initial:{opacity:0,x:-30},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.6},children:[a.jsx("span",{className:"inline-block text-sm font-semibold text-secondary uppercase tracking-wider mb-4",children:e.contact.badge}),a.jsxs("h2",{className:"text-3xl md:text-4xl lg:text-5xl font-bold mb-6",children:[e.contact.title1,a.jsx("span",{className:"text-gradient-hero",children:e.contact.titleHighlight}),a.jsx("br",{}),e.contact.title2]}),a.jsx("p",{className:"text-lg text-primary-foreground/70 mb-10",children:e.contact.subtitle}),a.jsx("div",{className:"space-y-6",children:s.map(i=>a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/20 flex items-center justify-center",children:a.jsx(i.icon,{className:"w-5 h-5 text-primary"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm text-primary-foreground/50",children:i.label}),a.jsx("div",{className:"font-medium",children:i.value})]})]},i.label))})]}),a.jsx(Ze.div,{initial:{opacity:0,x:30},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.6,delay:.2},children:a.jsxs("form",{onSubmit:r,className:"bg-card/10 backdrop-blur-sm rounded-2xl p-8 border border-primary-foreground/10",children:[a.jsxs("div",{className:"grid sm:grid-cols-2 gap-4 mb-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium mb-2 text-primary-foreground/70",children:e.contact.form.fullName}),a.jsx(J,{value:t.name,onChange:i=>n({...t,name:i.target.value}),placeholder:e.contact.form.namePlaceholder,className:"bg-primary-foreground/10 border-primary-foreground/20 text-primary-foreground placeholder:text-primary-foreground/40",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium mb-2 text-primary-foreground/70",children:e.contact.form.email}),a.jsx(J,{type:"email",value:t.email,onChange:i=>n({...t,email:i.target.value}),placeholder:e.contact.form.emailPlaceholder,className:"bg-primary-foreground/10 border-primary-foreground/20 text-primary-foreground placeholder:text-primary-foreground/40",required:!0})]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium mb-2 text-primary-foreground/70",children:e.contact.form.company}),a.jsx(J,{value:t.company,onChange:i=>n({...t,company:i.target.value}),placeholder:e.contact.form.companyPlaceholder,className:"bg-primary-foreground/10 border-primary-foreground/20 text-primary-foreground placeholder:text-primary-foreground/40"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-sm font-medium mb-2 text-primary-foreground/70",children:e.contact.form.project}),a.jsx(rt,{value:t.message,onChange:i=>n({...t,message:i.target.value}),placeholder:e.contact.form.projectPlaceholder,rows:4,className:"bg-primary-foreground/10 border-primary-foreground
574/20 text-primary-foreground placeholder:text-primary-foreground/40 resize-none",required:!0})]}),a.jsxs(z,{type:"submit",size:"lg",className:"w-full bg-gradient-hero text-primary-foreground hover:opacity-90 transition-opacity",children:[e.contact.form.submit,a.jsx(sa,{className:"ml-2 w-5 h-5"})]})]})})]})})]})},_6=()=>{var n,r,s,i;const e=new Date().getFullYear(),{t}=Qn();return a.jsx("footer",{className:"bg-charcoal text-primary-foreground py-16",children:a.jsxs("div",{className:"container px-4",children:[a.jsxs("div",{className:"grid md:grid-cols-4 gap-12 mb-12",children:[a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("div",{className:"flex items-center gap-3 mb-4",children:a.jsx("img",{src:Sc,alt:"Rich Media Logo",className:"h-12 w-auto"})}),a.jsx("p",{className:"text-primary-foreground/60 max-w-md mb-6",children:t.footer.description}),a.jsx("div",{className:"flex gap-4",children:[{Icon:oO,href:"https://www.linkedin.com/company/richmedia-bf",label:"LinkedIn"},{Icon:SO,href:"#",label:"Twitter"},{Icon:QR,href:"#",label:"Facebook"},{Icon:sO,href:"#",label:"Instagram"}].map(({Icon:o,href:l,label:c})=>a.jsx("a",{href:l,target:l.startsWith("http")?"_blank":void 0,rel:l.startsWith("http")?"noopener noreferrer":void 0,"aria-label":c,className:"w-10 h-10 rounded-xl bg-primary-foreground/10 flex items-center justify-center hover:bg-primary/20 transition-colors",children:a.jsx(o,{className:"w-5 h-5"})},c))})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold mb-4",children:t.footer.services}),a.jsxs("ul",{className:"space-y-3 text-primary-foreground/60",children:[a.jsx("li",{children:a.jsx("a",{href:"#services",className:"hover:text-primary transition-colors",children:(n=t.services.items.ai)==null?void 0:n.title})}),a.jsx("li",{children:a.jsx("a",{href:"#services",className:"hover:text-primary transition-colors",children:(r=t.services.items.rpa)==null?void 0:r.title})}),a.jsx("li",{children:a.jsx("a",{href:"#services",className:"hover:text-primary transition-colors",children:(s=t.services.items.agritech)==null?void 0:s.title})}),a.jsx("li",{children:a.jsx("a",{href:"#services",className:"hover:text-primary transition-colors",children:(i=t.services.items.fintech)==null?void 0:i.title})})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold mb-4",children:t.footer.company}),a.jsxs("ul",{className:"space-y-3 text-primary-foreground/60",children:[a.jsx("li",{children:a.jsx("a",{href:"#about",className:"hover:text-primary transition-colors",children:t.footer.about})}),a.jsx("li",{children:a.jsx("a",{href:"#contact",className:"hover:text-primary transition-colors",children:t.footer.contact})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"hover:text-primary transition-colors",children:t.footer.careers})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"hover:text-primary transition-colors",children:t.footer.blog})})]})]})]}),a.jsxs("div",{className:"pt-8 border-t border-primary-foreground/10 flex flex-col md:flex-row items-center justify-between gap-4",children:[a.jsxs("p",{className:"text-sm text-primary-foreground/50",children:["© ",e," Rich Media. ",t.footer.rights]}),a.jsxs("div",{className:"flex gap-6 text-sm text-primary-foreground/50",children:[a.jsx("a",{href:"#",className:"hover:text-primary transition-colors",children:t.footer.legal}),a.jsx("a",{href:"#",className:"hover:text-primary transition-colors",children:t.footer.privacy})]})]})]})})},S6=()=>a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx(p6,{}),a.jsxs("main",{children:[a.jsx(g6,{}),a.jsx(v6,{}),a.jsx(x6,{}),a.jsx(w6,{}),a.jsx(b6,{})]}),a.jsx(_6,{})]});var j6="Label",vT=m.forwardRef((e,t)=>a.jsx(he.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));vT.displayName=j6;var yT=vT;
vendor: 3,048 bytes, line 574
574const k6=oh("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),L=m.forwardRef(({className:e,...t},n)=>a.jsx(yT,{ref:n,className:de(k6(),e),...t}));L.displayName=yT.displayName;const Te=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:de("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Te.displayName="Card";const Us=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:de("flex flex-col space-y-1.5 p-6",e),...t}));Us.displayName="CardHeader";const Bs=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:de("text-2xl font-semibold leading-none tracking-tight",e),...t}));Bs.displayName="CardTitle";const xT=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:de("text-sm text-muted-foreground",e),...t}));xT.displayName="CardDescription";const Ne=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:de("p-6 pt-0",e),...t}));Ne.displayName="CardContent";const C6=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:de("flex items-center p-6 pt-0",e),...t}));C6.displayName="CardFooter";var np="rovingFocusGroup.onEntryFocus",E6={bubbles:!1,cancelable:!0},jc="RovingFocusGroup",[rg,wT,T6]=av(jc),[N6,Dh]=hn(jc,[T6]),[P6,A6]=N6(jc),bT=m.forwardRef((e,t)=>a.jsx(rg.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(rg.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(R6,{...e,ref:t})})}));bT.displayName=jc;var R6=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,f=m.useRef(null),p=Se(t,f),g=Ph(i),[v,x]=Lr({prop:o,defaultProp:l??null,onChange:c,caller:jc}),[b,w]=m.useState(!1),y=kn(u),_=wT(n),j=m.useRef(!1),[C,k]=m.useState(0);return m.useEffect(()=>{const S=f.current;if(S)return S.addEventListener(np,y),()=>S.removeEventListener(np,y)},[y]),a.jsx(P6,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:v,onItemFocus:m.useCallback(S=>x(S),[x]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(S=>S+1),[]),onFocusableItemRemove:m.useCallback(()=>k(S=>S-1),[]),children:a.jsx(he.div,{tabIndex:b||C===0?-1:0,"data-orientation":r,...h,ref:p,style:{outline:"none",...e.style},onMouseDown:ae(e.onMouseDown,()=>{j.current=!0}),onFocus:ae(e.onFocus,S=>{const P=!j.current;if(S.target===S.currentTarget&&P&&!b){const E=new CustomEvent(np,E6);if(S.currentTarget.dispatchEvent(E),!E.defaultPrevented){const I=_().filter(D=>D.focusable),R=I.find(D=>D.active),$=I.find(D=>D.id===v),U=[R,$,...I].filter(Boolean).map(D=>D.ref.current);jT(U,d)}}j.current=!1}),onBlur:ae(e.onBlur,()=>w(!1))})})}),_T="RovingFocusGroupItem",ST=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:o,...l}=e,c=Es(),u=i||c,d=A6(_T,n),h=d.currentTabStopId===u,f=wT(n),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:v}=d;return m.useEffect(()=>{if(r)return p(),()=>g()}
vendor: 4,519 bytes, line 574
574,[r,p,g]),a.jsx(rg.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:a.jsx(he.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:ae(e.onMouseDown,x=>{r?d.onItemFocus(u):x.preventDefault()}),onFocus:ae(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:ae(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){d.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const b=M6(x,d.orientation,d.dir);if(b!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let y=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const _=y.indexOf(x.currentTarget);y=d.loop?D6(y,_+1):y.slice(_+1)}setTimeout(()=>jT(y))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:v!=null}):o})})});ST.displayName=_T;var O6={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function I6(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function M6(e,t,n){const r=I6(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return O6[r]}function jT(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function D6(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kT=bT,CT=ST,Lh="Tabs",[L6,z9]=hn(Lh,[Dh]),ET=Dh(),[$6,cy]=L6(Lh),TT=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=Ph(l),[h,f]=Lr({prop:r,onChange:s,defaultProp:i??"",caller:Lh});return a.jsx($6,{scope:n,baseId:Es(),value:h,onValueChange:f,orientation:o,dir:d,activationMode:c,children:a.jsx(he.div,{dir:d,"data-orientation":o,...u,ref:t})})});TT.displayName=Lh;var NT="TabsList",PT=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=cy(NT,n),o=ET(n);return a.jsx(kT,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:a.jsx(he.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});PT.displayName=NT;var AT="TabsTrigger",RT=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,o=cy(AT,n),l=ET(n),c=MT(o.baseId,r),u=DT(o.baseId,r),d=r===o.value;return a.jsx(CT,{asChild:!0,...l,focusable:!s,active:d,children:a.jsx(he.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:t,onMouseDown:ae(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?o.onValueChange(r):h.preventDefault()}),onKeyDown:ae(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(r)}),onFocus:ae(e.onFocus,()=>{const h=o.activationMode!=="manual";!d&&!s&&h&&o.onValueChange(r)})})})});RT.displayName=AT;var OT="TabsContent",IT=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=e,l=cy(OT,n),c=MT(l.baseId,r),u=DT(l.baseId,r),d=r===l.value,h=m.useRef(d);return m.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),a.jsx(Br,{present:s||d,children:({present:f})=>a.jsx(he.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:f&&i})})});IT.displayName=OT;function MT(e,t){return`${e}-trigger-${t}`}function DT(e,t){return`${e}-content-${t}`}var F6=TT,LT=PT,$T=RT,FT=IT;const uy=F6,$h=m.forwardRef(({className:e,...t},n)=>a.jsx(LT,{ref:n,className:de("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));$h.displayName=LT.displayName;const dt=m.forwardRef(({className:e,...t},n)=>a.jsx($T,{ref:n,className:de("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));dt.displayName=$T.displayName;const ht=m.forwardRef(({className:e,...t},n)=>a.jsx(FT,{ref:n,className:de("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));
vendor: 2,866 bytes, line 574
574ht.displayName=FT.displayName;var dy="Radio",[V6,VT]=hn(dy),[U6,B6]=V6(dy),UT=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:i,disabled:o,value:l="on",onCheck:c,form:u,...d}=e,[h,f]=m.useState(null),p=Se(t,x=>f(x)),g=m.useRef(!1),v=h?u||!!h.closest("form"):!0;return a.jsxs(U6,{scope:n,checked:s,disabled:o,children:[a.jsx(he.button,{type:"button",role:"radio","aria-checked":s,"data-state":WT(s),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:p,onClick:ae(e.onClick,x=>{s||c==null||c(),v&&(g.current=x.isPropagationStopped(),g.current||x.stopPropagation())})}),v&&a.jsx(HT,{control:h,bubbles:!g.current,name:r,value:l,checked:s,required:i,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});UT.displayName=dy;var BT="RadioIndicator",zT=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,i=B6(BT,n);return a.jsx(Br,{present:r||i.checked,children:a.jsx(he.span,{"data-state":WT(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t})})});zT.displayName=BT;var z6="RadioBubbleInput",HT=m.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const o=m.useRef(null),l=Se(o,i),c=Ah(n),u=hh(t);return m.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&p){const g=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(g)}},[c,n,r]),a.jsx(he.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});HT.displayName=z6;function WT(e){return e?"checked":"unchecked"}var H6=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Fh="RadioGroup",[W6,H9]=hn(Fh,[Dh,VT]),qT=Dh(),KT=VT(),[q6,K6]=W6(Fh),GT=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:h,...f}=e,p=qT(n),g=Ph(u),[v,x]=Lr({prop:i,defaultProp:s??null,onChange:h,caller:Fh});return a.jsx(q6,{scope:n,name:r,required:o,disabled:l,value:v,onValueChange:x,children:a.jsx(kT,{asChild:!0,...p,orientation:c,dir:g,loop:d,children:a.jsx(he.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:g,...f,ref:t})})})});GT.displayName=Fh;var YT="RadioGroupItem",ZT=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...s}=e,i=K6(YT,n),o=i.disabled||r,l=qT(n),c=KT(n),u=m.useRef(null),d=Se(t,u),h=i.value===s.value,f=m.useRef(!1);return m.useEffect(()=>{const p=v=>{H6.includes(v.key)&&(f.current=!0)},g=()=>f.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",g)}},[]),a.jsx(CT,{asChild:!0,...l,focusable:!o,active:h,children:a.jsx(UT,{disabled:o,required:i.required,
574checked:h,...c,...s,name:i.name,ref:d,onCheck:()=>i.onValueChange(s.value),onKeyDown:ae(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:ae(s.onFocus,()=>{var p;f.current&&((p=u.current)==null||p.click())})})})});ZT.displayName=YT;var G6="RadioGroupIndicator",JT=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=KT(n);return a.jsx(zT,{...s,...r,ref:t})});JT.displayName=G6;var QT=GT,XT=ZT,Y6=JT;const eN=m.forwardRef(({className:e,...t},n)=>a.jsx(QT,{className:de("grid gap-2",e),...t,ref:n}));eN.displayName=QT.displayName;const sg=m.forwardRef(({className:e,...t},n)=>a.jsx(XT,{ref:n,className:de("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",e),...t,children:a.jsx(Y6,{className:"flex items-center justify-center",children:a.jsx(WR,{className:"h-2.5 w-2.5 fill-current text-current"})})}));sg.displayName=XT.displayName;const Z6=()=>{const{t:e}=Qn(),{signIn:t,signUp:n}=Sh(),r=vc(),{toast:s}=Et(),[i,o]=m.useState(!1),[l,c]=m.useState("signin"),[u,d]=m.useState(""),[h,f]=m.useState(""),[p,g]=m.useState(""),[v,x]=m.useState(""),[b,w]=m.useState(""),[y,_]=m.useState("consultant"),[j,C]=m.useState(""),[k,S]=m.useState(""),[P,E]=m.useState(""),[I,R]=m.useState(""),[$,T]=m.useState(""),[U,D]=m.useState(""),[A,N]=m.useState(""),[O,V]=m.useState(""),H=async B=>{B.preventDefault(),o(!0);const{error:le}=await t(u,h);le?s({title:e.auth.signInError,description:le.message,variant:"destructive"}):r("/dashboard"),o(!1)},Z=async B=>{if(B.preventDefault(),v!==b){s({title:e.auth.signUpError,description:e.auth.passwordMismatch,variant:"destructive"});return}o(!0);const le=y==="consultant"?{full_name:j,expertise:k,experience_years:parseInt(P)||0,skills:I.split(",").map(Me=>Me.trim()).filter(Boolean),photo_url:U||void 0,bio:$||void 0}:{full_name:j,company_name:A||void 0,position:O||void 0},{error:Pe}=await n(p,v,y,le);Pe?s({title:e.auth.signUpError,description:Pe.message,variant:"destructive"}):(s({title:e.auth.signUpSuccess}),c("signin")),o(!1)};return a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:a.jsxs(Ze.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"w-full max-w-lg",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsxs(Lt,{to:"/",className:"inline-flex items-center gap-2 text-muted-foreground hover:text-foreground mb-6",children:[a.jsx(dv,{className:"w-4 h-4"}),e.nav.home]}),a.jsx("div",{className:"flex justify-center mb-4",children:a.jsx("img",{src:Sc,alt:"Rich Media",className:"h-16 w-auto"})})]}),a.jsxs(Te,{className:"border-border/50 shadow-elevated",children:[a.jsxs(Us,{className:"text-center",children:[a.jsx(Bs,{className:"text-2xl",children:l==="signin"?e.auth.signIn:e.auth.signUp}),a.jsxs(xT,{children:[l==="signin"?e.auth.dontHaveAccount:e.auth.alreadyHaveAccount," ",a.jsx("button",{type:"button",onClick:()=>c(l==="signin"?"signup":"signin"),className:"text-primary hover:underline font-medium",children:l==="signin"?e.auth.signUp:e.auth.signIn})]})]}),a.jsx(Ne,{children:a.jsxs(uy,{value:l,onValueChange:B=>c(B),children:[a.jsxs($h,{className:"grid w-full grid-cols-2 mb-6",children:[a.jsx(dt,{value:"signin",children:e.auth.signIn}),a.jsx(dt,{value:"signup",children:e.auth.signUp})]}),a.jsx(ht,{value:"signin",children:a.jsxs("form",{onSubmit:H,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"signin-email",children:e.auth.email}),a.jsx(J,{id:"signin-email",type:"email",value:u,onChange:B=>d(B.target.value),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"signin-password",children:e.auth.password}),a.jsx(J,{id:"signin-password",type:"password",value:h,onChange:B=>f(B.target.value),required:!0})]}),a.jsx(z,{type:"submit",className:"w-full",disabled:i,children:i?e.auth.signingIn:e.auth.signIn})]})}),a.jsx(ht,{value:"signup",children:a.jsxs("form",{onSubmit:Z,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx(L,{children:e.auth.selectRole}),a.jsxs(eN,{value:y,onValueChange:B=>_(B),className:"grid grid-cols-2 gap-4",children:[a.jsxs(L,{htmlFor:"role-consultant",className:`flex flex-col items-center gap-2 p-4 border rounded-lg cursor-pointer transition-all ${y==="consultant"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[a.jsx(sg,{value:"consultant",id:"role-consultant",className:"sr-only"}),a.jsx(Is,{className:"w-6 h-6 text-primary"}),a.jsx("span",{className:"text-sm font-medium text-center",children:e.auth.consultant})]}),a.jsxs(L,{htmlFor:"role-hiring",className:`flex flex-col items-center gap-2 p-4 border rounded-lg cursor-pointer transition-all ${y==="hiring_professional"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[a.jsx(sg,{value:"hiring_professional",id:"role-hiring",className:"sr-only"}),a.jsx(ah,{className:"w-6 h-6 text-primary"}),a.jsx("span",{className:"text-sm font-medium text-center",children:e.auth.hiringProfessional})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"signup-name",children:e.auth.fullName}),a.jsx(J,{id:"signup-name",type:"text",value:j,onChange:B=>C(B.target.value),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"signup-email",children:e.auth.email}),a.jsx(J,{id:"signup-email",type:"email",value:p,onChange:B=>g(B.target.value),required:!0})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"signup-password",children:e.auth.password}
574),a.jsx(J,{id:"signup-password",type:"password",value:v,onChange:B=>x(B.target.value),required:!0,minLength:6})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"signup-confirm",children:e.auth.confirmPassword}),a.jsx(J,{id:"signup-confirm",type:"password",value:b,onChange:B=>w(B.target.value),required:!0,minLength:6})]})]}),y==="consultant"&&a.jsxs("div",{className:"space-y-4 pt-4 border-t border-border",children:[a.jsx("h4",{className:"font-medium text-sm text-muted-foreground",children:e.auth.consultantSignup.title}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"expertise",children:e.auth.consultantSignup.expertise}),a.jsx(J,{id:"expertise",value:k,onChange:B=>S(B.target.value),placeholder:e.auth.consultantSignup.expertisePlaceholder,required:!0})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"experience",children:e.auth.consultantSignup.experience}),a.jsx(J,{id:"experience",type:"number",min:"0",value:P,onChange:B=>E(B.target.value),placeholder:e.auth.consultantSignup.experiencePlaceholder})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"photoUrl",children:e.auth.consultantSignup.photoUrl}),a.jsx(J,{id:"photoUrl",type:"url",value:U,onChange:B=>D(B.target.value),placeholder:e.auth.consultantSignup.photoUrlPlaceholder})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"skills",children:e.auth.consultantSignup.skills}),a.jsx(J,{id:"skills",value:I,onChange:B=>R(B.target.value),placeholder:e.auth.consultantSignup.skillsPlaceholder})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"bio",children:e.auth.consultantSignup.bio}),a.jsx(rt,{id:"bio",value:$,onChange:B=>T(B.target.value),placeholder:e.auth.consultantSignup.bioPlaceholder,rows:3})]})]}),y==="hiring_professional"&&a.jsxs("div",{className:"space-y-4 pt-4 border-t border-border",children:[a.jsx("h4",{className:"font-medium text-sm text-muted-foreground",children:e.auth.hiringSignup.title}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"companyName",children:e.auth.hiringSignup.companyName}),a.jsx(J,{id:"companyName",value:A,onChange:B=>N(B.target.value),placeholder:e.auth.hiringSignup.companyPlaceholder})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"position",children:e.auth.hiringSignup.position}),a.jsx(J,{id:"position",value:O,onChange:B=>V(B.target.value),placeholder:e.auth.hiringSignup.positionPlaceholder})]})]}),a.jsx(z,{type:"submit",className:"w-full",disabled:i,children:i?e.auth.signingUp:e.auth.signUp})]})})]})})]})]})})};var Vh="Switch",[J6,W9]=hn(Vh),[Q6,X6]=J6(Vh),tN=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...h}=e,[f,p]=m.useState(null),g=Se(t,y=>p(y)),v=m.useRef(!1),x=f?d||!!f.closest("form"):!0,[b,w]=Lr({prop:s,defaultProp:i??!1,onChange:u,caller:Vh});return a.jsxs(Q6,{scope:n,checked:b,disabled:l,children:[a.jsx(he.button,{type:"button",role:"switch","aria-checked":b,"aria-required":o,"data-state":iN(b),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:g,onClick:ae(e.onClick,y=>{w(_=>!_),x&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),x&&a.jsx(sN,{control:f,bubbles:!v.current,name:r,value:c,checked:b,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});tN.displayName=Vh;var nN="SwitchThumb",rN=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=X6(nN,n);return a.jsx(he.span,{"data-state":iN(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});rN.displayName=nN;var e8="SwitchBubbleInput",sN=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const o=m.useRef(null),l=Se(o,i),c=Ah(n),u=hh(t);return m.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&p){const g=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(g)}},[c,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});sN.displayName=e8;function iN(e){return e?"checked":"unchecked"}var oN=tN,t8=rN;const Cn=m.forwardRef(({className:e,...t},n)=>a.jsx(oN,{className:de("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:a.jsx(t8,{className:de("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}
vendor: 6,758 bytes, lines 574-578
574));Cn.displayName=oN.displayName;const n8=oh("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 Ve({className:e,variant:t,...n}){return a.jsx("div",{className:de(n8({variant:t}),e),...n})}var Uh="Dialog",[aN,lN]=hn(Uh),[r8,Xn]=aN(Uh),cN=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,l=m.useRef(null),c=m.useRef(null),[u,d]=Lr({prop:r,defaultProp:s??!1,onChange:i,caller:Uh});return a.jsx(r8,{scope:t,triggerRef:l,contentRef:c,contentId:Es(),titleId:Es(),descriptionId:Es(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(h=>!h),[d]),modal:o,children:n})};cN.displayName=Uh;var uN="DialogTrigger",dN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Xn(uN,n),i=Se(t,s.triggerRef);return a.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":py(s.open),...r,ref:i,onClick:ae(e.onClick,s.onOpenToggle)})});dN.displayName=uN;var hy="DialogPortal",[s8,hN]=aN(hy,{forceMount:void 0}),fN=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Xn(hy,t);return a.jsx(s8,{scope:t,forceMount:n,children:m.Children.map(r,o=>a.jsx(Br,{present:n||i.open,children:a.jsx(rh,{asChild:!0,container:s,children:o})}))})};fN.displayName=hy;var Md="DialogOverlay",pN=m.forwardRef((e,t)=>{const n=hN(Md,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Xn(Md,e.__scopeDialog);return i.modal?a.jsx(Br,{present:r||i.open,children:a.jsx(o8,{...s,ref:t})}):null});pN.displayName=Md;var i8=ra("DialogOverlay.RemoveScroll"),o8=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Xn(Md,n);return a.jsx(ay,{as:i8,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(he.div,{"data-state":py(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Oi="DialogContent",mN=m.forwardRef((e,t)=>{const n=hN(Oi,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Xn(Oi,e.__scopeDialog);return a.jsx(Br,{present:r||i.open,children:i.modal?a.jsx(a8,{...s,ref:t}):a.jsx(l8,{...s,ref:t})})});mN.displayName=Oi;var a8=m.forwardRef((e,t)=>{const n=Xn(Oi,e.__scopeDialog),r=m.useRef(null),s=Se(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return jE(i)},[]),a.jsx(gN,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ae(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:ae(e.onFocusOutside,i=>i.preventDefault())})}),l8=m.forwardRef((e,t)=>{const n=Xn(Oi,e.__scopeDialog),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(gN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),gN=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,l=Xn(Oi,n),c=m.useRef(null),u=Se(t,c);return bE(),a.jsxs(a.Fragment,{children:[a.jsx(oy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(dc,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":py(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(u8,{titleId:l.titleId}),a.jsx(h8,{contentRef:c,descriptionId:l.descriptionId})]})]})}),fy="DialogTitle",vN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Xn(fy,n);return a.jsx(he.h2,{id:s.titleId,...r,ref:t})});vN.displayName=fy;var yN="DialogDescription",xN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Xn(yN,n);return a.jsx(he.p,{id:s.descriptionId,...r,ref:t})});xN.displayName=yN;var wN="DialogClose",bN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Xn(wN,n);return a.jsx(he.button,{type:"button",...r,ref:t,onClick:ae(e.onClick,()=>s.onOpenChange(!1))})});bN.displayName=wN;function py(e){return e?"open":"closed"}var _N="DialogTitleWarning",[c8,SN]=zA(_N,{contentName:Oi,titleName:fy,docsSlug:"dialog"}),u8=({titleId:e})=>{const t=SN(_N),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
575
576If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
577
578For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},d8="DialogDescriptionWarning",h8=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${SN(d8).contentName}}.`;return m.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},jN=cN,kN=dN,CN=fN,my=pN,gy=mN,vy=vN,yy=xN,xy=bN;const en=jN,Xl=kN,f8=CN,EN=m.forwardRef(({className:e,...t},n)=>a.jsx(my,{ref:n,className:de("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",e),...t}));EN.displayName=my.displayName;const Ut=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(f8,{children:[a.jsx(EN,{}),a.jsxs(gy,{ref:r,className:de("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",e),...n,children:[t,a.jsxs(xy,{className:"absolute right-4 top-4 roun
578ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[a.jsx(fc,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ut.displayName=gy.displayName;const Bt=({className:e,...t})=>a.jsx("div",{className:de("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Bt.displayName="DialogHeader";const En=({className:e,...t})=>a.jsx("div",{className:de("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});En.displayName="DialogFooter";const zt=m.forwardRef(({className:e,...t},n)=>a.jsx(vy,{ref:n,className:de("text-lg font-semibold leading-none tracking-tight",e),...t}));zt.displayName=vy.displayName;const ec=m.forwardRef(({className:e,...t},n)=>a.jsx(yy,{ref:n,className:de("text-sm text-muted-foreground",e),...t}));ec.displayName=yy.displayName;var TN="AlertDialog",[p8,q9]=hn(TN,[lN]),Wr=lN(),NN=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wr(t);return a.jsx(jN,{...r,...n,modal:!0})};NN.displayName=TN;var m8="AlertDialogTrigger",g8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wr(n);return a.jsx(kN,{...s,...r,ref:t})});g8.displayName=m8;var v8="AlertDialogPortal",PN=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wr(t);return a.jsx(CN,{...r,...n})};PN.displayName=v8;var y8="AlertDialogOverlay",AN=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wr(n);return a.jsx(my,{...s,...r,ref:t})});AN.displayName=y8;var Uo="AlertDialogContent",[x8,w8]=p8(Uo),b8=jS("AlertDialogContent"),RN=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=Wr(n),o=m.useRef(null),l=Se(t,o),c=m.useRef(null);return a.jsx(c8,{contentName:Uo,titleName:ON,docsSlug:"alert-dialog",children:a.jsx(x8,{scope:n,cancelRef:c,children:a.jsxs(gy,{role:"alertdialog",...i,...s,ref:l,onOpenAutoFocus:ae(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[a.jsx(b8,{children:r}),a.jsx(S8,{contentRef:o})]})})})});RN.displayName=Uo;var ON="AlertDialogTitle",IN=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wr(n);return a.jsx(vy,{...s,...r,ref:t})});IN.displayName=ON;var MN="AlertDialogDescription",DN=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wr(n);return a.jsx(yy,{...s,...r,ref:t})});DN.displayName=MN;var _8="AlertDialogAction",LN=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wr(n);return a.jsx(xy,{...s,...r,ref:t})});LN.displayName=_8;var $N="AlertDialogCancel",FN=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=w8($N,n),i=Wr(n),o=Se(t,s);return a.jsx(xy,{...i,...r,ref:o})});FN.displayName=$N;var S8=({contentRef:e})=>{const t=`\`${Uo}\` requires a description for the component to be accessible for screen reader users.
579
580You can add a description to the \`${Uo}\` by passing a \`${MN}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
581
582Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Uo}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
583
584For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},j8=NN,k8=PN,VN=AN,UN=RN,BN=LN,zN=FN,HN=IN,WN=DN;const Na=j8,C8=k8,qN=m.forwardRef(({className:e,...t},n)=>a.jsx(VN,{className:de("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",e),...t,ref:n}));qN.displayName=VN.displayName;const Ui=m.forwardRef(({className:e,...t},n)=>a.jsxs(C8,{children:[a.jsx(qN,{}),a.jsx(UN,{ref:n,className:de("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:rou
584nded-lg",e),...t})]}));Ui.displayName=UN.displayName;const Bi=({className:e,...t})=>a.jsx("div",{className:de("flex flex-col space-y-2 text-center sm:text-left",e),...t});Bi.displayName="AlertDialogHeader";const zi=({className:e,...t})=>a.jsx("div",{className:de("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zi.displayName="AlertDialogFooter";const Hi=m.forwardRef(({className:e,...t},n)=>a.jsx(HN,{ref:n,className:de("text-lg font-semibold",e),...t}));Hi.displayName=HN.displayName;const Bh=m.forwardRef(({className:e,...t},n)=>a.jsx(WN,{ref:n,className:de("text-sm text-muted-foreground",e),...t}));Bh.displayName=WN.displayName;const Wi=m.forwardRef(({className:e,...t},n)=>a.jsx(BN,{ref:n,className:de(iy(),e),...t}));Wi.displayName=BN.displayName;const qi=m.forwardRef(({className:e,...t},n)=>a.jsx(zN,{ref:n,className:de(iy({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));qi.displayName=zN.displayName;const E8={slug:"",icon_name:"Sparkles",color_gradient:"from-primary to-secondary",title_fr:"",title_en:"",description_fr:"",description_en:"",sort_order:999,is_active:!0},T8={icon_name:"Sparkles",value:"",label_fr:"",label_en:"",sort_order:999,is_active:!0},N8=()=>{const{services:e,refresh:t}=Gs(),{toast:n}=Et(),[r,s]=m.useState(null),[i,o]=m.useState(null),[l,c]=m.useState(!1),u=async()=>{if(!r)return;c(!0);const g={slug:r.slug,icon_name:r.icon_name,color_gradient:r.color_gradient,title_fr:r.title_fr,title_en:r.title_en,description_fr:r.description_fr,description_en:r.description_en,sort_order:r.sort_order??999,is_active:r.is_active??!0},{error:v}=r.id?await W.from("site_services").update(g).eq("id",r.id):await W.from("site_services").insert(g);v?n({title:"Erreur",description:v.message,variant:"destructive"}):(n({title:"Service enregistré"}),s(null),await t()),c(!1)},d=async()=>{if(!i)return;const{error:g}=await W.from("site_services").delete().eq("id",i.id);g?n({title:"Erreur",description:g.message,variant:"destructive"}):(n({title:"Service supprimé"}),await t()),o(null)},h=async(g,v)=>{const x=[...e].sort((y,_)=>y.sort_order-_.sort_order),b=x.findIndex(y=>y.id===g.id),w=x[b+v];w&&(await Promise.all([W.from("site_services").update({sort_order:w.sort_order}).eq("id",g.id),W.from("site_services").update({sort_order:g.sort_order}).eq("id",w.id)]),await t())},f=async(g,v)=>{await W.from("site_services").update({is_active:v}).eq("id",g.id),await t()},p=[...e].sort((g,v)=>g.sort_order-v.sort_order);return a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:[p.length," services"]}),a.jsxs(z,{onClick:()=>s(E8),size:"sm",children:[a.jsx($i,{className:"w-4 h-4 mr-2"})," Ajouter"]})]}),a.jsx("div",{className:"space-y-2",children:p.map((g,v)=>{const x=Ta(g.icon_name);return a.jsx(Te,{children:a.jsxs(Ne,{className:"p-3 flex items-center gap-3",children:[a.jsx("div",{className:`w-10 h-10 rounded-lg bg-gradient-to-br ${g.color_gradient} flex items-center justify-center shrink-0`,children:a.jsx(x,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium truncate",children:g.title_fr}),a.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:[g.slug," · ",g.icon_name]})]}),a.jsx(Cn,{checked:g.is_active,onCheckedChange:b=>f(g,b)}),a.jsx(z,{size:"icon",variant:"ghost",disabled:v===0,onClick:()=>h(g,-1),children:a.jsx(LR,{className:"w-4 h-4"})}),a.jsx(z,{size:"icon",variant:"ghost",disabled:v===p.length-1,onClick:()=>h(g,1),children:a.jsx(DR,{className:"w-4 h-4"})}),a.jsx(z,{size:"icon",variant:"ghost",onClick:()=>s(g),children:a.jsx(zr,{className:"w-4 h-4"})}),a.jsx(z,{size:"icon",variant:"ghost",onClick:()=>o(g),children:a.jsx(xr,{className:"w-4 h-4 text-destructive"})})]})},g.id)})}),a.jsx(en,{open:!!r,onOpenChange:g=>!g&&s(null),children:a.jsxs(Ut,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(Bt,{children:a.jsx(zt,{children:r!=null&&r.id?"Modifier le service":"Nouveau service"})}),r&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Slug (unique)"}),a.jsx(J,{value:r.slug||"",onChange:g=>s({...r,slug:g.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Icône"}
584),a.jsxs(ze,{value:r.icon_name,onValueChange:g=>s({...r,icon_name:g}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsx($e,{className:"max-h-60",children:gT.map(g=>a.jsx(ue,{value:g,children:g},g))})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Dégradé de couleur"}),a.jsxs(ze,{value:r.color_gradient,onValueChange:g=>s({...r,color_gradient:g}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsx($e,{className:"max-h-60",children:m6.map(g=>a.jsx(ue,{value:g,children:g},g))})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Titre (FR)"}),a.jsx(J,{value:r.title_fr||"",onChange:g=>s({...r,title_fr:g.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Titre (EN)"}),a.jsx(J,{value:r.title_en||"",onChange:g=>s({...r,title_en:g.target.value})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Description (FR)"}),a.jsx(rt,{rows:3,value:r.description_fr||"",onChange:g=>s({...r,description_fr:g.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Description (EN)"}),a.jsx(rt,{rows:3,value:r.description_en||"",onChange:g=>s({...r,description_en:g.target.value})})]})]}),a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cn,{checked:r.is_active??!0,onCheckedChange:g=>s({...r,is_active:g})}),a.jsx(L,{children:"Actif"})]})})]}),a.jsxs(En,{children:[a.jsx(z,{variant:"outline",onClick:()=>s(null),children:"Annuler"}),a.jsxs(z,{onClick:u,disabled:l,children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),l?"...":"Enregistrer"]})]})]})}),a.jsx(Na,{open:!!i,onOpenChange:g=>!g&&o(null),children:a.jsxs(Ui,{children:[a.jsxs(Bi,{children:[a.jsx(Hi,{children:"Supprimer ce service ?"}),a.jsxs(Bh,{children:[a.jsx("strong",{children:i==null?void 0:i.title_fr})," sera supprimé définitivement."]})]}),a.jsxs(zi,{children:[a.jsx(qi,{children:"Annuler"}),a.jsx(Wi,{onClick:d,children:"Supprimer"})]})]})})]})},P8=()=>{const{metrics:e,refresh:t}=Gs(),{toast:n}=Et(),[r,s]=m.useState(null),[i,o]=m.useState(null),[l,c]=m.useState(!1),u=async()=>{if(!r)return;c(!0);const p={icon_name:r.icon_name,value:r.value,label_fr:r.label_fr,label_en:r.label_en,sort_order:r.sort_order??999,is_active:r.is_active??!0},{error:g}=r.id?await W.from("site_metrics").update(p).eq("id",r.id):await W.from("site_metrics").insert(p);g?n({title:"Erreur",description:g.message,variant:"destructive"}):(n({title:"Métrique enregistrée"}),s(null),await t()),c(!1)},d=async()=>{if(!i)return;const{error:p}=await W.from("site_metrics").delete().eq("id",i.id);p?n({title:"Erreur",description:p.message,variant:"destructive"}):(n({title:"Métrique supprimée"}),await t()),o(null)},h=async(p,g)=>{await W.from("site_metrics").update({is_active:g}).eq("id",p.id),await t()},f=[...e].sort((p,g)=>p.sort_order-g.sort_order);return a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:[f.length," métriques"]}),a.jsxs(z,{onClick:()=>s(T8),size:"sm",children:[a.jsx($i,{className:"w-4 h-4 mr-2"})," Ajouter"]})]}),a.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:f.map(p=>{const g=Ta(p.icon_name);return a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4 flex items-center gap-3",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center shrink-0",children:a.jsx(g,{className:"w-6 h-6 text-primary"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-2xl font-bold",children:p.value}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p.label_fr})]}),a.jsx(Cn,{checked:p.is_active,onCheckedChange:v=>h(p,v)}),a.jsx(z,{size:"icon",variant:"ghost",onClick:()=>s(p),children:a.jsx(zr,{className:"w-4 h-4"})}),a.jsx(z,{size:"icon",variant:"ghost",onClick:()=>o(p),children:a.jsx(xr,{className:"w-4 h-4 text-destructive"})})]})},p.id)})}),a.jsx(en,{open:!!r,onOpenChange:p=>!p&&s(null),children:a.jsxs(Ut,{className:"max-w-xl",children:[a.jsx(Bt,{children:a.jsx(zt,{children:r!=null&&r.id?"Modifier la métrique":"Nouvelle métrique"})}),r&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Valeur"}),a.jsx(J,{placeholder:"18+",value:r.value||"",onChange:p=>s({...r,value:p.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Icône"}
584),a.jsxs(ze,{value:r.icon_name,onValueChange:p=>s({...r,icon_name:p}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsx($e,{className:"max-h-60",children:gT.map(p=>a.jsx(ue,{value:p,children:p},p))})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Libellé (FR)"}),a.jsx(J,{value:r.label_fr||"",onChange:p=>s({...r,label_fr:p.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Libellé (EN)"}),a.jsx(J,{value:r.label_en||"",onChange:p=>s({...r,label_en:p.target.value})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Ordre"}),a.jsx(J,{type:"number",value:r.sort_order??0,onChange:p=>s({...r,sort_order:parseInt(p.target.value)||0})})]}),a.jsxs("div",{className:"flex items-end gap-2 pb-2",children:[a.jsx(Cn,{checked:r.is_active??!0,onCheckedChange:p=>s({...r,is_active:p})}),a.jsx(L,{children:"Actif"})]})]})]}),a.jsxs(En,{children:[a.jsx(z,{variant:"outline",onClick:()=>s(null),children:"Annuler"}),a.jsxs(z,{onClick:u,disabled:l,children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),l?"...":"Enregistrer"]})]})]})}),a.jsx(Na,{open:!!i,onOpenChange:p=>!p&&o(null),children:a.jsxs(Ui,{children:[a.jsx(Bi,{children:a.jsx(Hi,{children:"Supprimer cette métrique ?"})}),a.jsxs(zi,{children:[a.jsx(qi,{children:"Annuler"}),a.jsx(Wi,{onClick:d,children:"Supprimer"})]})]})})]})},A8=[{key:"badge_fr",label:"Badge (FR)"},{key:"badge_en",label:"Badge (EN)"},{key:"title1_fr",label:"Titre début (FR)"},{key:"title1_en",label:"Titre début (EN)"},{key:"title_highlight_fr",label:"Titre surligné (FR)"},{key:"title_highlight_en",label:"Titre surligné (EN)"},{key:"title2_fr",label:"Titre fin (FR)"},{key:"title2_en",label:"Titre fin (EN)"},{key:"paragraph1_fr",label:"Paragraphe 1 (FR) — HTML autorisé",multiline:!0},{key:"paragraph1_en",label:"Paragraphe 1 (EN) — HTML autorisé",multiline:!0},{key:"paragraph2_fr",label:"Paragraphe 2 (FR) — HTML autorisé",multiline:!0},{key:"paragraph2_en",label:"Paragraphe 2 (EN) — HTML autorisé",multiline:!0},{key:"paragraph3_fr",label:"Paragraphe 3 (FR)",multiline:!0},{key:"paragraph3_en",label:"Paragraphe 3 (EN)",multiline:!0},{key:"since_fr",label:"Depuis (FR)"},{key:"since_en",label:"Depuis (EN)"}],R8=()=>{const{story:e,refresh:t}=Gs(),{toast:n}=Et(),[r,s]=m.useState(null),[i,o]=m.useState(!1);m.useEffect(()=>{e&&s(e)},[e]);const l=async()=>{if(!r)return;o(!0);const{error:c}=await W.from("site_settings").update({value:r}).eq("key","story");c?n({title:"Erreur",description:c.message,variant:"destructive"}):(n({title:"Histoire mise à jour"}),await t()),o(!1)};return r?a.jsxs("div",{className:"space-y-4 max-w-3xl",children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:A8.map(c=>a.jsxs("div",{className:`space-y-2 ${c.multiline?"md:col-span-2":""}`,children:[a.jsx(L,{children:c.label}),c.multiline?a.jsx(rt,{rows:3,value:r[c.key],onChange:u=>s({...r,[c.key]:u.target.value})}):a.jsx(J,{value:r[c.key],onChange:u=>s({...r,[c.key]:u.target.value})})]},c.key))}),a.jsxs(z,{onClick:l,disabled:i,children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),i?"...":"Enregistrer l'histoire"]})]}):a.jsx("p",{className:"text-muted-foreground",children:"Chargement..."})};function KN(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),s=m.useCallback(async()=>{const{data:i}=await W.from("site_sub_services").select("*").order("sort_order");i&&t(i),r(!1)},[]);return m.useEffect(()=>{s()},[s]),{subServices:e,isLoading:n,refresh:s}}const O8=e=>({service_id:e,slug:"",title_fr:"",title_en:"",description_fr:"",description_en:"",sort_order:999,is_active:!0}),I8=()=>{const{services:e}=Gs(),{subServices:t,refresh:n}=KN(),{toast:r}=Et(),[s,i]=m.useState(null),[o,l]=m.useState(null),[c,u]=m.useState(!1),[d,h]=m.useState(null),f=[...e].sort((x,b)=>x.sort_order-b.sort_order),p=async(x,b)=>{await W.from("site_sub_services").update({is_active:b}).eq("id",x.id),await n()},g=async()=>{if(!s)return;u(!0);const x={service_id:s.service_id,slug:s.slug,title_fr:s.title_fr,title_en:s.title_en,description_fr:s.description_fr??"",description_en:s.description_en??"",sort_order:s.sort_order??999,is_active:s.is_active??!0},{error:b}=s.id?await W.from("site_sub_services").update(x).eq("id",s.id):await W.from("site_sub_services").insert(x);b?r({title:"Erreur",description:b.message,variant:"destructive"}):(r({title:"Sous-service enregistré"}),i(null),await n()),u(!1)},v=async()=>
584{if(!o)return;const{error:x}=await W.from("site_sub_services").delete().eq("id",o.id);x?r({title:"Erreur",description:x.message,variant:"destructive"}):(r({title:"Sous-service supprimé"}),await n()),l(null)};return a.jsxs("div",{className:"space-y-3",children:[f.map(x=>{const b=Ta(x.icon_name),w=t.filter(j=>j.service_id===x.id).sort((j,C)=>j.sort_order-C.sort_order),y=d===x.id,_=w.filter(j=>j.is_active).length;return a.jsxs(Te,{children:[a.jsxs("button",{type:"button",onClick:()=>h(y?null:x.id),className:"w-full p-4 flex items-center gap-3 text-left hover:bg-muted/50 transition-colors",children:[a.jsx("div",{className:`w-10 h-10 rounded-lg bg-gradient-to-br ${x.color_gradient} flex items-center justify-center shrink-0`,children:a.jsx(b,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-semibold",children:x.title_fr}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.length," sous-services · ",_," actifs"]})]}),a.jsx(lh,{className:`w-5 h-5 text-muted-foreground transition-transform ${y?"rotate-180":""}`})]}),y&&a.jsxs(Ne,{className:"pt-0 border-t",children:[a.jsx("div",{className:"flex justify-end pt-3 mb-3",children:a.jsxs(z,{size:"sm",onClick:()=>i(O8(x.id)),children:[a.jsx($i,{className:"w-4 h-4 mr-1"})," Ajouter"]})}),w.length===0?a.jsx("p",{className:"text-sm text-muted-foreground py-3",children:"Aucun sous-service."}):a.jsx("div",{className:"space-y-2",children:w.map(j=>a.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-md border border-border",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:j.title_fr}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:j.slug})]}),a.jsx(Cn,{checked:j.is_active,onCheckedChange:C=>p(j,C)}),a.jsx(z,{size:"icon",variant:"ghost",onClick:()=>i(j),children:a.jsx(zr,{className:"w-4 h-4"})}),a.jsx(z,{size:"icon",variant:"ghost",onClick:()=>l(j),children:a.jsx(xr,{className:"w-4 h-4 text-destructive"})})]},j.id))})]})]},x.id)}),a.jsx(en,{open:!!s,onOpenChange:x=>!x&&i(null),children:a.jsxs(Ut,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(Bt,{children:a.jsx(zt,{children:s!=null&&s.id?"Modifier le sous-service":"Nouveau sous-service"})}),s&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Service parent"}),a.jsxs(ze,{value:s.service_id,onValueChange:x=>i({...s,service_id:x}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsx($e,{children:f.map(x=>a.jsx(ue,{value:x.id,children:x.title_fr},x.id))})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Slug"}),a.jsx(J,{value:s.slug||"",onChange:x=>i({...s,slug:x.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Ordre"}),a.jsx(J,{type:"number",value:s.sort_order??0,onChange:x=>i({...s,sort_order:parseInt(x.target.value)||0})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Titre (FR)"}),a.jsx(J,{value:s.title_fr||"",onChange:x=>i({...s,title_fr:x.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Titre (EN)"}),a.jsx(J,{value:s.title_en||"",onChange:x=>i({...s,title_en:x.target.value})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Description (FR)"}),a.jsx(rt,{rows:3,value:s.description_fr||"",onChange:x=>i({...s,description_fr:x.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Description (EN)"}),a.jsx(rt,{rows:3,value:s.description_en||"",onChange:x=>i({...s,description_en:x.target.value})})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cn,{checked:s.is_active??!0,onCheckedChange:x=>i({...s,is_active:x})}),a.jsx(L,{children:"Actif"})]})]}),a.jsxs(En,{children:[a.jsx(z,{variant:"outline",onClick:()=>i(null),children:"Annuler"}
584),a.jsxs(z,{onClick:g,disabled:c,children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),c?"...":"Enregistrer"]})]})]})}),a.jsx(Na,{open:!!o,onOpenChange:x=>!x&&l(null),children:a.jsxs(Ui,{children:[a.jsx(Bi,{children:a.jsx(Hi,{children:"Supprimer ce sous-service ?"})}),a.jsxs(zi,{children:[a.jsx(qi,{children:"Annuler"}),a.jsx(Wi,{onClick:v,children:"Supprimer"})]})]})})]})},M8=["new","contacted","quoted","won","lost","archived"],Pb={new:"Nouveau",contacted:"Contacté",quoted:"Devis envoyé",won:"Gagné",lost:"Perdu",archived:"Archivé"},D8=()=>{const{toast:e}=Et(),[t,n]=m.useState([]),[r,s]=m.useState(!0),[i,o]=m.useState(null),[l,c]=m.useState(null),[u,d]=m.useState(""),[h,f]=m.useState(!1),[p,g]=m.useState(null),[v,x]=m.useState(""),[b,w]=m.useState(!1),y=async()=>{s(!0);const{data:E,error:I}=await W.from("quote_requests").select("*").order("created_at",{ascending:!1});I?e({title:"Erreur",description:I.message,variant:"destructive"}):n(E||[]),s(!1)};m.useEffect(()=>{y()},[]);const _=async(E,I)=>{const{error:R}=await W.from("quote_requests").update({status:I}).eq("id",E.id);R?e({title:"Erreur",description:R.message,variant:"destructive"}):(n($=>$.map(T=>T.id===E.id?{...T,status:I}:T)),(i==null?void 0:i.id)===E.id&&o({...i,status:I}))},j=async()=>{if(!i)return;f(!0);const{error:E}=await W.from("quote_requests").update({admin_notes:u}).eq("id",i.id);E?e({title:"Erreur",description:E.message,variant:"destructive"}):(e({title:"Notes enregistrées"}),n(I=>I.map(R=>R.id===i.id?{...R,admin_notes:u}:R)),o({...i,admin_notes:u})),f(!1)},C=async()=>{if(!l)return;const{error:E}=await W.from("quote_requests").delete().eq("id",l.id);E?e({title:"Erreur",description:E.message,variant:"destructive"}):(e({title:"Demande supprimée"}),n(I=>I.filter(R=>R.id!==l.id))),c(null)},k=E=>{g(E),x(E.response_message??`Bonjour ${E.full_name},
585
586Merci pour votre intérêt envers Rich Media.
587
588
589
590Cordialement,
591L'équipe Rich Media`)},S=async E=>{if(!p)return;w(!0);const I=new Date().toISOString(),{error:R}=await W.from("quote_requests").update({response_message:v,responded_at:I,status:p.status==="new"?"contacted":p.status}).eq("id",p.id);if(w(!1),R){e({title:"Erreur",description:R.message,variant:"destructive"});return}if(e({title:"Réponse enregistrée"}),n($=>$.map(T=>T.id===p.id?{...T,response_message:v,responded_at:I,status:T.status==="new"?"contacted":T.status}:T)),E!=null&&E.openMail){const $=encodeURIComponent("Rich Media — Votre demande de devis"),T=encodeURIComponent(v);window.open(`mailto:${p.email}?subject=${$}&body=${T}`,"_blank")}g(null)},P=E=>E==="won"?"default":E==="lost"?"destructive":"secondary";return r?a.jsx("p",{className:"text-muted-foreground",children:"Chargement..."}):a.jsxs("div",{children:[a.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[t.length," demande(s) de devis"]}),t.length===0?a.jsx("p",{className:"text-muted-foreground",children:"Aucune demande pour le moment."}):a.jsx("div",{className:"space-y-3",children:t.map(E=>{var I;return a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4 flex flex-col md:flex-row md:items-center gap-4",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("h3",{className:"font-semibold truncate",children:E.full_name}),a.jsx(Ve,{variant:P(E.status),children:Pb[E.status]||E.status}),E.budget_range&&a.jsx(Ve,{variant:"outline",children:E.budget_range})]}),a.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-3 flex-wrap mt-1",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(ya,{className:"w-3 h-3"})," ",E.email]}),E.phone&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(ij,{className:"w-3 h-3"})," ",E.phone]}),E.company&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(ah,{className:"w-3 h-3"})," ",E.company]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(UR,{className:"w-3 h-3"}),new Date(E.created_at).toLocaleDateString("fr-FR")]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[((I=E.selected_items)==null?void 0:I.length)||0," service(s) demandé(s)"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ze,{value:E.status,onValueChange:R=>_(E,R),children:[a.jsx(Le,{className:"w-36 h-9",children:a.jsx(He,{})}),a.jsx($e,{children:M8.map(R=>a.jsx(ue,{value:R,children:Pb[R]},R))})]}),a.jsx(z,{size:"sm",variant:"outline",onClick:()=>{o(E),d(E.admin_notes??"")},children:a.jsx(ej,{className:"w-4 h-4"})}),a.jsx(z,{size:"sm",variant:"outline",onClick:()=>k(E),title:"Répondre",children:a.jsx(dO,{className:"w-4 h-4 text-primary"})}),a.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(E),children:a.jsx(xr,{className:"w-4 h-4 text-destructive"})})]})]})},E.id)})}),a.jsx(en,{open:!!i,onOpenChange:E=>!E&&o(null),children:a.jsxs(Ut,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(Bt,{children:a.jsxs(zt,{children:["Demande de devis · ",i==null?void 0:i.full_name]})}),i&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Email: "}),i.email]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Téléphone: "}),i.phone||"—"]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Entreprise: "}),i.company||"—"]}
591),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Budget: "}),i.budget_range||"—"]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold mb-2",children:"Services demandés"}),a.jsx("div",{className:"space-y-1",children:i.selected_items.map((E,I)=>a.jsxs("div",{className:"text-sm p-2 rounded bg-muted",children:[a.jsx("span",{className:"font-medium",children:E.service_title})," · ",a.jsx("span",{className:"text-muted-foreground",children:E.title})]},I))})]}),i.message&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold mb-1",children:"Message"}),a.jsx("p",{className:"text-sm whitespace-pre-wrap p-3 rounded bg-muted",children:i.message})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Notes internes"}),a.jsx(rt,{rows:4,value:u,onChange:E=>d(E.target.value)}),a.jsxs(z,{onClick:j,disabled:h,size:"sm",children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),h?"...":"Enregistrer les notes"]})]})]})]})}),a.jsx(Na,{open:!!l,onOpenChange:E=>!E&&c(null),children:a.jsxs(Ui,{children:[a.jsx(Bi,{children:a.jsx(Hi,{children:"Supprimer cette demande ?"})}),a.jsxs(zi,{children:[a.jsx(qi,{children:"Annuler"}),a.jsx(Wi,{onClick:C,children:"Supprimer"})]})]})}),a.jsx(en,{open:!!p,onOpenChange:E=>!E&&g(null),children:a.jsxs(Ut,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(Bt,{children:a.jsxs(zt,{children:["Répondre à ",p==null?void 0:p.full_name]})}),p&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"text-sm bg-muted p-3 rounded",children:[a.jsxs("p",{children:[a.jsx("span",{className:"text-muted-foreground",children:"À: "}),p.email]}),p.responded_at&&a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Dernière réponse : ",new Date(p.responded_at).toLocaleString("fr-FR")]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Message de réponse"}),a.jsx(rt,{rows:12,value:v,onChange:E=>x(E.target.value)})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-end",children:[a.jsx(z,{variant:"outline",onClick:()=>g(null),children:"Annuler"}),a.jsxs(z,{variant:"outline",onClick:()=>S(),disabled:b,children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),"Enregistrer"]}),a.jsxs(z,{onClick:()=>S({openMail:!0}),disabled:b,children:[a.jsx(sa,{className:"w-4 h-4 mr-2"}),"Enregistrer & envoyer"]})]})]})]})})]})},Ab={title_fr:"Merci ! Votre demande a bien été reçue.",title_en:"Thank you! Your request has been received.",message_fr:"",message_en:""},L8=()=>{const{toast:e}=Et(),[t,n]=m.useState(Ab),[r,s]=m.useState(!0),[i,o]=m.useState(!1);m.useEffect(()=>{(async()=>{const{data:c}=await W.from("site_settings").select("value").eq("key","quote_auto_response").maybeSingle();c!=null&&c.value&&n({...Ab,...c.value}),s(!1)})()},[]);const l=async()=>{o(!0);const{error:c}=await W.from("site_settings").upsert({key:"quote_auto_response",value:t},{onConflict:"key"});o(!1),e(c?{title:"Erreur",description:c.message,variant:"destructive"}:{title:"Réponse automatique enregistrée"})};return r?a.jsx("p",{className:"text-muted-foreground",children:"Chargement..."}):a.jsx(Te,{children:a.jsxs(Ne,{className:"p-6 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(sj,{className:"w-5 h-5 text-primary"}),a.jsx("h3",{className:"font-semibold",children:"Réponse automatique — Demande de devis"})]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Ce message est affiché au client dès qu'il soumet le formulaire de devis. Utilisez ",a.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:"{name}"})," pour insérer son nom."]}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Titre (Français)"}
591),a.jsx(J,{value:t.title_fr,onChange:c=>n({...t,title_fr:c.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Titre (English)"}),a.jsx(J,{value:t.title_en,onChange:c=>n({...t,title_en:c.target.value})})]})]}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Message (Français)"}),a.jsx(rt,{rows:8,value:t.message_fr,onChange:c=>n({...t,message_fr:c.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Message (English)"}),a.jsx(rt,{rows:8,value:t.message_en,onChange:c=>n({...t,message_en:c.target.value})})]})]}),a.jsxs(z,{onClick:l,disabled:i,children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),i?"...":"Enregistrer"]})]})})},ig=({role:e,triggerLabel:t,onCreated:n})=>{const{toast:r}=Et(),[s,i]=m.useState(!1),[o,l]=m.useState(!1),[c,u]=m.useState(""),[d,h]=m.useState(""),[f,p]=m.useState(""),[g,v]=m.useState(""),[x,b]=m.useState("0"),[w,y]=m.useState(""),[_,j]=m.useState(""),[C,k]=m.useState(""),[S,P]=m.useState(""),[E,I]=m.useState(""),R=()=>{u(""),h(""),p(""),v(""),b("0"),y(""),j(""),k(""),P(""),I("")},$=async()=>{if(!c||!d||!f){r({title:"Champs requis manquants",variant:"destructive"});return}if(d.length<8){r({title:"Mot de passe trop court (min 8)",variant:"destructive"});return}l(!0);const T={email:c,password:d,role:e,full_name:f};e==="consultant"?Object.assign(T,{expertise:g,experience_years:parseInt(x)||0,skills:w.split(",").map(A=>A.trim()).filter(Boolean),photo_url:C||null,bio:_||null,is_public:!0}):e==="hiring_professional"&&Object.assign(T,{company_name:S||null,position:E||null});const{data:U,error:D}=await W.functions.invoke("admin-create-user",{body:T});if(l(!1),D||U!=null&&U.error){const A=(U==null?void 0:U.error)||(D==null?void 0:D.message)||"Erreur inconnue";r({title:"Erreur",description:A,variant:"destructive"});return}r({title:"Utilisateur créé"}),i(!1),R(),n==null||n()};return a.jsxs(en,{open:s,onOpenChange:T=>{i(T),T||R()},children:[a.jsxs(z,{size:"sm",onClick:()=>i(!0),children:[a.jsx(kO,{className:"w-4 h-4 mr-2"})," ",t]}),a.jsxs(Ut,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(Bt,{children:a.jsx(zt,{children:t})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Nom complet *"}),a.jsx(J,{value:f,onChange:T=>p(T.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Email *"}),a.jsx(J,{type:"email",value:c,onChange:T=>u(T.target.value)})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Mot de passe temporaire *"}),a.jsx(J,{type:"text",value:d,onChange:T=>h(T.target.value)}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"L'utilisateur pourra le changer ensuite."})]}),e==="consultant"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Expertise"}),a.jsx(J,{value:g,onChange:T=>v(T.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Années d'expérience"}),a.jsx(J,{type:"number",min:"0",value:x,onChange:T=>b(T.target.value)})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Compétences (séparées par des virgules)"}),a.jsx(J,{value:w,onChange:T=>y(T.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"URL photo"}),a.jsx(J,{type:"url",value:C,onChange:T=>k(T.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Bio"}),a.jsx(rt,{rows:3,value:_,onChange:T=>j(T.target.value)})]})]}),e==="hiring_professional"&&a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Entreprise"}),a.jsx(J,{value:S,onChange:T=>P(T.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Poste"}),a.jsx(J,{value:E,onChange:T=>I(T.target.value)})]})]}),e==="admin"&&a.jsx("p",{className:"text-sm text-muted-foreground bg-muted p-3 rounded",children:"Cet utilisateur aura un accès complet au panneau d'administration."})]}),a.jsxs(En,{children:[a.jsx(z,{variant:"outline",onClick:()=>i(!1),children:"Annuler"}),a.jsxs(z,{onClick:$,disabled:o,children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),o?"...":"Créer"]})]})]})]})},Ha={admin:"Administrateur",consultant:"Consultant",hiring_professional:"Recruteur"},$8=()=>{const{toast:e}=Et(),[t,n]=m.useState([]),[r,s]=m.useState(!0),[i,o]=m.useState(null),l=async()=>{s(!0);const{data:h,error:f}=await W.functions.invoke("admin-list-users");if(f){e({title:"Erreur",description:f.message,variant:"destructive"}),s(!1);return}const p=h;p.error?e({title:"Erreur",description:p.error,variant:"destructive"}):n(p.users??[]),s(!1)};m.useEffect(()=>{l()},[]);const c=async(h,f)=>{if(h.roles.includes(f))return;const{error:p}=await W.from("user_roles").insert({user_id:h.id,role:f});p?e({title:"Erreur",description:p.message,variant:"destructive"}):(e({title:`Rôle ${Ha[f]} attribué`}),l())},u=async()=>
591{if(!i)return;const{error:h}=await W.from("user_roles").delete().eq("user_id",i.user.id).eq("role",i.role);h?e({title:"Erreur",description:h.message,variant:"destructive"}):(e({title:"Rôle retiré"}),o(null),l())},d=h=>["admin","consultant","hiring_professional"].filter(f=>!h.roles.includes(f));return r?a.jsx("p",{className:"text-muted-foreground",children:"Chargement..."}):a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," utilisateur(s) — ",t.filter(h=>h.roles.includes("admin")).length," admin(s)"]}),a.jsx(ig,{role:"admin",triggerLabel:"Ajouter un administrateur",onCreated:l})]}),t.length===0?a.jsx("p",{className:"text-muted-foreground",children:"Aucun utilisateur."}):a.jsx("div",{className:"space-y-3",children:t.map(h=>a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4 flex flex-col md:flex-row md:items-center gap-4",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx(Is,{className:"w-4 h-4 text-muted-foreground shrink-0"}),a.jsx("h3",{className:"font-semibold truncate",children:h.full_name||"(Sans nom)"}),h.roles.map(f=>a.jsxs(Ve,{variant:f==="admin"?"default":"secondary",className:"gap-1",children:[f==="admin"?a.jsx(aj,{className:"w-3 h-3"}):a.jsx(pv,{className:"w-3 h-3"}),Ha[f],a.jsx("button",{type:"button","aria-label":`Retirer le rôle ${Ha[f]}`,onClick:()=>o({user:h,role:f}),className:"ml-1 hover:opacity-70",children:a.jsx(xr,{className:"w-3 h-3"})})]},f)),h.roles.length===0&&a.jsx(Ve,{variant:"outline",children:"Aucun rôle"})]}),a.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1 mt-1 truncate",children:[a.jsx(ya,{className:"w-3 h-3 shrink-0"})," ",h.email]})]}),d(h).length>0&&a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs(ze,{onValueChange:f=>c(h,f),children:[a.jsx(Le,{className:"w-52 h-9",children:a.jsx(He,{placeholder:"+ Ajouter un rôle"})}),a.jsx($e,{children:d(h).map(f=>a.jsx(ue,{value:f,children:Ha[f]},f))})]})})]})},h.id))}),a.jsx(Na,{open:!!i,onOpenChange:h=>!h&&o(null),children:a.jsxs(Ui,{children:[a.jsxs(Bi,{children:[a.jsx(Hi,{children:"Retirer ce rôle ?"}),a.jsxs(Bh,{children:["Retirer le rôle ",a.jsx("strong",{children:i&&Ha[i.role]})," ","de ",a.jsx("strong",{children:(i==null?void 0:i.user.full_name)||(i==null?void 0:i.user.email)}),".",(i==null?void 0:i.role)==="admin"&&a.jsx("span",{className:"block mt-2 text-destructive",children:"Attention : cet utilisateur perdra l'accès administrateur."})]})]}),a.jsxs(zi,{children:[a.jsx(qi,{children:"Annuler"}),a.jsx(Wi,{onClick:u,children:"Retirer"})]})]})})]})},Rb={name:"",campaign_type:"organization",description:"",language:"fr",status:"draft",daily_cap:25},F8=()=>{const{toast:e}=Et(),[t,n]=m.useState([]),[r,s]=m.useState(!0),[i,o]=m.useState(!1),[l,c]=m.useState(null),[u,d]=m.useState({...Rb}),h=async()=>{s(!0);const{data:x,error:b}=await W.from("outreach_campaigns").select("*").order("created_at",{ascending:!1});b?e({title:"Erreur",description:b.message,variant:"destructive"}):n(x||[]),s(!1)};m.useEffect(()=>{h()},[]);const f=()=>{c(null),d({...Rb}),o(!0)},p=x=>{c(x.id),d({name:x.name,campaign_type:x.campaign_type,description:x.description||"",language:x.language,status:x.status,daily_cap:x.daily_cap}),o(!0)},g=async()=>{if(!u.name.trim()){e({title:"Nom requis",variant:"destructive"});return}const x={name:u.name.trim(),campaign_type:u.campaign_type,description:u.description||null,language:u.language,status:u.status,daily_cap:Number(u.daily_cap)||25},{error:b}=l?await W.from("outreach_campaigns").update(x).eq("id",l):await W.from("outreach_campaigns").insert(x);b?e({title:"Erreur",description:b.message,variant:"destructive"}):(e({title:l?"Campagne mise à jour":"Campagne créée"}),o(!1),h())},v=async x=>{const{error:b}=await W.from("outreach_campaigns").delete().eq("id",x);b?e({title:"Erreur",description:b.message,variant:"destructive"}):(e({title:"Campagne supprimée"}),n(w=>w.filter(y=>y.id!==x)))};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Une campagne regroupe une cible, des modèles de message et un rythme d'envoi."}),a.jsxs(en,{open:i,onOpenChange:o,children:[a.jsx(Xl,{asChild:!0,children:a.jsxs(z,{onClick:f,className:"gap-2",children:[a.jsx($i,{className:"w-4 h-4"})," Nouvelle campagne"]})}),a.jsxs(Ut,{className:"max-w-lg",children:[a.jsx(Bt,{children:a.jsx(zt,{children:l?"Modifier la campagne":"Nouvelle campagne"})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Nom"}),a.jsx(J,{value:u.name,onChange:x=>d({...u,name:x.target.value})})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Type"}),a.jsxs(ze,{value:u.campaign_type,onValueChange:x=>d({...u,campaign_type:x}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsxs($e,{children:[a.jsx(ue,{value:"organization",children:"Prospection organisations"}),a.jsx(ue,{value:"consultant",children:"Recrutement consultants"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Langue"}),a.jsxs(ze,{value:u.language,onValueChange:x=>d({...u,language:x}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsxs($e,{children:[a.jsx(ue,{value:"fr",children:"Français"}),a.jsx(ue,{value:"en",children:"English"})]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Statut"}),a.jsxs(ze,{value:u.status,onValueChange:x=>d({...u,status:x}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsxs($e,{children:[a.jsx(ue,{value:"draft",children:"Brouillon"}),a.jsx(ue,{value:"active",children:"Active"}),a.jsx(ue,{value:"paused",children:"En pause"}),a.jsx(ue,{value:"finished",children:"Terminée"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Envois max / jour"}),a.jsx(J,{type:"number",min:"1",value:u.daily_cap,onChange:x=>d({...u,daily_cap:Number(x.target.value)})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Description"}),a.jsx(rt,{rows:3,value:u.description,onChange:x=>d({...u,description:x.target.value})})]})]}),a.jsxs(En,{children:[a.jsx(z,{variant:"outline",onClick:()=>o(!1),children:"Annuler"}),a.jsx(z,{onClick:g,children:"Enregistrer"})]})]})]})]}),r?a.jsx("p",{className:"text-muted-foreground",children:"Chargement…"}):t.length===0?a.jsx("p",{className:"text-muted-foreground",children:"Aucune campagne pour l'instant."}):a.jsx("div",{className:"space-y-3",children:t.map(x=>a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4 flex flex-col sm:flex-row sm:items-center gap-3",children:[a.jsx(rj,{className:"w-5 h-5 text-primary shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("h4",{className:"font-semibold truncate",children:x.name}),a.jsx(Ve,{variant:x.status==="active"?"default":"secondary",children:x.status}),a.jsx(Ve,{variant:"outline",children:x.campaign_type==="consultant"?"Consultants":"Organisations"}),a.jsx(Ve,{variant:"outline",children:x.language.toUpperCase()})]}),x.description&&a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:x.description}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Max ",x.daily_cap," envois/jour"]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(z,{variant:"outline",size:"sm",onClick:()=>p(x),children:a.jsx(zr,{className:"w-4 h-4"})}),a.jsx(z,{variant:"outline",size:"sm",onClick:()=>v(x.id),children:a.jsx(xr,{className:"w-4 h-4 text-destructive"})})]})]})},x.id))})]})},rp={new:"Nouveau",enriched:"Enrichi",approved:"Approuvé",contacted:"Contacté",replied:"A répondu",won:"Gagné",lost:"Perdu",do_not_contact:"Ne pas contacter"},Ob={campaign_id:"",prospect_type:"organization",full_name:"",organization:"",role_title:"",sector:"",city:"Ouagadougou",country:"Burkina Faso",email:"",email_status:"unknown",email_confidence:"none",linkedin_url:"",website:"",phone:"",notes:"",status:"new"},V8=e=>{const t=[];let n="",r=[],s=!1;for(let l=0;l<e.length;l++){const c=e[l];s?c==='"'?e[l+1]==='"'?(n+='"',l++):s=!1:n+=c:c==='"'?s=!0:c===","||c===";"?(r.push(n),n=""):c===`
592`?(r.push(n),t.push(r),r=[],n=""):c!=="\r"&&(n+=c)}(n.length||r.length)&&(r.push(n),t.push(r));const i=t.filter(l=>l.some(c=>
592c.trim()!==""));if(i.length<2)return[];const o=i[0].map(l=>l.trim().toLowerCase());return i.slice(1).map(l=>{const c={};return o.forEach((u,d)=>c[u]=(l[d]||"").trim()),c})},U8=()=>{const{toast:e}=Et(),[t,n]=m.useState([]),[r,s]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(""),[u,d]=m.useState("all"),[h,f]=m.useState("all"),[p,g]=m.useState(!1),[v,x]=m.useState(!1),[b,w]=m.useState(!1),[y,_]=m.useState(""),[j,C]=m.useState(null),[k,S]=m.useState({...Ob}),P=m.useRef(null),E=async()=>{o(!0);const[A,N]=await Promise.all([W.from("outreach_prospects").select("*").order("created_at",{ascending:!1}),W.from("outreach_campaigns").select("*").order("name")]);A.error?e({title:"Erreur",description:A.error.message,variant:"destructive"}):n(A.data||[]),N.error||s(N.data||[]),o(!1)};m.useEffect(()=>{E()},[]);const I=m.useMemo(()=>{const A=l.trim().toLowerCase();return t.filter(N=>u!=="all"&&N.prospect_type!==u||h!=="all"&&N.status!==h?!1:A?[N.full_name,N.organization,N.email,N.sector,N.role_title].filter(Boolean).some(O=>O.toLowerCase().includes(A)):!0)},[t,l,u,h]),R=()=>{C(null),S({...Ob}),g(!0)},$=A=>{C(A.id),S({campaign_id:A.campaign_id||"",prospect_type:A.prospect_type,full_name:A.full_name,organization:A.organization||"",role_title:A.role_title||"",sector:A.sector||"",city:A.city||"",country:A.country,email:A.email||"",email_status:A.email_status,email_confidence:A.email_confidence,linkedin_url:A.linkedin_url||"",website:A.website||"",phone:A.phone||"",notes:A.notes||"",status:A.status}),g(!0)},T=async()=>{if(!k.full_name.trim()){e({title:"Nom requis",variant:"destructive"});return}const A={campaign_id:k.campaign_id||null,prospect_type:k.prospect_type,full_name:k.full_name.trim(),organization:k.organization||null,role_title:k.role_title||null,sector:k.sector||null,city:k.city||null,country:k.country||"Burkina Faso",email:k.email?k.email.trim().toLowerCase():null,email_status:k.email?k.email_status==="unknown"?"found":k.email_status:"unknown",email_confidence:k.email_confidence,linkedin_url:k.linkedin_url||null,website:k.website||null,phone:k.phone||null,notes:k.notes||null,status:k.status},{error:N}=j?await W.from("outreach_prospects").update(A).eq("id",j):await W.from("outreach_prospects").insert({...A,source:"manual"});N?e({title:"Erreur",description:N.message,variant:"destructive"}):(e({title:j?"Prospect mis à jour":"Prospect ajouté"}),g(!1),E())},U=async A=>{const{error:N}=await W.from("outreach_prospects").delete().eq("id",A);N?e({title:"Erreur",description:N.message,variant:"destructive"}):n(O=>O.filter(V=>V.id!==A))},D=async A=>{w(!0);try{const N=V8(await A.text());if(N.length===0){e({title:"Fichier vide ou invalide",variant:"destructive"});return}const O=N.map(H=>({campaign_id:y||null,prospect_type:(H.type||"organization").toLowerCase().startsWith("cons")?"consultant":"organization",full_name:H.full_name||H.nom||H.name||"",organization:H.organization||H.organisation||H.entreprise||null,role_title:H.role||H.poste||H.title||null,sector:H.sector||H.secteur||null,city:H.city||H.ville||null,country:H.country||H.pays||"Burkina Faso",email:(H.email||"").trim().toLowerCase()||null,email_status:(H.email||"").trim()?"found":"unknown",email_confidence:(H.email||"").trim()?"medium":"none",linkedin_url:H.linkedin||H.linkedin_url||null,website:H.website||H.site||null,phone:H.phone||H.telephone||null,notes:H.notes||null,source:"csv",status:"new"})).filter(H=>H.full_name);if(O.length===0){e({title:"Aucune ligne valide",description:"La colonne full_name (ou nom) est requise.",variant:"destructive"});return}const{error:V}=await W.from("outreach_prospects").insert(O);V?e({title:"Erreur",description:V.message,variant:"destructive"}):(e({title:`${O.length} prospects importés`}),x(!1),E())}finally{w(!1),P.current&&(P.current.value="")}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-3",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(fO,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),a.jsx(J,{className:"pl-9",placeholder:"Rechercher un prospect…",value:l,onCh
592ange:A=>c(A.target.value)})]}),a.jsxs(ze,{value:u,onValueChange:d,children:[a.jsx(Le,{className:"w-full lg:w-48",children:a.jsx(He,{})}),a.jsxs($e,{children:[a.jsx(ue,{value:"all",children:"Tous les types"}),a.jsx(ue,{value:"organization",children:"Organisations"}),a.jsx(ue,{value:"consultant",children:"Consultants"})]})]}),a.jsxs(ze,{value:h,onValueChange:f,children:[a.jsx(Le,{className:"w-full lg:w-48",children:a.jsx(He,{})}),a.jsxs($e,{children:[a.jsx(ue,{value:"all",children:"Tous les statuts"}),Object.entries(rp).map(([A,N])=>a.jsx(ue,{value:A,children:N},A))]})]}),a.jsxs(en,{open:v,onOpenChange:x,children:[a.jsx(Xl,{asChild:!0,children:a.jsxs(z,{variant:"outline",className:"gap-2",children:[a.jsx(jO,{className:"w-4 h-4"})," Importer CSV"]})}),a.jsxs(Ut,{children:[a.jsxs(Bt,{children:[a.jsx(zt,{children:"Importer des prospects"}),a.jsx(ec,{children:"Colonnes reconnues : full_name (requis), type, organization, role, sector, city, country, email, linkedin, website, phone, notes."})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Campagne cible"}),a.jsxs(ze,{value:y||"none",onValueChange:A=>_(A==="none"?"":A),children:[a.jsx(Le,{children:a.jsx(He,{placeholder:"Aucune"})}),a.jsxs($e,{children:[a.jsx(ue,{value:"none",children:"Aucune"}),r.map(A=>a.jsx(ue,{value:A.id,children:A.name},A.id))]})]})]}),a.jsx(J,{ref:P,type:"file",accept:".csv,text/csv",disabled:b,onChange:A=>{var O;const N=(O=A.target.files)==null?void 0:O[0];N&&D(N)}}),b&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"Import en cours…"})]})]})]}),a.jsxs(en,{open:p,onOpenChange:g,children:[a.jsx(Xl,{asChild:!0,children:a.jsxs(z,{onClick:R,className:"gap-2",children:[a.jsx($i,{className:"w-4 h-4"})," Ajouter"]})}),a.jsxs(Ut,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(Bt,{children:a.jsx(zt,{children:j?"Modifier le prospect":"Nouveau prospect"})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Type"}),a.jsxs(ze,{value:k.prospect_type,onValueChange:A=>S({...k,prospect_type:A}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsxs($e,{children:[a.jsx(ue,{value:"organization",children:"Organisation"}),a.jsx(ue,{value:"consultant",children:"Consultant"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Campagne"}),a.jsxs(ze,{value:k.campaign_id||"none",onValueChange:A=>S({...k,campaign_id:A==="none"?"":A}),children:[a.jsx(Le,{children:a.jsx(He,{placeholder:"Aucune"})}),a.jsxs($e,{children:[a.jsx(ue,{value:"none",children:"Aucune"}),r.map(A=>a.jsx(ue,{value:A.id,children:A.name},A.id))]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Nom complet *"}),a.jsx(J,{value:k.full_name,onChange:A=>S({...k,full_name:A.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Organisation"}),a.jsx(J,{value:k.organization,onChange:A=>S({...k,organization:A.target.value})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Poste"}),a.jsx(J,{value:k.role_title,onChange:A=>S({...k,role_title:A.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Secteur"}),a.jsx(J,{value:k.sector,onChange:A=>S({...k,sector:A.target.value})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Ville"}),a.jsx(J,{value:k.city,onChange:A=>S({...k,city:A.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Pays"}),a.jsx(J,{value:k.country,onChange:A=>S({...k,country:A.target.value})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Email"}),a.jsx(J,{type:"email",value:k.email,onChange:A=>S({...k,email:A.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Fiabilité de l'email"}),a.jsxs(ze,{value:k.email_confidence,onValueChange:A=>S({...k,email_confidence:A}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsxs($e,{children:[a.jsx(ue,{value:"none",children:"Inconnue"}),a.jsx(ue,{value:"low",children:"Faible (déduit)"}),a.jsx(ue,{value:"medium",children:"Moyenne"}),a.jsx(ue,{value:"high",children:"Élevée (vérifié)"})]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"LinkedIn"}),a.jsx(J,{value:k.linkedin_url,onChange:A=>S({...k,linkedin_url:A.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Site web"}),a.jsx(J,{value:k.website,onChange:A=>S({...k,website:A.target.value})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Téléphone"}),a.jsx(J,{value:k.phone,onChange:A=>S({...k,phone:A.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Statut"}),a.jsxs(ze,{value:k.status,onValueChange:A=>S({...k,status:A}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsx($e,{children:Object.entries(rp).map(([A,N])=>a.jsx(ue,{value:A,children:N},A))})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Notes"}),a.jsx(rt,{rows:3,value:k.notes,onChange:A=>S({...k,notes:A.target.value})})]})]}),a.jsxs(En,{children:[a.jsx(z,{variant:"outline",onClick:()=>g(!1),children:"Annuler"}),a.jsx(z,{onClick:T,children:"Enregistrer"})]})]})]})]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[I.length," prospect(s) affiché(s) sur ",t.length]}),i?a.jsx("p",{className:"text-muted-foreground",children:"Chargement…"}):I.length===0?a.jsx("p",{className:"text-muted-foreground",children:"Aucun prospect."}):a.jsx("div",{className:"space-y-3",children:I.map(A=>a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4 flex flex-col sm:flex-row sm:items-center gap-3",children:[A.prospect_type==="consultant"?a.jsx(Is,{className:"w-5 h-5 text-primary shrink-0"}):a.jsx(ah,{className:"w-5 h-5 text-primary shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("h4",{className:"font-semibold truncate",children:A.full_name}),a.jsx(Ve,{variant:"secondary",children:rp[A.status]||A.status}),A.email?a.jsx(Ve,{variant:"outline",children:A.email}):a.jsx(Ve,{variant:"outline",children:"Email manquant"}),A.fit_score!==null&&a.jsxs(Ve,{children:["Score ",A.fit_score]})]}),a.jsx("p",{className:"text-sm text-muted-foreground truncate",children:[A.role_title,A.organization,A.sector,A.city].filter(
592Boolean).join(" · ")})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(z,{variant:"outline",size:"sm",onClick:()=>$(A),children:a.jsx(zr,{className:"w-4 h-4"})}),a.jsx(z,{variant:"outline",size:"sm",onClick:()=>U(A.id),children:a.jsx(xr,{className:"w-4 h-4 text-destructive"})})]})]})},A.id))})]})},B8=["{{name}}","{{organization}}","{{role}}","{{sector}}","{{city}}"],Ib={campaign_id:"",name:"",kind:"initial",step_number:0,delay_days:0,subject_fr:"",body_fr:"",subject_en:"",body_en:"",is_active:!0},z8=()=>{const{toast:e}=Et(),[t,n]=m.useState([]),[r,s]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(!1),[u,d]=m.useState(null),[h,f]=m.useState({...Ib}),p=async()=>{o(!0);const[y,_]=await Promise.all([W.from("outreach_templates").select("*").order("step_number",{ascending:!0}),W.from("outreach_campaigns").select("*").order("name")]);y.error?e({title:"Erreur",description:y.error.message,variant:"destructive"}):n(y.data||[]),_.error||s(_.data||[]),o(!1)};m.useEffect(()=>{p()},[]);const g=()=>{d(null),f({...Ib}),c(!0)},v=y=>{d(y.id),f({campaign_id:y.campaign_id||"",name:y.name,kind:y.kind,step_number:y.step_number,delay_days:y.delay_days,subject_fr:y.subject_fr,body_fr:y.body_fr,subject_en:y.subject_en,body_en:y.body_en,is_active:y.is_active}),c(!0)},x=async()=>{if(!h.name.trim()){e({title:"Nom requis",variant:"destructive"});return}const y={campaign_id:h.campaign_id||null,name:h.name.trim(),kind:h.kind,step_number:Number(h.step_number)||0,delay_days:Number(h.delay_days)||0,subject_fr:h.subject_fr,body_fr:h.body_fr,subject_en:h.subject_en,body_en:h.body_en,is_active:h.is_active},{error:_}=u?await W.from("outreach_templates").update(y).eq("id",u):await W.from("outreach_templates").insert(y);_?e({title:"Erreur",description:_.message,variant:"destructive"}):(e({title:u?"Modèle mis à jour":"Modèle créé"}),c(!1),p())},b=async y=>{const{error:_}=await W.from("outreach_templates").delete().eq("id",y);_?e({title:"Erreur",description:_.message,variant:"destructive"}):n(j=>j.filter(C=>C.id!==y))},w=async(y,_)=>{const{error:j}=await W.from("outreach_templates").update({is_active:_}).eq("id",y.id);j?e({title:"Erreur",description:j.message,variant:"destructive"}):n(C=>C.map(k=>k.id===y.id?{...k,is_active:_}:k))};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Variables disponibles : ",B8.join(" · ")]}),a.jsxs(en,{open:l,onOpenChange:c,children:[a.jsx(Xl,{asChild:!0,children:a.jsxs(z,{onClick:g,className:"gap-2",children:[a.jsx($i,{className:"w-4 h-4"})," Nouveau modèle"]})}),a.jsxs(Ut,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[a.jsx(Bt,{children:a.jsx(zt,{children:u?"Modifier le modèle":"Nouveau modèle"})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Nom"}),a.jsx(J,{value:h.name,onChange:y=>f({...h,name:y.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Campagne"}),a.jsxs(ze,{value:h.campaign_id||"none",onValueChange:y=>f({...h,campaign_id:y==="none"?"":y}),children:[a.jsx(Le,{children:a.jsx(He,{placeholder:"Aucune"})}),a.jsxs($e,{children:[a.jsx(ue,{value:"none",children:"Aucune (générique)"}),r.map(y=>a.jsx(ue,{value:y.id,children:y.name},y.id))]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Type"}),a.jsxs(ze,{value:h.kind,onValueChange:y=>f({...h,kind:y}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsxs($e,{children:[a.jsx(ue,{value:"initial",children:"Premier message"}),a.jsx(ue,{value:"follow_up",children:"Relance"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Étape"}),a.jsx(J,{type:"number",min:"0",value:h.step_number,onChange:y=>f({...h,step_number:Number(y.target.value)})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Délai (jours)"}),a.jsx(J,{type:"number",min:"0",value:h.delay_days,onChange:y=>f({...h,delay_days:Number(y.target.value)})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Objet (FR)"}
vendor: 6,512 bytes, line 592
592),a.jsx(J,{value:h.subject_fr,onChange:y=>f({...h,subject_fr:y.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Message (FR)"}),a.jsx(rt,{rows:7,value:h.body_fr,onChange:y=>f({...h,body_fr:y.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Subject (EN)"}),a.jsx(J,{value:h.subject_en,onChange:y=>f({...h,subject_en:y.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Message (EN)"}),a.jsx(rt,{rows:7,value:h.body_en,onChange:y=>f({...h,body_en:y.target.value})})]})]}),a.jsxs(En,{children:[a.jsx(z,{variant:"outline",onClick:()=>c(!1),children:"Annuler"}),a.jsx(z,{onClick:x,children:"Enregistrer"})]})]})]})]}),i?a.jsx("p",{className:"text-muted-foreground",children:"Chargement…"}):t.length===0?a.jsx("p",{className:"text-muted-foreground",children:"Aucun modèle."}):a.jsx("div",{className:"space-y-3",children:t.map(y=>a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4 flex flex-col sm:flex-row sm:items-center gap-3",children:[a.jsx(ya,{className:"w-5 h-5 text-primary shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("h4",{className:"font-semibold truncate",children:y.name}),a.jsx(Ve,{variant:"outline",children:y.kind==="follow_up"?`Relance J+${y.delay_days}`:"Premier message"}),a.jsxs(Ve,{variant:"secondary",children:["Étape ",y.step_number]})]}),a.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.subject_fr})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cn,{checked:y.is_active,onCheckedChange:_=>w(y,_)}),a.jsx(z,{variant:"outline",size:"sm",onClick:()=>v(y),children:a.jsx(zr,{className:"w-4 h-4"})}),a.jsx(z,{variant:"outline",size:"sm",onClick:()=>b(y.id),children:a.jsx(xr,{className:"w-4 h-4 text-destructive"})})]})]})},y.id))})]})};var zh="Checkbox",[H8,K9]=hn(zh),[W8,wy]=H8(zh);function q8(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:i,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:h}=e,[f,p]=Lr({prop:n,defaultProp:s??!1,onChange:c,caller:zh}),[g,v]=m.useState(null),[x,b]=m.useState(null),w=m.useRef(!1),y=g?!!o||!!g.closest("form"):!0,_={checked:f,disabled:i,setChecked:p,control:g,setControl:v,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,required:u,defaultChecked:Ns(s)?!1:s,isFormControl:y,bubbleInput:x,setBubbleInput:b};return a.jsx(W8,{scope:t,..._,children:K8(h)?h(_):r})}var GN="CheckboxTrigger",YN=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:i,value:o,disabled:l,checked:c,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:g}=wy(GN,e),v=Se(s,d),x=m.useRef(c);return m.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const w=()=>h(x.current);return b.addEventListener("reset",w),()=>b.removeEventListener("reset",w)}},[i,h]),a.jsx(he.button,{type:"button",role:"checkbox","aria-checked":Ns(c)?"mixed":c,"aria-required":u,"data-state":e2(c),"data-disabled":l?"":void 0,disabled:l,value:o,...r,ref:v,onKeyDown:ae(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:ae(n,b=>{h(w=>Ns(w)?!0:!w),g&&p&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});YN.displayName=GN;var by=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:o,disabled:l,value:c,onCheckedChange:u,form:d,...h}=e;return a.jsx(q8,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:l,required:o,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:f})=>a.jsxs(a.Fragment,{children:[a.jsx(YN,{...h,ref:t,__scopeCheckbox:n}),f&&a.jsx(XN,{__scopeCheckbox:n})]})})});by.displayName=zh;var ZN="CheckboxIndicator",JN=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=wy(ZN,n);return a.jsx(Br,{present:r||Ns(i.checked)||i.checked===!0,children:a.jsx(he.span,{"data-state":e2(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});JN.displayName=ZN;var QN="CheckboxBubbleInput",XN=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:o,required:l,disabled:c,name:u,value:d,form:h,bubbleInput:f,setBubbleInput:p}=wy(QN,e),g=Se(n,p),v=Ah(i),x=hh(r);m.useEffect(()=>{const w=f;if(!w)return;const y=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(y,"checked").set,C=!s.current;if(v!==i&&j){const k=new Event("click",{bubbles:C});w.indeterminate=Ns(i),j.call(w,Ns(i)?!1:i),w.dispatchEvent(k)}},[f,v,i,s]);const b=m.useRef(Ns(i)?!1:i);return a.jsx(he.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??b.current,required:l,disabled:c,name:u,value:d,form:h,...t,tabIndex:-1,ref:g,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});XN.displayName=QN;function K8(e){return typeof e=="function"}function Ns(e){return e==="indeterminate"}function e2(e){return Ns(e)?"indeterminate":e?"checked":"unchecked"}const yl=m.forwardRef(({className:e,...t},n)=>a.jsx(by,{ref:n,className:de("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-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",e),...t,children:a.jsx(JN,{className:de("flex items-center justify-center text-current"),children:a.jsx(Dl,{className:"h-4 w-4"})})}));yl.displayName=by.displayName;const G8={draft:"Brouillon",approved:"Approuvé",rejected:"Rejeté",scheduled:"Planifié",sent:"Envoyé",failed:"Échec"},Y8={draft:"secondary",approved:"default",rejected:"destructive",scheduled:"outline",sent:"default",failed:"destructive"},Z8=()=>{const{toast:e}=Et(),[t,n]=m.useState([]),[r,s]=m.useState([]),[i,o]=m.useState([]),[l,c]=m.useState([]),[u,d]=m.useState(!0),[h,f]=m.useState("draft"),[p,g]=m.useState([]),[v,x]=m.useState(null),[b,w]=m.useState({subject:"",body:""}),[y,_]=m.useState(!1),[j,C]=m.useState(""),[k,S]=m.useState(""),[P,E]=m.useState(!0),[I,R]=m.useState([]),[$,T]=m.useState(!1),U=async()=>{d(!0);const[M,ie,fe,pe]=await Promise.all([W.from("outreach_messages").select("*").order("created_at",{ascending:!1}),W.from("outreach_prospects").select("id, full_name, organization, email, email_status, prospect_type, status, c
592ampaign_id").order("full_name"),W.from("outreach_campaigns").select("id, name").order("name"),W.from("outreach_templates").select("id, name, campaign_id, step_number").eq("is_active",!0).order("step_number")]);n(M.data??[]),s(ie.data??[]),o(fe.data??[]),c(pe.data??[]),d(!1)};m.useEffect(()=>{U()},[]);const D=m.useMemo(()=>new Map(r.map(M=>[M.id,M])),[r]),A=m.useMemo(()=>h==="all"?t:t.filter(M=>M.state===h),[t,h]),N=m.useMemo(()=>r.filter(M=>M.status!=="do_not_contact"&&(!j||M.campaign_id===j)),[r,j]),O=async()=>{if(!k||I.length===0){e({title:"Sélection incomplète",description:"Choisissez un modèle et au moins un prospect.",variant:"destructive"});return}T(!0);const{data:M,error:ie}=await W.functions.invoke("outreach-draft",{body:{prospect_ids:I,template_id:k,campaign_id:j||null,personalize:P}});if(T(!1),ie||M!=null&&M.error){e({title:"Échec de la génération",description:(M==null?void 0:M.error)??(ie==null?void 0:ie.message),variant:"destructive"});return}e({title:"Brouillons générés",description:`${M.created} message(s) en attente d'approbation.`}),_(!1),R([]),f("draft"),U()},V=async(M,ie)=>{var we;const fe={state:ie};if(ie==="approved"){const{data:mt}=await W.auth.getUser();fe.approved_at=new Date().toISOString(),fe.approved_by=((we=mt.user)==null?void 0:we.id)??null}const{error:pe}=await W.from("outreach_messages").update(fe).in("id",M);if(pe){e({title:"Erreur",description:pe.message,variant:"destructive"});return}g([]),U()},H=async()=>{if(!v)return;const{error:M}=await W.from("outreach_messages").update({subject:b.subject,body:b.body}).eq("id",v.id);if(M){e({title:"Erreur",description:M.message,variant:"destructive"});return}x(null),U()},Z=M=>{const ie=D.get(M.prospect_id);if(!(ie!=null&&ie.email)){e({title:"Aucune adresse email",description:"Ajoutez une adresse au prospect avant l'envoi.",variant:"destructive"});return}window.open(`mailto:${ie.email}?subject=${encodeURIComponent(M.subject)}&body=${encodeURIComponent(M.body)}`,"_blank")},[B,le]=m.useState(!1),Pe=async M=>{le(!0);const{data:ie,error:fe}=await W.functions.invoke("outreach-send",{body:{message_ids:M}});if(le(!1),fe||ie!=null&&ie.error){e({title:"Échec de l'envoi",description:(ie==null?void 0:ie.error)??(fe==null?void 0:fe.message),variant:"destructive"});return}const pe=ie.sent,we=M.length-pe;e({title:`${pe} message(s) envoyé(s)`,description:we>0?`${we} en échec (email manquant ou suppression).`:"Notification envoyée à [email protected]."}),g([]),U()},Me=async M=>{await W.from("outreach_messages").update({state:"sent",sent_at:new Date().toISOString()}).eq("id",M.id),await W.from("outreach_prospects").update({status:"contacted",last_contacted_at:new Date().toISOString()}).eq("id",M.prospect_id),await W.from("outreach_events").insert({prospect_id:M.prospect_id,message_id:M.id,event_type:"sent",detail:"Envoi manuel depuis le back-office"}),U()},Q=(M,ie,fe)=>fe(ie.includes(M)?ie.filter(pe=>pe!==M):[...ie,M]);return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsxs(ze,{value:h,onValueChange:f,children:[a.jsx(Le,{className:"w-56",children:a.jsx(He,{})}),a.jsxs($e,{children:[a.jsx(ue,{value:"draft",children:"Brouillons"}),a.jsx(ue,{value:"approved",children:"Approuvés"}),a.jsx(ue,{value:"sent",children:"Envoyés"}),a.jsx(ue,{value:"rejected",children:"Rejetés"}),a.jsx(ue,{value:"all",children:"Tous"})]})]}),a.jsx(z,{variant:"outline",size:"icon",onClick:U,"aria-label":"Rafraîchir",children:a.jsx(fv,{className:"w-4 h-4"})}),a.jsx("div",{className:"flex-1"}),p.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs(z,{onClick:()=>V(p,"approved"),className:"gap-2",children:[a.jsx(Dl,{className:"w-4 h-4"})," Approuver (",p.length,")"]}),a.jsxs(z,{variant:"outline",onClick:()=>V(p,"rejected"),className:"gap-2",children:[a.jsx(fc,{className:"w-4 h-4"})," Rejeter"]}),h==="approved"&&a.jsxs(z,{variant:"outline",disabled:B,onClick:()=>Pe(p),className:"gap-2",children:[a.jsx(sa,{className:"w-4 h-4"})," ",B?"Envoi…":`Envoyer (${p.length})`]})]}),a.jsxs(z,{onClick:()=>_(!0),className:"gap-2",children:[a.jsx(Os,{className:"w-4 h-4"})," Générer des messages"]})]}),u?a.jsx("p",{className:"text-sm text-muted-foreground",children:"Chargement…"}):A.length===0?a.jsx(Te,{children:a.jsx(Ne,{className:"p-8 text-center text-sm text-muted-foreground",children:"Aucun message dans cette vue. Générez des brouillons personnalisés à partir d'un modèle et d'une liste de prospects."})}):a.jsx("div",{className:"space-y-3",children:A.map(M=>{const ie=D.get(M.prospect_id);return a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(yl,{checked:p.includes(M.id),onCheckedChange:()=>Q(M.id,p,g),className:"mt-1","aria-label":"Sélectionner"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"font-medium",children:(ie==null?void 0:ie.full_name)??"Prospect supprimé"}),(ie==null?void 0:ie.organization)&&a.jsxs("span",{className:"text-sm text-muted-foreground",children:["· ",ie.organization]}),a.jsx(Ve,{variant:Y8[M.state]??"secondary",children:G8[M.state]??M.state}),a.jsxs(Ve,{variant:"outline",children:["Étape ",M.step_number]}),ie!=null&&ie.email?a.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:ie.email}):a.jsx(Ve,{variant:"destructive",children:"Email manquant"})]}),a.jsx("p",{className:"mt-2 font-medium text-sm",children:M.subject}),a.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap line-clamp-6",children:M.body})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2 justify-end",children:[a.jsxs(z,{size:"sm",variant:"ghost",className:"gap-2",onClick:()=>{navigator.clipboard.writeText(`${M.subject}
593
594${M.body}
594`),e({title:"Copié dans le presse-papiers"})},children:[a.jsx(YR,{className:"w-4 h-4"})," Copier"]}),a.jsxs(z,{size:"sm",variant:"outline",className:"gap-2",onClick:()=>{x(M),w({subject:M.subject,body:M.body})},children:[a.jsx(zr,{className:"w-4 h-4"})," Modifier"]}),M.state==="draft"&&a.jsxs(a.Fragment,{children:[a.jsx(z,{size:"sm",variant:"outline",onClick:()=>V([M.id],"rejected"),children:"Rejeter"}),a.jsxs(z,{size:"sm",onClick:()=>V([M.id],"approved"),className:"gap-2",children:[a.jsx(Dl,{className:"w-4 h-4"})," Approuver"]})]}),M.state==="approved"&&a.jsxs(a.Fragment,{children:[a.jsxs(z,{size:"sm",disabled:B,onClick:()=>Pe([M.id]),className:"gap-2",children:[a.jsx(sa,{className:"w-4 h-4"})," Envoyer"]}),a.jsxs(z,{size:"sm",variant:"outline",className:"gap-2",onClick:()=>Z(M),children:[a.jsx(ya,{className:"w-4 h-4"})," Ouvrir dans l'email"]}),a.jsx(z,{size:"sm",variant:"outline",onClick:()=>Me(M),children:"Marquer comme envoyé"})]})]})]})},M.id)})}),a.jsx(en,{open:!!v,onOpenChange:M=>!M&&x(null),children:a.jsxs(Ut,{className:"max-w-2xl",children:[a.jsxs(Bt,{children:[a.jsx(zt,{children:"Modifier le message"}),a.jsx(ec,{children:"Ajustez l'objet et le corps avant approbation."})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx(L,{children:"Objet"}),a.jsx(J,{value:b.subject,onChange:M=>w({...b,subject:M.target.value})})]}),a.jsxs("div",{children:[a.jsx(L,{children:"Message"}),a.jsx(rt,{rows:12,value:b.body,onChange:M=>w({...b,body:M.target.value})})]})]}),a.jsxs(En,{children:[a.jsx(z,{variant:"outline",onClick:()=>x(null),children:"Annuler"}),a.jsx(z,{onClick:H,children:"Enregistrer"})]})]})}),a.jsx(en,{open:y,onOpenChange:_,children:a.jsxs(Ut,{className:"max-w-2xl",children:[a.jsxs(Bt,{children:[a.jsx(zt,{children:"Générer des messages personnalisés"}),a.jsx(ec,{children:"L'IA part de votre modèle et l'adapte au contexte de chaque prospect. Les messages arrivent en brouillon et nécessitent votre approbation."})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx(L,{children:"Campagne"}),a.jsxs(ze,{value:j||"none",onValueChange:M=>{C(M==="none"?"":M),R([])},children:[a.jsx(Le,{children:a.jsx(He,{placeholder:"Toutes"})}),a.jsxs($e,{children:[a.jsx(ue,{value:"none",children:"Aucune / toutes"}),i.map(M=>a.jsx(ue,{value:M.id,children:M.name},M.id))]})]})]}),a.jsxs("div",{children:[a.jsx(L,{children:"Modèle"}),a.jsxs(ze,{value:k,onValueChange:S,children:[a.jsx(Le,{children:a.jsx(He,{placeholder:"Choisir un modèle"})}),a.jsx($e,{children:l.filter(M=>!j||!M.campaign_id||M.campaign_id===j).map(M=>a.jsxs(ue,{value:M.id,children:[M.name," (étape ",M.step_number,")"]},M.id))})]})]})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx(yl,{checked:P,onCheckedChange:M=>E(!!M)}),"Personnalisation IA (sinon simple remplissage des variables)"]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs(L,{children:["Prospects (",I.length," sélectionné(s))"]}),a.jsx(z,{size:"sm",variant:"ghost",onClick:()=>R(I.length===N.length?[]:N.map(M=>M.id)),children:I.length===N.length?"Tout désélectionner":"Tout sélectionner"})]}),a.jsxs("div",{className:"max-h-64 overflow-y-auto border rounded-md divide-y",children:[N.length===0&&a.jsx("p",{className:"p-3 text-sm text-muted-foreground",children:"Aucun prospect éligible."}),N.map(M=>a.jsxs("label",{className:"flex items-center gap-3 p-2 text-sm cursor-pointer",children:[a.jsx(yl,{checked:I.includes(M.id),onCheckedChange:()=>Q(M.id,I,R)}),a.jsx("span",{className:"font-medium",children:M.full_name}),M.organization&&a.jsxs("span",{className:"text-muted-foreground",children:["· ",M.organization]}),!M.email&&a.jsx(Ve,{variant:"outline",children:"sans email"})]},M.id))]})]})]}),a.jsxs(En,{children:[a.jsx(z,{variant:"outline",onClick:()=>_(!1),children:"Annuler"}),a.jsxs(z,{onClick:O,disabled:$,className:"gap-2",children:[a.jsx(Os,{className:"w-4 h-4"}),$?"Génération…":"Générer"]})]})]})})]})},J8=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),[s,i]=m.useState([]),[o,l]=m.useState({unscored:0,contacted:0,drafts:0}),c=async()=>{const[h,f,p]=await Promise.all([W.from("outreach_prospects").select("id",{count:"exact",head:!0}).is("fit_score",null),W.from("outreach_prospects").select("id",{count:"exact",head:!0}).eq("status","contacted"),W.from("outreach_messages").select("id",{count:"exact",head:!0}).eq("state","draft")]);l({unscored:h.count??0,contacted:f.count??0,drafts:p.count??0})};m.useEffect(()=>{c()},[]);const u=async()=>{var h;t(!0);try{const{data:f,error:p}=await W.functions.invoke("outreach-score",{body:{only_unscored:!0,limit:25}});if(p)throw p;if(f!=null&&f.error)throw new Error(f.error);ut.success(`${(f==null?void 0:f.scored)??0} prospect(s) scoré(s) par l'IA`),(h=f==null?void 0:f.errors)!=null&&h.length&&ut.warning(f.errors.slice(0,3).join(" · ")),c()}catch(f){ut.error(f instanceof Error?f.message:"Échec du scoring")}finally{t(!1)}},d=async h=>{var f,p;r(!0);try{const{data:g,error:v}=await W.functions.invoke("outreach-followup",{body:{dry_run:h}});if(v)throw v;if(g!=null&&g.error)throw new Error(g.error);i((g==null?void 0:g.planned)??[]),h?ut.success(`${((f=g==null?void 0:g.planned)==null?void 0:f.length)??0} relance(s) éligible(s)`):ut.success(`${(g==null?void 0:g.created)??0} relance(s) préparée(s) — à approuver dans Messages`),(p=g==null?void 0:g.errors)!=null&&p.length&&ut.warning(g.errors.slice(0,3).join(" · ")),c()}catch(g){ut.error(g instanceof Error?g.message:"Échec de la génération des relances")}finally{r(!1)}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Prospects non scorés"}),a.jsx("p",{className:"text-2xl font-bold",children:o.unscored})]})}),a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Prospects contactés"}),a.jsx("p",{className:"text-2xl font-bold",children:o.contacted})]})}),a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Brouillons en attente"}),a.jsx("p",{className:"text-2xl font-bold",children:o.drafts})]})})]}),a.jsxs(Te,{children:[a.jsx(Us,{children:a.jsxs(Bs,{className:"text-base flex items-center gap-2",children:[a.jsx(Os,{className:"w-4 h-4 text-primary"})," Scoring IA des prospects"]})}),a.jsxs(Ne,{className:"space-y-3",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"L'IA attribue un score de pertinence (0-100) et une justification à chaque prospect non encore scoré, en tenant compte du secteur, du rôle, de la localisation et de la qualité des coordonnées. Traitement par lots de 25."}),a.jsxs(z,{onClick:u,disabled:e,className:"gap-2",children:[e?a.jsx(ul,{className:"w-4 h-4 animate-spin"}):a.jsx(Os,{className:"w-4 h-4"}),"Scorer les prospects"]})]})]}),a.jsxs(Te,{children:[a.jsx(Us,{children:a.jsxs(Bs,{className:"text-base flex items-center gap-2",children:[a.jsx(Kx,{className:"w-4 h-4 text-primary"})," Relances automatiques"]})}),a.jsxs(Ne,{className:"space-y-3",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Pour chaque campagne active, les prospects contactés et sans réponse reçoivent une relance dès que le délai du modèle de l'étape suivante est écoulé. Les brouillons créés restent soumis à votre approbation dans l'onglet Messages, dans la limite du plafond quotidien de la campagne."}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs(z,{variant:"outline",onClick:()=>d(!0),disabled:n,className:"gap-2",children:[n?a.jsx(ul,{className:"w-4 h-4 animate-spin"}):a.jsx(fv,{className:"w-4 h-4"}),"Simuler"]}),a.jsxs(z,{onClick:()=>d(!1),disabled:n,className:"gap-2",children:[n?a.jsx(ul,{className:"w-4 h-4 animate-spin"}):a.jsx(Kx,{className:"w-4 h-4"}),"Générer les relances"]})]}),s.length>0&&a.jsxs("div",{className:"mt-4 space-y-2",children:[a.jsx("p",{className:"text-sm font-medium",children:"Relances concernées"}),a.jsx("div",{className:"space-y-1",children:s.map((h,f)=>a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsxs(Ve,{variant:"secondary",children:["Étape ",h.step]}),a.jsx("span",{children:h.prospect}),a.jsxs("span",{className:"text-muted-foreground",children:["· ",h.campaign]})]},f))})]})]})]})]})},Mb=[{value:0,label:"Manuel uniquement"},{value:6,label:"Toutes les 6 heures"},{value:12,label:"Toutes les 12 heures"},{value:24,label:"Tous les jours"},{value:72,label:"Tous les 3 jours"},{value:168,label:"Toutes les semaines"},{value:336,label:"Toutes les 2 semaines"},{value:720,label:"Tous les mois"}],Db={name:"",prospect_type:"organization",brief:"",country:"Burkina Faso",max_results:8,frequency_hours:0,is_active:!0},Q8=()=>{const[e,t]=m.useState([]),[n,r]=m.useState([]),[s,i]=m.useState(!0),[o,l]=m.useState(null),[c,u]=m.useState(!1),[d,h]=m.useState(null),[f,p]=m.useState(Db),g=async()=>{const[S,P]=await Promise.all([W.from("outreach_discovery_briefs").select("*").order("created_at",{ascending:!1}),W.from("outreach_discovery_candidates").select("*").eq("status","pen
594ding").order("fit_score",{ascending:!1}).limit(200)]);t(S.data??[]),r(P.data??[]),i(!1)};m.useEffect(()=>{g()},[]);const v=()=>{h(null),p(Db),u(!0)},x=S=>{h(S),p({name:S.name,prospect_type:S.prospect_type,brief:S.brief,country:S.country,max_results:S.max_results,frequency_hours:S.frequency_hours,is_active:S.is_active}),u(!0)},b=async()=>{if(!f.name.trim()||!f.brief.trim()){ut.error("Nom et brief obligatoires");return}const S={...f,paused_reason:null,next_run_at:f.frequency_hours>0?new Date(Date.now()+6e4).toISOString():null},{error:P}=d?await W.from("outreach_discovery_briefs").update(S).eq("id",d.id):await W.from("outreach_discovery_briefs").insert(S);if(P){ut.error(P.message);return}ut.success(d?"Brief mis à jour":"Brief créé"),u(!1),g()},w=async S=>{const{error:P}=await W.from("outreach_discovery_briefs").delete().eq("id",S);if(P)return ut.error(P.message);ut.success("Brief supprimé"),g()},y=async(S,P)=>{const{error:E}=await W.from("outreach_discovery_briefs").update({is_active:P,paused_reason:P?null:S.paused_reason,next_run_at:P&&S.frequency_hours>0?new Date(Date.now()+6e4).toISOString():null}).eq("id",S.id);if(E)return ut.error(E.message);g()},_=async S=>{var P;l(S.id);try{const{data:E,error:I}=await W.functions.invoke("outreach-discover",{body:{brief_id:S.id}});if(I)throw I;if(E!=null&&E.error)throw new Error(E.error);ut.success(`${(E==null?void 0:E.inserted)??0} candidat(s) ajouté(s) à la file d'examen`),(P=E==null?void 0:E.errors)!=null&&P.length&&ut.warning(E.errors.slice(0,2).join(" · ")),g()}catch(E){ut.error(E instanceof Error?E.message:"Échec de la découverte")}finally{l(null)}},j=async S=>{const{data:P,error:E}=await W.from("outreach_prospects").insert({prospect_type:S.prospect_type,full_name:S.full_name,organization:S.organization,role_title:S.role_title,sector:S.sector,city:S.city,country:S.country,email:S.email,email_status:S.email?"found":"unknown",email_confidence:S.email_confidence==="unknown"?"low":S.email_confidence,website:S.website,linkedin_url:S.linkedin_url,source:"ai_discovery",fit_score:S.fit_score,fit_reason:S.fit_reason,notes:S.evidence,status:"enriched"}).select("id").single();if(E)return ut.error(E.message);await W.from("outreach_discovery_candidates").update({status:"approved",reviewed_at:new Date().toISOString(),prospect_id:P.id}).eq("id",S.id),ut.success(`${S.full_name} ajouté aux prospects`),r(I=>I.filter(R=>R.id!==S.id))},C=async S=>{const{error:P}=await W.from("outreach_discovery_candidates").update({status:"rejected",reviewed_at:new Date().toISOString()}).eq("id",S.id);if(P)return ut.error(P.message);r(E=>E.filter(I=>I.id!==S.id))},k=S=>{var P;return((P=Mb.find(E=>E.value===S))==null?void 0:P.label)??`Toutes les ${S} h`};return s?a.jsx("div",{className:"flex justify-center py-10",children:a.jsx(ul,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold",children:"Découverte automatique"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Définissez un brief de recherche et sa fréquence. Les candidats trouvés arrivent dans la file d'examen — rien n'entre dans les prospects sans votre validation."})]}),a.jsxs(en,{open:c,onOpenChange:u,children:[a.jsx(Xl,{asChild:!0,children:a.jsxs(z,{onClick:v,className:"gap-2",children:[a.jsx($i,{className:"w-4 h-4"})," Nouveau brief"]})}),a.jsxs(Ut,{className:"max-w-lg",children:[a.jsx(Bt,{children:a.jsx(zt,{children:d?"Modifier le brief":"Nouveau brief de recherche"})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Nom"}),a.jsx(J,{value:f.name,onChange:S=>p({...f,name:S.target.value}),placeholder:"Institutions de microfinance à Ouagadougou"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Type"}),a.jsxs(ze,{value:f.prospect_type,onValueChange:S=>p({...f,prospect_type:S}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsxs($e,{children:[a.jsx(ue,{value:"organization",children:"Organisation"}),a.jsx(ue,{value:"consultant",children:"Consultant"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Pays"}),a.jsx(J,{value:f.country,onChange:S=>p({...f,country:S.target.value})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Brief de recherche"}),a.jsx(rt,{rows:4,value:f.brief,onChange:S=>p({...f,brief:S.target.value}),placeholder:"Ex : institutions de microfinance de 20+ salariés à Ouagadougou, en cours de digitalisation, avec un responsable SI identifiable."})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Fréquence de recherche"}),a.jsxs(ze,{value:String(f.frequency_hours),onValueChange:S=>p({...f,frequency_hours:Number(S)}),children:[a.jsx(Le,{children:a.jsx(He,{})}),a.jsx($e,{children:Mb.map(S=>
594a.jsx(ue,{value:String(S.value),children:S.label},S.value))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Candidats par exécution"}),a.jsx(J,{type:"number",min:1,max:15,value:f.max_results,onChange:S=>p({...f,max_results:Number(S.target.value)})})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Cn,{checked:f.is_active,onCheckedChange:S=>p({...f,is_active:S})}),a.jsx("span",{className:"text-sm",children:"Brief actif"})]})]}),a.jsxs(En,{children:[a.jsx(z,{variant:"outline",onClick:()=>u(!1),children:"Annuler"}),a.jsx(z,{onClick:b,children:"Enregistrer"})]})]})]})]}),a.jsxs("div",{className:"grid gap-3",children:[e.length===0&&a.jsx(Te,{children:a.jsx(Ne,{className:"p-6 text-sm text-muted-foreground",children:"Aucun brief pour l'instant."})}),e.map(S=>a.jsx(Te,{children:a.jsx(Ne,{className:"p-4 space-y-2",children:a.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("p",{className:"font-medium",children:S.name}),a.jsx(Ve,{variant:"secondary",children:S.prospect_type==="consultant"?"Consultant":"Organisation"}),a.jsxs(Ve,{variant:"outline",className:"gap-1",children:[a.jsx(qR,{className:"w-3 h-3"})," ",k(S.frequency_hours)]})]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:S.brief}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[S.last_run_at?`Dernière recherche : ${new Date(S.last_run_at).toLocaleString("fr-FR")}`:"Jamais exécuté",S.next_run_at&&S.is_active?` · Prochaine : ${new Date(S.next_run_at).toLocaleString("fr-FR")}`:""]}),S.paused_reason&&a.jsxs("p",{className:"text-xs text-destructive flex items-center gap-1 mt-1",children:[a.jsx(bO,{className:"w-3 h-3"})," En pause : ",S.paused_reason]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cn,{checked:S.is_active,onCheckedChange:P=>y(S,P)}),a.jsxs(z,{size:"sm",variant:"outline",className:"gap-2",disabled:o===S.id,onClick:()=>_(S),children:[o===S.id?a.jsx(ul,{className:"w-4 h-4 animate-spin"}):a.jsx(oj,{className:"w-4 h-4"}),"Rechercher"]}),a.jsx(z,{size:"icon",variant:"ghost",onClick:()=>x(S),children:a.jsx(zr,{className:"w-4 h-4"})}),a.jsx(z,{size:"icon",variant:"ghost",onClick:()=>w(S.id),children:a.jsx(xr,{className:"w-4 h-4 text-destructive"})})]})]})})},S.id))]}),a.jsxs(Te,{children:[a.jsx(Us,{children:a.jsxs(Bs,{className:"text-base",children:["File d'examen (",n.length,")"]})}),a.jsxs(Ne,{className:"space-y-3",children:[n.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"Aucun candidat en attente d'examen."}),n.map(S=>a.jsx("div",{className:"border rounded-lg p-3 space-y-1",children:a.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("p",{className:"font-medium",children:S.full_name}),S.organization&&a.jsxs("span",{className:"text-sm text-muted-foreground",children:["· ",S.organization]}),S.fit_score!==null&&a.jsxs(Ve,{children:[S.fit_score,"/100"]}),!S.email&&a.jsx(Ve,{variant:"outline",children:"Email à trouver"})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:[S.role_title,S.sector,S.city,S.country].filter(Boolean).join(" · ")}),S.email&&a.jsx("p",{className:"text-sm font-mono",children:S.email}),S.fit_reason&&a.jsx("p",{className:"text-sm",children:S.fit_reason}),S.evidence&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Source : ",S.evidence]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(z,{size:"sm",className:"gap-1",onClick:()=>j(S),children:[a.jsx(Dl,{className:"w-4 h-4"})," Approuver"]}),a.jsxs(z,{size:"sm",variant:"outline",className:"gap-1",onClick:()=>C(S),children:[a.jsx(fc,{className:"w-4 h-4"})," Rejeter"]})]})]})},S.id))]})]})]})},X8=()=>a.jsxs("div",{className:"space-y-6",children:[a.jsx(Te,{className:"border-primary/30",children:a.jsxs(Ne,{className:"p-4 flex gap-3",children:[a.jsx(rO,{className:"w-5 h-5 text-primary shrink-0 mt-0.5"}),a.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[a.jsx("p",{className:"font-medium text-foreground",children:"Prospection automatisée"}),a.jsxs("p",{children:["Générez des messages personnalisés par IA, approuvez-les puis envoyez-les automatiquement via ",a.jsx("span",{className:"font-mono",children:"outreach.richmedia.bf"}),". L'onglet Automatisation score vos prospects par IA et prépare les relances des prospects sans réponse — chaque relance reste soumise à votre approbation avant envoi."]})]})]})}),a.jsxs(uy,{defaultValue:"prospects",children:[a.jsxs($h,{className:"flex flex-wrap h-auto",children:[a.jsxs(dt,{value:"prospects",className:"gap-2",children:[a.jsx(CO,{className:"w-4 h-4"})," Prospects"]}),a.jsxs(dt,{value:"campaigns",className:"gap-2",children:[a.jsx(rj,{className:"w-4 h-4"})," Campagnes"]}),a.jsxs(dt,{value:"templates",className:"gap-2",children:[a.jsx(ya,{className:"w-4 h-4"})," Modèles"]}),a.jsxs(dt,{value:"messages",className:"gap-2",children:[a.jsx(Os,{className:"w-4 h-4"})," Messages"]}),a.jsxs(dt,{value:"discovery",className:"gap-2",children:[a.jsx(oj,{className:"w-4 h-4"})," Découverte"]}),a.jsxs(dt,{value:"automation",className:"gap-2",children:[a.jsx(FR,{className:"w-4 h-4"})," Automatisation"]})]}),a.jsx(ht,{value:"prospects",className:"mt-6",children:a.jsx(U8,{})}),a.jsx(ht,{value:"campaigns",className:"mt-6",children:a.jsx(F8,{})}),a.jsx(ht,{value:"templates",className:"mt-6",children:a.jsx(z8,{})}),a.jsx(ht,{value:"messages",className:"mt-6",children:a.jsx(Z8,{})}),a.jsx(ht,{value:"discovery",className:"mt-6",children:a.jsx(Q8,{})}),a.jsx(ht,{value:"automation",className:"mt-6",children:a.jsx(J8,{})})]})]}),e9=()=>{const{toast:e}=Et(),[t,n]=m.useState([]),[r,s]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(null),[u,d]=m.useState(null),[h,f]=m.useState(!1),[p,g]=m.useState(""),[v,x]=m.useState(""),[b,w]=m.useState(""),[y,_]=m.useState(""),[j,C]=m.useState(""),[k,S]=m.useState(""),P=async()=>{o(!0);const[T,U]=await Promise.all([W.from("consultant_profiles").select("*").order("is_featured",{ascending:!1}).order("created_at",{ascending:!1}),W.from("hiring_professional_profiles").select("*").order("created_at",{ascending:!1})]);T.error?e({title:"Erreur",description:T.error.message,variant:"destructive"}):n(T.data||[]),U.error?e({title:"Erreur",description:U.error.message,variant:"destructive"}):s(U.data||[]),o(!1)};m.useEffect(()=>{P()},[]);const E=T=>{var U,D;c(T),g(T.full_name),x(T.expertise),w(((U=T.experience_years)==null?void 0:U.toString())||"0"),_(((D=T.skills)==null?void 0:D.join(", "))||""),C(T.bio||""),S(T.photo_url||"")},I=async(T,U,D)=>{const A=U==="is_featured"?{is_featured:D}:{is_public:D},{error:N}=await W.from("consultant_profiles").update(A).eq("id",T.id);N?e({title:"Erreur",description:N.message,variant:"destructive"}):n(O=>O.map(V=>V.id===T.id?{...V,[U]:D}:V))},R=async()=>
594{if(!l)return;f(!0);const{error:T}=await W.from("consultant_profiles").update({full_name:p,expertise:v,experience_years:parseInt(b)||0,skills:y.split(",").map(U=>U.trim()).filter(Boolean),bio:j||null,photo_url:k||null}).eq("id",l.id);T?e({title:"Erreur",description:T.message,variant:"destructive"}):(e({title:"Profil mis à jour"}),c(null),P()),f(!1)},$=async()=>{if(!u)return;const{error:T}=await W.from("consultant_profiles").delete().eq("id",u.id);T?e({title:"Erreur",description:T.message,variant:"destructive"}):(e({title:"Consultant supprimé"}),n(U=>U.filter(D=>D.id!==u.id))),d(null)};return i?a.jsx("div",{className:"flex items-center justify-center py-16",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):a.jsxs(Ze.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[a.jsx(pv,{className:"w-6 h-6 text-primary"}),a.jsx("h2",{className:"text-2xl font-bold",children:"Panneau d'administration"})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 mb-8",children:[a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Consultants"}),a.jsx("p",{className:"text-3xl font-bold",children:t.length})]})}),a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Mis en avant"}),a.jsx("p",{className:"text-3xl font-bold",children:t.filter(T=>T.is_featured).length})]})}),a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Recruteurs"}),a.jsx("p",{className:"text-3xl font-bold",children:r.length})]})})]}),a.jsxs(uy,{defaultValue:"consultants",children:[a.jsxs($h,{className:"flex flex-wrap h-auto",children:[a.jsxs(dt,{value:"users",className:"gap-2",children:[a.jsx(aj,{className:"w-4 h-4"})," Rôles & Accès"]}),a.jsxs(dt,{value:"consultants",className:"gap-2",children:[a.jsx(ud,{className:"w-4 h-4"})," Consultants"]}),a.jsxs(dt,{value:"hiring",className:"gap-2",children:[a.jsx(hv,{className:"w-4 h-4"})," Recruteurs"]}),a.jsxs(dt,{value:"quotes",className:"gap-2",children:[a.jsx(XR,{className:"w-4 h-4"})," Devis"]}),a.jsxs(dt,{value:"outreach",className:"gap-2",children:[a.jsx(sa,{className:"w-4 h-4"})," Prospection"]}),a.jsxs(dt,{value:"autoresponse",className:"gap-2",children:[a.jsx(sj,{className:"w-4 h-4"})," Réponse auto"]}),a.jsxs(dt,{value:"services",className:"gap-2",children:[a.jsx(iO,{className:"w-4 h-4"})," Services"]}),a.jsxs(dt,{value:"subservices",className:"gap-2",children:[a.jsx(aO,{className:"w-4 h-4"})," Sous-services"]}),a.jsxs(dt,{value:"metrics",className:"gap-2",children:[a.jsx(BR,{className:"w-4 h-4"})," Métriques"]}),a.jsxs(dt,{value:"story",className:"gap-2",children:[a.jsx($R,{className:"w-4 h-4"})," Histoire"]})]}),a.jsx(ht,{value:"users",className:"mt-6",children:a.jsx($8,{})}),a.jsxs(ht,{value:"consultants",className:"mt-6",children:[a.jsx("div",{className:"flex justify-end mb-4",children:a.jsx(ig,{role:"consultant",triggerLabel:"Ajouter un consultant",onCreated:P})}),t.length===0?a.jsx("p",{className:"text-muted-foreground",children:"Aucun consultant."}):a.jsx("div",{className:"space-y-3",children:t.map(T=>{var U;return a.jsx(Te,{children:a.jsxs(Ne,{className:"p-4 flex flex-col md:flex-row md:items-center gap-4",children:[a.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[a.jsx("div",{className:"w-14 h-14 rounded-full bg-muted overflow-hidden shrink-0",children:T.photo_url?a.jsx("img",{src:T.photo_url,alt:T.full_name,className:"w-full h-full object-cover"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center",children:a.jsx(ud,{className:"w-6 h-6 text-muted-foreground"})})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("h3",{className:"font-semibold truncate",children:T.full_name}),T.is_featured&&a.jsxs(Ve,{variant:"default",className:"gap-1",children:[a.jsx(mv,{className:"w-3 h-3"})," Vedette"]}),T.is_public?a.jsxs(Ve,{variant:"secondary",className:"gap-1",children:[a.jsx(ej,{className:"w-3 h-3"})," Public"]}):a.jsx(Ve,{variant:"outline",children:"Privé"})]}),a.jsx("p",{className:"text-sm text-primary truncate",children:T.expertise}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.experience_years," ans • ",((U=T.skills)==null?void 0:U.length)||0," compétences"]})]})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cn,{checked:T.is_featured,onCheckedChange:D=>I(T,"is_featured",D),id:`feat-${T.id}`}),a.jsx(L,{htmlFor:`feat-${T.id}`,className:"text-xs",children:"Vedette"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cn,{checked:T.is_public,onCheckedChange:D=>I(T,"is_public",D),id:`pub-${T.id}`}),a.jsx(L,{htmlFor:`pub-${T.id}`,className:"text-xs",children:"Public"})]}),a.jsx(z,{variant:"outline",size:"sm",onClick:()=>E(T),children:a.jsx(zr,{className:"w-4 h-4"})}),a.jsx(z,{variant:"outline",size:"sm",onClick:()=>d(T),children:a.jsx(xr,{className:"w-4 h-4 text-destructive"})})]})]})},T.id)})})]}),a.jsxs(ht,{value:"hiring",className:"mt-6",children:[a.jsx("div",{className:"flex justify-end mb-4",children:a.jsx(ig,{role:"hiring_professional",triggerLabel:"Ajouter un recruteur",onCreated:P})}),r.length===0?a.jsx("p",{className:"text-muted-foreground",children:"Aucun recruteur."}):a.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:r.map(T=>a.jsxs(Te,{children:[a.jsx(Us,{children:a.jsx(Bs,{className:"text-base",children:T.full_name})}),a.jsxs(Ne,{className:"space-y-1",children:[T.company_name&&a.jsxs("p",{className:"text-sm",children:[a.jsx("span",{className:"text-muted-foreground",children:"Entreprise: "}),T.company_name]}),T.position&&a.jsxs("p",{className:"text-sm",children:[a.jsx("span",{className:"text-muted-foreground",children:"Poste: "}),T.position]})]})]},T.id))})]}),a.jsx(ht,{value:"quotes",className:"mt-6",children:a.jsx(D8,{})}),a.jsx(ht,{value:"outreach",className:"mt-6",children:a.jsx(X8,{})}),a.jsx(ht,{value:"autoresponse",className:"mt-6",children:a.jsx(L8,{})}),a.jsx(ht,{value:"services",className:"mt-6",children:a.jsx(N8,{})}),a.jsx(ht,{value:"subservices",className:"mt-6",children:a.jsx(I8,{})}),a.jsx(ht,{value:"metrics",className:"mt-6",children:a.jsx(P8,{})}),a.jsx(ht,{value:"story",className:"mt-6",children:a.jsx(R8,{})})]}),a.jsx(en,{open:!!l,onOpenChange:T=>!T&&c(null),children:a.jsxs(Ut,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(Bt,{children:[a.jsx(zt,{children:"Modifier le consultant"}),a.jsx(ec,{children:l==null?void 0:l.full_name})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Nom complet"}),a.jsx(J,{value:p,onChange:T=>g(T.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Expertise"}
594),a.jsx(J,{value:v,onChange:T=>x(T.target.value)})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Années d'expérience"}),a.jsx(J,{type:"number",min:"0",value:b,onChange:T=>w(T.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"URL photo"}),a.jsx(J,{type:"url",value:k,onChange:T=>S(T.target.value)})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Compétences (séparées par des virgules)"}),a.jsx(J,{value:y,onChange:T=>_(T.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:"Bio"}),a.jsx(rt,{value:j,onChange:T=>C(T.target.value),rows:4})]})]}),a.jsxs(En,{children:[a.jsx(z,{variant:"outline",onClick:()=>c(null),children:"Annuler"}),a.jsxs(z,{onClick:R,disabled:h,children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),h?"...":"Enregistrer"]})]})]})}),a.jsx(Na,{open:!!u,onOpenChange:T=>!T&&d(null),children:a.jsxs(Ui,{children:[a.jsxs(Bi,{children:[a.jsx(Hi,{children:"Supprimer ce consultant ?"}),a.jsxs(Bh,{children:["Cette action supprimera définitivement le profil de"," ",a.jsx("strong",{children:u==null?void 0:u.full_name}),". Cette action est irréversible."]})]}),a.jsxs(zi,{children:[a.jsx(qi,{children:"Annuler"}),a.jsx(Wi,{onClick:$,children:"Supprimer"})]})]})})]})},t9=()=>{const{t:e}=Qn(),{user:t,userRole:n,isLoading:r,signOut:s}=Sh(),i=vc(),{toast:o}=Et(),[l,c]=m.useState(null),[u,d]=m.useState([]),[h,f]=m.useState(!0),[p,g]=m.useState(!1),[v,x]=m.useState(""),[b,w]=m.useState(""),[y,_]=m.useState(""),[j,C]=m.useState(""),[k,S]=m.useState(""),[P,E]=m.useState("");m.useEffect(()=>{!r&&!t&&i("/auth")},[t,r,i]),m.useEffect(()=>{(async()=>{var T,U;if(!(!t||!n)){if(f(!0),n==="consultant"){const{data:D,error:A}=await W.from("consultant_profiles").select("*").eq("user_id",t.id).maybeSingle();D&&(c(D),x(D.full_name),w(D.expertise),_(((T=D.experience_years)==null?void 0:T.toString())||""),C(((U=D.skills)==null?void 0:U.join(", "))||""),S(D.bio||""),E(D.photo_url||"")),A&&console.error("Error fetching profile:",A)}else if(n==="hiring_professional"){const{data:D,error:A}=await W.from("consultant_profiles").select("*").order("is_featured",{ascending:!1}).order("created_at",{ascending:!1});D&&d(D),A&&console.error("Error fetching consultants:",A)}f(!1)}})()},[t,n]);const I=async()=>{if(!t||!l)return;g(!0);const{error:$}=await W.from("consultant_profiles").update({full_name:v,expertise:b,experience_years:parseInt(y)||0,skills:j.split(",").map(T=>T.trim()).filter(Boolean),bio:k||null,photo_url:P||null}).eq("user_id",t.id);o($?{title:"Error",description:$.message,variant:"destructive"}:{title:e.dashboard.profileUpdated}),g(!1)},R=async()=>{await s(),i("/")};return r||h?a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("header",{className:"border-b border-border bg-card",children:a.jsxs("div",{className:"container mx-auto px-4 py-4 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Lt,{to:"/",children:a.jsx("img",{src:Sc,alt:"Rich Media",className:"h-10 w-auto"})}),a.jsx("span",{className:"text-muted-foreground",children:"/"}),a.jsx("span",{className:"font-medium",children:e.nav.dashboard})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(Lt,{to:"/",className:"text-sm text-muted-foreground hover:text-foreground flex items-center gap-1",children:[a.jsx(dv,{className:"w-4 h-4"}),e.nav.home]}),a.jsx(z,{variant:"outline",size:"sm",onClick:R,children:e.nav.logout})]})]})}),a.jsx("main",{className:"container mx-auto px-4 py-8",children:a.jsxs(Ze.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},children:[a.jsxs("h1",{className:"text-3xl font-bold mb-2",children:[e.dashboard.welcome,", ",t==null?void 0:t.email]}),a.jsx("p",{className:"text-muted-foreground mb-8",children:n==="consultant"?e.auth.consultant:n==="hiring_professional"?e.auth.hiringProfessional:n==="admin"?"Administrateur":"Aucun rôle attribué"}),n==="admin"&&a.jsx(e9,{}),!n&&a.jsxs(Te,{className:"max-w-xl",children:[a.jsx(Us,{children:a.jsx(Bs,{children:"Aucun rôle attribué"})}),a.jsx(Ne,{children:a.jsx("p",{className:"text-muted-foreground",children:"Votre compte n'a pas encore de rôle. Contactez un administrateur ou créez un nouveau compte avec le rôle souhaité."})})]}),n==="consultant"&&l&&a.jsxs(Te,{className:"max-w-2xl",children:[a.jsx(Us,{children:a.jsxs(Bs,{className:"flex items-center gap-2",children:[a.jsx(Is,{className:"w-5 h-5"}),e.dashboard.consultantProfile]})}),a.jsxs(Ne,{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"edit-name",children:e.auth.fullName}
594),a.jsx(J,{id:"edit-name",value:v,onChange:$=>x($.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"edit-expertise",children:e.auth.consultantSignup.expertise}),a.jsx(J,{id:"edit-expertise",value:b,onChange:$=>w($.target.value)})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"edit-experience",children:e.auth.consultantSignup.experience}),a.jsx(J,{id:"edit-experience",type:"number",min:"0",value:y,onChange:$=>_($.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"edit-photo",children:e.auth.consultantSignup.photoUrl}),a.jsx(J,{id:"edit-photo",type:"url",value:P,onChange:$=>E($.target.value)})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"edit-skills",children:e.auth.consultantSignup.skills}),a.jsx(J,{id:"edit-skills",value:j,onChange:$=>C($.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"edit-bio",children:e.auth.consultantSignup.bio}),a.jsx(rt,{id:"edit-bio",value:k,onChange:$=>S($.target.value),rows:4})]}),a.jsxs(z,{onClick:I,disabled:p,children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),p?"...":e.dashboard.saveChanges]})]})]}),n==="hiring_professional"&&a.jsxs("div",{children:[a.jsxs("h2",{className:"text-xl font-semibold mb-6 flex items-center gap-2",children:[a.jsx(hv,{className:"w-5 h-5"}),e.dashboard.allConsultants]}),u.length===0?a.jsx("p",{className:"text-muted-foreground",children:e.consultants.noConsultants}):a.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-6",children:u.map($=>a.jsxs(Te,{className:"overflow-hidden",children:[a.jsxs("div",{className:"aspect-square bg-muted relative",children:[$.photo_url?a.jsx("img",{src:$.photo_url,alt:$.full_name,className:"w-full h-full object-cover"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center",children:a.jsx(Is,{className:"w-16 h-16 text-muted-foreground"})}),$.is_featured&&a.jsx("span",{className:"absolute top-2 right-2 bg-primary text-primary-foreground text-xs px-2 py-1 rounded",children:e.consultants.featured})]}),a.jsxs(Ne,{className:"p-4",children:[a.jsx("h3",{className:"font-semibold text-lg",children:$.full_name}),a.jsx("p",{className:"text-primary text-sm mb-2",children:$.expertise}),$.experience_years>0&&a.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:[$.experience_years," ",e.consultants.yearsExp]}),$.skills&&$.skills.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:$.skills.slice(0,4).map((T,U)=>a.jsx("span",{className:"text-xs bg-muted px-2 py-1 rounded",children:T},U))}),$.bio&&a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3",children:$.bio})]})]},$.id))})]})]})})]})};var Ee;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of i)o[l]=s[l];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},e.find=(s,i)=>{for(const o of s)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Ee||(Ee={}));var Lb;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Lb||(Lb={}));const se=Ee.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ss=e=>{switch(typeof e){case"undefined":return se.undefined;case"string":return se.string;case"number":return Number.isNaN(e)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;
vendor: 4,991 bytes, line 594
594case"object":return Array.isArray(e)?se.array:e===null?se.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?se.promise:typeof Map<"u"&&e instanceof Map?se.map:typeof Set<"u"&&e instanceof Set?se.set:typeof Date<"u"&&e instanceof Date?se.date:se.object;default:return se.unknown}},K=Ee.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Vr extends Error{get errors(){return this.issues}constructor(t){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=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(n(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return s(this),r}static assert(t){if(!(t instanceof Vr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ee.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Vr.create=e=>new Vr(e);const og=(e,t)=>{let n;switch(e.code){case K.invalid_type:e.received===se.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ee.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ee.joinValues(e.keys,", ")}`;break;case K.invalid_union:n="Invalid input";break;case K.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ee.joinValues(e.options)}`;break;case K.invalid_enum_value:n=`Invalid enum value. Expected ${Ee.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:n="Invalid function arguments";break;case K.invalid_return_type:n="Invalid function return type";break;case K.invalid_date:n="Invalid date";break;case K.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ee.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case K.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case K.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case K.custom:n="Invalid input";break;case K.invalid_intersection_types:n="Intersection results could not be merged";break;case K.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ee.assertNever(e)}return{message:n}};let n9=og;function r9(){return n9}const s9=e=>
vendor: 17,828 bytes, line 594
594{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...s,path:i,message:l}};function ee(e,t){const n=r9(),r=s9({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===og?void 0:og].filter(s=>!!s)});e.common.issues.push(r)}class cn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return me;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return cn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return me;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}}const me=Object.freeze({status:"aborted"}),Xa=e=>({status:"dirty",value:e}),Tn=e=>({status:"valid",value:e}),$b=e=>e.status==="aborted",Fb=e=>e.status==="dirty",da=e=>e.status==="valid",Dd=e=>typeof Promise<"u"&&e instanceof Promise;var oe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(oe||(oe={}));class zs{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Vb=(e,t)=>{if(da(t))return{success:!0,data:t.value};if(!e.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 Vr(e.common.issues);return this._error=n,this._error}}};function be(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:s}}class ke{get description(){return this._def.description}_getType(t){return ss(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ss(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cn,ctx:{common:t.parent.common,data:t.data,parsedType:ss(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Dd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ss(t)},s=this._parseSync({data:t,path:r.path,parent:r});return Vb(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ss(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return da(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>da(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,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:t,parsedType:ss(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(Dd(s)?s:Promise.resolve(s));return Vb(r,i)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=t(s),l=()=>i.addIssue({code:K.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new fa({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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 Ps.create(this,this._def)}nullable(){return pa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mr.create(this)}promise(){return Vd.create(this,this._def)}or(t){return $d.create([this,t],this._def)}and(t){return Fd.create(this,t,this._def)}transform(t){return new fa({...be(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new cg({...be(this._def),innerType:this,defaultValue:n,typeName:ge.ZodDefault})}brand(){return new E9({typeName:ge.ZodBranded,type:this,...be(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new ug({...be(this._def),innerType:this,catchValue:n,typeName:ge.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return _y.create(this,t)}readonly(){return dg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const i9=/^c[^\s-]{8,}$/i,o9=/^[0-9a-z]+$/,a9=/^[0-9A-HJKMNP-TV-Z]{26}$/i,l9=/^[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,c9=/^[a-z0-9_-]{21}$/i,u9=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,d9=/^[-+]?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)?)??$/,h9=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,f9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let sp;const p9=/^(?:(?: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])$/,m9=/^(?:(?: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])$/,g9=/^(([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]))$/,v9=/^(([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])$/,y9=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,x9=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,t2="((\\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])))",w9=new RegExp(`^${t2}$`);function n2(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function b9(e){return new RegExp(`^${n2(e)}$`)}function _9(e){let t=`${t2}T${n2(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function S9(e,t){return!!((t==="v4"||!t)&&p9.test(e)||(t==="v6"||!t)&&g9.test(e))}function j9(e,t){if(!u9.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function k9(e,t){return!!((t==="v4"||!t)&&m9.test(e)||(t==="v6"||!t)&&v9.test(e))}class ys extends ke{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==se.string){const i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:se.string,received:i.parsedType}),me}const r=new cn;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),ee(s,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),ee(s,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,l=t.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(t,s),o?ee(s,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&ee(s,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")h9.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"email",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")sp||(sp=new RegExp(f9,"u")),sp.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"emoji",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")l9.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"uuid",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")c9.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"nanoid",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")i9.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"cuid",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")o9.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"cuid2",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")a9.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"ulid",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),ee(s,{validation:"url",code:K.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"regex",code:K.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),ee(s,{code:K.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),ee(s,{code:K.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),ee(s,{code:K.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?_9(i).test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{code:K.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?w9.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{code:K.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?b9(i).test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{code:K.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?d9.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"duration",code:K.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?S9(t.data,i.version)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"ip",code:K.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?j9(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"jwt",code:K.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?k9(t.data,i.version)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"cidr",code:K.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?y9.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"base64",code:K.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?x9.test(t.data)||(s=this._getOrReturnCtx(t,s),ee(s,{validation:"base64url",code:K.invalid_string,message:i.message}),r.dirty()):Ee.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:K.invalid_string,...oe.errToObj(r)})}_addCheck(t){return new ys({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...oe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...oe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...oe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...oe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...oe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...oe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...oe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...oe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...oe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...oe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...oe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...oe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...oe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...oe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...oe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...oe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...oe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...oe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...oe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...oe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...oe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...oe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...oe.errToObj(n)})}nonempty(t){return this.min(1,oe.errToObj(t))}trim(){return new ys({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ys({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ys({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}
vendor: 4,664 bytes, line 594
594get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ys.create=e=>new ys({checks:[],typeName:ge.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...be(e)});function C9(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return i%o/10**s}class tc extends ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==se.number){const i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:se.number,received:i.parsedType}),me}let r;const s=new cn;for(const i of this._def.checks)i.kind==="int"?Ee.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:K.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?C9(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:K.not_finite,message:i.message}),s.dirty()):Ee.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,oe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,oe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,oe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,oe.toString(n))}setLimit(t,n,r,s){return new tc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:oe.toString(s)}]})}_addCheck(t){return new tc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:oe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:oe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:oe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:oe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:oe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:oe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ee.isInteger(t.value))}get isFinite(){let t=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"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}
vendor: 6,707 bytes, line 594
594}tc.create=e=>new tc({checks:[],typeName:ge.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...be(e)});class nc extends ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==se.bigint)return this._getInvalidInput(t);let r;const s=new cn;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Ee.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:se.bigint,received:n.parsedType}),me}gte(t,n){return this.setLimit("min",t,!0,oe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,oe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,oe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,oe.toString(n))}setLimit(t,n,r,s){return new nc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:oe.toString(s)}]})}_addCheck(t){return new nc({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:oe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:oe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}nc.create=e=>new nc({checks:[],typeName:ge.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...be(e)});class Ub extends ke{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==se.boolean){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:se.boolean,received:r.parsedType}),me}return Tn(t.data)}}Ub.create=e=>new Ub({typeName:ge.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...be(e)});class Ld extends ke{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==se.date){const i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:se.date,received:i.parsedType}),me}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_date}),me}const r=new cn;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),ee(s,{code:K.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),ee(s,{code:K.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Ee.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ld({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:oe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:oe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Ld.create=e=>new Ld({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ge.ZodDate,...be(e)});class Bb extends ke{_parse(t){if(this._getType(t)!==se.symbol){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:se.symbol,received:r.parsedType}),me}return Tn(t.data)}}Bb.create=e=>new Bb({typeName:ge.ZodSymbol,...be(e)});class zb extends ke{_parse(t){if(this._getType(t)!==se.undefined){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:se.undefined,received:r.parsedType}),me}return Tn(t.data)}}zb.create=e=>new zb({typeName:ge.ZodUndefined,...be(e)});class Hb extends ke{_parse(t){if(this._getType(t)!==se.null){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:se.null,received:r.parsedType}),me}return Tn(t.data)}}Hb.create=e=>new Hb({typeName:ge.ZodNull,...be(e)});class Wb extends ke{constructor(){super(...arguments),this._any=!0}_parse(t){return Tn(t.data)}}Wb.create=e=>new Wb({typeName:ge.ZodAny,...be(e)});class qb extends ke{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Tn(t.data)}}qb.create=e=>new qb({typeName:ge.ZodUnknown,...be(e)});class Hs extends ke{_parse(t){const n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:se.never,received:n.parsedType}),me}}Hs.create=e=>new Hs({typeName:ge.ZodNever,...be(e)});class Kb extends ke{_parse(t){if(this._getType(t)!==se.undefined){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:se.void,received:r.parsedType}),me}return Tn(t.data)}}Kb.create=e=>new Kb({typeName:ge.ZodVoid,...be(e)});class mr extends ke{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==se.array)return ee(n,{code:K.invalid_type,expected:se.array,received:n.parsedType}),me;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(ee(n,{code:o?K.too_big:K.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ee(n,{code:K.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ee(n,{code:K.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new zs(n,o,n.path,l)))).then(o=>cn.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new zs(n,o,n.path,l)));return cn.mergeArray(r,i)}
vendor: 5,224 bytes, line 594
594get element(){return this._def.type}min(t,n){return new mr({...this._def,minLength:{value:t,message:oe.toString(n)}})}max(t,n){return new mr({...this._def,maxLength:{value:t,message:oe.toString(n)}})}length(t,n){return new mr({...this._def,exactLength:{value:t,message:oe.toString(n)}})}nonempty(t){return this.min(1,t)}}mr.create=(e,t)=>new mr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...be(t)});function po(e){if(e instanceof tt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ps.create(po(r))}return new tt({...e._def,shape:()=>t})}else return e instanceof mr?new mr({...e._def,type:po(e.element)}):e instanceof Ps?Ps.create(po(e.unwrap())):e instanceof pa?pa.create(po(e.unwrap())):e instanceof Ii?Ii.create(e.items.map(t=>po(t))):e}class tt extends ke{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ee.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==se.object){const u=this._getOrReturnCtx(t);return ee(u,{code:K.invalid_type,expected:se.object,received:u.parsedType}),me}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Hs&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=i[u],h=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new zs(s,h,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Hs){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")l.length>0&&(ee(s,{code:K.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const h=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new zs(s,h,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const h=await d.key,f=await d.value;u.push({key:h,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>cn.mergeObjectSync(r,u)):cn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return oe.errToObj,new tt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:oe.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new tt({...this._def,unknownKeys:"strip"})}passthrough(){return new tt({...this._def,unknownKeys:"passthrough"})}extend(t){return new tt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new tt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ge.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new tt({...this._def,catchall:t})}pick(t){const n={};for(const r of Ee.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new tt({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Ee.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new tt({...this._def,shape:()=>n})}deepPartial(){return po(this)}partial(t){const n={};for(const r of Ee.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new tt({...this._def,shape:()=>n})}required(t){const n={};for(const r of Ee.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ps;)i=i._def.innerType;n[r]=i}return new tt({...this._def,shape:()=>n})}keyof(){return r2(Ee.objectKeys(this.shape))}}tt.create=(e,t)=>new tt({shape:()=>e,unknownKeys:"strip",catchall:Hs.create(),typeName:ge.ZodObject,...be(t)});tt.strictCreate=(e,t)=>new tt({shape:()=>e,unknownKeys:"strict",catchall:Hs.create(),typeName:ge.ZodObject,...be(t)});tt.lazycreate=(e,t)=>new tt({shape:e,unknownKeys:"strip",catchall:Hs.create(),typeName:ge.ZodObject,...be(t)});class $d extends ke{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Vr(l.ctx.common.issues));return ee(n,{code:K.invalid_union,unionErrors:o}),me}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new Vr(c));return ee(n,{code:K.invalid_union,unionErrors:l}),me}}get options(){return this._def.options}}$d.create=(e,t)=>
vendor: 2,611 bytes, line 594
594new $d({options:e,typeName:ge.ZodUnion,...be(t)});function ag(e,t){const n=ss(e),r=ss(t);if(e===t)return{valid:!0,data:e};if(n===se.object&&r===se.object){const s=Ee.objectKeys(t),i=Ee.objectKeys(e).filter(l=>s.indexOf(l)!==-1),o={...e,...t};for(const l of i){const c=ag(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===se.array&&r===se.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const o=e[i],l=t[i],c=ag(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===se.date&&r===se.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Fd extends ke{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,o)=>{if($b(i)||$b(o))return me;const l=ag(i.value,o.value);return l.valid?((Fb(i)||Fb(o))&&n.dirty(),{status:n.value,value:l.data}):(ee(r,{code:K.invalid_intersection_types}),me)};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(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Fd.create=(e,t,n)=>new Fd({left:e,right:t,typeName:ge.ZodIntersection,...be(n)});class Ii extends ke{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==se.array)return ee(r,{code:K.invalid_type,expected:se.array,received:r.parsedType}),me;if(r.data.length<this._def.items.length)return ee(r,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),me;!this._def.rest&&r.data.length>this._def.items.length&&(ee(r,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new zs(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>cn.mergeArray(n,o)):cn.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new Ii({...this._def,rest:t})}}Ii.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ii({items:e,typeName:ge.ZodTuple,rest:null,...be(t)})};class Gb extends ke{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==se.map)return ee(r,{code:K.invalid_type,expected:se.map,received:r.parsedType}),me;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>
vendor: 4,169 bytes, line 594
594({key:s._parse(new zs(r,l,r.path,[u,"key"])),value:i._parse(new zs(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return me;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return me;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}Gb.create=(e,t,n)=>new Gb({valueType:t,keyType:e,typeName:ge.ZodMap,...be(n)});class rc extends ke{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==se.set)return ee(r,{code:K.invalid_type,expected:se.set,received:r.parsedType}),me;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ee(r,{code:K.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(ee(r,{code:K.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return me;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>i._parse(new zs(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new rc({...this._def,minSize:{value:t,message:oe.toString(n)}})}max(t,n){return new rc({...this._def,maxSize:{value:t,message:oe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}rc.create=(e,t)=>new rc({valueType:e,minSize:null,maxSize:null,typeName:ge.ZodSet,...be(t)});class Yb extends ke{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Yb.create=(e,t)=>new Yb({getter:e,typeName:ge.ZodLazy,...be(t)});class lg extends ke{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ee(n,{received:n.data,code:K.invalid_literal,expected:this._def.value}),me}return{status:"valid",value:t.data}}get value(){return this._def.value}}lg.create=(e,t)=>new lg({value:e,typeName:ge.ZodLiteral,...be(t)});function r2(e,t){return new ha({values:e,typeName:ge.ZodEnum,...be(t)})}class ha extends ke{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ee(n,{expected:Ee.joinValues(r),received:n.parsedType,code:K.invalid_type}),me}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ee(n,{received:n.data,code:K.invalid_enum_value,options:r}),me}return Tn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ha.create(t,{...this._def,...n})}exclude(t,n=this._def){return ha.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}ha.create=r2;class Zb extends ke{_parse(t){const n=Ee.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==se.string&&r.parsedType!==se.number){const s=Ee.objectValues(n);return ee(r,{expected:Ee.joinValues(s),received:r.parsedType,code:K.invalid_type}),me}if(this._cache||(this._cache=new Set(Ee.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Ee.objectValues(n);return ee(r,{received:r.data,code:K.invalid_enum_value,options:s}),me}return Tn(t.data)}get enum(){return this._def.values}}Zb.create=(e,t)=>new Zb({values:e,typeName:ge.ZodNativeEnum,...be(t)});class Vd extends ke{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==se.promise&&n.common.async===!1)return ee(n,{code:K.invalid_type,expected:se.promise,received:n.parsedType}),me;
vendor: 4,097 bytes, line 594
594const r=n.parsedType===se.promise?n.data:Promise.resolve(n.data);return Tn(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Vd.create=(e,t)=>new Vd({type:e,typeName:ge.ZodPromise,...be(t)});class fa extends ke{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:o=>{ee(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return me;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?me:c.status==="dirty"||n.value==="dirty"?Xa(c.value):c});{if(n.value==="aborted")return me;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?me:l.status==="dirty"||n.value==="dirty"?Xa(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,i);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"?me:(l.status==="dirty"&&n.dirty(),o(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"?me:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!da(o))return me;const l=s.transform(o.value,i);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(o=>da(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):me);Ee.assertNever(s)}}fa.create=(e,t,n)=>new fa({schema:e,typeName:ge.ZodEffects,effect:t,...be(n)});fa.createWithPreprocess=(e,t,n)=>new fa({schema:t,effect:{type:"preprocess",transform:e},typeName:ge.ZodEffects,...be(n)});class Ps extends ke{_parse(t){return this._getType(t)===se.undefined?Tn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ps.create=(e,t)=>new Ps({innerType:e,typeName:ge.ZodOptional,...be(t)});class pa extends ke{_parse(t){return this._getType(t)===se.null?Tn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}pa.create=(e,t)=>new pa({innerType:e,typeName:ge.ZodNullable,...be(t)});class cg extends ke{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===se.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}cg.create=(e,t)=>new cg({innerType:e,typeName:ge.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...be(t)});class ug extends ke{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Dd(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Vr(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Vr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ug.create=(e,t)=>new ug({innerType:e,typeName:ge.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...be(t)});class Jb extends ke{_parse(t){if(this._getType(t)!==se.nan){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:se.nan,received:r.parsedType}),me}
594return{status:"valid",value:t.data}}}Jb.create=e=>new Jb({typeName:ge.ZodNaN,...be(e)});class E9 extends ke{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class _y extends ke{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?me:i.status==="dirty"?(n.dirty(),Xa(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?me:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new _y({in:t,out:n,typeName:ge.ZodPipeline})}}class dg extends ke{_parse(t){const n=this._def.innerType._parse(t),r=s=>(da(s)&&(s.value=Object.freeze(s.value)),s);return Dd(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}dg.create=(e,t)=>new dg({innerType:e,typeName:ge.ZodReadonly,...be(t)});tt.lazycreate;var ge;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ge||(ge={}));const oo=ys.create;Hs.create;mr.create;const T9=tt.create;tt.strictCreate;$d.create;Fd.create;Ii.create;const hu=lg.create;ha.create;Vd.create;Ps.create;pa.create;const N9=T9({full_name:oo().trim().min(2).max(100),email:oo().trim().email().max(255),phone:oo().trim().max(40).optional().or(hu("")),company:oo().trim().max(120).optional().or(hu("")),message:oo().trim().max(2e3).optional().or(hu("")),budget_range:oo().max(40).optional().or(hu(""))}),P9=["< 5 000 €","5 000 – 15 000 €","15 000 – 50 000 €","50 000 – 150 000 €","> 150 000 €"],A9=()=>{const{language:e}=Qn(),{services:t}=Gs(),{subServices:n,isLoading:r}=KN(),s=vc(),{toast:i}=Et(),[o,l]=m.useState(""),[c,u]=m.useState(""),[d,h]=m.useState(""),[f,p]=m.useState(""),[g,v]=m.useState(""),[x,b]=m.useState(""),[w,y]=m.useState({}),[_,j]=m.useState(null),[C,k]=m.useState(!1),[S,P]=m.useState(!1),[E,I]=m.useState(null),R=e==="fr",$=m.useMemo(()=>t.filter(N=>N.is_active).sort((N,O)=>N.sort_order-O.sort_order),[t]),T=m.useMemo(()=>{const N=new Map;return n.filter(O=>O.is_active).forEach(O=>{const V=N.get(O.service_id)??[];V.push(O),N.set(O.service_id,V)}),N},[n]),U=Object.values(w).filter(Boolean).length,D=N=>y(O=>({...O,[N]:!O[N]})),A=async N=>{N.preventDefault();const O=N9.safeParse({full_name:o,email:c,phone:d,company:f,message:g,budget_range:x});if(!O.success){i({title:R?"Formulaire invalide":"Invalid form",description:O.error.issues[0].message,variant:"destructive"});return}if(U===0){i({title:R?"Sélectionnez au moins un service":"Select at least one service",variant:"destructive"});return}const V=n.filter(Z=>w[Z.id]).map(Z=>{const B=$.find(le=>le.id===Z.service_id);return{sub_service_id:Z.id,service_slug:(B==null?void 0:B.slug)??"",service_title:B?R?B.title_fr:B.title_en:"",title:R?Z.title_fr:Z.title_en}});k(!0);const{error:H}=await W.from("quote_requests").insert({full_name:o.trim(),email:c.trim(),phone:d.trim()||null,company:f.trim()||null,message:g.trim()||"",budget_range:x||null,selected_items:V});if(k(!1),H)i({title:R?"Erreur":"Error",description:H.message,variant:"destructive"});else{const{data:Z}=await W.from("site_settings").select("value").eq("key","quote_auto_response").maybeSingle();Z!=null&&Z.value&&I(Z.value),P(!0)}};if(S){const N=E?R?E.title_fr:E.title_en:R?"Merci ! Demande reçue.":"Thank y
594ou! Request received.",V=(E?R?E.message_fr:E.message_en:R?"Notre équipe revient vers vous sous 24h ouvrées.":"Our team will get back to you within 1 business day.").split("{name}").join(o);return a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:a.jsxs(Ze.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center max-w-xl",children:[a.jsx(HR,{className:"w-20 h-20 text-primary mx-auto mb-6"}),a.jsx("h1",{className:"text-3xl font-bold mb-4",children:N}),a.jsx("p",{className:"text-muted-foreground mb-8 whitespace-pre-wrap text-left bg-muted/40 p-6 rounded-lg",children:V}),a.jsx(z,{onClick:()=>s("/"),size:"lg",children:R?"Retour à l'accueil":"Back home"})]})})}return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("header",{className:"border-b border-border bg-card sticky top-0 z-40",children:a.jsxs("div",{className:"container mx-auto px-4 py-4 flex items-center justify-between",children:[a.jsx(Lt,{to:"/",className:"flex items-center gap-3",children:a.jsx("img",{src:Sc,alt:"Rich Media",className:"h-10 w-auto"})}),a.jsxs(Lt,{to:"/",className:"text-sm text-muted-foreground hover:text-foreground flex items-center gap-1",children:[a.jsx(dv,{className:"w-4 h-4"}),R?"Accueil":"Home"]})]})}),a.jsxs("main",{className:"container mx-auto px-4 py-10 max-w-5xl",children:[a.jsxs(Ze.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8 text-center",children:[a.jsx("span",{className:"inline-block text-sm font-semibold text-primary uppercase tracking-wider mb-3",children:R?"Demander un devis":"Request a Quote"}),a.jsx("h1",{className:"text-3xl md:text-5xl font-bold mb-4",children:R?"Construisons votre projet":"Let's build your project"}),a.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:R?"Sélectionnez les services et sous-services qui vous intéressent. Nous préparerons une proposition adaptée.":"Pick the services and sub-services you're interested in. We'll craft a tailored proposal."})]}),a.jsxs("form",{onSubmit:A,className:"grid lg:grid-cols-[1fr_360px] gap-8",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h2",{className:"text-xl font-semibold",children:R?"Services souhaités":"Desired services"}),a.jsxs(Ve,{variant:"secondary",children:[U," ",R?"sélectionné(s)":"selected"]})]}),r?a.jsx("p",{className:"text-muted-foreground",children:R?"Chargement...":"Loading..."}):$.map(N=>{const O=Ta(N.icon_name),V=T.get(N.id)??[],H=_===N.id,Z=V.filter(B=>w[B.id]).length;return a.jsxs(Te,{className:"overflow-hidden",children:[a.jsxs("button",{type:"button",onClick:()=>j(H?null:N.id),className:"w-full p-4 flex items-center gap-3 hover:bg-muted/50 transition-colors text-left",children:[a.jsx("div",{className:`w-10 h-10 rounded-lg bg-gradient-to-br ${N.color_gradient} flex items-center justify-center shrink-0`,children:a.jsx(O,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-semibold truncate",children:R?N.title_fr:N.title_en}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[V.length," ",R?"sous-services":"sub-services",Z>0&&` · ${Z} ${R?"sélectionné(s)":"selected"}`]})]}),a.jsx(lh,{className:`w-5 h-5 text-muted-foreground transition-transform ${H?"rotate-180":""}`})]}),H&&a.jsx(Ne,{className:"pt-0 pb-4 px-4 border-t border-border",children:V.length===0?a.jsx("p",{className:"text-sm text-muted-foreground py-3",children:R?"Aucun sous-service actif.":"No active sub-services."}):a.jsx("div",{className:"grid sm:grid-cols-2 gap-2 pt-3",children:V.map(B=>a.jsxs("label",{className:"flex items-start gap-3 p-3 rounded-md border border-border hover:border-primary/50 cursor-pointer transition-colors",children:[a.jsx(yl,{checked:!!w[B.id],onCheckedChange:()=>D(B.id),className:"mt-0.5"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm font-medium leading-tight",children:R?B.title_fr:B.title_en}),(R?B.description_fr:B.description_en)&&a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:R?B.description_fr:B.description_en})]})]},B.id))})})]},N.id)})]}),a.jsx(Te,{className:"h-fit lg:sticky lg:top-24",children:a.jsxs(Ne,{className:"p-6 space-y-4",children:[a.jsx("h2",{className:"text-xl font-semibold mb-2",children:R?"Vos coordonnées":"Your contact details"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"q-name",children:R?"Nom complet *":"Full name *"}),a.jsx(J,{id:"q-name",value:o,onChange:N=>l(N.target.value),required:!0,maxLength:100})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"q-email",children:"Email *"}),a.jsx(J,{id:"q-email",type:"email",value:c,onChange:N=>u(N.target.value),required:!0,maxLength:255})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"q-phone",children:R?"Téléphone":"Phone"}),a.jsx(J,{id:"q-phone",value:d,onChange:N=>h(N.target.value),maxLength:40})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"q-company",children:R?"Entreprise":"Company"}),a.jsx(J,{id:"q-company",value:f,onChange:N=>p(N.target.value),maxLength:120})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{children:R?"Budget estimé":"Estimated budget"}),a.jsxs(ze,{value:x,onValueChange:b,children:[a.jsx(Le,{children:a.jsx(He,{placeholder:R?"Sélectionner":"Select"})}),a.jsx($e,{children:P9.map(N=>a.jsx(ue,{value:N,children:N},N))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(L,{htmlFor:"q-msg",children:R?"Décrivez votre besoin":"Describe your needs"}),a.jsx(rt,{id:"q-msg",value:g,onChange:N=>v(N.target.value),rows:5,maxLength:2e3})]}),a.jsxs(z,{type:"submit",className:"w-full",disabled:C,size:"lg",children:[a.jsx(sa,{className:"w-4 h-4 mr-2"}),C?R?"Envoi...":"Sending...":R?"Envoyer la demande":"Send request"]})]})})]})]})]})},R9=()=>{const e=gc();return m.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),a.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),a.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},O9=new $4,I9=()=>a.jsx(V4,{client:O9,children:a.jsx(UD,{children:a.jsx(W5,{children:a.jsx(q5,{children:a.jsxs(p4,{children:[a.jsx(uI,{}),a.jsx(BI,{}),a.jsx(DD,{children:a.jsxs(ND,{children:[a.jsx(ao,{path:"/",element:a.jsx(S6,{})}),a.jsx(ao,{path:"/auth",element:a.jsx(Z6,{})}),a.jsx(ao,{path:"/dashboard",element:a.jsx(t9,{})}),a.jsx(ao,{path:"/quote",element:a.jsx(A9,{})}),a.jsx(ao,{path:"*",element:a.jsx(R9,{})})]})})]})})})})});wS(document.getElementById("root")).render(a.jsx(I9,{}));

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.