PageSourceSearch

https://altifypro.lovable.app/assets/index-BNqYtdVq.js

js altifypro.lovable.app collected 2026-10-03 03:21:47 UTC 1,092,662 bytes, 733 lines download raw bytes

vendor: 6,685 bytes, lines 1-9
1var Uv=e=>{throw TypeError(e)};var Of=(e,t,n)=>t.has(e)||Uv("Cannot "+n);var O=(e,t,n)=>(Of(e,t,"read from private field"),n?n.call(e):t.get(e)),Pe=(e,t,n)=>t.has(e)?Uv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),pe=(e,t,n,r)=>(Of(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Tt=(e,t,n)=>(Of(e,t,"access private method"),n);var yd=(e,t,n,r)=>({set _(a){pe(e,t,a,n)},get _(){return O(e,t,r)}});function UA(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)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(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Fn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xj(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function BA(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Zj={exports:{}},vh={},e1={exports:{}},we={};/**
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"),VA=Symbol.for("react.portal"),zA=Symbol.for("react.fragment"),WA=Symbol.for("react.strict_mode"),HA=Symbol.for("react.profiler"),KA=Symbol.for("react.provider"),GA=Symbol.for("react.context"),qA=Symbol.for("react.forward_ref"),YA=Symbol.for("react.suspense"),QA=Symbol.for("react.memo"),JA=Symbol.for("react.lazy"),Bv=Symbol.iterator;function XA(e){return e===null||typeof e!="object"?null:(e=Bv&&e[Bv]||e["@@iterator"],typeof e=="function"?e:null)}var t1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n1=Object.assign,r1={};function Eo(e,t,n){this.props=e,this.context=t,this.refs=r1,this.updater=n||t1}Eo.prototype.isReactComponent={};Eo.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")};Eo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function s1(){}s1.prototype=Eo.prototype;function rx(e,t,n){this.props=e,this.context=t,this.refs=r1,this.updater=n||t1}var sx=rx.prototype=new s1;sx.constructor=rx;n1(sx,Eo.prototype);sx.isPureReactComponent=!0;var Vv=Array.isArray,a1=Object.prototype.hasOwnProperty,ax={current:null},i1={key:!0,ref:!0,__self:!0,__source:!0};function o1(e,t,n){var r,a={},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)a1.call(t,r)&&!i1.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(l===1)a.children=n;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)a[r]===void 0&&(a[r]=l[r]);return{$$typeof:Oc,type:e,key:i,ref:o,props:a,_owner:ax.current}}function ZA(e,t){return{$$typeof:Oc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ix(e){return typeof e=="object"&&e!==null&&e.$$typeof===Oc}function eR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var zv=/\/+/g;function Df(e,t){return typeof e=="object"&&e!==null&&e.key!=null?eR(""+e.key):t.toString(36)}function eu(e,t,n,r,a){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 VA:o=!0}}if(o)return o=e,a=a(o),e=r===""?"."+Df(o,0):r,Vv(a)?(n="",e!=null&&(n=e.replace(zv,"$&/")+"/"),eu(a,t,n,"",function(d){return d})):a!=null&&(ix(a)&&(a=ZA(a,n+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(zv,"$&/")+"/")+e)),t.push(a)),1;if(o=0,r=r===""?".":r+":",Vv(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Df(i,l);o+=eu(i,t,n,c,a)}else if(c=XA(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Df(i,l++),o+=eu(i,t,n,c,a);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 vd(e,t,n){if(e==null)return e;var r=[],a=0;return eu(e,r,"","",function(i){return t.call(n,i,a++)}),r}function tR(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 Kt={current:null},tu={transition:null},nR={ReactCurrentDispatcher:Kt,ReactCurrentBatchConfig:tu,ReactCurrentOwner:ax};function l1(){throw Error("act(...) is not supported in production builds of React.")}we.Children={map:vd,forEach:function(e,t,n){vd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return vd(e,function(){t++}),t},toArray:function(e){return vd(e,function(t){return t})||[]},only:function(e){if(!ix(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};we.Component=Eo;we.Fragment=zA;we.Profiler=HA;we.PureComponent=rx;we.StrictMode=WA;we.Suspense=YA;
vendor: 7,211 bytes, lines 9-25
9we.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nR;we.act=l1;we.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=n1({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=ax.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)a1.call(t,c)&&!i1.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 d=0;d<c;d++)l[d]=arguments[d+2];r.children=l}return{$$typeof:Oc,type:e.type,key:a,ref:i,props:r,_owner:o}};we.createContext=function(e){return e={$$typeof:GA,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:KA,_context:e},e.Consumer=e};we.createElement=o1;we.createFactory=function(e){var t=o1.bind(null,e);return t.type=e,t};we.createRef=function(){return{current:null}};we.forwardRef=function(e){return{$$typeof:qA,render:e}};we.isValidElement=ix;we.lazy=function(e){return{$$typeof:JA,_payload:{_status:-1,_result:e},_init:tR}};we.memo=function(e,t){return{$$typeof:QA,type:e,compare:t===void 0?null:t}};we.startTransition=function(e){var t=tu.transition;tu.transition={};try{e()}finally{tu.transition=t}};we.unstable_act=l1;we.useCallback=function(e,t){return Kt.current.useCallback(e,t)};we.useContext=function(e){return Kt.current.useContext(e)};we.useDebugValue=function(){};we.useDeferredValue=function(e){return Kt.current.useDeferredValue(e)};we.useEffect=function(e,t){return Kt.current.useEffect(e,t)};we.useId=function(){return Kt.current.useId()};we.useImperativeHandle=function(e,t,n){return Kt.current.useImperativeHandle(e,t,n)};we.useInsertionEffect=function(e,t){return Kt.current.useInsertionEffect(e,t)};we.useLayoutEffect=function(e,t){return Kt.current.useLayoutEffect(e,t)};we.useMemo=function(e,t){return Kt.current.useMemo(e,t)};we.useReducer=function(e,t,n){return Kt.current.useReducer(e,t,n)};we.useRef=function(e){return Kt.current.useRef(e)};we.useState=function(e){return Kt.current.useState(e)};we.useSyncExternalStore=function(e,t,n){return Kt.current.useSyncExternalStore(e,t,n)};we.useTransition=function(){return Kt.current.useTransition()};we.version="18.3.1";e1.exports=we;var f=e1.exports;const B=Xj(f),ox=UA({__proto__:null,default:B},[f]);/**
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 rR=f,sR=Symbol.for("react.element"),aR=Symbol.for("react.fragment"),iR=Object.prototype.hasOwnProperty,oR=rR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lR={key:!0,ref:!0,__self:!0,__source:!0};function c1(e,t,n){var r,a={},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)iR.call(t,r)&&!lR.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:sR,type:e,key:i,ref:o,props:a,_owner:oR.current}}vh.Fragment=aR;vh.jsx=c1;vh.jsxs=c1;Zj.exports=vh;var s=Zj.exports,d1={exports:{}},Sn={},u1={exports:{}},h1={};/**
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(P,_){var U=P.length;P.push(_);e:for(;0<U;){var Z=U-1>>>1,ee=P[Z];if(0<a(ee,_))P[Z]=_,P[U]=ee,U=Z;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var _=P[0],U=P.pop();if(U!==_){P[0]=U;e:for(var Z=0,ee=P.length,ie=ee>>>1;Z<ie;){var de=2*(Z+1)-1,Re=P[de],Ee=de+1,Q=P[Ee];if(0>a(Re,U))Ee<ee&&0>a(Q,Re)?(P[Z]=Q,P[Ee]=U,Z=Ee):(P[Z]=Re,P[de]=U,Z=de);else if(Ee<ee&&0>a(Q,U))P[Z]=Q,P[Ee]=U,Z=Ee;else break e}}return _}function a(P,_){var U=P.sortIndex-_.sortIndex;return U!==0?U:P.id-_.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=[],d=[],u=1,h=null,p=3,m=!1,b=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,x=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 v(P){for(var _=n(d);_!==null;){if(_.callback===null)r(d);else if(_.startTime<=P)r(d),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(d)}}function j(P){if(g=!1,v(P),!b)if(n(c)!==null)b=!0,z(N);else{var _=n(d);_!==null&&I(j,_.startTime-P)}}function N(P,_){b=!1,g&&(g=!1,x(C),C=-1),m=!0;var U=p;try{for(v(_),h=n(c);h!==null&&(!(h.expirationTime>_)||P&&!G());){var Z=h.callback;if(typeof Z=="function"){h.callback=null,p=h.priorityLevel;var ee=Z(h.expirationTime<=_);_=e.unstable_now(),typeof ee=="function"?h.callback=ee:h===n(c)&&r(c),v(_)}else r(c);h=n(c)}if(h!==null)var ie=!0;else{var de=n(d);de!==null&&I(j,de.startTime-_),ie=!1}return ie}finally{h=null,p=U,m=!1}}var S=!1,k=null,C=-1,A=5,R=-1;function G(){return!(e.unstable_now()-R<A)}function W(){if(k!==null){var P=e.unstable_now();R=P;var _=!0;try{_=k(!0,P)}finally{_?$():(S=!1,k=null)}}else S=!1}var $;if(typeof w=="function")$=function(){w(W)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,K=M.port2;M.port1.onmessage=W,$=function(){K.postMessage(null)}}else $=function(){y(W,0)};function z(P){k=P,S||(S=!0,$())}function I(P,_){C=y(function(){P(e.unstable_now())},_)}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(P){P.callback=null},e.unstable_continueExecution=function(){b||m||(b=!0,z(N))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(P){switch(p){case 1:case 2:case 3:var _=3;break;default:_=p}var U=p;p=_;try{return P()}finally{p=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,_){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var U=p;p=P;try{return _()}finally{p=U}},e.unstable_scheduleCallback=function(P,_,U){var Z=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?Z+U:Z):U=Z,P){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=U+ee,P={id:u++,callback:_,priorityLevel:P,startTime:U,expirationTime:ee,sortIndex:-1},U>Z?(P.sortIndex=U,t(d,P),n(c)===null&&P===n(d)&&(g?(x(C),C=-1):g=!0,I(j,U-Z
vendor: 4,446 bytes, lines 25-33
25))):(P.sortIndex=ee,t(c,P),b||m||(b=!0,z(N))),P},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(P){var _=p;return function(){var U=p;p=_;try{return P.apply(this,arguments)}finally{p=U}}}})(h1);u1.exports=h1;var cR=u1.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 dR=f,Nn=cR;function H(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 f1=new Set,ql={};function Za(e,t){uo(e,t),uo(e+"Capture",t)}function uo(e,t){for(ql[e]=t,e=0;e<t.length;e++)f1.add(t[e])}var Zr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),np=Object.prototype.hasOwnProperty,uR=/^[: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]*$/,Wv={},Hv={};function hR(e){return np.call(Hv,e)?!0:np.call(Wv,e)?!1:uR.test(e)?Hv[e]=!0:(Wv[e]=!0,!1)}function fR(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 mR(e,t,n,r){if(t===null||typeof t>"u"||fR(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 Gt(e,t,n,r,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Pt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Pt[e]=new Gt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Pt[t]=new Gt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Pt[e]=new Gt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Pt[e]=new Gt(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){Pt[e]=new Gt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Pt[e]=new Gt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Pt[e]=new Gt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Pt[e]=new Gt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Pt[e]=new Gt(e,5,!1,e.toLowerCase(),null,!1,!1)});var lx=/[\-:]([a-z])/g;function cx(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
33-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(lx,cx);Pt[t]=new Gt(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(lx,cx);Pt[t]=new Gt(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(lx,cx);Pt[t]=new Gt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Pt[e]=new Gt(e,1,!1,e.toLowerCase(),null,!1,!1)});Pt.xlinkHref=new Gt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Pt[e]=new Gt(e,1,!1,e.toLowerCase(),null,!0,!0)});function dx(e,t,n,r){var a=Pt.hasOwnProperty(t)?Pt[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(mR(t,n,a,r)&&(n=null),r||a===null?hR(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ls=dR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,wd=Symbol.for("react.element"),Si=Symbol.for("react.portal"),ki=Symbol.for("react.fragment"),ux=Symbol.for("react.strict_mode"),rp=Symbol.for("react.profiler"),m1=Symbol.for("react.provider"),p1=Symbol.for("react.context"),hx=Symbol.for("react.forward_ref"),sp=Symbol.for("react.suspense"),ap=Symbol.for("react.suspense_list"),fx=Symbol.for("react.memo"),Ns=Symbol.for("react.lazy"),g1=Symbol.for("react.offscreen"),Kv=Symbol.iterator;function rl(e){return e===null||typeof e!="object"?null:(e=Kv&&e[Kv]||e["@@iterator"],typeof e=="function"?e:null)}var et=Object.assign,Lf;function wl(e){if(Lf===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Lf=t&&t[1]||""}return`
34`+Lf+e}var Ff=!1;function $f(e,t){if(!e||Ff)return"";Ff=!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(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var a=d.stack.split(`
35`),i=r.stack.split(`
36`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=`
37`+a[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{Ff=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?wl(e):""}function pR(e){switch(e.tag){case 5:return wl(e.type);case 16:return wl("Lazy");case 13:return wl("Suspense");case 19:return wl("SuspenseList");case 0:case 2:case 15:return e=$f(e.type,!1),e;case 11:return e=$f(e.type.render,!1),e;case 1:return e=$f(e.type,!0),e;default:return""}}function ip(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 ki:return"Fragment";case Si:return"Portal";case rp:return"Profiler";case ux:return"StrictMode";case sp:return"Suspense";case ap:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case p1:return(e.displayName||"Context")+".Consumer";case m1:return(e._context.displayName||"Context")+".Provider";case hx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fx:return t=e.displayName||null,t!==null?t:ip(e.type)||"Memo";case Ns:t=e._payload,e=e._init;try{return ip(e(t))}catch{}}return null}function gR(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 ip(t);case 8:return t===ux?"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 Ks(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function x1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xR(e){var t=x1(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 a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.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 bd(e){e._valueTracker||(e._valueTracker=xR(e))}function y1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=x1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function bu(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 op(e,t){var n=t.checked;return et({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Gv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ks(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}}
vendor: 4,651 bytes, line 37
37function v1(e,t){t=t.checked,t!=null&&dx(e,"checked",t,!1)}function lp(e,t){v1(e,t);var n=Ks(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")?cp(e,t.type,n):t.hasOwnProperty("defaultValue")&&cp(e,t.type,Ks(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function qv(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 cp(e,t,n){(t!=="number"||bu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bl=Array.isArray;function Wi(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Ks(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function dp(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return et({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Yv(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(bl(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ks(n)}}function w1(e,t){var n=Ks(t.value),r=Ks(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 Qv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function b1(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 up(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?b1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var jd,j1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(jd=jd||document.createElement("div"),jd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=jd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Tl={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},yR=["Webkit","ms","Moz","O"];Object.keys(Tl).forEach(function(e){yR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tl[t]=Tl[e]})});function N1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Tl.hasOwnProperty(e)&&Tl[e]?(""+t).trim():t+"px"}function S1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=N1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var vR=et({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 hp(e,t){if(t){if(vR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function fp(e,t){if(e.indexOf("-")===-1)return typeof t.is=="str
37ing";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 mp=null;function mx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pp=null,Hi=null,Ki=null;function Jv(e){if(e=Fc(e)){if(typeof pp!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Sh(t),pp(e.stateNode,e.type,t))}}function k1(e){Hi?Ki?Ki.push(e):Ki=[e]:Hi=e}function C1(){if(Hi){var e=Hi,t=Ki;if(Ki=Hi=null,Jv(e),t)for(e=0;e<t.length;e++)Jv(t[e])}}function _1(e,t){return e(t)}function E1(){}var Uf=!1;function P1(e,t,n){if(Uf)return e(t,n);Uf=!0;try{return _1(e,t,n)}finally{Uf=!1,(Hi!==null||Ki!==null)&&(E1(),C1())}}function Ql(e,t){var n=e.stateNode;if(n===null)return null;var r=Sh(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(H(231,t,typeof n));return n}var gp=!1;if(Zr)try{var sl={};Object.defineProperty(sl,"passive",{get:function(){gp=!0}}),window.addEventListener("test",sl,sl),window.removeEventListener("test",sl,sl)}catch{gp=!1}function wR(e,t,n,r,a,i,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(u){this.onError(u)}}var Al=!1,ju=null,Nu=!1,xp=null,bR={onError:function(e){Al=!0,ju=e}};function jR(e,t,n,r,a,i,o,l,c){Al=!1,ju=null,wR.apply(bR,arguments)}function NR(e,t,n,r,a,i,o,l,c){if(jR.apply(this,arguments),Al){if(Al){var d=ju;Al=!1,ju=null}else throw Error(H(198));Nu||(Nu=!0,xp=d)}}function ei(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 T1(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 Xv(e){if(ei(e)!==e)throw Error(H(188))}function SR(e){var t=e.alternate;if(!t){if(t=ei(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return Xv(a),e;if(i===r)return Xv(a),t;i=i.sibling}throw Error(H(188))}if(n.return!==r.return)n=a,r=i;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function A1(e){return e=SR(e),e!==null?R1(e):null}function R1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=R1(e);if(t!==null)return t;e=e.sibling}return null}var I1=Nn.unstable_scheduleCallback,Zv=Nn.unstable_cancelCallback,kR=Nn.unstable_shouldYield,CR=Nn.unstable_requestPaint,at=Nn.unstable_now,_R=Nn.unstable_getCurrentPriorityLevel,px=Nn.unstable_ImmediatePriority,M1=Nn.unstable_UserBlockingPriority,Su=Nn.unstable_NormalPriority,ER=Nn.unstable_LowPriority,O1=Nn.unstable_IdlePriority,wh=null,Ar=null;function PR(e){if(Ar&&typeof Ar.onCommitFiberRoot=="function")try{Ar.onCommitFiberRoot(wh,e,void 0,(e.current.flags&128)===128)}catch{}}var ir=Math.clz32?Math.clz32:RR,TR=Math.log,AR=Math.LN2;function RR(e){return e>>>=0,e===0?32:31-(TR(e)/AR|0)|0}var Nd=64,Sd=4194304;function jl(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 ku(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~a;l!==0?r=jl(l):(i&=o,i!==0&&(r=jl(i)))}else o=n&~a,o!==0?r=jl(o):i!==0&&(r=jl(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,i=t&-t,a>=i||a===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-ir(t),a=1<<n,r|=e[n],t&=~a;return r}function IR(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 MR(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-ir(i),l=1<<o,c=a[o];c===-1?(!(l&n)||l&r)&&(a[o]=IR(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function yp(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function D1(){var e=Nd;return Nd<<=1,!(Nd&4194240)&&(Nd=64),e}function Bf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Dc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ir(t),e[t]=n}function OR(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 a=31-ir(n),i=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~i}}function gx(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ir(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var Le=0;function L1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var F1,xx,$1,U1,B1,vp=!1,kd=[],Ds=null,Ls=null,Fs=null,Jl=new Map,Xl=new Map,ks=[],DR="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 e0(e,t){switch(e){case"focusin":case"focusout":Ds=null;break;case"dragenter":case"dragleave":Ls=null;break;case"mouseover":case"mouseout":Fs=null;break;case"pointerover":case"pointerout":Jl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xl.delete(t.pointerId)}}function al(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Fc(t),t!==null&&xx(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function LR(e,t,n,r,a){switch(t){case"focusin":return Ds=al(Ds,e,t,n,r,a),!0;case"dragenter":return Ls=al(Ls,e,t,n,r,a),!0;case"mouseover":return Fs=al(Fs,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return Jl.set(i,al(Jl.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,Xl.set(i,al(Xl.get(i)||null,e,t,n,r,a)),!0}return!1}function V1(e){var t=Na(e.target);
vendor: 12,275 bytes, line 37
37if(t!==null){var n=ei(t);if(n!==null){if(t=n.tag,t===13){if(t=T1(n),t!==null){e.blockedOn=t,B1(e.priority,function(){$1(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 nu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wp(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mp=r,n.target.dispatchEvent(r),mp=null}else return t=Fc(n),t!==null&&xx(t),e.blockedOn=n,!1;t.shift()}return!0}function t0(e,t,n){nu(e)&&n.delete(t)}function FR(){vp=!1,Ds!==null&&nu(Ds)&&(Ds=null),Ls!==null&&nu(Ls)&&(Ls=null),Fs!==null&&nu(Fs)&&(Fs=null),Jl.forEach(t0),Xl.forEach(t0)}function il(e,t){e.blockedOn===t&&(e.blockedOn=null,vp||(vp=!0,Nn.unstable_scheduleCallback(Nn.unstable_NormalPriority,FR)))}function Zl(e){function t(a){return il(a,e)}if(0<kd.length){il(kd[0],e);for(var n=1;n<kd.length;n++){var r=kd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ds!==null&&il(Ds,e),Ls!==null&&il(Ls,e),Fs!==null&&il(Fs,e),Jl.forEach(t),Xl.forEach(t),n=0;n<ks.length;n++)r=ks[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ks.length&&(n=ks[0],n.blockedOn===null);)V1(n),n.blockedOn===null&&ks.shift()}var Gi=ls.ReactCurrentBatchConfig,Cu=!0;function $R(e,t,n,r){var a=Le,i=Gi.transition;Gi.transition=null;try{Le=1,yx(e,t,n,r)}finally{Le=a,Gi.transition=i}}function UR(e,t,n,r){var a=Le,i=Gi.transition;Gi.transition=null;try{Le=4,yx(e,t,n,r)}finally{Le=a,Gi.transition=i}}function yx(e,t,n,r){if(Cu){var a=wp(e,t,n,r);if(a===null)Jf(e,t,r,_u,n),e0(e,r);else if(LR(a,e,t,n,r))r.stopPropagation();else if(e0(e,r),t&4&&-1<DR.indexOf(e)){for(;a!==null;){var i=Fc(a);if(i!==null&&F1(i),i=wp(e,t,n,r),i===null&&Jf(e,t,r,_u,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else Jf(e,t,r,null,n)}}var _u=null;function wp(e,t,n,r){if(_u=null,e=mx(r),e=Na(e),e!==null)if(t=ei(e),t===null)e=null;else if(n=t.tag,n===13){if(e=T1(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 _u=e,null}function z1(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(_R()){case px:return 1;case M1:return 4;case Su:case ER:return 16;case O1:return 536870912;default:return 16}default:return 16}}var Is=null,vx=null,ru=null;function W1(){if(ru)return ru;var e,t=vx,n=t.length,r,a="value"in Is?Is.value:Is.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===a[i-r];r++);return ru=a.slice(e,1<r?1-r:void 0)}function su(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 Cd(){return!0}function n0(){return!1}function kn(e){function t(n,r,a,i,o){this._reactName=n,this._targetInst=a,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)?Cd:n0,this.isPropagationStopped=n0,this}return et(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=Cd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Cd)},persist:function(){},isPersistent:Cd}),t}var Po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wx=kn(Po),Lc=et({},Po,{view:0,detail:0}),BR=kn(Lc),Vf,zf,ol,bh=et({},Lc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bx,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!==ol&&(ol&&e.type==="mousemove"?(Vf=e.screenX-ol.screenX,zf=e.screenY-ol.screenY):zf=Vf=0,ol=e),Vf)},movementY:function(e){return"movementY"in e?e.movementY:zf}}),r0=kn(bh),VR=et({},bh,{dataTransfer:0}),zR=kn(VR),WR=et({},Lc,{relatedTarget:0}),Wf=kn(WR),HR=et({},Po,{animationName:0,elapsedTime:0,pseudoElement:0}),KR=kn(HR),GR=et({},Po,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qR=kn(GR),YR=et({},Po,{data:0}),s0=kn(YR),QR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JR={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"},XR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZR(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=XR[e])?!!t[e]:!1}function bx(){return ZR}var eI=et({},Lc,{key:function(e){if(e.key){var t=QR[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=su(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?JR[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bx,charCode:function(e){return e.type==="keypress"?su(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?su(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),tI=kn(eI),nI=et({},bh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),a0=kn(nI),rI=et({},Lc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bx}),sI=kn(rI),aI=et({},Po,{propertyName:0,elapsedTime:0,pseudoElement:0}),iI=kn(aI),oI=et({},bh,{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}),lI=kn(oI),cI=[9,13,27,32],jx=Zr&&"CompositionEvent"in window,Rl=null;Zr&&"documentMode"in document&&(Rl=document.documentMode);var dI=Zr&&"TextEvent"in window&&!Rl,H1=Zr&&(!jx||Rl&&8<Rl&&11>=Rl),i0=" ",o0=!1;function K1(e,t){switch(e){case"keyup":return cI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function G1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ci=!1;function uI(e,t){switch(e){case"compositionend":return G1(t);case"keypress":return t.which!==32?null:(o0=!0,i0);case"textInput":return e=t.data,e===i0&&o0?null:e;default:return null}}function hI(e,t){if(Ci)return e==="compositionend"||!jx&&K1(e,t)?(e=W1(),ru=vx=Is=null,Ci=!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 H1&&t.locale!=="ko"?null:t.data;default:return null}}var fI={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 l0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fI[e.type]:t==="textarea"}function q1(e,t,n,r){k1(r),t=Eu(t,"onChange"),0<t.length&&(n=new wx("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Il=null,ec=null;function mI(e){aN(e,0)}function jh(e){var t=Pi(e);if(y1(t))return e}function pI(e,t){if(e==="change")return t}var Y1=!1;if(Zr){var Hf;if(Zr){var Kf="oninput"in document;if(!Kf){var c0=document.createElement("div");c0.setAttribute("oninput","return;"),Kf=typeof c0.oninput=="function"}Hf=Kf}else Hf=!1;Y1=Hf&&(!document.documentMode||9<document.documentMode)}function d0(){Il&&(Il.detachEvent("onpropertychange",Q1),ec=Il=null)}function Q1(e){if(e.propertyName==="value"&&jh(ec)){var t=[];q1(t,ec,e,mx(e)),P1(mI,t)}}function gI(e,t,n){e==="focusin"?(d0(),Il=t,ec=n,Il.attachEvent("onpropertychange",Q1)):e==="focusout"&&d0()}function xI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return jh(ec)}function yI(e,t){if(e==="click")return jh(t)}function vI(e,t){if(e==="input"||e==="change")return jh(t)}function wI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lr=typeof Object.is=="function"?Object.is:wI;function tc(e,t){if(lr(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 a=n[r];if(!np.call(t,a)||!lr(e[a],t[a]))return!1}return!0}function u0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function h0(e,t){var n=u0(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=u0(n)}}function J1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?J1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function X1(){for(var e=window,t=bu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=bu(e.document)}return t}function Nx(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 bI(e){var t=X1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&J1(n.ownerDocument.documentElement,n)){if(r!==null&&Nx(n)){if(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 a=n.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!e.extend&&i>r&&(a=r,r=i,i=a),a=h0(n,i);var o=h0(n,r);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.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 jI=Zr&&"documentMode"in document&&11>=document.documentMode,_i=null,bp=null,Ml=null,jp=!1;
vendor: 4,120 bytes, line 37
37function f0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jp||_i==null||_i!==bu(r)||(r=_i,"selectionStart"in r&&Nx(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}),Ml&&tc(Ml,r)||(Ml=r,r=Eu(bp,"onSelect"),0<r.length&&(t=new wx("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=_i)))}function _d(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ei={animationend:_d("Animation","AnimationEnd"),animationiteration:_d("Animation","AnimationIteration"),animationstart:_d("Animation","AnimationStart"),transitionend:_d("Transition","TransitionEnd")},Gf={},Z1={};Zr&&(Z1=document.createElement("div").style,"AnimationEvent"in window||(delete Ei.animationend.animation,delete Ei.animationiteration.animation,delete Ei.animationstart.animation),"TransitionEvent"in window||delete Ei.transitionend.transition);function Nh(e){if(Gf[e])return Gf[e];if(!Ei[e])return e;var t=Ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Z1)return Gf[e]=t[n];return e}var eN=Nh("animationend"),tN=Nh("animationiteration"),nN=Nh("animationstart"),rN=Nh("transitionend"),sN=new Map,m0="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 ta(e,t){sN.set(e,t),Za(t,[e])}for(var qf=0;qf<m0.length;qf++){var Yf=m0[qf],NI=Yf.toLowerCase(),SI=Yf[0].toUpperCase()+Yf.slice(1);ta(NI,"on"+SI)}ta(eN,"onAnimationEnd");ta(tN,"onAnimationIteration");ta(nN,"onAnimationStart");ta("dblclick","onDoubleClick");ta("focusin","onFocus");ta("focusout","onBlur");ta(rN,"onTransitionEnd");uo("onMouseEnter",["mouseout","mouseover"]);uo("onMouseLeave",["mouseout","mouseover"]);uo("onPointerEnter",["pointerout","pointerover"]);uo("onPointerLeave",["pointerout","pointerover"]);Za("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Za("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Za("onBeforeInput",["compositionend","keypress","textInput","paste"]);Za("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Za("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Za("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nl="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(" "),kI=new Set("cancel close invalid load scroll toggle".split(" ").concat(Nl));function p0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,NR(r,t,void 0,e),e.currentTarget=null}function aN(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=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,d=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;p0(a,l,d),i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;p0(a,l,d),i=c}}}if(Nu)throw e=xp,Nu=!1,xp=null,e}function Ke(e,t){var n=t[_p];n===void 0&&(n=t[_p]=new Set);var r=e+"__bubble";n.has(r)||(iN(t,e,2,!1),n.add(r))}function Qf(e,t,n){var r=0;t&&(r|=4),iN(n,e,r,t)}var Ed="_reactListening"+Math.random().toString(36).slice(2);
vendor: 3,228 bytes, line 37
37function nc(e){if(!e[Ed]){e[Ed]=!0,f1.forEach(function(n){n!=="selectionchange"&&(kI.has(n)||Qf(n,!1,e),Qf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,Qf("selectionchange",!1,t))}}function iN(e,t,n,r){switch(z1(t)){case 1:var a=$R;break;case 4:a=UR;break;default:a=yx}n=a.bind(null,t,n,e),a=void 0,!gp||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Jf(e,t,n,r,a){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===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=Na(l),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}l=l.parentNode}}r=r.return}P1(function(){var d=i,u=mx(n),h=[];e:{var p=sN.get(e);if(p!==void 0){var m=wx,b=e;switch(e){case"keypress":if(su(n)===0)break e;case"keydown":case"keyup":m=tI;break;case"focusin":b="focus",m=Wf;break;case"focusout":b="blur",m=Wf;break;case"beforeblur":case"afterblur":m=Wf;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":m=r0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=zR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=sI;break;case eN:case tN:case nN:m=KR;break;case rN:m=iI;break;case"scroll":m=BR;break;case"wheel":m=lI;break;case"copy":case"cut":case"paste":m=qR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=a0}var g=(t&4)!==0,y=!g&&e==="scroll",x=g?p!==null?p+"Capture":null:p;g=[];for(var w=d,v;w!==null;){v=w;var j=v.stateNode;if(v.tag===5&&j!==null&&(v=j,x!==null&&(j=Ql(w,x),j!=null&&g.push(rc(w,j,v)))),y)break;w=w.return}0<g.length&&(p=new m(p,b,null,n,u),h.push({event:p,listeners:g}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&n!==mp&&(b=n.relatedTarget||n.fromElement)&&(Na(b)||b[es]))break e;if((m||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,m?(b=n.relatedTarget||n.toElement,m=d,b=b?Na(b):null,b!==null&&(y=ei(b),b!==y||b.tag!==5&&b.tag!==6)&&(b=null)):(m=null,b=d),m!==b)){if(g=r0,j="onMouseLeave",x="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(g=a0,j="onPointerLeave",x="onPointerEnter",w="pointer"),y=m==null?p:Pi(m),v=b==null?p:Pi(b),p=new g(j,w+"leave",m,n,u),p.target=y,p.relatedTarget=v,j=null,Na(u)===d&&(g=new g(x,w+"enter",b,n,u),g.target=v,g.relatedTarget=y,j=g),y=j,m&&b)t:{for(g=m,x=b,w=0,v=g;v;v=di(v))w++;for(v=0,j=x;j;j=di(j))v++;for(;0<w-v;)g=di(g),w--;for(;0<v-w;)x=di(x),v--;for(;w--;){if(g===x||x!==null&&g===x.alternate)break t;g=di(g),x=di(x)}g=null}else g=null;m!==null&&g0(h,p,m,g,!1),b!==null&&y!==null&&g0(h,y,b,g,!0)}}
vendor: 4,113 bytes, lines 37-38
37e:{if(p=d?Pi(d):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var N=pI;else if(l0(p))if(Y1)N=vI;else{N=xI;var S=gI}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(N=yI);if(N&&(N=N(e,d))){q1(h,N,n,u);break e}S&&S(e,p,d),e==="focusout"&&(S=p._wrapperState)&&S.controlled&&p.type==="number"&&cp(p,"number",p.value)}switch(S=d?Pi(d):window,e){case"focusin":(l0(S)||S.contentEditable==="true")&&(_i=S,bp=d,Ml=null);break;case"focusout":Ml=bp=_i=null;break;case"mousedown":jp=!0;break;case"contextmenu":case"mouseup":case"dragend":jp=!1,f0(h,n,u);break;case"selectionchange":if(jI)break;case"keydown":case"keyup":f0(h,n,u)}var k;if(jx)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Ci?K1(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(H1&&n.locale!=="ko"&&(Ci||C!=="onCompositionStart"?C==="onCompositionEnd"&&Ci&&(k=W1()):(Is=u,vx="value"in Is?Is.value:Is.textContent,Ci=!0)),S=Eu(d,C),0<S.length&&(C=new s0(C,e,null,n,u),h.push({event:C,listeners:S}),k?C.data=k:(k=G1(n),k!==null&&(C.data=k)))),(k=dI?uI(e,n):hI(e,n))&&(d=Eu(d,"onBeforeInput"),0<d.length&&(u=new s0("onBeforeInput","beforeinput",null,n,u),h.push({event:u,listeners:d}),u.data=k))}aN(h,t)})}function rc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Eu(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=Ql(e,n),i!=null&&r.unshift(rc(e,i,a)),i=Ql(e,t),i!=null&&r.push(rc(e,i,a))),e=e.return}return r}function di(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function g0(e,t,n,r,a){for(var i=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&d!==null&&(l=d,a?(c=Ql(n,i),c!=null&&o.unshift(rc(n,c,l))):a||(c=Ql(n,i),c!=null&&o.push(rc(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var CI=/\r\n?/g,_I=/\u0000|\uFFFD/g;function x0(e){return(typeof e=="string"?e:""+e).replace(CI,`
38`).replace(_I,"")}function Pd(e,t,n){if(t=x0(t),x0(e)!==t&&n)throw Error(H(425))}function Pu(){}var Np=null,Sp=null;function kp(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 Cp=typeof setTimeout=="function"?setTimeout:void 0,EI=typeof clearTimeout=="function"?clearTimeout:void 0,y0=typeof Promise=="function"?Promise:void 0,PI=typeof queueMicrotask=="function"?queueMicrotask:typeof y0<"u"?function(e){return y0.resolve(null).then(e).catch(TI)}:Cp;function TI(e){setTimeout(function(){throw e})}function Xf(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),Zl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Zl(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 v0(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 To=Math.random().toString(36).slice(2),Er="__reactFiber$"+To,sc="__reactProps$"+To,es="__reactContainer$"+To,_p="__reactEvents$"+To,AI="__reactListeners$"+To,RI="__reactHandles$"+To;function Na(e){var t=e[Er];if(t)return t;for(var n=e.parentNode;n;){if(t=n[es]||n[Er]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=v0(e);e!==null;){if(n=e[Er])return n;e=v0(e)}return t}e=n,n=e.parentNode}return null}function Fc(e){return e=e[Er]||e[es],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Pi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function Sh(e){return e[sc]||null}var Ep=[],Ti=-1;function na(e){return{current:e}}function Ge(e){0>
vendor: 4,512 bytes, line 38
38Ti||(e.current=Ep[Ti],Ep[Ti]=null,Ti--)}function ze(e,t){Ti++,Ep[Ti]=e.current,e.current=t}var Gs={},Ft=na(Gs),on=na(!1),Ba=Gs;function ho(e,t){var n=e.type.contextTypes;if(!n)return Gs;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ln(e){return e=e.childContextTypes,e!=null}function Tu(){Ge(on),Ge(Ft)}function w0(e,t,n){if(Ft.current!==Gs)throw Error(H(168));ze(Ft,t),ze(on,n)}function oN(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(H(108,gR(e)||"Unknown",a));return et({},n,r)}function Au(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gs,Ba=Ft.current,ze(Ft,e),ze(on,on.current),!0}function b0(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=oN(e,t,Ba),r.__reactInternalMemoizedMergedChildContext=e,Ge(on),Ge(Ft),ze(Ft,e)):Ge(on),ze(on,n)}var qr=null,kh=!1,Zf=!1;function lN(e){qr===null?qr=[e]:qr.push(e)}function II(e){kh=!0,lN(e)}function ra(){if(!Zf&&qr!==null){Zf=!0;var e=0,t=Le;try{var n=qr;for(Le=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}qr=null,kh=!1}catch(a){throw qr!==null&&(qr=qr.slice(e+1)),I1(px,ra),a}finally{Le=t,Zf=!1}}return null}var Ai=[],Ri=0,Ru=null,Iu=0,Tn=[],An=0,Va=null,Qr=1,Jr="";function ga(e,t){Ai[Ri++]=Iu,Ai[Ri++]=Ru,Ru=e,Iu=t}function cN(e,t,n){Tn[An++]=Qr,Tn[An++]=Jr,Tn[An++]=Va,Va=e;var r=Qr;e=Jr;var a=32-ir(r)-1;r&=~(1<<a),n+=1;var i=32-ir(t)+a;if(30<i){var o=a-a%5;i=(r&(1<<o)-1).toString(32),r>>=o,a-=o,Qr=1<<32-ir(t)+a|n<<a|r,Jr=i+e}else Qr=1<<i|n<<a|r,Jr=e}function Sx(e){e.return!==null&&(ga(e,1),cN(e,1,0))}function kx(e){for(;e===Ru;)Ru=Ai[--Ri],Ai[Ri]=null,Iu=Ai[--Ri],Ai[Ri]=null;for(;e===Va;)Va=Tn[--An],Tn[An]=null,Jr=Tn[--An],Tn[An]=null,Qr=Tn[--An],Tn[An]=null}var bn=null,vn=null,Ye=!1,ar=null;function dN(e,t){var n=Rn(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 j0(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,bn=e,vn=$s(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,bn=e,vn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Va!==null?{id:Qr,overflow:Jr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Rn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,bn=e,vn=null,!0):!1;default:return!1}}function Pp(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Tp(e){if(Ye){var t=vn;if(t){var n=t;if(!j0(e,t)){if(Pp(e))throw Error(H(418));t=$s(n.nextSibling);var r=bn;t&&j0(e,t)?dN(r,n):(e.flags=e.flags&-4097|2,Ye=!1,bn=e)}}else{if(Pp(e))throw Error(H(418));e.flags=e.flags&-4097|2,Ye=!1,bn=e}}}function N0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;bn=e}function Td(e){if(e!==bn)return!1;if(!Ye)return N0(e),Ye=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!kp(e.type,e.memoizedProps)),t&&(t=vn)){if(Pp(e))throw uN(),Error(H(418));for(;t;)dN(e,t),t=$s(t.nextSibling)}if(N0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){vn=$s(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}vn=null}}else vn=bn?$s(e.stateNode.nextSibling):null;return!0}function uN(){for(var e=vn;e;)e=$s(e.nextSibling)}function fo(){vn=bn=null,Ye=!1}function Cx(e){ar===null?ar=[e]:ar.push(e)}var MI=ls.ReactCurrentBatchConfig;function ll(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(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var a=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function Ad(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function S0(e){var t=e._init;return t(e._payload)}
vendor: 3,335 bytes, line 38
38function hN(e){function t(x,w){if(e){var v=x.deletions;v===null?(x.deletions=[w],x.flags|=16):v.push(w)}}function n(x,w){if(!e)return null;for(;w!==null;)t(x,w),w=w.sibling;return null}function r(x,w){for(x=new Map;w!==null;)w.key!==null?x.set(w.key,w):x.set(w.index,w),w=w.sibling;return x}function a(x,w){return x=zs(x,w),x.index=0,x.sibling=null,x}function i(x,w,v){return x.index=v,e?(v=x.alternate,v!==null?(v=v.index,v<w?(x.flags|=2,w):v):(x.flags|=2,w)):(x.flags|=1048576,w)}function o(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,w,v,j){return w===null||w.tag!==6?(w=im(v,x.mode,j),w.return=x,w):(w=a(w,v),w.return=x,w)}function c(x,w,v,j){var N=v.type;return N===ki?u(x,w,v.props.children,j,v.key):w!==null&&(w.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ns&&S0(N)===w.type)?(j=a(w,v.props),j.ref=ll(x,w,v),j.return=x,j):(j=uu(v.type,v.key,v.props,null,x.mode,j),j.ref=ll(x,w,v),j.return=x,j)}function d(x,w,v,j){return w===null||w.tag!==4||w.stateNode.containerInfo!==v.containerInfo||w.stateNode.implementation!==v.implementation?(w=om(v,x.mode,j),w.return=x,w):(w=a(w,v.children||[]),w.return=x,w)}function u(x,w,v,j,N){return w===null||w.tag!==7?(w=Da(v,x.mode,j,N),w.return=x,w):(w=a(w,v),w.return=x,w)}function h(x,w,v){if(typeof w=="string"&&w!==""||typeof w=="number")return w=im(""+w,x.mode,v),w.return=x,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case wd:return v=uu(w.type,w.key,w.props,null,x.mode,v),v.ref=ll(x,null,w),v.return=x,v;case Si:return w=om(w,x.mode,v),w.return=x,w;case Ns:var j=w._init;return h(x,j(w._payload),v)}if(bl(w)||rl(w))return w=Da(w,x.mode,v,null),w.return=x,w;Ad(x,w)}return null}function p(x,w,v,j){var N=w!==null?w.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return N!==null?null:l(x,w,""+v,j);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case wd:return v.key===N?c(x,w,v,j):null;case Si:return v.key===N?d(x,w,v,j):null;case Ns:return N=v._init,p(x,w,N(v._payload),j)}if(bl(v)||rl(v))return N!==null?null:u(x,w,v,j,null);Ad(x,v)}return null}function m(x,w,v,j,N){if(typeof j=="string"&&j!==""||typeof j=="number")return x=x.get(v)||null,l(w,x,""+j,N);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case wd:return x=x.get(j.key===null?v:j.key)||null,c(w,x,j,N);case Si:return x=x.get(j.key===null?v:j.key)||null,d(w,x,j,N);case Ns:var S=j._init;return m(x,w,v,S(j._payload),N)}if(bl(j)||rl(j))return x=x.get(v)||null,u(w,x,j,N,null);Ad(w,j)}return null}function b(x,w,v,j){for(var N=null,S=null,k=w,C=w=0,A=null;k!==null&&C<v.length;C++){k.index>C?(A=k,k=null):A=k.sibling;var R=p(x,k,v[C],j);if(R===null){k===null&&(k=A);break}e&&k&&R.alternate===null&&t(x,k),w=i(R,w,C),S===null?N=R:S.sibling=R,S=R,k=A}if(C===v.length)return n(x,k),Ye&&ga(x,C),N;if(k===null){for(;C<v.length;C++)k=h(x,v[C],j),k!==null&&(w=i(k,w,C),S===null?N=k:S.sibling=k,S=k);return Ye&&ga(x,C),N}for(k=r(x,k);C<v.length;C++)A=m(k,x,C,v[C],j),A!==null&&(e&&A.alternate!==null&&k.delete(A.key===null?C:A.key),w=i(A,w,C),S===null?N=A:S.sibling=A,S=A);return e&&k.forEach(function(G){return t(x,G)}),Ye&&ga(x,C),N}function g(x,w,v,j){var N=rl(v);if(typeof N!="function")throw Error(H(150));if(v=N.call(v),v==null)throw Error(H(151));for(var S=N=null,k=w,C=w=0,A=null,R=v.next();k!==null&&!R.done;C++,R=v.next()){k.index>C?(A=k,k=null):A=k.sibling;
vendor: 9,614 bytes, line 38
38var G=p(x,k,R.value,j);if(G===null){k===null&&(k=A);break}e&&k&&G.alternate===null&&t(x,k),w=i(G,w,C),S===null?N=G:S.sibling=G,S=G,k=A}if(R.done)return n(x,k),Ye&&ga(x,C),N;if(k===null){for(;!R.done;C++,R=v.next())R=h(x,R.value,j),R!==null&&(w=i(R,w,C),S===null?N=R:S.sibling=R,S=R);return Ye&&ga(x,C),N}for(k=r(x,k);!R.done;C++,R=v.next())R=m(k,x,C,R.value,j),R!==null&&(e&&R.alternate!==null&&k.delete(R.key===null?C:R.key),w=i(R,w,C),S===null?N=R:S.sibling=R,S=R);return e&&k.forEach(function(W){return t(x,W)}),Ye&&ga(x,C),N}function y(x,w,v,j){if(typeof v=="object"&&v!==null&&v.type===ki&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case wd:e:{for(var N=v.key,S=w;S!==null;){if(S.key===N){if(N=v.type,N===ki){if(S.tag===7){n(x,S.sibling),w=a(S,v.props.children),w.return=x,x=w;break e}}else if(S.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ns&&S0(N)===S.type){n(x,S.sibling),w=a(S,v.props),w.ref=ll(x,S,v),w.return=x,x=w;break e}n(x,S);break}else t(x,S);S=S.sibling}v.type===ki?(w=Da(v.props.children,x.mode,j,v.key),w.return=x,x=w):(j=uu(v.type,v.key,v.props,null,x.mode,j),j.ref=ll(x,w,v),j.return=x,x=j)}return o(x);case Si:e:{for(S=v.key;w!==null;){if(w.key===S)if(w.tag===4&&w.stateNode.containerInfo===v.containerInfo&&w.stateNode.implementation===v.implementation){n(x,w.sibling),w=a(w,v.children||[]),w.return=x,x=w;break e}else{n(x,w);break}else t(x,w);w=w.sibling}w=om(v,x.mode,j),w.return=x,x=w}return o(x);case Ns:return S=v._init,y(x,w,S(v._payload),j)}if(bl(v))return b(x,w,v,j);if(rl(v))return g(x,w,v,j);Ad(x,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,w!==null&&w.tag===6?(n(x,w.sibling),w=a(w,v),w.return=x,x=w):(n(x,w),w=im(v,x.mode,j),w.return=x,x=w),o(x)):n(x,w)}return y}var mo=hN(!0),fN=hN(!1),Mu=na(null),Ou=null,Ii=null,_x=null;function Ex(){_x=Ii=Ou=null}function Px(e){var t=Mu.current;Ge(Mu),e._currentValue=t}function Ap(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 qi(e,t){Ou=e,_x=Ii=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sn=!0),e.firstContext=null)}function $n(e){var t=e._currentValue;if(_x!==e)if(e={context:e,memoizedValue:t,next:null},Ii===null){if(Ou===null)throw Error(H(308));Ii=e,Ou.dependencies={lanes:0,firstContext:e}}else Ii=Ii.next=e;return t}var Sa=null;function Tx(e){Sa===null?Sa=[e]:Sa.push(e)}function mN(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,Tx(t)):(n.next=a.next,a.next=n),t.interleaved=n,ts(e,r)}function ts(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 Ss=!1;function Ax(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pN(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 Xr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Us(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,_e&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,ts(e,n)}return a=r.interleaved,a===null?(t.next=t,Tx(r)):(t.next=a.next,a.next=t),r.interleaved=t,ts(e,n)}function au(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,gx(e,n)}}function k0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=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?a=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,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 Du(e,t,n,r){var a=e.updateQueue;Ss=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(i!==null){var h=a.baseState;o=0,u=d=c=null,l=i;do{var p=l.lane,m=l.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var b=e,g=l;switch(p=t,m=n,g.tag){case 1:if(b=g.payload,typeof b=="function"){h=b.call(m,h,p);break e}h=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=g.payload,p=typeof b=="function"?b.call(m,h,p):b,p==null)break e;h=et({},h,p);break e;case 2:Ss=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[l]:p.push(l))}else m={eventTime:m,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=m,c=h):u=u.next=m,o|=p;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;p=l,l=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);if(u===null&&(c=h),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=u,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);Wa|=o,e.lanes=o,e.memoizedState=h}}function C0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(H(191,a));a.call(r)}}}var $c={},Rr=na($c),ac=na($c),ic=na($c);function ka(e){if(e===$c)throw Error(H(174));return e}function Rx(e,t){switch(ze(ic,t),ze(ac,e),ze(Rr,$c),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:up(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=up(t,e)}Ge(Rr),ze(Rr,t)}function po(){Ge(Rr),Ge(ac),Ge(ic)}function gN(e){ka(ic.current);var t=ka(Rr.current),n=up(t,e.type);t!==n&&(ze(ac,e),ze(Rr,n))}function Ix(e){ac.current===e&&(Ge(Rr),Ge(ac))}var Je=na(0);function Lu(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 em=[];function Mx(){for(var e=0;e<em.length;e++)em[e]._workInProgressVersionPrimary=null;em.length=0}var iu=ls.ReactCurrentDispatcher,tm=ls.ReactCurrentBatchConfig,za=0,Ze=null,mt=null,xt=null,Fu=!1,Ol=!1,oc=0,OI=0;function At(){throw Error(H(321))}function Ox(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!lr(e[n],t[n]))return!1;return!0}function Dx(e,t,n,r,a,i){if(za=i,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,iu.current=e===null||e.memoizedState===null?$I:UI,e=n(r,a),Ol){i=0;do{if(Ol=!1,oc=0,25<=i)throw Error(H(301));i+=1,xt=mt=null,t.updateQueue=null,iu.current=BI,e=n(r,a)}while(Ol)}if(iu.current=$u,t=mt!==null&&mt.next!==null,za=0,xt=mt=Ze=null,Fu=!1,t)throw Error(H(300));return e}function Lx(){var e=oc!==0;return oc=0,e}function jr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?Ze.memoizedState=xt=e:xt=xt.next=e,xt}function Un(){if(mt===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var t=xt===null?Ze.memoizedState:xt.next;if(t!==null)xt=t,mt=e;else{if(e===null)throw Error(H(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},xt===null?Ze.memoizedState=xt=e:xt=xt.next=e}return xt}function lc(e,t){return typeof t=="function"?t(e):t}function nm(e){var t=Un(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=mt,a=r.baseQueue,i=n.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}r.baseQueue=a=i,n.pending=null}if(a!==null){i=a.next,r=r.baseState;var l=o=null,c=null,d=i;do{var u=d.lane;if((za&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var h={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=h,o=r):c=c.next=h,Ze.lanes|=u,Wa|=u}d=d.next}while(d!==null&&d!==i);c===null?o=r:c.next=l,lr(r,t.memoizedState)||(sn=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do i=a.lane,Ze.lanes|=i,Wa|=i,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function rm(e){var t=Un(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);lr(i,t.memoizedState)||(sn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function xN(){}function yN(e,t){var n=Ze,r=Un(),a=t(),i=!lr(r.memoizedState,a);if(i&&(r.memoizedState=a,sn=!0),r=r.queue,Fx(bN.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||xt!==null&&xt.memoizedState.tag&1){if(n.flags|=2048,cc(9,wN.bind(null,n,r,a,t),void 0,null),yt===null)throw Error(H(349));za&30||vN(n,t,a)}return a}
vendor: 4,204 bytes, line 38
38function vN(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ze.updateQueue,t===null?(t={lastEffect:null,stores:null},Ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function wN(e,t,n,r){t.value=n,t.getSnapshot=r,jN(t)&&NN(e)}function bN(e,t,n){return n(function(){jN(t)&&NN(e)})}function jN(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lr(e,n)}catch{return!0}}function NN(e){var t=ts(e,1);t!==null&&or(t,e,1,-1)}function _0(e){var t=jr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:lc,lastRenderedState:e},t.queue=e,e=e.dispatch=FI.bind(null,Ze,e),[t.memoizedState,e]}function cc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ze.updateQueue,t===null?(t={lastEffect:null,stores:null},Ze.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 SN(){return Un().memoizedState}function ou(e,t,n,r){var a=jr();Ze.flags|=e,a.memoizedState=cc(1|t,n,void 0,r===void 0?null:r)}function Ch(e,t,n,r){var a=Un();r=r===void 0?null:r;var i=void 0;if(mt!==null){var o=mt.memoizedState;if(i=o.destroy,r!==null&&Ox(r,o.deps)){a.memoizedState=cc(t,n,i,r);return}}Ze.flags|=e,a.memoizedState=cc(1|t,n,i,r)}function E0(e,t){return ou(8390656,8,e,t)}function Fx(e,t){return Ch(2048,8,e,t)}function kN(e,t){return Ch(4,2,e,t)}function CN(e,t){return Ch(4,4,e,t)}function _N(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 EN(e,t,n){return n=n!=null?n.concat([e]):null,Ch(4,4,_N.bind(null,t,e),n)}function $x(){}function PN(e,t){var n=Un();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ox(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function TN(e,t){var n=Un();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ox(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function AN(e,t,n){return za&21?(lr(n,t)||(n=D1(),Ze.lanes|=n,Wa|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,sn=!0),e.memoizedState=n)}function DI(e,t){var n=Le;Le=n!==0&&4>n?n:4,e(!0);var r=tm.transition;tm.transition={};try{e(!1),t()}finally{Le=n,tm.transition=r}}function RN(){return Un().memoizedState}function LI(e,t,n){var r=Vs(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},IN(e))MN(t,n);else if(n=mN(e,t,n,r),n!==null){var a=zt();or(n,e,r,a),ON(n,t,r)}}function FI(e,t,n){var r=Vs(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(IN(e))MN(t,a);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(a.hasEagerState=!0,a.eagerState=l,lr(l,o)){var c=t.interleaved;c===null?(a.next=a,Tx(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=mN(e,t,a,r),n!==null&&(a=zt(),or(n,e,r,a),ON(n,t,r))}}function IN(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function MN(e,t){Ol=Fu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ON(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gx(e,n)}}var $u={readContext:$n,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useInsertionEffect:At,useLayoutEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useMutableSource:At,useSyncExternalStore:At,useId:At,unstable_isNewReconciler:!1},$I={readContext:$n,useCallback:function(e,t){return jr().memoizedState=[e,t===void 0?null:t],e},useContext:$n,useEffect:E0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ou(4194308,4,_N.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ou(4194308,4,e,t)},useInsertionEffect:function(e,t){return ou(4,2,e,t)},useMemo:function(e,t){var n=jr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jr();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=LI.bind(null,Ze,e),[r.memoizedState,e]}
vendor: 7,431 bytes, lines 38-40
38,useRef:function(e){var t=jr();return e={current:e},t.memoizedState=e},useState:_0,useDebugValue:$x,useDeferredValue:function(e){return jr().memoizedState=e},useTransition:function(){var e=_0(!1),t=e[0];return e=DI.bind(null,e[1]),jr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ze,a=jr();if(Ye){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),yt===null)throw Error(H(349));za&30||vN(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,E0(bN.bind(null,r,i,e),[e]),r.flags|=2048,cc(9,wN.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=jr(),t=yt.identifierPrefix;if(Ye){var n=Jr,r=Qr;n=(r&~(1<<32-ir(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=oc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=OI++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},UI={readContext:$n,useCallback:PN,useContext:$n,useEffect:Fx,useImperativeHandle:EN,useInsertionEffect:kN,useLayoutEffect:CN,useMemo:TN,useReducer:nm,useRef:SN,useState:function(){return nm(lc)},useDebugValue:$x,useDeferredValue:function(e){var t=Un();return AN(t,mt.memoizedState,e)},useTransition:function(){var e=nm(lc)[0],t=Un().memoizedState;return[e,t]},useMutableSource:xN,useSyncExternalStore:yN,useId:RN,unstable_isNewReconciler:!1},BI={readContext:$n,useCallback:PN,useContext:$n,useEffect:Fx,useImperativeHandle:EN,useInsertionEffect:kN,useLayoutEffect:CN,useMemo:TN,useReducer:rm,useRef:SN,useState:function(){return rm(lc)},useDebugValue:$x,useDeferredValue:function(e){var t=Un();return mt===null?t.memoizedState=e:AN(t,mt.memoizedState,e)},useTransition:function(){var e=rm(lc)[0],t=Un().memoizedState;return[e,t]},useMutableSource:xN,useSyncExternalStore:yN,useId:RN,unstable_isNewReconciler:!1};function Zn(e,t){if(e&&e.defaultProps){t=et({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Rp(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:et({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _h={isMounted:function(e){return(e=e._reactInternals)?ei(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=zt(),a=Vs(e),i=Xr(r,a);i.payload=t,n!=null&&(i.callback=n),t=Us(e,i,a),t!==null&&(or(t,e,a,r),au(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=zt(),a=Vs(e),i=Xr(r,a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Us(e,i,a),t!==null&&(or(t,e,a,r),au(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=zt(),r=Vs(e),a=Xr(n,r);a.tag=2,t!=null&&(a.callback=t),t=Us(e,a,r),t!==null&&(or(t,e,r,n),au(t,e,r))}};function P0(e,t,n,r,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!tc(n,r)||!tc(a,i):!0}function DN(e,t,n){var r=!1,a=Gs,i=t.contextType;return typeof i=="object"&&i!==null?i=$n(i):(a=ln(t)?Ba:Ft.current,r=t.contextTypes,i=(r=r!=null)?ho(e,a):Gs),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=_h,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function T0(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&&_h.enqueueReplaceState(t,t.state,null)}function Ip(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},Ax(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=$n(i):(i=ln(t)?Ba:Ft.current,a.context=ho(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Rp(e,t,i,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&_h.enqueueReplaceState(a,a.state,null),Du(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function go(e,t){try{var n="",r=t;do n+=pR(r),r=r.return;while(r);var a=n}catch(i){a=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:e,source:t,stack:a,digest:null}}function sm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Mp(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var VI=typeof WeakMap=="function"?WeakMap:Map;function LN(e,t,n){n=Xr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Bu||(Bu=!0,Wp=r),Mp(e,t)},n}function FN(e,t,n){n=Xr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){Mp(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Mp(e,t),typeof r!="function"&&(Bs===null?Bs=new Set([this]):Bs.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function A0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new VI;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=n4.bind(null,e,t,n),t.then(e,e))}function R0(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 I0(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,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=Xr(-1,1),t.tag=2,Us(n,t,1))),n.lanes|=1),e)}var zI=ls.ReactCurrentOwner,sn=!1;function Ut(e,t,n,r){t.child=e===null?fN(t,null,n,r):mo(t,e.child,n,r)}function M0(e,t,n,r,a){n=n.render;var i=t.ref;return qi(t,a),r=Dx(e,t,n,r,i,a),n=Lx(),e!==null&&!sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,ns(e,t,a)):(Ye&&n&&Sx(t),t.flags|=1,Ut(e,t,r,a),t.child)}function O0(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!Gx(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,$N(e,t,i,r,a)):(e=uu(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:tc,n(o,r)&&e.ref===t.ref)return ns(e,t,a)}return t.flags|=1,e=zs(i,r),e.ref=t.ref,e.return=t,t.child=e}function $N(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(tc(i,r)&&e.ref===t.ref)if(sn=!1,t.pendingProps=r=i,(e.lanes&a)!==0)e.flags&131072&&(sn=!0);else return t.lanes=e.lanes,ns(e,t,a)}return Op(e,t,n,r,a)}function UN(e,t,n){var r=t.pendingProps,a=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ze(Oi,xn),xn|=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,ze(Oi,xn),xn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ze(Oi,xn),xn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ze(Oi,xn),xn|=r;return Ut(e,t,a,n),t.child}function BN(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}
vendor: 8,359 bytes, line 40
40function Op(e,t,n,r,a){var i=ln(n)?Ba:Ft.current;return i=ho(t,i),qi(t,a),n=Dx(e,t,n,r,i,a),r=Lx(),e!==null&&!sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,ns(e,t,a)):(Ye&&r&&Sx(t),t.flags|=1,Ut(e,t,n,a),t.child)}function D0(e,t,n,r,a){if(ln(n)){var i=!0;Au(t)}else i=!1;if(qi(t,a),t.stateNode===null)lu(e,t),DN(t,n,r),Ip(t,n,r,a),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=$n(d):(d=ln(n)?Ba:Ft.current,d=ho(t,d));var u=n.getDerivedStateFromProps,h=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==d)&&T0(t,o,r,d),Ss=!1;var p=t.memoizedState;o.state=p,Du(t,r,o,a),c=t.memoizedState,l!==r||p!==c||on.current||Ss?(typeof u=="function"&&(Rp(t,n,u,r),c=t.memoizedState),(l=Ss||P0(t,n,l,r,p,c,d))?(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=d,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,pN(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Zn(t.type,l),o.props=d,h=t.pendingProps,p=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=$n(c):(c=ln(n)?Ba:Ft.current,c=ho(t,c));var m=n.getDerivedStateFromProps;(u=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||p!==c)&&T0(t,o,r,c),Ss=!1,p=t.memoizedState,o.state=p,Du(t,r,o,a);var b=t.memoizedState;l!==h||p!==b||on.current||Ss?(typeof m=="function"&&(Rp(t,n,m,r),b=t.memoizedState),(d=Ss||P0(t,n,d,r,p,b,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,b,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,b,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),o.props=r,o.state=b,o.context=c,r=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Dp(e,t,n,r,i,a)}function Dp(e,t,n,r,a,i){BN(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return a&&b0(t,n,!1),ns(e,t,i);r=t.stateNode,zI.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=mo(t,e.child,null,i),t.child=mo(t,null,l,i)):Ut(e,t,l,i),t.memoizedState=r.state,a&&b0(t,n,!0),t.child}function VN(e){var t=e.stateNode;t.pendingContext?w0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&w0(e,t.context,!1),Rx(e,t.containerInfo)}function L0(e,t,n,r,a){return fo(),Cx(a),t.flags|=256,Ut(e,t,n,r),t.child}var Lp={dehydrated:null,treeContext:null,retryLane:0};function Fp(e){return{baseLanes:e,cachePool:null,transitions:null}}function zN(e,t,n){var r=t.pendingProps,a=Je.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),ze(Je,a&1),e===null)return Tp(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=Th(o,r,0,null),e=Da(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Fp(n),t.memoizedState=Lp,e):Ux(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return WI(e,t,o,r,l,a,n);if(i){i=r.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=zs(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=zs(l,i):(i=Da(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?Fp(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Lp,r}return i=e.child,e=i.sibling,r=zs(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 Ux(e,t){return t=Th({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Rd(e,t,n,r){return r!==null&&Cx(r),mo(t,e.child,null,n),e=Ux(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function WI(e,t,n,r,a,i,o){if(n)return t.flags&256?(t.flags&=-257,r=sm(Error(H(422))),Rd(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=Th({mode:"visible",children:r.children},a,0,null),i=Da(i,a,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&mo(t,e.child,null,o),t.child.memoizedState=Fp(o),t.memoizedState=Lp,i);if(!(t.mode&1))return Rd(e,t,o,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(H(419)),r=sm(i,r,void 0),Rd(e,t,o,r)}if(l=(o&e.childLanes)!==0,sn||l){if(r=yt,r!==null){switch(o&-o){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,ts(e,a),or(r,e,a,-1))}return Kx(),r=sm(Error(H(421))),Rd(e,t,o,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=r4.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,vn=$s(a.nextSibling),bn=t,Ye=!0,ar=null,e!==null&&(Tn[An++]=Qr,Tn[An++]=Jr,Tn[An++]=Va,Qr=e.id,Jr=e.overflow,Va=t),t=Ux(t,r.children),t.flags|=4096,t)}function F0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ap(e.return,t,n)}function am(e,t,n,r,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a)}function WN(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(Ut(e,t,r.children,n),r=Je.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&&F0(e,n,t);else if(e.tag===19)F0(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(ze(Je,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Lu(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),am(t,!1,a,n,i);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Lu(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}am(t,!0,n,null,i);break;case"together":am(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function lu(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ns(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wa|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=zs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=zs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}
vendor: 5,270 bytes, line 40
40function HI(e,t,n){switch(t.tag){case 3:VN(t),fo();break;case 5:gN(t);break;case 1:ln(t.type)&&Au(t);break;case 4:Rx(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;ze(Mu,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ze(Je,Je.current&1),t.flags|=128,null):n&t.child.childLanes?zN(e,t,n):(ze(Je,Je.current&1),e=ns(e,t,n),e!==null?e.sibling:null);ze(Je,Je.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return WN(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ze(Je,Je.current),r)break;return null;case 22:case 23:return t.lanes=0,UN(e,t,n)}return ns(e,t,n)}var HN,$p,KN,GN;HN=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}};$p=function(){};KN=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,ka(Rr.current);var i=null;switch(n){case"input":a=op(e,a),r=op(e,r),i=[];break;case"select":a=et({},a,{value:void 0}),r=et({},r,{value:void 0}),i=[];break;case"textarea":a=dp(e,a),r=dp(e,r),i=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pu)}hp(n,r);var o;n=null;for(d in a)if(!r.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var l=a[d];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ql.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(l=a!=null?a[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="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(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(ql.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&Ke("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};GN=function(e,t,n,r){n!==r&&(t.flags|=4)};function cl(e,t){if(!Ye)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 Rt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function KI(e,t,n){var r=t.pendingProps;switch(kx(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(t),null;case 1:return ln(t.type)&&Tu(),Rt(t),null;case 3:return r=t.stateNode,po(),Ge(on),Ge(Ft),Mx(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Td(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ar!==null&&(Gp(ar),ar=null))),$p(e,t),Rt(t),null;case 5:Ix(t);var a=ka(ic.current);if(n=t.type,e!==null&&t.stateNode!=null)KN(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Rt(t),null}if(e=ka(Rr.current),Td(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Er]=t,r[sc]=i,e=(t.mode&1)!==0,n){case"dialog":Ke("cancel",r),Ke("close",r);break;case"iframe":case"object":case"embed":Ke("load",r);break;case"video":case"audio":for(a=0;a<Nl.length;a++)Ke(Nl[a],r);break;case"source":Ke("error",r);break;case"img":case"image":case"link":Ke("error",r),Ke("load",r);break;case"details":Ke("toggle",r);break;case"input":Gv(r,i),Ke("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ke("invalid",r);break;case"textarea":Yv(r,i),Ke("invalid",r)}hp(n,i),a=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&&Pd(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Pd(r.textContent,l,e),a=["children",""+l]):ql.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Ke("scroll",r)}switch(n){case"input":bd(r),qv(r,i,!0);break;case"textarea":bd(r),Qv(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Pu)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=b1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>
40",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[Er]=t,e[sc]=r,HN(e,t,!1,!1),t.stateNode=e;e:{switch(o=fp(n,r),n){case"dialog":Ke("cancel",e),Ke("close",e),a=r;break;case"iframe":case"object":case"embed":Ke("load",e),a=r;break;case"video":case"audio":for(a=0;a<Nl.length;a++)Ke(Nl[a],e);a=r;break;case"source":Ke("error",e),a=r;break;case"img":case"image":case"link":Ke("error",e),Ke("load",e),a=r;break;case"details":Ke("toggle",e),a=r;break;case"input":Gv(e,r),a=op(e,r),Ke("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=et({},r,{value:void 0}),Ke("invalid",e);break;case"textarea":Yv(e,r),a=dp(e,r),Ke("invalid",e);break;default:a=r}hp(n,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?S1(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&j1(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Yl(e,c):typeof c=="number"&&Yl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ql.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Ke("scroll",e):c!=null&&dx(e,i,c,o))}switch(n){case"input":bd(e),qv(e,r,!1);break;case"textarea":bd(e),Qv(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ks(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Wi(e,!!r.multiple,i,!1):r.defaultValue!=null&&Wi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Pu)}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 Rt(t),null;case 6:if(e&&t.stateNode!=null)GN(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=ka(ic.current),ka(Rr.current),Td(t)){if(r=t.stateNode,n=t.memoizedProps,r[Er]=t,(i=r.nodeValue!==n)&&(e=bn,e!==null))switch(e.tag){case 3:Pd(r.nodeValue,n,(e.mode&1)!==0);break;
vendor: 26,138 bytes, line 40
40case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Pd(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Er]=t,t.stateNode=r}return Rt(t),null;case 13:if(Ge(Je),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ye&&vn!==null&&t.mode&1&&!(t.flags&128))uN(),fo(),t.flags|=98560,i=!1;else if(i=Td(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[Er]=t}else fo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rt(t),i=!1}else ar!==null&&(Gp(ar),ar=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||Je.current&1?pt===0&&(pt=3):Kx())),t.updateQueue!==null&&(t.flags|=4),Rt(t),null);case 4:return po(),$p(e,t),e===null&&nc(t.stateNode.containerInfo),Rt(t),null;case 10:return Px(t.type._context),Rt(t),null;case 17:return ln(t.type)&&Tu(),Rt(t),null;case 19:if(Ge(Je),i=t.memoizedState,i===null)return Rt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)cl(i,!1);else{if(pt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Lu(e),o!==null){for(t.flags|=128,cl(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 ze(Je,Je.current&1|2),t.child}e=e.sibling}i.tail!==null&&at()>xo&&(t.flags|=128,r=!0,cl(i,!1),t.lanes=4194304)}else{if(!r)if(e=Lu(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),cl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ye)return Rt(t),null}else 2*at()-i.renderingStartTime>xo&&n!==1073741824&&(t.flags|=128,r=!0,cl(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=at(),t.sibling=null,n=Je.current,ze(Je,r?n&1|2:n&1),t):(Rt(t),null);case 22:case 23:return Hx(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?xn&1073741824&&(Rt(t),t.subtreeFlags&6&&(t.flags|=8192)):Rt(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function GI(e,t){switch(kx(t),t.tag){case 1:return ln(t.type)&&Tu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return po(),Ge(on),Ge(Ft),Mx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ix(t),null;case 13:if(Ge(Je),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));fo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ge(Je),null;case 4:return po(),null;case 10:return Px(t.type._context),null;case 22:case 23:return Hx(),null;case 24:return null;default:return null}}var Id=!1,Mt=!1,qI=typeof WeakSet=="function"?WeakSet:Set,te=null;function Mi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){rt(e,t,r)}else n.current=null}function Up(e,t,n){try{n()}catch(r){rt(e,t,r)}}var $0=!1;function YI(e,t){if(Np=Cu,e=X1(),Nx(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 a=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,d=0,u=0,h=e,p=null;t:for(;;){for(var m;h!==n||a!==0&&h.nodeType!==3||(l=o+a),h!==i||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(m=h.firstChild)!==null;)p=h,h=m;for(;;){if(h===e)break t;if(p===n&&++d===a&&(l=o),p===i&&++u===r&&(c=o),(m=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Sp={focusedElem:e,selectionRange:n},Cu=!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 b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var g=b.memoizedProps,y=b.memoizedState,x=t.stateNode,w=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:Zn(t.type,g),y);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(j){rt(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return b=$0,$0=!1,b}function Dl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Up(t,n,i)}a=a.next}while(a!==r)}}function Eh(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 Bp(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 qN(e){var t=e.alternate;t!==null&&(e.alternate=null,qN(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Er],delete t[sc],delete t[_p],delete t[AI],delete t[RI])),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 YN(e){return e.tag===5||e.tag===3||e.tag===4}function U0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||YN(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 Vp(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=Pu));else if(r!==4&&(e=e.child,e!==null))for(Vp(e,t,n),e=e.sibling;e!==null;)Vp(e,t,n),e=e.sibling}function zp(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(zp(e,t,n),e=e.sibling;e!==null;)zp(e,t,n),e=e.sibling}var wt=null,rr=!1;function ms(e,t,n){for(n=n.child;n!==null;)QN(e,t,n),n=n.sibling}function QN(e,t,n){if(Ar&&typeof Ar.onCommitFiberUnmount=="function")try{Ar.onCommitFiberUnmount(wh,n)}catch{}switch(n.tag){case 5:Mt||Mi(n,t);case 6:var r=wt,a=rr;wt=null,ms(e,t,n),wt=r,rr=a,wt!==null&&(rr?(e=wt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wt.removeChild(n.stateNode));break;case 18:wt!==null&&(rr?(e=wt,n=n.stateNode,e.nodeType===8?Xf(e.parentNode,n):e.nodeType===1&&Xf(e,n),Zl(e)):Xf(wt,n.stateNode));break;case 4:r=wt,a=rr,wt=n.stateNode.containerInfo,rr=!0,ms(e,t,n),wt=r,rr=a;break;case 0:case 11:case 14:case 15:if(!Mt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Up(n,t,o),a=a.next}while(a!==r)}ms(e,t,n);break;case 1:if(!Mt&&(Mi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){rt(n,t,l)}ms(e,t,n);break;case 21:ms(e,t,n);break;case 22:n.mode&1?(Mt=(r=Mt)||n.memoizedState!==null,ms(e,t,n),Mt=r):ms(e,t,n);break;default:ms(e,t,n)}}function B0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new qI),t.forEach(function(r){var a=s4.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function qn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:wt=l.stateNode,rr=!1;break e;case 3:wt=l.stateNode.containerInfo,rr=!0;break e;case 4:wt=l.stateNode.containerInfo,rr=!0;break e}l=l.return}if(wt===null)throw Error(H(160));QN(i,o,a),wt=null,rr=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){rt(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)JN(t,e),t=t.sibling}function JN(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(qn(t,e),br(e),r&4){try{Dl(3,e,e.return),Eh(3,e)}catch(g){rt(e,e.return,g)}try{Dl(5,e,e.return)}catch(g){rt(e,e.return,g)}}break;case 1:qn(t,e),br(e),r&512&&n!==null&&Mi(n,n.return);break;case 5:if(qn(t,e),br(e),r&512&&n!==null&&Mi(n,n.return),e.flags&32){var a=e.stateNode;try{Yl(a,"")}catch(g){rt(e,e.return,g)}}if(r&4&&(a=e.stateNode,a!=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&&v1(a,i),fp(l,o);var d=fp(l,i);for(o=0;o<c.length;o+=2){var u=c[o],h=c[o+1];u==="style"?S1(a,h):u==="dangerouslySetInnerHTML"?j1(a,h):u==="children"?Yl(a,h):dx(a,u,h,d)}switch(l){case"input":lp(a,i);break;case"textarea":w1(a,i);break;case"select":var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Wi(a,!!i.multiple,m,!1):p!==!!i.multiple&&(i.defaultValue!=null?Wi(a,!!i.multiple,i.defaultValue,!0):Wi(a,!!i.multiple,i.multiple?[]:"",!1))}a[sc]=i}catch(g){rt(e,e.return,g)}}break;case 6:if(qn(t,e),br(e),r&4){if(e.stateNode===null)throw Error(H(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(g){rt(e,e.return,g)}}break;case 3:if(qn(t,e),br(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Zl(t.containerInfo)}catch(g){rt(e,e.return,g)}break;case 4:qn(t,e),br(e);break;case 13:qn(t,e),br(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(zx=at())),r&4&&B0(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Mt=(d=Mt)||u,qn(t,e),Mt=d):qn(t,e),br(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(te=e,u=e.child;u!==null;){for(h=te=u;te!==null;){switch(p=te,m=p.child,p.tag){case 0:case 11:case 14:case 15:Dl(4,p,p.return);break;case 1:Mi(p,p.return);var b=p.stateNode;if(typeof b.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(g){rt(r,n,g)}}break;case 5:Mi(p,p.return);break;case 22:if(p.memoizedState!==null){z0(h);continue}}m!==null?(m.return=p,te=m):z0(h)}u=u.sibling}e:for(u=null,h=e;;){if(h.tag===5){if(u===null){u=h;try{a=h.stateNode,d?(i=a.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=N1("display",o))}catch(g){rt(e,e.return,g)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(g){rt(e,e.return,g)}}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;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:qn(t,e),br(e),r&4&&B0(e);break;case 21:break;default:qn(t,e),br(e)}}function br(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(YN(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(Yl(a,""),r.flags&=-33);var i=U0(e);zp(e,i,a);break;case 3:case 4:var o=r.stateNode.containerInfo,l=U0(e);Vp(e,l,o);break;default:throw Error(H(161))}}catch(c){rt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function QI(e,t,n){te=e,XN(e)}function XN(e,t,n){for(var r=(e.mode&1)!==0;te!==null;){var a=te,i=a.child;if(a.tag===22&&r){var o=a.memoizedState!==null||Id;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Mt;l=Id;var d=Mt;if(Id=o,(Mt=c)&&!d)for(te=a;te!==null;)o=te,c=o.child,o.tag===22&&o.memoizedState!==null?W0(a):c!==null?(c.return=o,te=c):W0(a);for(;i!==null;)te=i,XN(i),i=i.sibling;te=a,Id=l,Mt=d}V0(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,te=i):V0(e)}}function V0(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:Mt||Eh(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Mt)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Zn(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&C0(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}C0(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 d=t.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var h=u.dehydrated;h!==null&&Zl(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Mt||t.flags&512&&Bp(t)}catch(p){rt(t,t.return,p)}}if(t===e){te=null;break}if(n=t.sibling,n!==null){n.return=t.return,te=n;break}te=t.return}}function z0(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 W0(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Eh(4,t)}catch(c){rt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){rt(t,a,c)}}var i=t.return;try{Bp(t)}catch(c){rt(t,i,c)}break;case 5:var o=t.return;try{Bp(t)}catch(c){rt(t,o,c)}}}catch(c){rt(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 JI=Math.ceil,Uu=ls.ReactCurrentDispatcher,Bx=ls.ReactCurrentOwner,Mn=ls.ReactCurrentBatchConfig,_e=0,yt=null,ut=null,St=0,xn=0,Oi=na(0),pt=0,dc=null,Wa=0,Ph=0,Vx=0,Ll=null,tn=null,zx=0,xo=1/0,Kr=null,Bu=!1,Wp=null,Bs=null,Md=!1,Ms=null,Vu=0,Fl=0,Hp=null,cu=-1,du=0;function zt(){return _e&6?at():cu!==-1?cu:cu=at()}function Vs(e){return e.mode&1?_e&2&&St!==0?St&-St:MI.transition!==null?(du===0&&(du=D1()),du):(e=Le,e!==0||(e=window.event,e=e===void 0?16:z1(e.type)),e):1}function or(e,t,n,r){if(50<Fl)throw Fl=0,Hp=null,Error(H(185));Dc(e,n,r),(!(_e&2)||e!==yt)&&(e===yt&&(!(_e&2)&&(Ph|=n),pt===4&&Cs(e,St)),cn(e,r),n===1&&_e===0&&!(t.mode&1)&&(xo=at()+500,kh&&ra()))}function cn(e,t){var n=e.callbackNode;MR(e,t);var r=ku(e,e===yt?St:0);if(r===0)n!==null&&Zv(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Zv(n),t===1)e.tag===0?II(H0.bind(null,e)):lN(H0.bind(null,e)),PI(function(){!(_e&6)&&ra()}),n=null;else{switch(L1(r)){case 1:n=px;break;case 4:n=M1;break;case 16:n=Su;break;case 536870912:n=O1;break;default:n=Su}n=iS(n,ZN.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ZN(e,t){if(cu=-1,du=0,_e&6)throw Error(H(327));var n=e.callbackNode;if(Yi()&&e.callbackNode!==n)return null;var r=ku(e,e===yt?St:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=zu(e,r);else{t=r;var a=_e;_e|=2;var i=tS();(yt!==e||St!==t)&&(Kr=null,xo=at()+500,Oa(e,t));do try{e4();break}catch(l){eS(e,l)}while(!0);Ex(),Uu.current=i,_e=a,ut!==null?t=0:(yt=null,St=0,t=pt)}if(t!==0){if(t===2&&(a=yp(e),a!==0&&(r=a,t=Kp(e,a))),t===1)throw n=dc,Oa(e,0),Cs(e,r),cn(e,at()),n;if(t===6)Cs(e,r);else{if(a=e.current.alternate,!(r&30)&&!XI(a)&&(t=zu(e,r),t===2&&(i=yp(e),i!==0&&(r=i,t=Kp(e,i))),t===1))throw n=dc,Oa(e,0),Cs(e,r),cn(e,at()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:xa(e,tn,Kr);break;case 3:if(Cs(e,r),(r&130023424)===r&&(t=zx+500-at(),10<t)){if(ku(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){zt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Cp(xa.bind(null,e,tn,Kr),t);break}xa(e,tn,Kr);break;case 4:if(Cs(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var o=31-ir(r);i=1<<o,o=t[o],o>a&&(a=o),r&=~i}if(r=a,r=at()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*JI(r/1960))-r,10<r){e.timeoutHandle=Cp(xa.bind(null,e,tn,Kr),r);break}xa(e,tn,Kr);break;case 5:xa(e,tn,Kr);break;default:throw Error(H(329))}}}return cn(e,at()),e.callbackNode===n?ZN.bind(null,e):null}function Kp(e,t){var n=Ll;return e.current.memoizedState.isDehydrated&&(Oa(e,t).flags|=256),e=zu(e,t),e!==2&&(t=tn,tn=n,t!==null&&Gp(t)),e}function Gp(e){tn===null?tn=e:tn.push.apply(tn,e)}function XI(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 a=n[r],i=a.getSnapshot;a=a.value;try{if(!lr(i(),a))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 Cs(e,t){for(t&=~Vx,t&=~Ph,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ir(t),r=1<<n;e[n]=-1,t&=~r}}function H0(e){if(_e&6)throw Error(H(327));Yi();var t=ku(e,0);if(!(t&1))return cn(e,at()),null;var n=zu(e,t);if(e.tag!==0&&n===2){var r=yp(e);r!==0&&(t=r,n=Kp(e,r))}if(n===1)throw n=dc,Oa(e,0),Cs(e,t),cn(e,at()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,xa(e,tn,Kr),cn(e,at()),null}function Wx(e,t){var n=_e;_e|=1;try{return e(t)}finally{_e=n,_e===0&&(xo=at()+500,kh&&ra())}}function Ha(e){Ms!==null&&Ms.tag===0&&!(_e&6)&&Yi();var t=_e;_e|=1;var n=Mn.transition,r=Le;try{if(Mn.transition=null,Le=1,e)return e()}finally{Le=r,Mn.transition=n,_e=t,!(_e&6)&&ra()}}function Hx(){xn=Oi.current,Ge(Oi)}function Oa(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,EI(n)),ut!==null)for(n=ut.return;n!==null;){var r=n;switch(kx(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Tu();break;case 3:po(),Ge(on),Ge(Ft),Mx();break;case 5:Ix(r);break;case 4:po();break;case 13:Ge(Je);break;case 19:Ge(Je);break;case 10:Px(r.type._context);break;case 22:case 23:Hx()}n=n.return}if(yt=e,ut=e=zs(e.current,null),St=xn=t,pt=0,dc=null,Vx=Ph=Wa=0,tn=Ll=null,Sa!==null){for(t=0;t<Sa.length;t++)if(n=Sa[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=a,r.next=o}n.pending=r}Sa=null}return e}function eS(e,t){do{var n=ut;try{if(Ex(),iu.current=$u,Fu){for(var r=Ze.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Fu=!1}if(za=0,xt=mt=Ze=null,Ol=!1,oc=0,Bx.current=null,n===null||n.return===null){pt=1,dc=t,ut=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=St,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,h=u.tag;if(!(u.mode&1)&&(h===0||h===11||h===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=R0(o);if(m!==null){m.flags&=-257,I0(m,o,l,i,t),m.mode&1&&A0(i,d,t),t=m,c=d;var b=t.updateQueue;if(b===null){var g=new Set;g.add(c),t.updateQueue=g}else b.add(c);break e}else{if(!(t&1)){A0(i,d,t),Kx();break e}c=Error(H(426))}}else if(Ye&&l.mode&1){var y=R0(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),I0(y,o,l,i,t),Cx(go(c,l));break e}}i=c=go(c,l),pt!==4&&(pt=2),Ll===null?Ll=[i]:Ll.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=LN(i,c,t);k0(i,x);break e;case 1:l=c;var w=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Bs===null||!Bs.has(v)))){i.flags|=65536,t&=-t,i.lanes|=t;var j=FN(i,l,t);k0(i,j);break e}}i=i.return}while(i!==null)}rS(n)}catch(N){t=N,ut===n&&n!==null&&(ut=n=n.return);continue}break}while(!0)}function tS(){var e=Uu.current;return Uu.current=$u,e===null?$u:e}function Kx(){(pt===0||pt===3||pt===2)&&(pt=4),yt===null||!(Wa&268435455)&&!(Ph&268435455)||Cs(yt,St)}function zu(e,t){var n=_e;_e|=2;var r=tS();(yt!==e||St!==t)&&(Kr=null,Oa(e,t));do try{ZI();break}catch(a){eS(e,a)}while(!0);if(Ex(),_e=n,Uu.current=r,ut!==null)throw Error(H(261));return yt=null,St=0,pt}function ZI(){for(;ut!==null;)nS(ut)}function e4(){for(;ut!==null&&!kR();)nS(ut)}function nS(e){var t=aS(e.alternate,e,xn);e.memoizedProps=e.pendingProps,t===null?rS(e):ut=t,Bx.current=null}function rS(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=GI(n,t),n!==null){n.flags&=32767,ut=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{pt=6,ut=null;return}}else if(n=KI(n,t,xn),n!==null){ut=n;return}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);pt===0&&(pt=5)}function xa(e,t,n){var r=Le,a=Mn.transition;try{Mn.transition=null,Le=1,t4(e,t,n,r)}finally{Mn.transition=a,Le=r}return null}function t4(e,t,n,r){do Yi();while(Ms!==null);if(_e&6)throw Error(H(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(OR(e,i),e===yt&&(ut=yt=null,St=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Md||(Md=!0,iS(Su,function(){return Yi(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Mn.transition,Mn.transition=null;var o=Le;Le=1;var l=_e;_e|=4,Bx.current=null,YI(e,n),JN(n,e),bI(Sp),Cu=!!Np,Sp=Np=null,e.current=n,QI(n),CR(),_e=l,Le=o,Mn.transition=i}else e.current=n;if(Md&&(Md=!1,Ms=e,Vu=a),i=e.pendingLanes,i===0&&(Bs=null),PR(n.stateNode),cn(e,at()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Bu)throw Bu=!1,e=Wp,Wp=null,e;return Vu&1&&e.tag!==0&&Yi(),i=e.pendingLanes,i&1?e===Hp?Fl++:(Fl=0,Hp=e):Fl=0,ra(),null}function Yi(){if(Ms!==null){var e=L1(Vu),t=Mn.transition,n=Le;try{if(Mn.transition=null,Le=16>e?16:e,Ms===null)var r=!1;else{if(e=Ms,Ms=null,Vu=0,_e&6)throw Error(H(331));var a=_e;for(_e|=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 d=l[c];for(te=d;te!==null;){var u=te;switch(u.tag){case 0:case 11:case 15:Dl(8,u,i)}var h=u.child;if(h!==null)h.return=u,te=h;else for(;te!==null;){u=te;var p=u.sibling,m=u.return;if(qN(u),u===d){te=null;break}if(p!==null){p.return=m,te=p;break}te=m}}}var b=i.alternate;if(b!==null){var g=b.child;if(g!==null){b.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==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:Dl(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,te=x;break e}te=i.return}}var w=e.current;for(te=w;te!==null;){o=te;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,te=v;else e:for(o=w;te!==null;){if(l=te,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Eh(9,l)}}catch(N){rt(l,l.return,N)}if(l===o){te=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,te=j;break e}te=l.return}}if(_e=a,ra(),Ar&&typeof Ar.onPostCommitFiberRoot=="function")try{Ar.onPostCommitFiberRoot(wh,e)}catch{}r=!0}return r}finally{Le=n,Mn.transition=t}}return!1}function K0(e,t,n){t=go(n,t),t=LN(e,t,1),e=Us(e,t,1),t=zt(),e!==null&&(Dc(e,1,t),cn(e,t))}function rt(e,t,n){if(e.tag===3)K0(e,e,n);else for(;t!==null;){if(t.tag===3){K0(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Bs===null||!Bs.has(r))){e=go(n,e),e=FN(t,e,1),t=Us(t,e,1),e=zt(),t!==null&&(Dc(t,1,e),cn(t,e));break}}t=t.return}}function n4(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=zt(),e.pingedLanes|=e.suspendedLanes&n,yt===e&&(St&n)===n&&(pt===4||pt===3&&(St&130023424)===St&&500>at()-zx?Oa(e,0):Vx|=n),cn(e,t)}function sS(e,t){t===0&&(e.mode&1?(t=Sd,Sd<<=1,!(Sd&130023424)&&(Sd=4194304)):t=1);var n=zt();e=ts(e,t),e!==null&&(Dc(e,t,n),cn(e,n))}function r4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sS(e,n)}function s4(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),sS(e,n)}var aS;aS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||on.current)sn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return sn=!1,HI(e,t,n);sn=!!(e.flags&131072)}else sn=!1,Ye&&t.flags&1048576&&cN(t,Iu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;lu(e,t),e=t.pendingProps;var a=ho(t,Ft.current);qi(t,n),a=Dx(null,t,r,e,a,n);var i=Lx();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ln(r)?(i=!0,Au(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ax(t),a.updater=_h,t.stateNode=a,a._reactInternals=t,Ip(t,r,e,n),t=Dp(null,t,r,!0,i,n)):(t.tag=0,Ye&&i&&Sx(t),Ut(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(lu(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=i4(r),e=Zn(r,e),a){case 0:t=Op(null,t,r,e,n);break e;case 1:t=D0(null,t,r,e,n);break e;case 11:t=M0(null,t,r,e,n);break e;case 14:t=O0(null,t,r,Zn(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Zn(r,a),Op(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Zn(r,a),D0(e,t,r,a,n);case 3:e:{if(VN(t),e===null)throw Error(H(387));
vendor: 8,088 bytes, line 40
40r=t.pendingProps,i=t.memoizedState,a=i.element,pN(e,t),Du(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){a=go(Error(H(423)),t),t=L0(e,t,r,n,a);break e}else if(r!==a){a=go(Error(H(424)),t),t=L0(e,t,r,n,a);break e}else for(vn=$s(t.stateNode.containerInfo.firstChild),bn=t,Ye=!0,ar=null,n=fN(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fo(),r===a){t=ns(e,t,n);break e}Ut(e,t,r,n)}t=t.child}return t;case 5:return gN(t),e===null&&Tp(t),r=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,kp(r,a)?o=null:i!==null&&kp(r,i)&&(t.flags|=32),BN(e,t),Ut(e,t,o,n),t.child;case 6:return e===null&&Tp(t),null;case 13:return zN(e,t,n);case 4:return Rx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mo(t,null,r,n):Ut(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Zn(r,a),M0(e,t,r,a,n);case 7:return Ut(e,t,t.pendingProps,n),t.child;case 8:return Ut(e,t,t.pendingProps.children,n),t.child;case 12:return Ut(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,ze(Mu,r._currentValue),r._currentValue=o,i!==null)if(lr(i.value,o)){if(i.children===a.children&&!on.current){t=ns(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=Xr(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Ap(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(H(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ap(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}Ut(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,qi(t,n),a=$n(a),r=r(a),t.flags|=1,Ut(e,t,r,n),t.child;case 14:return r=t.type,a=Zn(r,t.pendingProps),a=Zn(r.type,a),O0(e,t,r,a,n);case 15:return $N(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Zn(r,a),lu(e,t),t.tag=1,ln(r)?(e=!0,Au(t)):e=!1,qi(t,n),DN(t,r,a),Ip(t,r,a,n),Dp(null,t,r,!0,e,n);case 19:return WN(e,t,n);case 22:return UN(e,t,n)}throw Error(H(156,t.tag))};function iS(e,t){return I1(e,t)}function a4(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 Rn(e,t,n,r){return new a4(e,t,n,r)}function Gx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function i4(e){if(typeof e=="function")return Gx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hx)return 11;if(e===fx)return 14}return 2}function zs(e,t){var n=e.alternate;return n===null?(n=Rn(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 uu(e,t,n,r,a,i){var o=2;if(r=e,typeof e=="function")Gx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ki:return Da(n.children,a,i,t);case ux:o=8,a|=8;break;case rp:return e=Rn(12,n,t,a|2),e.elementType=rp,e.lanes=i,e;case sp:return e=Rn(13,n,t,a),e.elementType=sp,e.lanes=i,e;case ap:return e=Rn(19,n,t,a),e.elementType=ap,e.lanes=i,e;case g1:return Th(n,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case m1:o=10;break e;case p1:o=9;break e;case hx:o=11;break e;case fx:o=14;break e;case Ns:o=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Rn(o,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function Da(e,t,n,r){return e=Rn(7,e,r,t),e.lanes=n,e}function Th(e,t,n,r){return e=Rn(22,e,r,t),e.elementType=g1,e.lanes=n,e.stateNode={isHidden:!1},e}function im(e,t,n){return e=Rn(6,e,null,t),e.lanes=n,e}function om(e,t,n){return t=Rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function o4(e,t,n,r,a){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=Bf(0),this.expirationTimes=Bf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bf(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function qx(e,t,n,r,a,i,o,l,c){return e=new o4(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Rn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ax(i),e}function l4(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Si,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function oS(e){if(!e)return Gs;e=e._reactInternals;e:{if(ei(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ln(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(ln(n))return oN(e,n,t)}return t}function lS(e,t,n,r,a,i,o,l,c){return e=qx(n,r,!0,e,a,i,o,l,c),e.context=oS(null),n=e.current,r=zt(),a=Vs(n),i=Xr(r,a),i.callback=t??null,Us(n,i,a),e.current.lanes=a,Dc(e,a,r),cn(e,r),e}function Ah(e,t,n,r){var a=t.current,i=zt(),o=Vs(a);return n=oS(n),t.context===null?t.context=n:t.pendingContext=n,t=Xr(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Us(a,t,o),e!==null&&(or(e,a,o,i),au(e,a,o)),o}function Wu(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 G0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Yx(e,t){G0(e,t),(e=e.alternate)&&G0(e,t)}function c4(){return null}var cS=typeof reportError=="function"?reportError:function(e){console.error(e)};function Qx(e){this._internalRoot=e}Rh.prototype.render=Qx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Ah(e,t,null,null)};Rh.prototype.unmount=Qx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ha(function(){Ah(null,e,null,null)}),t[es]=null}};function Rh(e){this._internalRoot=e}Rh.prototype.unstable_scheduleHydration=function(e){if(e){var t=U1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ks.length&&t!==0&&t<ks[n].priority;n++);ks.splice(n,0,e),n===0&&V1(e)}};function Jx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ih(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function q0(){}function d4(e,t,n,r,a){if(a){if(typeof r=="function"){var i=r;r=function(){var d=Wu(o);i.call(d)}}var o=lS(t,r,e,0,null,!1,!1,"",q0);return e._reactRootContainer=o,e[es]=o.current,nc(e.nodeType===8?e.parentNode:e),Ha(),o}for(;
vendor: 5,149 bytes, line 40
40a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var d=Wu(c);l.call(d)}}var c=qx(e,0,!1,null,null,!1,!1,"",q0);return e._reactRootContainer=c,e[es]=c.current,nc(e.nodeType===8?e.parentNode:e),Ha(function(){Ah(t,c,n,r)}),c}function Mh(e,t,n,r,a){var i=n._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=Wu(o);l.call(c)}}Ah(t,o,e,a)}else o=d4(n,t,e,a,r);return Wu(o)}F1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jl(t.pendingLanes);n!==0&&(gx(t,n|1),cn(t,at()),!(_e&6)&&(xo=at()+500,ra()))}break;case 13:Ha(function(){var r=ts(e,1);if(r!==null){var a=zt();or(r,e,1,a)}}),Yx(e,1)}};xx=function(e){if(e.tag===13){var t=ts(e,134217728);if(t!==null){var n=zt();or(t,e,134217728,n)}Yx(e,134217728)}};$1=function(e){if(e.tag===13){var t=Vs(e),n=ts(e,t);if(n!==null){var r=zt();or(n,e,t,r)}Yx(e,t)}};U1=function(){return Le};B1=function(e,t){var n=Le;try{return Le=e,t()}finally{Le=n}};pp=function(e,t,n){switch(t){case"input":if(lp(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 a=Sh(r);if(!a)throw Error(H(90));y1(r),lp(r,a)}}}break;case"textarea":w1(e,n);break;case"select":t=n.value,t!=null&&Wi(e,!!n.multiple,t,!1)}};_1=Wx;E1=Ha;var u4={usingClientEntryPoint:!1,Events:[Fc,Pi,Sh,k1,C1,Wx]},dl={findFiberByHostInstance:Na,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},h4={bundleType:dl.bundleType,version:dl.version,rendererPackageName:dl.rendererPackageName,rendererConfig:dl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ls.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=A1(e),e===null?null:e.stateNode},findFiberByHostInstance:dl.findFiberByHostInstance||c4,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Od=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Od.isDisabled&&Od.supportsFiber)try{wh=Od.inject(h4),Ar=Od}catch{}}Sn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=u4;Sn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jx(t))throw Error(H(200));return l4(e,t,null,n)};Sn.createRoot=function(e,t){if(!Jx(e))throw Error(H(299));var n=!1,r="",a=cS;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=qx(e,1,!1,null,null,n,!1,r,a),e[es]=t.current,nc(e.nodeType===8?e.parentNode:e),new Qx(t)};Sn.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(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=A1(t),e=e===null?null:e.stateNode,e};Sn.flushSync=function(e){return Ha(e)};Sn.hydrate=function(e,t,n){if(!Ih(t))throw Error(H(200));return Mh(null,e,t,!0,n)};Sn.hydrateRoot=function(e,t,n){if(!Jx(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,a=!1,i="",o=cS;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=lS(t,null,e,1,n??null,a,!1,i,o),e[es]=t.current,nc(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Rh(t)};Sn.render=function(e,t,n){if(!Ih(t))throw Error(H(200));return Mh(null,e,t,!1,n)};Sn.unmountComponentAtNode=function(e){if(!Ih(e))throw Error(H(40));return e._reactRootContainer?(Ha(function(){Mh(null,null,e,!1,function(){e._reactRootContainer=null,e[es]=null})}),!0):!1};Sn.unstable_batchedUpdates=Wx;Sn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ih(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return Mh(e,t,n,!1,r)};Sn.version="18.3.1-next-f1338f8080-20240426";function dS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dS)}catch(e){console.error(e)}}dS(),d1.exports=Sn;var ti=d1.exports;const uS=Xj(ti);var hS,Y0=ti;hS=Y0.createRoot,Y0.hydrateRoot;const f4=1,m4=1e6;let lm=0;function p4(){return lm=(lm+1)%Number.MAX_SAFE_INTEGER,lm.toString()}const cm=new Map,Q0=e=>{if(cm.has(e))return;const t=setTimeout(()=>{cm.delete(e),$l({type:"REMOVE_TOAST",toastId:e})},m4);cm.set(e,t)},g4=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,f4)};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;
vendor: 12,589 bytes, line 40
40return n?Q0(n):e.toasts.forEach(r=>{Q0(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)}}},hu=[];let fu={toasts:[]};function $l(e){fu=g4(fu,e),hu.forEach(t=>{t(fu)})}function bi({...e}){const t=p4(),n=a=>$l({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>$l({type:"DISMISS_TOAST",toastId:t});return $l({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function Uc(){const[e,t]=f.useState(fu);return f.useEffect(()=>(hu.push(t),()=>{const n=hu.indexOf(t);n>-1&&hu.splice(n,1)}),[e]),{...e,toast:bi,dismiss:n=>$l({type:"DISMISS_TOAST",toastId:n})}}function q(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function J0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Oh(...e){return t=>{let n=!1;const r=e.map(a=>{const i=J0(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():J0(e[a],null)}}}}function xe(...e){return f.useCallback(Oh(...e),e)}function x4(e,t){const n=f.createContext(t),r=i=>{const{children:o,...l}=i,c=f.useMemo(()=>l,Object.values(l));return s.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function a(i){const o=f.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function vt(e,t=[]){let n=[];function r(i,o){const l=f.createContext(o),c=n.length;n=[...n,o];const d=h=>{var x;const{scope:p,children:m,...b}=h,g=((x=p==null?void 0:p[e])==null?void 0:x[c])||l,y=f.useMemo(()=>b,Object.values(b));return s.jsx(g.Provider,{value:y,children:m})};d.displayName=i+"Provider";function u(h,p){var g;const m=((g=p==null?void 0:p[e])==null?void 0:g[c])||l,b=f.useContext(m);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[d,u]}const a=()=>{const i=n.map(o=>f.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,y4(a,...t)]}function y4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const h=c(i)[`__scope${d}`];return{...l,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function qs(e){const t=v4(e),n=f.forwardRef((r,a)=>{const{children:i,...o}=r,l=f.Children.toArray(i),c=l.find(w4);if(c){const d=c.props.children,u=l.map(h=>h===c?f.Children.count(d)>1?f.Children.only(null):f.isValidElement(d)?d.props.children:null:h);return s.jsx(t,{...o,ref:a,children:f.isValidElement(d)?f.cloneElement(d,void 0,u):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var Ao=qs("Slot");function v4(e){const t=f.forwardRef((n,r)=>{const{children:a,...i}=n;if(f.isValidElement(a)){const o=j4(a),l=b4(i,a.props);return a.type!==f.Fragment&&(l.ref=r?Oh(r,o):o),f.cloneElement(a,l)}return f.Children.count(a)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fS=Symbol("radix.slottable");function mS(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=fS,t}function w4(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fS}function b4(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function j4(e){var r,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Bc(e){const t=e+"CollectionProvider",[n,r]=vt(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:y,children:x}=g,w=B.useRef(null),v=B.useRef(new Map).current;return s.jsx(a,{scope:y,itemMap:v,collectionRef:w,children:x})};o.displayName=t;const l=e+"CollectionSlot",c=qs(l),d=B.forwardRef((g,y)=>{const{scope:x,children:w}=g,v=i(l,x),j=xe(y,v.collectionRef);return s.jsx(c,{ref:j,children:w})});d.displayName=l;const u=e+"CollectionItemSlot",h="data-radix-collection-item",p=qs(u),m=B.forwardRef((g,y)=>{const{scope:x,children:w,...v}=g,j=B.useRef(null),N=xe(y,j),S=i(u,x);return B.useEffect(()=>(S.itemMap.set(j,{ref:j,...v}),()=>void S.itemMap.delete(j))),s.jsx(p,{[h]:"",ref:N,children:w})});m.displayName=u;function b(g){const y=i(e+"CollectionConsumer",g);return B.useCallback(()=>{const w=y.collectionRef.current;if(!w)return[];const v=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((S,k)=>v.indexOf(S.ref.current)-v.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:d,ItemSlot:m},b,r]}var N4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ne=N4.reduce((e,t)=>{const n=qs(`Primitive.${t}`),r=f.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Xx(e,t){e&&ti.flushSync(()=>e.dispatchEvent(t))}function Wt(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function S4(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e);f.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var k4="DismissableLayer",qp="dismissableLayer.update",C4="dismissableLayer.pointerDownOutside",_4="dismissableLayer.focusOutside",X0,pS=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ni=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=f.useContext(pS),[u,h]=f.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=f.useState({}),b=xe(t,k=>h(k)),g=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(y),w=u?g.indexOf(u):-1,v=d.layersWithOutsidePointerEventsDisabled.size>0,j=w>=x,N=P4(k=>{const C=k.target,A=[...d.branches].some(R=>R.contains(C));!j||A||(a==null||a(k),o==null||o(k),k.defaultPrevented||l==null||l())},p),S=T4(k=>{const C=k.target;[...d.branches].some(R=>R.contains(C))||(i==null||i(k),o==null||o(k),k.defaultPrevented||l==null||l())},p);return S4(k=>{w===d.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},p),f.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(X0=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Z0(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=X0)}},[u,p,n,d]),f.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Z0())},[u,d]),f.useEffect(()=>{const k=()=>m({});return document.addEventListener(qp,k),()=>document.removeEventListener(qp,k)},[]),s.jsx(ne.div,{...c,ref:b,style:{pointerEvents:v?j?"auto":"none":void 0,...e.style},onFocusCapture:q(e.onFocusCapture,S.onFocusCapture),onBlurCapture:q(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,N.onPointerDownCapture)})});ni.displayName=k4;var E4="DismissableLayerBranch",gS=f.forwardRef((e,t)=>{const n=f.useContext(pS),r=f.useRef(null),a=xe(t,r);return f.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(ne.div,{...e,ref:a})});gS.displayName=E4;function P4(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=f.useRef(!1),a=f.useRef(()=>{});return f.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){xS(C4,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function T4(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=f.useRef(!1);return f.useEffect(()=>{const a=i=>{i.target&&!r.current&&xS(_4,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Z0(){const e=new CustomEvent(qp);document.dispatchEvent(e)}function xS(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?Xx(a,i):a.dispatchEvent(i)}var A4=ni,R4=gS,ot=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},I4="Portal",Ro=f.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,i]=f.useState(!1);ot(()=>i(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?uS.createPortal(s.jsx(ne.div,{...r,ref:t}),o):null});Ro.displayName=I4;function M4(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var qt=e=>{const{present:t,children:n}=e,r=O4(t),a=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=xe(r.ref,D4(a));return typeof n=="function"||r.isPresent?f.cloneElement(a,{ref:i}):null};qt.displayName="Presence";function O4(e){const[t,n]=f.useState(),r=f.useRef(null),a=f.useRef(e),i=f.useRef("none"),o=e?"mounted":"unmounted",[l,c]=M4(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const d=Dd(r.current);i.current=l==="mounted"?d:"none"},[l]),ot(()=>{const d=r.current,u=a.current;if(u!==e){const p=i.current,m=Dd(d);e?c("MOUNT"):m==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&p!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),ot(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,h=m=>{const g=Dd(r.current).includes(m.animationName);if(m.target===t&&g&&(c("ANIMATION_END"),!a.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=m=>{m.target===t&&(i.current=Dd(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Dd(e){return(e==null?void 0:e.animationName)||"none"}function D4(e){var r,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var L4=ox[" useInsertionEffect ".trim().toString()]||ot;function hn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=F4({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:a;{const u=f.useRef(e!==void 0);f.useEffect(()=>{const h=u.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.`),u.current=l},[l,r])}const d=f.useCallback(u=>{var h;if(l){const p=$4(u)?u(e):u;p!==e&&((h=o.current)==null||h.call(o,p))}else i(u)},[l,e,i,o]);return[c,d]}
40function F4({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),a=f.useRef(n),i=f.useRef(t);return L4(()=>{i.current=t},[t]),f.useEffect(()=>{var o;a.current!==n&&((o=i.current)==null||o.call(i,n),a.current=n)},[n,a]),[n,r,i]}function $4(e){return typeof e=="function"}var yS=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"}),U4="VisuallyHidden",Dh=f.forwardRef((e,t)=>s.jsx(ne.span,{...e,ref:t,style:{...yS,...e.style}}));Dh.displayName=U4;var B4=Dh,Zx="ToastProvider",[ey,V4,z4]=Bc("Toast"),[vS,bq]=vt("Toast",[z4]),[W4,Lh]=vS(Zx),wS=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[l,c]=f.useState(null),[d,u]=f.useState(0),h=f.useRef(!1),p=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Zx}\`. Expected non-empty \`string\`.`),s.jsx(ey.Provider,{scope:t,children:s.jsx(W4,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:f.useCallback(()=>u(m=>m+1),[]),onToastRemove:f.useCallback(()=>u(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:p,children:o})})};wS.displayName=Zx;var bS="ToastViewport",H4=["F8"],Yp="toast.viewportPause",Qp="toast.viewportResume",jS=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=H4,label:a="Notifications ({hotkey})",...i}=e,o=Lh(bS,n),l=V4(n),c=f.useRef(null),d=f.useRef(null),u=f.useRef(null),h=f.useRef(null),p=xe(t,h,o.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=o.toastCount>0;f.useEffect(()=>{const y=x=>{var v;r.length!==0&&r.every(j=>x[j]||x.code===j)&&((v=h.current)==null||v.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),f.useEffect(()=>{const y=c.current,x=h.current;if(b&&y&&x){const w=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(Yp);x.dispatchEvent(S),o.isClosePausedRef.current=!0}},v=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(Qp);x.dispatchEvent(S),o.isClosePausedRef.current=!1}},j=S=>{!y.contains(S.relatedTarget)&&v()},N=()=>{y.contains(document.activeElement)||v()};return y.addEventListener("focusin",w),y.addEventListener("focusout",j),y.addEventListener("pointermove",w),y.addEventListener("pointerleave",N),window.addEventListener("blur",w),window.addEventListener("focus",v),()=>{y.removeEventListener("focusin",w),y.removeEventListener("focusout",j),y.removeEventListener("pointermove",w),y.removeEventListener("pointerleave",N),window.removeEventListener("blur",w),window.removeEventListener("focus",v)}}},[b,o.isClosePausedRef]);const g=f.useCallback(({tabbingDirection:y})=>{const w=l().map(v=>{const j=v.ref.current,N=[j,...sM(j)];return y==="forwards"?N:N.reverse()});return(y==="forwards"?w.reverse():w).flat()},[l]);return f.useEffect(()=>{const y=h.current;if(y){const x=w=>{var N,S,k;const v=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!v){const C=document.activeElement,A=w.shiftKey;if(w.target===y&&A){(N=d.current)==null||N.focus();return}const W=g({tabbingDirection:A?"backwards":"forwards"}),$=W.findIndex(M=>M===C);dm(W.slice($+1))?w.preventDefault():A?(S=d.current)==null||S.focus():(k=u.current)==null||k.focus()}};return y.addEventListener("keydown",x),()=>y.removeEventListener("keydown",x)}},[l,g]),s.jsxs(R4,{ref:c,role:"region","aria-label":a.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&s.jsx(Jp,{ref:d,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"forwards"});dm(y)}}),s.jsx(ey.Slot,{scope:n,children:s.jsx(ne.ol,{tabIndex:-1,...i,ref:p})}),b&&s.jsx(Jp,{ref:u,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"backwards"});dm(y)}})]})});jS.displayName=bS;var NS="ToastFocusProxy",Jp=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=Lh(NS,n);return s.jsx(Dh,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{var d;const l=o.relatedTarget;!((d=i.viewport)!=null&&d.contains(l))&&r()}})});Jp.displayName=NS;var Vc="Toast",K4="toast.swipeStart",G4="toast.swipeMove",q4="toast.swipeCancel",Y4="toast.swipeEnd",SS=f.forwardRef((e,t)=>
40{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[l,c]=hn({prop:r,defaultProp:a??!0,onChange:i,caller:Vc});return s.jsx(qt,{present:n||l,children:s.jsx(X4,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:Wt(e.onPause),onResume:Wt(e.onResume),onSwipeStart:q(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:q(e.onSwipeMove,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:q(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:q(e.onSwipeEnd,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});SS.displayName=Vc;var[Q4,J4]=vS(Vc,{onClose(){}}),X4=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:h,onSwipeCancel:p,onSwipeEnd:m,...b}=e,g=Lh(Vc,n),[y,x]=f.useState(null),w=xe(t,M=>x(M)),v=f.useRef(null),j=f.useRef(null),N=a||g.duration,S=f.useRef(0),k=f.useRef(N),C=f.useRef(0),{onToastAdd:A,onToastRemove:R}=g,G=Wt(()=>{var K;(y==null?void 0:y.contains(document.activeElement))&&((K=g.viewport)==null||K.focus()),o()}),W=f.useCallback(M=>{!M||M===1/0||(window.clearTimeout(C.current),S.current=new Date().getTime(),C.current=window.setTimeout(G,M))},[G]);f.useEffect(()=>{const M=g.viewport;if(M){const K=()=>{W(k.current),d==null||d()},z=()=>{const I=new Date().getTime()-S.current;k.current=k.current-I,window.clearTimeout(C.current),c==null||c()};return M.addEventListener(Yp,z),M.addEventListener(Qp,K),()=>{M.removeEventListener(Yp,z),M.removeEventListener(Qp,K)}}},[g.viewport,N,c,d,W]),f.useEffect(()=>{i&&!g.isClosePausedRef.current&&W(N)},[i,N,g.isClosePausedRef,W]),f.useEffect(()=>(A(),()=>R()),[A,R]);const $=f.useMemo(()=>y?AS(y):null,[y]);return g.viewport?s.jsxs(s.Fragment,{children:[$&&s.jsx(Z4,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:$}),s.jsx(Q4,{scope:n,onClose:G,children:ti.createPortal(s.jsx(ey.ItemSlot,{scope:n,children:s.jsx(A4,{asChild:!0,onEscapeKeyDown:q(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||G(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(ne.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...b,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:q(e.onKeyDown,M=>{M.key==="Escape"&&(l==null||l(M.nativeEvent),M.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:q(e.onPointerDown,M=>{M.button===0&&(v.current={x:M.clientX,y:M.clientY})}),onPointerMove:q(e.onPointerMove,M=>{if(!v.current)return;const K=M.clientX-v.current.x,z=M.clientY-v.current.y,I=!!j.current,P=["left","right"].includes(g.swipeDirection),_=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,U=P?_(0,K):0,Z=P?0:_(0,z),ee=M.pointerType==="touch"?10:2,ie={x:U,y:Z},de={originalEvent:M,delta:ie};I?(j.current=ie,Ld(G4,h,de,{discrete:!1})):ew(ie,g.swipeDirection,ee)?(j.current=ie,Ld(K4,u,de,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(K)>ee||Math.abs(z)>ee)&&(v.current=null)}),onPointerUp:q(e.onPointerUp,M=>{const K=j.current,z=M.target;if(z.hasPointerCapture(M.pointerId)&&z.releasePointerCapture(M.pointerId),j.current=null,v.current=null,K){const I=M.currentTarget,P={originalEvent:M,delta:K};ew(K,g.swipeDirection,g.swipeThreshold)?Ld(Y4,m,P,{discrete:!0}):Ld(q4,p,P,{discrete:!0}),I.addEventListener("click",_=>_.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),Z4=e=>{const{__scopeToast:t,children:n,...r}=e,a=Lh(Vc,t),[i,o]=f.useState(!1),[l,c]=f.useState(!1);return nM(()=>o(!0)),f.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:s.jsx(Ro,{asChild:!0,children:s.jsx(Dh,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},eM="ToastTitle",kS=f.forwardRef((e,t)=>
vendor: 4,740 bytes, lines 40-60
40{const{__scopeToast:n,...r}=e;return s.jsx(ne.div,{...r,ref:t})});kS.displayName=eM;var tM="ToastDescription",CS=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(ne.div,{...r,ref:t})});CS.displayName=tM;var _S="ToastAction",ES=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(TS,{altText:n,asChild:!0,children:s.jsx(ty,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${_S}\`. Expected non-empty \`string\`.`),null)});ES.displayName=_S;var PS="ToastClose",ty=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=J4(PS,n);return s.jsx(TS,{asChild:!0,children:s.jsx(ne.button,{type:"button",...r,ref:t,onClick:q(e.onClick,a.onClose)})})});ty.displayName=PS;var TS=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(ne.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function AS(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),rM(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...AS(r))}}),t}function Ld(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?Xx(a,i):a.dispatchEvent(i)}var ew=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function nM(e=()=>{}){const t=Wt(e);ot(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function rM(e){return e.nodeType===e.ELEMENT_NODE}function sM(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dm(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var aM=wS,RS=jS,IS=SS,MS=kS,OS=CS,DS=ES,LS=ty;function FS(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=FS(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $S(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=FS(e))&&(r&&(r+=" "),r+=t);return r}const tw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,nw=$S,ri=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return nw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(d=>{const u=n==null?void 0:n[d],h=i==null?void 0:i[d];if(u===null)return null;const p=tw(u)||tw(h);return a[d][p]}),l=n&&Object.entries(n).reduce((d,u)=>{let[h,p]=u;return p===void 0||(d[h]=p),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:h,className:p,...m}=u;return Object.entries(m).every(b=>{let[g,y]=b;return Array.isArray(y)?y.includes({...i,...l}[g]):{...i,...l}[g]===y})?[...d,h,p]:d},[]);return nw(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 iM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),US=(...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 oM={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 lM=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:o,...l},c)=>f.createElement("svg",{ref:c,...oM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:US("lucide",a),...l},[...o.map(([d,u])=>f.createElement(d,u)),...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)=>
60{const n=f.forwardRef(({className:r,...a},i)=>f.createElement(lM,{ref:i,iconNode:t,className:US(`lucide-${iM(e)}`,r),...a}));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 rw=Y("Accessibility",[["circle",{cx:"16",cy:"4",r:"1",key:"1grugj"}],["path",{d:"m18 19 1-7-6 1",key:"r0i19z"}],["path",{d:"m5 8 3-3 5.5 3-2.36 3.5",key:"9ptxx2"}],["path",{d:"M4.24 14.5a5 5 0 0 0 6.88 6",key:"10kmtu"}],["path",{d:"M13.76 17.5a5 5 0 0 0-6.88-6",key:"2qq6rc"}]]);/**
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 BS=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 uc=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 cM=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"}]]);/**
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 dM=Y("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
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 VS=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 uM=Y("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/**
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 hM=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 fM=Y("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/**
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 zS=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"}]]);/**
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 mM=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"}]]);/**
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 Me=Y("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
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 Ys=Y("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
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 Xp=Y("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
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 zc=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 Ht=Y("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
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 ny=Y("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
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 Dr=Y("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 WS=Y("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
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 Zp=Y("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
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 Wc=Y("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
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 jt=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"}]]);/**
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 pM=Y("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
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 gM=Y("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
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 Hc=Y("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
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 HS=Y("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
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 xM=Y("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
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 ry=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"}]]);/**
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 yM=Y("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
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 Bn=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"}]]);/**
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 vM=Y("Gem",[["path",{d:"M6 3h12l4 6-10 13L2 9Z",key:"1pcd5k"}],["path",{d:"M11 3 8 9l4 13 4-13-3-6",key:"1fcu3u"}],["path",{d:"M2 9h20",key:"16fsjt"}]]);/**
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 wM=Y("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
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 Io=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"}]]);/**
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 sw=Y("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
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 KS=Y("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}
235]]);/**
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 GS=Y("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
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 hc=Y("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
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 yo=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"}]]);/**
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 La=Y("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
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 bM=Y("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
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 jM=Y("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
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 qS=Y("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
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 Hu=Y("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
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 NM=Y("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
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 SM=Y("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
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 YS=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"}]]);/**
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 On=Y("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 kM=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"}]]);/**
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 aw=Y("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
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 CM=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"}]]);/**
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 _M=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"}]]);/**
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 EM=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"}]]);/**
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 PM=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"}]]);/**
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 TM=Y("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
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 AM=Y("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
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 Ku=Y("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);/**
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 RM=Y("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
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 eg=Y("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 rn=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"}]]);/**
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 Fh=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"}]]);/**
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 Kc=Y("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 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"}]]);/**
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 IM=Y("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
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 QS=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",ke
380y:"oel41y"}]]);/**
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 MM=Y("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/**
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 Gu=Y("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
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 Nt=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"}]]);/**
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 sy=Y("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
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 qu=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"}]]);/**
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 Ka=Y("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]]);/**
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 iw=Y("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
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 OM=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"}]]);/**
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 DM=Y("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
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 LM=Y("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
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 Qs=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"}
vendor: 4,570 bytes, lines 435-485
435],["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"}]]);/**
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 JS=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"}]]);/**
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 XS=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"}]]);/**
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 ZS=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"}]]);/**
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 ek=Y("Unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
456 * @license lucide-react v0.462.0 - ISC
457 *
458 * This source code is licensed under the ISC license.
459 * See the LICENSE file in the root directory of this source tree.
460 */const rs=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"}]]);/**
461 * @license lucide-react v0.462.0 - ISC
462 *
463 * This source code is licensed under the ISC license.
464 * See the LICENSE file in the root directory of this source tree.
465 */const $h=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"}]]);/**
466 * @license lucide-react v0.462.0 - ISC
467 *
468 * This source code is licensed under the ISC license.
469 * See the LICENSE file in the root directory of this source tree.
470 */const FM=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"}]]);/**
471 * @license lucide-react v0.462.0 - ISC
472 *
473 * This source code is licensed under the ISC license.
474 * See the LICENSE file in the root directory of this source tree.
475 */const ow=Y("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
476 * @license lucide-react v0.462.0 - ISC
477 *
478 * This source code is licensed under the ISC license.
479 * See the LICENSE file in the root directory of this source tree.
480 */const cs=Y("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
481 * @license lucide-react v0.462.0 - ISC
482 *
483 * This source code is licensed under the ISC license.
484 * See the LICENSE file in the root directory of this source tree.
485 */const ay=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"}]]),iy="-",$M=e=>{const t=BM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(iy);return l[0]===""&&l.length!==1&&l.shift(),tk(l,t)||UM(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},tk=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?tk(e.slice(1),r):void 0;if(a)return a;
vendor: 5,457 bytes, line 485
485if(t.validators.length===0)return;const i=e.join(iy);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},lw=/^\[(.+)\]$/,UM=e=>{if(lw.test(e)){const t=lw.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},BM=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return zM(Object.entries(e.classGroups),n).forEach(([i,o])=>{tg(o,r,i,t)}),r},tg=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:cw(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(VM(a)){tg(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{tg(o,cw(t,i),n,r)})})},cw=(e,t)=>{let n=e;return t.split(iy).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},VM=e=>e.isThemeGetter,zM=(e,t)=>t?e.map(([n,r])=>{const a=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,a]}):e,WM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(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 a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},nk="!",HM=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=l=>{const c=[];let d=0,u=0,h;for(let y=0;y<l.length;y++){let x=l[y];if(d===0){if(x===a&&(r||l.slice(y,y+i)===t)){c.push(l.slice(u,y)),u=y+i;continue}if(x==="/"){h=y;continue}}x==="["?d++:x==="]"&&d--}const p=c.length===0?l:l.substring(u),m=p.startsWith(nk),b=m?p.substring(1):p,g=h&&h>u?h-u:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:o}):o},KM=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},GM=e=>({cache:WM(e.cacheSize),parseClassName:HM(e),...$M(e)}),qM=/\s+/,YM=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(qM);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(d);let b=!!m,g=r(b?p.substring(0,m):p);if(!g){if(!b){l=d+(l.length>0?" "+l:l);continue}if(g=r(p),!g){l=d+(l.length>0?" "+l:l);continue}b=!1}const y=KM(u).join(":"),x=h?y+nk:y,w=x+g;if(i.includes(w))continue;i.push(w);const v=a(g,b);for(let j=0;j<v.length;++j){const N=v[j];i.push(x+N)}l=d+(l.length>0?" "+l:l)}return l};function QM(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=rk(t))&&(r&&(r+=" "),r+=n);return r}const rk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=rk(e[r]))&&(n&&(n+=" "),n+=t);return n};function JM(e,...t){let n,r,a,i=o;function o(c){const d=t.reduce((u,h)=>h(u),e());return n=GM(d),r=n.cache.get,a=n.cache.set,i=l,l(c)}function l(c){const d=r(c);if(d)return d;const u=YM(c,n);return a(c,u),u}return function(){return i(QM.apply(null,arguments))}}const He=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},sk=/^\[(?:([a-z-]+):)?(.+)\]$/i,XM=/^\d+\/\d+$/,ZM=new Set(["px","full","screen"]),eO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tO=/\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$/,nO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,rO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wr=e=>Qi(e)||ZM.has(e)||XM.test(e),ps=e=>Oo(e,"length",hO),Qi=e=>!!e&&!Number.isNaN(Number(e)),um=e=>Oo(e,"number",Qi),ul=e=>!!e&&Number.isInteger(Number(e)),aO=e=>e.endsWith("%")&&Qi(e.slice(0,-1)),ge=e=>sk.test(e),gs=e=>eO.test(e),iO=new Set(["length","size","percentage"]),oO=e=>Oo(e,iO,ak),lO=e=>Oo(e,"position",ak),cO=new Set(["image","url"]),dO=e=>Oo(e,cO,mO),uO=e=>Oo(e,"",fO),hl=()=>!0,Oo=(e,t,n)=>{const r=sk.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},hO=e=>tO.test(e)&&!nO.test(e),ak=()=>!1,fO=e=>rO.test(e),mO=e=>sO.test(e),pO=()=>{const e=He("colors"),t=He("spacing"),n=He("blur"),r=He("brightness"),a=He("borderColor"),i=He("borderRadius"),o=He("borderSpacing"),l=He("borderWidth"),c=He("contrast"),d=He("grayscale"),u=He("hueRotate"),h=He("invert"),p=He("gap"),m=He("gradientColorStops"),b=He("gradientColorStopPositions"),g=He("inset"),y=He("margin"),x=He("opacity"),w=He("padding"),v=He("saturate"),j=He("scale"),N=He("sepia"),S=He("skew"),k=He("space"),C=He("translate"),A=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",ge,t],W=()=>[ge,t],$=()=>["",Wr,ps],M=()=>["auto",Qi,ge],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],_=()=>["","0",ge],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[Qi,ge];return{cacheSize:500,separator:":",theme:{colors:[hl],spacing:[Wr,ps],blur:["none","",gs,ge],brightness:Z(),borderColor:[e],borderRadius:["n
485one","","full",gs,ge],borderSpacing:W(),borderWidth:$(),contrast:Z(),grayscale:_(),hueRotate:Z(),invert:_(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[aO,ps],inset:G(),margin:G(),opacity:Z(),padding:W(),saturate:Z(),scale:Z(),sepia:_(),skew:Z(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",ge]}],container:["container"],columns:[{columns:[gs]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"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:[...K(),ge]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ul,ge]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ge]}],grow:[{grow:_()}],shrink:[{shrink:_()}],order:[{order:["first","last","none",ul,ge]}],"grid-cols":[{"grid-cols":[hl]}],"col-start-end":[{col:["auto",{span:["full",ul,ge]},ge]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[hl]}],"row-start-end":[{row:["auto",{span:[ul,ge]},ge]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ge]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ge]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"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:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"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",ge,t]}],"min-w":[{"min-w":[ge,t,"min","max","fit"]}],"max-w":[{"max-w":[ge,t,"none","full","min","max","fit","prose",{screen:[gs]},gs]}],h:[{h:[ge,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ge,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ge,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ge,t,"auto","min","max","fit"]}],"font-size":[{text:["base",gs,ps]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",um]}],"font-family":[{font:[hl]}],"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",ge]}],"line-clamp":[{"line-clamp":["none",Qi,um]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wr,ge]}],"list-image":[{"list-image":["none",ge]}],"list-style-type":[{list:["none","disc","decimal",ge]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wr,ps]}],"underline-offset":[{"underline-offset":["auto",Wr,ge]}],"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:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge]}],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",ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K(),lO]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oO]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dO]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}
vendor: 5,180 bytes, line 485
485],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],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":[x]}],"border-style":[{border:[...z(),"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":[x]}],"divide-style":[{divide:z()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Wr,ge]}],"outline-w":[{outline:[Wr,ps]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Wr,ps]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",gs,uO]}],"shadow-color":[{shadow:[hl]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",gs,ge]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[v]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"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",ge]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",ge]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",ge]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[ul,ge]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ge]}],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",ge]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,642 bytes, line 485
485],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",ge]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wr,ps,um]}],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"]}}},gO=JM(pO);function F(...e){return gO($S(e))}const xO=aM,ik=f.forwardRef(({className:e,...t},n)=>s.jsx(RS,{ref:n,className:F("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}));ik.displayName=RS.displayName;const yO=ri("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"}}),ok=f.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(IS,{ref:r,className:F(yO({variant:t}),e),...n}));ok.displayName=IS.displayName;const vO=f.forwardRef(({className:e,...t},n)=>s.jsx(DS,{ref:n,className:F("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}));vO.displayName=DS.displayName;const lk=f.forwardRef(({className:e,...t},n)=>s.jsx(LS,{ref:n,className:F("absolute right-2 top-2 rounded-md p-1 text-foreground
485/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:s.jsx(cs,{className:"h-4 w-4"})}));lk.displayName=LS.displayName;const ck=f.forwardRef(({className:e,...t},n)=>s.jsx(MS,{ref:n,className:F("text-sm font-semibold",e),...t}));ck.displayName=MS.displayName;const dk=f.forwardRef(({className:e,...t},n)=>s.jsx(OS,{ref:n,className:F("text-sm opacity-90",e),...t}));dk.displayName=OS.displayName;function wO(){const{toasts:e}=Uc();return s.jsxs(xO,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(ok,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(ck,{children:n}),r&&s.jsx(dk,{children:r})]}),a,s.jsx(lk,{})]},t)}),s.jsx(ik,{})]})}var dw=["light","dark"],bO="(prefers-color-scheme: dark)",jO=f.createContext(void 0),NO={setTheme:e=>{},themes:[]},SO=()=>{var e;return(e=f.useContext(jO))!=null?e:NO};f.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let d=i==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(b=>`'${b}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=a?dw.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(b,g=!1,y=!0)=>{let x=o?o[b]:b,w=g?b+"|| ''":`'${x}'`,v="";return a&&y&&!g&&dw.includes(b)&&(v+=`d.style.colorScheme = '${b}';`),n==="class"?g||x?v+=`c.add(${w})`:v+="null":x&&(v+=`d[s](n,${w})`),v},m=e?`!function(){${u}${p(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${bO}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}${d?"":"else{"+p(i,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}else{${p(i,!1,!1)};}${h}}catch(t){}}();`;return f.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var kO=e=>{switch(e){case"success":return EO;case"info":return TO;case"warning":return PO;case"error":return AO;default:return null}},CO=Array(12).fill(0),_O=({visible:e,className:t})=>B.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},B.createElement("div",{className:"sonner-spinner"},CO.map((n,r)=>B.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),EO=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},B.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"})),PO=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},B.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"})),TO=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},B.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"})),AO=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},B.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"})),RO=B.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"},B.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),B.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),IO=()=>
485{let[e,t]=B.useState(document.hidden);return B.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},ng=1,MO=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,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:ng++,i=this.toasts.find(l=>l.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...e,id:a,title:n}),{...l,...e,id:a,dismissible:o,title:n}):l):this.addToast({title:n,...r,dismissible:o,id:a}),a},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)=>
485this.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(),a=n!==void 0,i,o=r.then(async c=>{if(i=["resolve",c],B.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(DO(c)&&!c.ok){a=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:d,description:u})}else if(t.success!==void 0){a=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:d,description:u})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){a=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:d,description:u})}}).finally(()=>{var c;a&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>o.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));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)||ng++;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}},en=new MO,OO=(e,t)=>{let n=(t==null?void 0:t.id)||ng++;return en.addToast({title:e,...t,id:n}),n},DO=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",LO=OO,FO=()=>en.toasts,$O=()=>en.getActiveToasts(),T=Object.assign(LO,{success:en.success,info:en.info,warning:en.warning,error:en.error,custom:en.custom,message:en.message,promise:en.promise,dismiss:en.dismiss,loading:en.loading},{getHistory:FO,getToasts:$O});function UO(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))}UO(`: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;
485left: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}
485: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%);
485--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%)}
486`);function Fd(e){return e.label!==void 0}var BO=3,VO="32px",zO="16px",uw=4e3,WO=356,HO=14,KO=20,GO=200;function Yn(...e){return e.filter(Boolean).join(" ")}function qO(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var YO=e=>{var t,n,r,a,i,o,l,c,d,u,h;let{invert:p,toast:m,unstyled:b,interacting:g,setHeights:y,visibleToasts:x,heights:w,index:v,toasts:j,expanded:N,removeToast:S,defaultRichColors:k,closeButton:C,style:A,cancelButtonStyle:R,actionButtonStyle:G,className:W="",descriptionClassName:$="",duration:M,position:K,gap:z,loadingIcon:I,expandByDefault:P,classNames:_,icons:U,closeButtonAriaLabel:Z="Close toast",pauseWhenPageIsHidden:ee}
vendor: 4,502 bytes, line 486
486=e,[ie,de]=B.useState(null),[Re,Ee]=B.useState(null),[Q,be]=B.useState(!1),[ve,Se]=B.useState(!1),[je,ke]=B.useState(!1),[gt,Qt]=B.useState(!1),[$r,Kn]=B.useState(!1),[Ur,Br]=B.useState(0),[fn,md]=B.useState(0),Cn=B.useRef(m.duration||M||uw),pd=B.useRef(null),xr=B.useRef(null),Tf=v===0,fs=v+1<=x,Jt=m.type,yr=m.dismissible!==!1,Af=m.className||"",qo=m.descriptionClassName||"",ha=B.useMemo(()=>w.findIndex(he=>he.toastId===m.id)||0,[w,m.id]),Rf=B.useMemo(()=>{var he;return(he=m.closeButton)!=null?he:C},[m.closeButton,C]),Yo=B.useMemo(()=>m.duration||M||uw,[m.duration,M]),ci=B.useRef(0),vr=B.useRef(0),Qo=B.useRef(0),Vr=B.useRef(null),[If,gd]=K.split("-"),Jo=B.useMemo(()=>w.reduce((he,Ie,Be)=>Be>=ha?he:he+Ie.height,0),[w,ha]),Xo=IO(),Zo=m.invert||p,el=Jt==="loading";vr.current=B.useMemo(()=>ha*z+Jo,[ha,Jo]),B.useEffect(()=>{Cn.current=Yo},[Yo]),B.useEffect(()=>{be(!0)},[]),B.useEffect(()=>{let he=xr.current;if(he){let Ie=he.getBoundingClientRect().height;return md(Ie),y(Be=>[{toastId:m.id,height:Ie,position:m.position},...Be]),()=>y(Be=>Be.filter(Xt=>Xt.toastId!==m.id))}},[y,m.id]),B.useLayoutEffect(()=>{if(!Q)return;let he=xr.current,Ie=he.style.height;he.style.height="auto";let Be=he.getBoundingClientRect().height;he.style.height=Ie,md(Be),y(Xt=>Xt.find(mn=>mn.toastId===m.id)?Xt.map(mn=>mn.toastId===m.id?{...mn,height:Be}:mn):[{toastId:m.id,height:Be,position:m.position},...Xt])},[Q,m.title,m.description,y,m.id]);let wr=B.useCallback(()=>{Se(!0),Br(vr.current),y(he=>he.filter(Ie=>Ie.toastId!==m.id)),setTimeout(()=>{S(m)},GO)},[m,S,y,vr]);B.useEffect(()=>{if(m.promise&&Jt==="loading"||m.duration===1/0||m.type==="loading")return;let he;return N||g||ee&&Xo?(()=>{if(Qo.current<ci.current){let Ie=new Date().getTime()-ci.current;Cn.current=Cn.current-Ie}Qo.current=new Date().getTime()})():Cn.current!==1/0&&(ci.current=new Date().getTime(),he=setTimeout(()=>{var Ie;(Ie=m.onAutoClose)==null||Ie.call(m,m),wr()},Cn.current)),()=>clearTimeout(he)},[N,g,m,Jt,ee,Xo,wr]),B.useEffect(()=>{m.delete&&wr()},[wr,m.delete]);function xd(){var he,Ie,Be;return U!=null&&U.loading?B.createElement("div",{className:Yn(_==null?void 0:_.loader,(he=m==null?void 0:m.classNames)==null?void 0:he.loader,"sonner-loader"),"data-visible":Jt==="loading"},U.loading):I?B.createElement("div",{className:Yn(_==null?void 0:_.loader,(Ie=m==null?void 0:m.classNames)==null?void 0:Ie.loader,"sonner-loader"),"data-visible":Jt==="loading"},I):B.createElement(_O,{className:Yn(_==null?void 0:_.loader,(Be=m==null?void 0:m.classNames)==null?void 0:Be.loader),visible:Jt==="loading"})}return B.createElement("li",{tabIndex:0,ref:xr,className:Yn(W,Af,_==null?void 0:_.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,_==null?void 0:_.default,_==null?void 0:_[Jt],(n=m==null?void 0:m.classNames)==null?void 0:n[Jt]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:k,"data-styled":!(m.jsx||m.unstyled||b),"data-mounted":Q,"data-promise":!!m.promise,"data-swiped":$r,"data-removed":ve,"data-visible":fs,"data-y-position":If,"data-x-position":gd,"data-index":v,"data-front":Tf,"data-swiping":je,"data-dismissible":yr,"data-type":Jt,"data-invert":Zo,"data-swipe-out":gt,"data-swipe-direction":Re,"data-expanded":!!(N||P&&Q),style:{"--index":v,"--toasts-before":v,"--z-index":j.length-v,"--offset":`${ve?Ur:vr.current}px`,"--initial-height":P?"auto":`${fn}px`,...A,...m.style},onDragEnd:()=>{ke(!1),de(null),Vr.current=null},onPointerDown:he=>{el||!yr||(pd.current=new Date,Br(vr.current),he.target.setPointerCapture(he.pointerId),he.target.tagName!=="BUTTON"&&(ke(!0),Vr.current={x:he.clientX,y:he.clientY}))},onPointerUp:()=>{var he,Ie,Be,Xt;if(gt||!yr)return;Vr.current=null;let mn=Number(((he=xr.current)==null?void 0:he.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),D=Number(((Ie=xr.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),re=new Date().getTime()-((Be=pd.current)==null?void 0:Be.getTime()),ce=ie==="x"?mn:D,le=Math.abs(ce)/re;if(Math.abs(ce)>=KO||le>.11){Br(vr.current),(Xt=m.onDismiss)==null||Xt.call(m,m),Ee(ie==="x"?mn>0?"right":"left":D>0?"down":"up"),wr(),Qt(!0),Kn(!1);return}ke(!1),de(null)},onPointerMove:he=>{var Ie,Be,Xt,mn;if(!Vr.current||!yr||((Ie=window.getSelection())==null?void 0:Ie.toString().length)>0)return;let D=he.clientY-Vr.current.y,re=he.clientX-Vr.current.x,ce=(Be=e.swipeDirections)!=null?Be:qO(K);!ie&&(Math.abs(re)>1||Math.abs(D)>1)&&de(Math.abs(re)>Math.abs(D)?"x":"y");let le={x:0,y:0};
486ie==="y"?(ce.includes("top")||ce.includes("bottom"))&&(ce.includes("top")&&D<0||ce.includes("bottom")&&D>0)&&(le.y=D):ie==="x"&&(ce.includes("left")||ce.includes("right"))&&(ce.includes("left")&&re<0||ce.includes("right")&&re>0)&&(le.x=re),(Math.abs(le.x)>0||Math.abs(le.y)>0)&&Kn(!0),(Xt=xr.current)==null||Xt.style.setProperty("--swipe-amount-x",`${le.x}px`),(mn=xr.current)==null||mn.style.setProperty("--swipe-amount-y",`${le.y}px`)}},Rf&&!m.jsx?B.createElement("button",{"aria-label":Z,"data-disabled":el,"data-close-button":!0,onClick:el||!yr?()=>{}:()=>{var he;wr(),(he=m.onDismiss)==null||he.call(m,m)},className:Yn(_==null?void 0:_.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},(i=U==null?void 0:U.close)!=null?i:RO):null,m.jsx||f.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:B.createElement(B.Fragment,null,Jt||m.icon||m.promise?B.createElement("div",{"data-icon":"",className:Yn(_==null?void 0:_.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||xd():null,m.type!=="loading"?m.
vendor: 5,974 bytes, line 486
486icon||(U==null?void 0:U[Jt])||kO(Jt):null):null,B.createElement("div",{"data-content":"",className:Yn(_==null?void 0:_.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},B.createElement("div",{"data-title":"",className:Yn(_==null?void 0:_.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?B.createElement("div",{"data-description":"",className:Yn($,qo,_==null?void 0:_.description,(d=m==null?void 0:m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),f.isValidElement(m.cancel)?m.cancel:m.cancel&&Fd(m.cancel)?B.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||R,onClick:he=>{var Ie,Be;Fd(m.cancel)&&yr&&((Be=(Ie=m.cancel).onClick)==null||Be.call(Ie,he),wr())},className:Yn(_==null?void 0:_.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,f.isValidElement(m.action)?m.action:m.action&&Fd(m.action)?B.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||G,onClick:he=>{var Ie,Be;Fd(m.action)&&((Be=(Ie=m.action).onClick)==null||Be.call(Ie,he),!he.defaultPrevented&&wr())},className:Yn(_==null?void 0:_.actionButton,(h=m==null?void 0:m.classNames)==null?void 0:h.actionButton)},m.action.label):null))};function hw(){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 QO(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",l=i?zO:VO;function c(d){["top","right","bottom","left"].forEach(u=>{n[`${o}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}var uk=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:h,duration:p,style:m,visibleToasts:b=BO,toastOptions:g,dir:y=hw(),gap:x=HO,loadingIcon:w,icons:v,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:N}=e,[S,k]=B.useState([]),C=B.useMemo(()=>Array.from(new Set([r].concat(S.filter(ee=>ee.position).map(ee=>ee.position)))),[S,r]),[A,R]=B.useState([]),[G,W]=B.useState(!1),[$,M]=B.useState(!1),[K,z]=B.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=B.useRef(null),P=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=B.useRef(null),U=B.useRef(!1),Z=B.useCallback(ee=>{k(ie=>{var de;return(de=ie.find(Re=>Re.id===ee.id))!=null&&de.delete||en.dismiss(ee.id),ie.filter(({id:Re})=>Re!==ee.id)})},[]);return B.useEffect(()=>en.subscribe(ee=>{if(ee.dismiss){k(ie=>ie.map(de=>de.id===ee.id?{...de,delete:!0}:de));return}setTimeout(()=>{uS.flushSync(()=>{k(ie=>{let de=ie.findIndex(Re=>Re.id===ee.id);return de!==-1?[...ie.slice(0,de),{...ie[de],...ee},...ie.slice(de+1)]:[ee,...ie]})})})}),[]),B.useEffect(()=>{if(u!=="system"){z(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let ee=window.matchMedia("(prefers-color-scheme: dark)");try{ee.addEventListener("change",({matches:ie})=>{z(ie?"dark":"light")})}catch{ee.addListener(({matches:de})=>{try{z(de?"dark":"light")}catch(Re){console.error(Re)}})}},[u]),B.useEffect(()=>{S.length<=1&&W(!1)},[S]),B.useEffect(()=>{let ee=ie=>{var de,Re;a.every(Ee=>ie[Ee]||ie.code===Ee)&&(W(!0),(de=I.current)==null||de.focus()),ie.code==="Escape"&&(document.activeElement===I.current||(Re=I.current)!=null&&Re.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[a]),B.useEffect(()=>{if(I.current)return()=>{_.current&&(_.current.focus({preventScroll:!0}),_.current=null,U.current=!1)}},[I.current]),B.createElement("section",{ref:t,"aria-label":`${j} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((ee,ie)=>{var de;let[Re,Ee]=ee.split("-");return S.length?B.createElement("ol",{key:ee,dir:y==="auto"?hw():y,tabIndex:-1,ref:I,className:l,"data-sonner-toaster":!0,"data-theme":K,"data-y-position":Re,"data-lifted":G&&S.length>1&&!i,"data-x-position":Ee,style:{"--front-toast-height":`${((de=A[0])==null?void 0:de.height)||0}px`,"--width":`${WO}px`,"--gap":`${x}px`,...m,...QO(c,d)},onBlur:Q=>{U.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(U.current=!1,_.current&&(_.current.focus({preventScroll:!0}),_.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||U.current||(U.current=!0,_.current=Q.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{$||W(!1)},onDragEnd:()=>W(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||M(!0)},onPointerUp:()=>M(!1)},S.filter(Q=>!Q.position&&ie===0||Q.position===ee).map((Q,be)=>{var ve,Se;return B.createElement(YO,{key:Q.id,icons:v,index:be,toast:Q,defaultRichColors:h,duration:(ve=g==null?void 0:g.duration)!=null?ve:p,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:b,closeButton:(Se=g==null?void 0:g.closeButton)!=null?Se:o,interacting:$,position:ee,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:Z,toasts:S.filter(je=>je.position==Q.position),heights:A.filter(je=>je.position==Q.position),setHeights:R,expandByDefault:i,gap:x,loadingIcon:w,exp
vendor: 6,478 bytes, line 486
486anded:G,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const JO=Object.freeze(Object.defineProperty({__proto__:null,Toaster:uk,toast:T},Symbol.toStringTag,{value:"Module"})),XO=({...e})=>{const{theme:t="system"}=SO();return s.jsx(uk,{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 ZO=ox[" useId ".trim().toString()]||(()=>{}),eD=0;function dn(e){const[t,n]=f.useState(ZO());return ot(()=>{n(r=>r??String(eD++))},[e]),t?`radix-${t}`:""}const tD=["top","right","bottom","left"],Js=Math.min,yn=Math.max,Yu=Math.round,$d=Math.floor,Ir=e=>({x:e,y:e}),nD={left:"right",right:"left",bottom:"top",top:"bottom"},rD={start:"end",end:"start"};function rg(e,t,n){return yn(e,Js(t,n))}function ss(e,t){return typeof e=="function"?e(t):e}function as(e){return e.split("-")[0]}function Do(e){return e.split("-")[1]}function oy(e){return e==="x"?"y":"x"}function ly(e){return e==="y"?"height":"width"}const sD=new Set(["top","bottom"]);function Tr(e){return sD.has(as(e))?"y":"x"}function cy(e){return oy(Tr(e))}function aD(e,t,n){n===void 0&&(n=!1);const r=Do(e),a=cy(e),i=ly(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Qu(o)),[o,Qu(o)]}function iD(e){const t=Qu(e);return[sg(e),t,sg(t)]}function sg(e){return e.replace(/start|end/g,t=>rD[t])}const fw=["left","right"],mw=["right","left"],oD=["top","bottom"],lD=["bottom","top"];function cD(e,t,n){switch(e){case"top":case"bottom":return n?t?mw:fw:t?fw:mw;case"left":case"right":return t?oD:lD;default:return[]}}function dD(e,t,n,r){const a=Do(e);let i=cD(as(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(sg)))),i}function Qu(e){return e.replace(/left|right|bottom|top/g,t=>nD[t])}function uD(e){return{top:0,right:0,bottom:0,left:0,...e}}function hk(e){return typeof e!="number"?uD(e):{top:e,right:e,bottom:e,left:e}}function Ju(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function pw(e,t,n){let{reference:r,floating:a}=e;const i=Tr(t),o=cy(t),l=ly(o),c=as(t),d=i==="y",u=r.x+r.width/2-a.width/2,h=r.y+r.height/2-a.height/2,p=r[l]/2-a[l]/2;let m;switch(c){case"top":m={x:u,y:r.y-a.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-a.width,y:h};break;default:m={x:r.x,y:r.y}}switch(Do(t)){case"start":m[o]-=p*(n&&d?-1:1);break;case"end":m[o]+=p*(n&&d?-1:1);break}return m}const hD=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:h}=pw(d,r,c),p=r,m={},b=0;for(let g=0;g<l.length;g++){const{name:y,fn:x}=l[g],{x:w,y:v,data:j,reset:N}=await x({x:u,y:h,initialPlacement:r,placement:p,strategy:a,middlewareData:m,rects:d,platform:o,elements:{reference:e,floating:t}});u=w??u,h=v??h,m={...m,[y]:{...m[y],...j}},N&&b<=50&&(b++,typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(d=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):N.rects),{x:u,y:h}=pw(d,p,c)),g=-1)}return{x:u,y:h,placement:p,strategy:a,middlewareData:m}};async function fc(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:p=!1,padding:m=0}=ss(t,e),b=hk(m),y=l[p?h==="floating"?"reference":"floating":h],x=Ju(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),w=h==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},N=Ju(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:v,strategy:c}):w);return{top:(x.top-N.top+b.top)/j.y,bottom:(N.bottom-x.bottom+b.bottom)/j.y,left:(x.left-N.left+b.left)/j.x,right:(N.right-x.right+b.right)/j.x}}const fD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=ss(e,t)||{};if(d==null)return{};const h=hk(u),p={x:n,y:r},m=cy(a),b=ly(m),g=await o.getDimensions(d),y=m==="y",x=y?"top":"left",w=y?"bottom":"right",v=y?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[m]-p[m]-i.floating[b],N=p[m]-i.reference[m],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let k=S?S[v]:0;(!k||!await(o.isElement==null?void 0:o.isElement(S)))&&(k=l.floating[v]||i.floating[b]);const C=j/2-N/2,A=k/2-g[b]/2-1,R=Js(h[x],A),G=Js(h[w],A),W=R,$=k-g[b]-G,M=k/2-g[b]/2+C,K=rg(W,M,$),z=!c.arrow&&Do(a)!=null&&M!==K&&i.reference[b]/2-(M<W?R:G)-g[b]/2<0,I=z?M<W?M-W:M-$:0;return{[m]:p[m]+I,data:{[m]:K,centerOffset:M-K-I,...z&&{alignmentOffset:I}},reset:z}}}),mD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:g=!0,...y}=ss(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=as(a),w=Tr(l),v=as(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=p||(v||!g?[Qu(l)]:iD(l)),S=b!=="none";!p&&S&&N.push(...dD(l,g,b,j));const k=[l,...N],C=await fc(t,y),A=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&A.push(C[x]),h){const M=aD(a,o,j);A.push(C[M[0]],C[M[1]])}if(R=[...R,{placement:a,overflows:A}],!A.every(M=>M<=0)){var G,W;const M=(((G=i.flip)==null?void 0:G.index)||0)+1,K=k[M];if(K&&(!(h==="alignment"?w!==Tr(K):!1)||R.every(P=>P.overflows[0]>0&&Tr(P.placement)===w)))return{data:{index:M,overflows:R},reset:{placement:K}
vendor: 4,810 bytes, line 486
486};let z=(W=R.filter(I=>I.overflows[0]<=0).sort((I,P)=>I.overflows[1]-P.overflows[1])[0])==null?void 0:W.placement;if(!z)switch(m){case"bestFit":{var $;const I=($=R.filter(P=>{if(S){const _=Tr(P.placement);return _===w||_==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(_=>_>0).reduce((_,U)=>_+U,0)]).sort((P,_)=>P[1]-_[1])[0])==null?void 0:$[0];I&&(z=I);break}case"initialPlacement":z=l;break}if(a!==z)return{reset:{placement:z}}}return{}}}};function gw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xw(e){return tD.some(t=>e[t]>=0)}const pD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=ss(e,t);switch(r){case"referenceHidden":{const i=await fc(t,{...a,elementContext:"reference"}),o=gw(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:xw(o)}}}case"escaped":{const i=await fc(t,{...a,altBoundary:!0}),o=gw(i,n.floating);return{data:{escapedOffsets:o,escaped:xw(o)}}}default:return{}}}}},fk=new Set(["left","top"]);async function gD(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=as(n),l=Do(n),c=Tr(n)==="y",d=fk.has(o)?-1:1,u=i&&c?-1:1,h=ss(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof b=="number"&&(m=l==="end"?b*-1:b),c?{x:m*u,y:p*d}:{x:p*d,y:m*u}}const xD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await gD(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},yD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:y=>{let{x,y:w}=y;return{x,y:w}}},...c}=ss(e,t),d={x:n,y:r},u=await fc(t,c),h=Tr(as(a)),p=oy(h);let m=d[p],b=d[h];if(i){const y=p==="y"?"top":"left",x=p==="y"?"bottom":"right",w=m+u[y],v=m-u[x];m=rg(w,m,v)}if(o){const y=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=b+u[y],v=b-u[x];b=rg(w,b,v)}const g=l.fn({...t,[p]:m,[h]:b});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[h]:o}}}}}},vD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=ss(e,t),u={x:n,y:r},h=Tr(a),p=oy(h);let m=u[p],b=u[h];const g=ss(l,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const v=p==="y"?"height":"width",j=i.reference[p]-i.floating[v]+y.mainAxis,N=i.reference[p]+i.reference[v]-y.mainAxis;m<j?m=j:m>N&&(m=N)}if(d){var x,w;const v=p==="y"?"width":"height",j=fk.has(as(a)),N=i.reference[h]-i.floating[v]+(j&&((x=o.offset)==null?void 0:x[h])||0)+(j?0:y.crossAxis),S=i.reference[h]+i.reference[v]+(j?0:((w=o.offset)==null?void 0:w[h])||0)-(j?y.crossAxis:0);b<N?b=N:b>S&&(b=S)}return{[p]:m,[h]:b}}}},wD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...d}=ss(e,t),u=await fc(t,d),h=as(a),p=Do(a),m=Tr(a)==="y",{width:b,height:g}=i.floating;let y,x;h==="top"||h==="bottom"?(y=h,x=p===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(x=h,y=p==="end"?"top":"bottom");const w=g-u.top-u.bottom,v=b-u.left-u.right,j=Js(g-u[y],w),N=Js(b-u[x],v),S=!t.middlewareData.shift;let k=j,C=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=w),S&&!p){const R=yn(u.left,0),G=yn(u.right,0),W=yn(u.top,0),$=yn(u.bottom,0);m?C=b-2*(R!==0||G!==0?R+G:yn(u.left,u.right)):k=g-2*(W!==0||$!==0?W+$:yn(u.top,u.bottom))}await c({...t,availableWidth:C,availableHeight:k});const A=await o.getDimensions(l.floating);return b!==A.width||g!==A.height?{reset:{rects:!0}}:{}}}};function Uh(){return typeof window<"u"}function Lo(e){return mk(e)?(e.nodeName||"").toLowerCase():"#document"}function jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fr(e){var t;return(t=(mk(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mk(e){return Uh()?e instanceof Node||e instanceof jn(e).Node:!1}function cr(e){return Uh()?e instanceof Element||e instanceof jn(e).Element:!1}function Lr(e){return Uh()?e instanceof HTMLElement||e instanceof jn(e).HTMLElement:!1}function yw(e){return!Uh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jn(e).ShadowRoot}const bD=new Set(["inline","contents"]);function Gc(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=dr(e);
vendor: 4,121 bytes, line 486
486return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!bD.has(a)}const jD=new Set(["table","td","th"]);function ND(e){return jD.has(Lo(e))}const SD=[":popover-open",":modal"];function Bh(e){return SD.some(t=>{try{return e.matches(t)}catch{return!1}})}const kD=["transform","translate","scale","rotate","perspective"],CD=["transform","translate","scale","rotate","perspective","filter"],_D=["paint","layout","strict","content"];function dy(e){const t=uy(),n=cr(e)?dr(e):e;return kD.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||CD.some(r=>(n.willChange||"").includes(r))||_D.some(r=>(n.contain||"").includes(r))}function ED(e){let t=Xs(e);for(;Lr(t)&&!vo(t);){if(dy(t))return t;if(Bh(t))return null;t=Xs(t)}return null}function uy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const PD=new Set(["html","body","#document"]);function vo(e){return PD.has(Lo(e))}function dr(e){return jn(e).getComputedStyle(e)}function Vh(e){return cr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xs(e){if(Lo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yw(e)&&e.host||Fr(e);return yw(t)?t.host:t}function pk(e){const t=Xs(e);return vo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lr(t)&&Gc(t)?t:pk(t)}function mc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=pk(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=jn(a);if(i){const l=ag(o);return t.concat(o,o.visualViewport||[],Gc(a)?a:[],l&&n?mc(l):[])}return t.concat(a,mc(a,[],n))}function ag(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gk(e){const t=dr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Lr(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,l=Yu(n)!==i||Yu(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function hy(e){return cr(e)?e:e.contextElement}function Ji(e){const t=hy(e);if(!Lr(t))return Ir(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=gk(t);let o=(i?Yu(n.width):n.width)/r,l=(i?Yu(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const TD=Ir(0);function xk(e){const t=jn(e);return!uy()||!t.visualViewport?TD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function AD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jn(e)?!1:t}function Ga(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=hy(e);let o=Ir(1);t&&(r?cr(r)&&(o=Ji(r)):o=Ji(e));const l=AD(i,n,r)?xk(i):Ir(0);let c=(a.left+l.x)/o.x,d=(a.top+l.y)/o.y,u=a.width/o.x,h=a.height/o.y;if(i){const p=jn(i),m=r&&cr(r)?jn(r):r;let b=p,g=ag(b);for(;g&&r&&m!==b;){const y=Ji(g),x=g.getBoundingClientRect(),w=dr(g),v=x.left+(g.clientLeft+parseFloat(w.paddingLeft))*y.x,j=x.top+(g.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,h*=y.y,c+=v,d+=j,b=jn(g),g=ag(b)}}return Ju({width:u,height:h,x:c,y:d})}function fy(e,t){const n=Vh(e).scrollLeft;return t?t.left+n:Ga(Fr(e)).left+n}function yk(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:fy(e,r)),i=r.top+t.scrollTop;return{x:a,y:i}}function RD(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=Fr(r),l=t?Bh(t.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=Ir(1);const u=Ir(0),h=Lr(r);if((h||!h&&!i)&&((Lo(r)!=="body"||Gc(o))&&(c=Vh(r)),Lr(r))){const m=Ga(r);d=Ji(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}const p=o&&!h&&!i?yk(o,c,!0):Ir(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x+p.x,y:n.y*d.y-c.scrollTop*d.y+u.y+p.y}}function ID(e){return Array.from(e.getClientRects())}function MD(e){const t=Fr(e),n=Vh(e),r=e.ownerDocument.body,a=yn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=yn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+fy(e);const l=-n.scrollTop;return dr(r).direction==="rtl"&&(o+=yn(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:l}}
vendor: 4,850 bytes, line 486
486function OD(e,t){const n=jn(e),r=Fr(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const d=uy();(!d||d&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:i,height:o,x:l,y:c}}const DD=new Set(["absolute","fixed"]);function LD(e,t){const n=Ga(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Lr(e)?Ji(e):Ir(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,d=r*i.y;return{width:o,height:l,x:c,y:d}}function vw(e,t,n){let r;if(t==="viewport")r=OD(e,n);else if(t==="document")r=MD(Fr(e));else if(cr(t))r=LD(t,n);else{const a=xk(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Ju(r)}function vk(e,t){const n=Xs(e);return n===t||!cr(n)||vo(n)?!1:dr(n).position==="fixed"||vk(n,t)}function FD(e,t){const n=t.get(e);if(n)return n;let r=mc(e,[],!1).filter(l=>cr(l)&&Lo(l)!=="body"),a=null;const i=dr(e).position==="fixed";let o=i?Xs(e):e;for(;cr(o)&&!vo(o);){const l=dr(o),c=dy(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&DD.has(a.position)||Gc(o)&&!c&&vk(e,o))?r=r.filter(u=>u!==o):a=l,o=Xs(o)}return t.set(e,r),r}function $D(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Bh(t)?[]:FD(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((d,u)=>{const h=vw(t,u,a);return d.top=yn(h.top,d.top),d.right=Js(h.right,d.right),d.bottom=Js(h.bottom,d.bottom),d.left=yn(h.left,d.left),d},vw(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function UD(e){const{width:t,height:n}=gk(e);return{width:t,height:n}}function BD(e,t,n){const r=Lr(t),a=Fr(t),i=n==="fixed",o=Ga(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ir(0);function d(){c.x=fy(a)}if(r||!r&&!i)if((Lo(t)!=="body"||Gc(a))&&(l=Vh(t)),r){const m=Ga(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else a&&d();i&&!r&&a&&d();const u=a&&!r&&!i?yk(a,l):Ir(0),h=o.left+l.scrollLeft-c.x-u.x,p=o.top+l.scrollTop-c.y-u.y;return{x:h,y:p,width:o.width,height:o.height}}function hm(e){return dr(e).position==="static"}function ww(e,t){if(!Lr(e)||dr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Fr(e)===n&&(n=n.ownerDocument.body),n}function wk(e,t){const n=jn(e);if(Bh(e))return n;if(!Lr(e)){let a=Xs(e);for(;a&&!vo(a);){if(cr(a)&&!hm(a))return a;a=Xs(a)}return n}let r=ww(e,t);for(;r&&ND(r)&&hm(r);)r=ww(r,t);return r&&vo(r)&&hm(r)&&!dy(r)?n:r||ED(e)||n}const VD=async function(e){const t=this.getOffsetParent||wk,n=this.getDimensions,r=await n(e.floating);return{reference:BD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zD(e){return dr(e).direction==="rtl"}const WD={convertOffsetParentRelativeRectToViewportRelativeRect:RD,getDocumentElement:Fr,getClippingRect:$D,getOffsetParent:wk,getElementRects:VD,getClientRects:ID,getDimensions:UD,getScale:Ji,isElement:cr,isRTL:zD};function bk(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function HD(e,t){let n=null,r;const a=Fr(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 d=e.getBoundingClientRect(),{left:u,top:h,width:p,height:m}=d;if(l||t(),!p||!m)return;const b=$d(h),g=$d(a.clientWidth-(u+p)),y=$d(a.clientHeight-(h+m)),x=$d(u),v={rootMargin:-b+"px "+-g+"px "+-y+"px "+-x+"px",threshold:yn(0,Js(1,c))||1};let j=!0;function N(S){const k=S[0].intersectionRatio;if(k!==c){if(!j)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!bk(d,e.getBoundingClientRect())&&o(),j=!1}try{n=new IntersectionObserver(N,{...v,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,v)}n.observe(e)}return o(!0),i}function KD(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=hy(e),u=a||i?[...d?mc(d):[],...mc(t)]:[];u.forEach(x=>{a&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const h=d&&l?HD(d,n):null;let p=-1,m=null;o&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),d&&!c&&m.observe(d),m.observe(t));let b,g=c?Ga(e):null;c&&y();function y(){const x=Ga(e);g&&!bk(g,x)&&n(),g=x,b=requestAnimationFrame(y)}return n(),()=>{var x;u.forEach(w=>{a&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),h==null||h(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(b)}}const GD=xD,qD=yD,YD=mD,QD=wD,JD=pD,bw=fD,XD=vD,ZD=(e,t,n)=>{const r=new Map,a={platform:WD,...n},i={...a.platform,_c:r};return hD(e,t,{...a,platform:i})};var e5=typeof document<"u",t5=function(){},mu=e5?f.useLayoutEffect:t5;function Xu(e,t){if(e===t)return!0;
vendor: 4,143 bytes, line 486
486if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;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(!Xu(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Xu(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function jk(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jw(e,t){const n=jk(e);return Math.round(t*n)/n}function fm(e){const t=f.useRef(e);return mu(()=>{t.current=e}),t}function n5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,h]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);Xu(p,r)||m(r);const[b,g]=f.useState(null),[y,x]=f.useState(null),w=f.useCallback(P=>{P!==S.current&&(S.current=P,g(P))},[]),v=f.useCallback(P=>{P!==k.current&&(k.current=P,x(P))},[]),j=i||b,N=o||y,S=f.useRef(null),k=f.useRef(null),C=f.useRef(u),A=c!=null,R=fm(c),G=fm(a),W=fm(d),$=f.useCallback(()=>{if(!S.current||!k.current)return;const P={placement:t,strategy:n,middleware:p};G.current&&(P.platform=G.current),ZD(S.current,k.current,P).then(_=>{const U={..._,isPositioned:W.current!==!1};M.current&&!Xu(C.current,U)&&(C.current=U,ti.flushSync(()=>{h(U)}))})},[p,t,n,G,W]);mu(()=>{d===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,h(P=>({...P,isPositioned:!1})))},[d]);const M=f.useRef(!1);mu(()=>(M.current=!0,()=>{M.current=!1}),[]),mu(()=>{if(j&&(S.current=j),N&&(k.current=N),j&&N){if(R.current)return R.current(j,N,$);$()}},[j,N,$,R,A]);const K=f.useMemo(()=>({reference:S,floating:k,setReference:w,setFloating:v}),[w,v]),z=f.useMemo(()=>({reference:j,floating:N}),[j,N]),I=f.useMemo(()=>{const P={position:n,left:0,top:0};if(!z.floating)return P;const _=jw(z.floating,u.x),U=jw(z.floating,u.y);return l?{...P,transform:"translate("+_+"px, "+U+"px)",...jk(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:U}},[n,l,z.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:$,refs:K,elements:z,floatingStyles:I}),[u,$,K,z,I])}const r5=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?bw({element:r.current,padding:a}).fn(n):{}:r?bw({element:r,padding:a}).fn(n):{}}}},s5=(e,t)=>({...GD(e),options:[e,t]}),a5=(e,t)=>({...qD(e),options:[e,t]}),i5=(e,t)=>({...XD(e),options:[e,t]}),o5=(e,t)=>({...YD(e),options:[e,t]}),l5=(e,t)=>({...QD(e),options:[e,t]}),c5=(e,t)=>({...JD(e),options:[e,t]}),d5=(e,t)=>({...r5(e),options:[e,t]});var u5="Arrow",Nk=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(ne.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});Nk.displayName=u5;var h5=Nk;function my(e){const[t,n]=f.useState(void 0);return ot(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.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 py="Popper",[Sk,sa]=vt(py),[f5,kk]=Sk(py),Ck=e=>{const{__scopePopper:t,children:n}=e,[r,a]=f.useState(null);return s.jsx(f5,{scope:t,anchor:r,onAnchorChange:a,children:n})};Ck.displayName=py;var _k="PopperAnchor",Ek=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=kk(_k,n),o=f.useRef(null),l=xe(t,o);return f.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:s.jsx(ne.div,{...a,ref:l})});Ek.displayName=_k;var gy="PopperContent",[m5,p5]=Sk(gy),Pk=f.forwardRef((e,t)=>
vendor: 4,217 bytes, line 486
486{var Q,be,ve,Se,je,ke;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:b,...g}=e,y=kk(gy,n),[x,w]=f.useState(null),v=xe(t,gt=>w(gt)),[j,N]=f.useState(null),S=my(j),k=(S==null?void 0:S.width)??0,C=(S==null?void 0:S.height)??0,A=r+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},G=Array.isArray(d)?d:[d],W=G.length>0,$={padding:R,boundary:G.filter(x5),altBoundary:W},{refs:M,floatingStyles:K,placement:z,isPositioned:I,middlewareData:P}=n5({strategy:"fixed",placement:A,whileElementsMounted:(...gt)=>KD(...gt,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[s5({mainAxis:a+C,alignmentAxis:o}),c&&a5({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?i5():void 0,...$}),c&&o5({...$}),l5({...$,apply:({elements:gt,rects:Qt,availableWidth:$r,availableHeight:Kn})=>{const{width:Ur,height:Br}=Qt.reference,fn=gt.floating.style;fn.setProperty("--radix-popper-available-width",`${$r}px`),fn.setProperty("--radix-popper-available-height",`${Kn}px`),fn.setProperty("--radix-popper-anchor-width",`${Ur}px`),fn.setProperty("--radix-popper-anchor-height",`${Br}px`)}}),j&&d5({element:j,padding:l}),y5({arrowWidth:k,arrowHeight:C}),p&&c5({strategy:"referenceHidden",...$})]}),[_,U]=Rk(z),Z=Wt(b);ot(()=>{I&&(Z==null||Z())},[I,Z]);const ee=(Q=P.arrow)==null?void 0:Q.x,ie=(be=P.arrow)==null?void 0:be.y,de=((ve=P.arrow)==null?void 0:ve.centerOffset)!==0,[Re,Ee]=f.useState();return ot(()=>{x&&Ee(window.getComputedStyle(x).zIndex)},[x]),s.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:I?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Re,"--radix-popper-transform-origin":[(Se=P.transformOrigin)==null?void 0:Se.x,(je=P.transformOrigin)==null?void 0:je.y].join(" "),...((ke=P.hide)==null?void 0:ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(m5,{scope:n,placedSide:_,onArrowChange:N,arrowX:ee,arrowY:ie,shouldHideArrow:de,children:s.jsx(ne.div,{"data-side":_,"data-align":U,...g,ref:v,style:{...g.style,animation:I?void 0:"none"}})})})});Pk.displayName=gy;var Tk="PopperArrow",g5={top:"bottom",right:"left",bottom:"top",left:"right"},Ak=f.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=p5(Tk,r),o=g5[i.placedSide];return s.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:s.jsx(h5,{...a,ref:n,style:{...a.style,display:"block"}})})});Ak.displayName=Tk;function x5(e){return e!==null}var y5=e=>({name:"transformOrigin",options:e,fn(t){var y,x,w;const{placement:n,rects:r,middlewareData:a}=t,o=((y=a.arrow)==null?void 0:y.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,u]=Rk(n),h={start:"0%",center:"50%",end:"100%"}[u],p=(((x=a.arrow)==null?void 0:x.x)??0)+l/2,m=(((w=a.arrow)==null?void 0:w.y)??0)+c/2;let b="",g="";return d==="bottom"?(b=o?h:`${p}px`,g=`${-c}px`):d==="top"?(b=o?h:`${p}px`,g=`${r.floating.height+c}px`):d==="right"?(b=`${-c}px`,g=o?h:`${m}px`):d==="left"&&(b=`${r.floating.width+c}px`,g=o?h:`${m}px`),{data:{x:b,y:g}}}});function Rk(e){const[t,n="center"]=e.split("-");return[t,n]}var zh=Ck,qc=Ek,Wh=Pk,Hh=Ak,[Kh,jq]=vt("Tooltip",[sa]),Gh=sa(),Ik="TooltipProvider",v5=700,ig="tooltip.open",[w5,xy]=Kh(Ik),Mk=e=>{const{__scopeTooltip:t,delayDuration:n=v5,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,o=f.useRef(!0),l=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),s.jsx(w5,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>
vendor: 5,043 bytes, line 486
486o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:f.useCallback(d=>{l.current=d},[]),disableHoverableContent:a,children:i})};Mk.displayName=Ik;var pc="Tooltip",[b5,qh]=Kh(pc),Ok=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=xy(pc,e.__scopeTooltip),d=Gh(t),[u,h]=f.useState(null),p=dn(),m=f.useRef(0),b=o??c.disableHoverableContent,g=l??c.delayDuration,y=f.useRef(!1),[x,w]=hn({prop:r,defaultProp:a??!1,onChange:k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(ig))):c.onClose(),i==null||i(k)},caller:pc}),v=f.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),j=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,w(!0)},[w]),N=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w(!1)},[w]),S=f.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,w(!0),m.current=0},g)},[g,w]);return f.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),s.jsx(zh,{...d,children:s.jsx(b5,{scope:t,contentId:p,open:x,stateAttribute:v,trigger:u,onTriggerChange:h,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayedRef.current?S():j()},[c.isOpenDelayedRef,S,j]),onTriggerLeave:f.useCallback(()=>{b?N():(window.clearTimeout(m.current),m.current=0)},[N,b]),onOpen:j,onClose:N,disableHoverableContent:b,children:n})})};Ok.displayName=pc;var og="TooltipTrigger",Dk=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=qh(og,n),i=xy(og,n),o=Gh(n),l=f.useRef(null),c=xe(t,l,a.onTriggerChange),d=f.useRef(!1),u=f.useRef(!1),h=f.useCallback(()=>d.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),s.jsx(qc,{asChild:!0,...o,children:s.jsx(ne.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:q(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:q(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:q(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:q(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:q(e.onBlur,a.onClose),onClick:q(e.onClick,a.onClose)})})});Dk.displayName=og;var j5="TooltipPortal",[Nq,N5]=Kh(j5,{forceMount:void 0}),wo="TooltipContent",Lk=f.forwardRef((e,t)=>{const n=N5(wo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=qh(wo,e.__scopeTooltip);return s.jsx(qt,{present:r||o.open,children:o.disableHoverableContent?s.jsx(Fk,{side:a,...i,ref:t}):s.jsx(S5,{side:a,...i,ref:t})})}),S5=f.forwardRef((e,t)=>{const n=qh(wo,e.__scopeTooltip),r=xy(wo,e.__scopeTooltip),a=f.useRef(null),i=xe(t,a),[o,l]=f.useState(null),{trigger:c,onClose:d}=n,u=a.current,{onPointerInTransitChange:h}=r,p=f.useCallback(()=>{l(null),h(!1)},[h]),m=f.useCallback((b,g)=>{const y=b.currentTarget,x={x:b.clientX,y:b.clientY},w=P5(x,y.getBoundingClientRect()),v=T5(x,w),j=A5(g.getBoundingClientRect()),N=I5([...v,...j]);l(N),h(!0)},[h]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(c&&u){const b=y=>m(y,u),g=y=>m(y,c);return c.addEventListener("pointerleave",b),u.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",g)}}},[c,u,m,p]),f.useEffect(()=>{if(o){const b=g=>{const y=g.target,x={x:g.clientX,y:g.clientY},w=(c==null?void 0:c.contains(y))||(u==null?void 0:u.contains(y)),v=!R5(x,o);w?p():v&&(p(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,u,o,d,p]),s.jsx(Fk,{...e,ref:i})}),[k5,C5]=Kh(pc,{isInside:!1}),_5=mS("TooltipContent"),Fk=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=qh(wo,n),d=Gh(n),{onClose:u}=c;return f.useEffect(()=>(document.addEventListener(ig,u),()=>document.removeEventListener(ig,u)),[u]),f.useEffect(()=>{if(c.trigger){const h=p=>{const m=p.target;m!=null&&m.contains(c.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,u]),s.jsx(ni,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:s.jsxs(Wh,{"data-state":c.stateAttribute,...d,...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:[s.jsx(_5,{children:r}),s.jsx(k5,{scope:n,isInside:!0,children:s.jsx(B4,{id:c.contentId,role:"tooltip",children:a||r})})]})})});Lk.displayName=wo;var $k="TooltipArrow",E5=f.forwardRef((e,t)=>
486{const{__scopeTooltip:n,...r}=e,a=Gh(n);return C5($k,n).isInside?null:s.jsx(Hh,{...a,...r,ref:t})});E5.displayName=$k;function P5(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function T5(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 A5(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function R5(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],d=l.x,u=l.y,h=c.x,p=c.y;u>r!=p>r&&n<(h-d)*(r-u)/(p-u)+d&&(a=!a)}return a}function I5(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),M5(t)}function M5(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}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 O5=Mk,D5=Ok,L5=Dk,Uk=Lk;const bo=O5,gc=D5,xc=L5,jo=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Uk,{ref:r,sideOffset:t,className:F("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}));jo.displayName=Uk.displayName;var Yh=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(){}},Qh=typeof window>"u"||"Deno"in globalThis;function er(){}function F5(e,t){return typeof e=="function"?e(t):e}function $5(e){return typeof e=="number"&&e>=0&&e!==1/0}function U5(e,t){return Math.max(e+(t||0)-Date.now(),0)}function lg(e,t){return typeof e=="function"?e(t):e}function B5(e,t){return typeof e=="function"?e(t):e}function Nw(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==yy(o,t.options))return!1}else if(!vc(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||a&&a!==t.state.fetchStatus||i&&!i(t))}function Sw(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(yc(t.options.mutationKey)!==yc(i))return!1}else if(!vc(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function yy(e,t){return((t==null?void 0:t.queryKeyHashFn)||yc)(e)}function yc(e){return JSON.stringify(e,(t,n)=>cg(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function vc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>vc(e[n],t[n])):!1}function Bk(e,t){if(e===t)return e;const n=kw(e)&&kw(t);if(n||cg(e)&&cg(t)){const r=n?e:Object.keys(e),a=r.length,i=n?t:Object.keys(t),o=i.length,l=n?[]:{},c=new Set(r);let d=0;for(let u=0;u<o;u++){const h=n?u:i[u];(!n&&c.has(h)||n)&&e[h]===void 0&&t[h]===void 0?(l[h]=void 0,d++):(l[h]=Bk(e[h],t[h]),l[h]===e[h]&&e[h]!==void 0&&d++)}return a===o&&d===a?e:l}return t}function kw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cg(e){if(!Cw(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;
vendor: 6,309 bytes, line 486
486return!(!Cw(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Cw(e){return Object.prototype.toString.call(e)==="[object Object]"}function V5(e){return new Promise(t=>{setTimeout(t,e)})}function z5(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Bk(e,t):t}function W5(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function H5(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var vy=Symbol();function Vk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===vy?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Pa,Es,no,Wj,K5=(Wj=class extends Yh{constructor(){super();Pe(this,Pa);Pe(this,Es);Pe(this,no);pe(this,no,t=>{if(!Qh&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){O(this,Es)||this.setEventListener(O(this,no))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,Es))==null||t.call(this),pe(this,Es,void 0))}setEventListener(t){var n;pe(this,no,t),(n=O(this,Es))==null||n.call(this),pe(this,Es,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){O(this,Pa)!==t&&(pe(this,Pa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof O(this,Pa)=="boolean"?O(this,Pa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Pa=new WeakMap,Es=new WeakMap,no=new WeakMap,Wj),zk=new K5,ro,Ps,so,Hj,G5=(Hj=class extends Yh{constructor(){super();Pe(this,ro,!0);Pe(this,Ps);Pe(this,so);pe(this,so,t=>{if(!Qh&&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(){O(this,Ps)||this.setEventListener(O(this,so))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,Ps))==null||t.call(this),pe(this,Ps,void 0))}setEventListener(t){var n;pe(this,so,t),(n=O(this,Ps))==null||n.call(this),pe(this,Ps,t(this.setOnline.bind(this)))}setOnline(t){O(this,ro)!==t&&(pe(this,ro,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return O(this,ro)}},ro=new WeakMap,Ps=new WeakMap,so=new WeakMap,Hj),Zu=new G5;function q5(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}function Y5(e){return Math.min(1e3*2**e,3e4)}function Wk(e){return(e??"online")==="online"?Zu.isOnline():!0}var Hk=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function mm(e){return e instanceof Hk}function Kk(e){let t=!1,n=0,r=!1,a;const i=q5(),o=g=>{var y;r||(p(new Hk(g)),(y=e.abort)==null||y.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>zk.isFocused()&&(e.networkMode==="always"||Zu.isOnline())&&e.canRun(),u=()=>Wk(e.networkMode)&&e.canRun(),h=g=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,g),a==null||a(),i.resolve(g))},p=g=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,g),a==null||a(),i.reject(g))},m=()=>new Promise(g=>{var y;a=x=>{(r||d())&&g(x)},(y=e.onPause)==null||y.call(e)}).then(()=>{var g;a=void 0,r||(g=e.onContinue)==null||g.call(e)}),b=()=>{if(r)return;let g;const y=n===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(h).catch(x=>{var S;if(r)return;const w=e.retry??(Qh?0:3),v=e.retryDelay??Y5,j=typeof v=="function"?v(n,x):v,N=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,x);if(t||!N){p(x);return}n++,(S=e.onFail)==null||S.call(e,n,x),V5(j).then(()=>d()?void 0:m()).then(()=>{t?p(x):b()})})};return{promise:i,cancel:o,continue:()=>(a==null||a(),i),cancelRetry:l,continueRetry:c,canStart:u,start:()=>(u()?b():m().then(b),i)}}var Q5=e=>setTimeout(e,0);function J5(){let e=[],t=0,n=l=>{l()},r=l=>{l()},a=Q5;const i=l=>{t?e.push(l):a(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{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=>{a=l}}}var Bt=J5(),Ta,Kj,Gk=(Kj=class{constructor(){Pe(this,Ta)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$5(this.gcTime)&&pe(this,Ta,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Qh?1/0:5*60*1e3))}clearGcTimeout(){O(this,Ta)&&(clearTimeout(O(this,Ta)),pe(this,Ta,void 0))}},Ta=new WeakMap,Kj),ao,Aa,Pn,Ra,It,Ic,Ia,tr,Hr,Gj,X5=(Gj=class extends Gk{constructor(t){super();Pe(this,tr);Pe(this,ao);Pe(this,Aa);Pe(this,Pn);Pe(this,Ra);Pe(this,It);Pe(this,Ic);Pe(this,Ia);pe(this,Ia,!1),pe(this,Ic,t.defaultOptions),this.setOptions(t.options),this.observers=[],pe(this,Ra,t.client),pe(this,Pn,O(this,Ra).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,pe(this,ao,e3(this.options)),this.state=t.state??O(this,ao),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=O(this,It))==null?void 0:t.promise}setOptions(t){this.options={...O(this,Ic),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&O(this,Pn).remove(this)}setData(t,n){const r=z5(this.state.data,t,this.options);return Tt(this,tr,Hr).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,tr,Hr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=O(this,It))==null?void 0:r.promise;return(a=O(this,It))==null||a.cancel(t),n?n.then(er).catch(er):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(O(this,ao))}isActive(){return this.observers.some(t=>B5(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===vy||this.state.dataUpdateCount+this.state.errorUpdate
vendor: 1,274 bytes, line 486
486Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>lg(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:!U5(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,It))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,It))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),O(this,Pn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(O(this,It)&&(O(this,Ia)?O(this,It).cancel({revert:!0}):O(this,It).cancelRetry()),this.scheduleGc()),O(this,Pn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Tt(this,tr,Hr).call(this,{type:"invalidate"})}
vendor: 13,738 bytes, line 486
486fetch(t,n){var d,u,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(O(this,It))return O(this,It).continueRetry(),O(this,It).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,a=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(pe(this,Ia,!0),r.signal)})},i=()=>{const p=Vk(this.options,n),b=(()=>{const g={client:O(this,Ra),queryKey:this.queryKey,meta:this.meta};return a(g),g})();return pe(this,Ia,!1),this.options.persister?this.options.persister(p,b,this):p(b)},l=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:O(this,Ra),state:this.state,fetchFn:i};return a(p),p})();(d=this.options.behavior)==null||d.onFetch(l,this),pe(this,Aa,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=l.fetchOptions)==null?void 0:u.meta))&&Tt(this,tr,Hr).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta});const c=p=>{var m,b,g,y;mm(p)&&p.silent||Tt(this,tr,Hr).call(this,{type:"error",error:p}),mm(p)||((b=(m=O(this,Pn).config).onError)==null||b.call(m,p,this),(y=(g=O(this,Pn).config).onSettled)==null||y.call(g,this.state.data,p,this)),this.scheduleGc()};return pe(this,It,Kk({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var m,b,g,y;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(x){c(x);return}(b=(m=O(this,Pn).config).onSuccess)==null||b.call(m,p,this),(y=(g=O(this,Pn).config).onSettled)==null||y.call(g,p,this.state.error,this),this.scheduleGc()},onError:c,onFail:(p,m)=>{Tt(this,tr,Hr).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{Tt(this,tr,Hr).call(this,{type:"pause"})},onContinue:()=>{Tt(this,tr,Hr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),O(this,It).start()}},ao=new WeakMap,Aa=new WeakMap,Pn=new WeakMap,Ra=new WeakMap,It=new WeakMap,Ic=new WeakMap,Ia=new WeakMap,tr=new WeakSet,Hr=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,...Z5(r.data,this.options),fetchMeta:t.meta??null};case"success":return pe(this,Aa,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 a=t.error;return mm(a)&&a.revert&&O(this,Aa)?{...O(this,Aa),fetchStatus:"idle"}:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Bt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),O(this,Pn).notify({query:this,type:"updated",action:t})})},Gj);function Z5(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wk(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function e3(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 kr,qj,t3=(qj=class extends Yh{constructor(t={}){super();Pe(this,kr);this.config=t,pe(this,kr,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??yy(a,n);let o=this.get(i);return o||(o=new X5({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){O(this,kr).has(t.queryHash)||(O(this,kr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=O(this,kr).get(t.queryHash);n&&(t.destroy(),n===t&&O(this,kr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return O(this,kr).get(t)}getAll(){return[...O(this,kr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Nw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Nw(t,r)):n}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},kr=new WeakMap,qj),Cr,$t,Ma,_r,vs,Yj,n3=(Yj=class extends Gk{constructor(t){super();Pe(this,_r);Pe(this,Cr);Pe(this,$t);Pe(this,Ma);this.mutationId=t.mutationId,pe(this,$t,t.mutationCache),pe(this,Cr,[]),this.state=t.state||r3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){O(this,Cr).includes(t)||(O(this,Cr).push(t),this.clearGcTimeout(),O(this,$t).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){pe(this,Cr,O(this,Cr).filter(n=>n!==t)),this.scheduleGc(),O(this,$t).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){O(this,Cr).length||(this.state.status==="pending"?this.scheduleGc():O(this,$t).remove(this))}continue(){var t;return((t=O(this,Ma))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,l,c,d,u,h,p,m,b,g,y,x,w,v,j,N,S,k,C;const n=()=>{Tt(this,_r,vs).call(this,{type:"continue"})};pe(this,Ma,Kk({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,R)=>{Tt(this,_r,vs).call(this,{type:"failed",failureCount:A,error:R})},onPause:()=>{Tt(this,_r,vs).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>O(this,$t).canRun(this)}));const r=this.state.status==="pending",a=!O(this,Ma).canStart();try{if(r)n();else{Tt(this,_r,vs).call(this,{type:"pending",variables:t,isPaused:a}),await((o=(i=O(this,$t).config).onMutate)==null?void 0:o.call(i,t,this));const R=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));R!==this.state.context&&Tt(this,_r,vs).call(this,{type:"pending",context:R,variables:t,isPaused:a})}const A=await O(this,Ma).start();return await((u=(d=O(this,$t).config).onSuccess)==null?void 0:u.call(d,A,t,this.state.context,this)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,A,t,this.state.context)),await((b=(m=O(this,$t).config).onSettled)==null?void 0:b.call(m,A,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,A,null,t,this.state.context)),Tt(this,_r,vs).call(this,{type:"success",data:A}),A}catch(A){try{throw await((w=(x=O(this,$t).config).onError)==null?void 0:w.call(x,A,t,this.state.context,this)),await((j=(v=this.options).onError)==null?void 0:j.call(v,A,t,this.state.context)),await((S=(N=O(this,$t).config).onSettled)==null?void 0:S.call(N,void 0,A,this.state.variables,this.state.context,this)),await((C=(k=this.options).onSettled)==null?void 0:C.call(k,void 0,A,t,this.state.context)),A}finally{Tt(this,_r,vs).call(this,{type:"error",error:A})}}finally{O(this,$t).runNext(this)}}},Cr=new WeakMap,$t=new WeakMap,Ma=new WeakMap,_r=new WeakSet,vs=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),Bt.batch(()=>{O(this,Cr).forEach(r=>{r.onMutationUpdate(t)}),O(this,$t).notify({mutation:this,type:"updated",action:t})})},Yj);function r3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yr,nr,Mc,Qj,s3=(Qj=class extends Yh{constructor(t={}){super();Pe(this,Yr);Pe(this,nr);Pe(this,Mc);this.config=t,pe(this,Yr,new Set),pe(this,nr,new Map),pe(this,Mc,0)}build(t,n,r){const a=new n3({mutationCache:this,mutationId:++yd(this,Mc)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){O(this,Yr).add(t);const n=Ud(t);if(typeof n=="string"){const r=O(this,nr).get(n);r?r.push(t):O(this,nr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(O(this,Yr).delete(t)){const n=Ud(t);if(typeof n=="string"){const r=O(this,nr).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&O(this,nr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ud(t);if(typeof n=="string"){const r=O(this,nr).get(n),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=Ud(t);if(typeof n=="string"){const a=(r=O(this,nr).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Bt.batch(()=>{O(this,Yr).forEach(t=>{this.notify({type:"removed",mutation:t})}),O(this,Yr).clear(),O(this,nr).clear()})}getAll(){return Array.from(O(this,Yr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Sw(n,r))}findAll(t={}){return this.getAll().filter(n=>Sw(t,n))}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Bt.batch(()=>Promise.all(t.map(n=>n.continue().catch(er))))}},Yr=new WeakMap,nr=new WeakMap,Mc=new WeakMap,Qj);function Ud(e){var t;return(t=e.options.scope)==null?void 0:t.id}function _w(e){return{onFetch:(t,n)=>{var u,h,p,m,b;const r=t.options,a=(p=(h=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,i=((m=t.state.data)==null?void 0:m.pages)||[],o=((b=t.state.data)==null?void 0:b.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let g=!1;const y=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},x=Vk(t.options,t.fetchOptions),w=async(v,j,N)=>{if(g)return Promise.reject();if(j==null&&v.pages.length)return Promise.resolve(v);const k=(()=>{const G={client:t.client,queryKey:t.queryKey,pageParam:j,direction:N?"backward":"forward",meta:t.options.meta};return y(G),G})(),C=await x(k),{maxPages:A}=t.options,R=N?H5:W5;return{pages:R(v.pages,C,A),pageParams:R(v.pageParams,j,A)}};if(a&&i.length){const v=a==="backward",j=v?a3:Ew,N={pages:i,pageParams:o},S=j(r,N);l=await w(N,S,v)}else{const v=e??i.length;do{const j=c===0?o[0]??r.initialPageParam:Ew(r,l);if(c>0&&j==null)break;l=await w(l,j),c++}while(c<v)}return l};t.options.persister?t.fetchFn=()=>{var g,y;return(y=(g=t.options).persister)==null?void 0:y.call(g,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function Ew(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 a3(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 tt,Ts,As,io,oo,Rs,lo,co,Jj,i3=(Jj=class{constructor(e={}){Pe(this,tt);Pe(this,Ts);Pe(this,As);Pe(this,io);Pe(this,oo);Pe(this,Rs);Pe(this,lo);Pe(this,co);pe(this,tt,e.queryCache||new t3),pe(this,Ts,e.mutationCache||new s3),pe(this,As,e.defaultOptions||{}),pe(this,io,new Map),pe(this,oo,new Map),pe(this,Rs,0)}mount(){yd(this,Rs)._++,O(this,Rs)===1&&(pe(this,lo,zk.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,tt).onFocus())})),pe(this,co,Zu.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,tt).onOnline())})))}unmount(){var e,t;yd(this,Rs)._--,O(this,Rs)===0&&((e=O(this,lo))==null||e.call(this),pe(this,lo,void 0),(t=O(this,co))==null||t.call(this),pe(this,co,void 0))}isFetching(e){return O(this,tt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return O(this,Ts).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,tt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=O(this,tt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(lg(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return O(this,tt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=O(this,tt).get(r.queryHash),i=a==null?void 0:a.state.data,o=F5(t,i);if(o!==void 0)return O(this,tt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Bt.batch(()=>O(this,tt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,tt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=O(this,tt);Bt.batch(()=>
486{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=O(this,tt);return Bt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Bt.batch(()=>O(this,tt).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(er).catch(er)}invalidateQueries(e,t={}){return Bt.batch(()=>(O(this,tt).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=Bt.batch(()=>O(this,tt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(er)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(er)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=O(this,tt).build(this,t);return n.isStaleByTime(lg(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(er).catch(er)}fetchInfiniteQuery(e){return e.behavior=_w(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(er).catch(er)}ensureInfiniteQueryData(e){return e.behavior=_w(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Zu.isOnline()?O(this,Ts).resumePausedMutations():Promise.resolve()}getQueryCache(){return O(this,tt)}getMutationCache(){return O(this,Ts)}getDefaultOptions(){return O(this,As)}setDefaultOptions(e){pe(this,As,e)}setQueryDefaults(e,t){O(this,io).set(yc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...O(this,io).values()],n={};return t.forEach(r=>{vc(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){O(this,oo).set(yc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...O(this,oo).values()],n={};return t.forEach(r=>{vc(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...O(this,As).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=yy(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===vy&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...O(this,As).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){O(this,tt).clear(),O(this,Ts).clear()}},tt=new WeakMap,Ts=new WeakMap,As=new WeakMap,io=new WeakMap,oo=new WeakMap,Rs=new WeakMap,lo=new WeakMap,co=new WeakMap,Jj),o3=f.createContext(void 0),l3=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(o3.Provider,{value:e,children:t}));/**
487 * @remix-run/router v1.23.0
488 *
489 * Copyright (c) Remix Software Inc.
490 *
491 * This source code is licensed under the MIT license found in the
492 * LICENSE.md file in the root directory of this source tree.
493 *
494 * @license MIT
495 */function wc(){return wc=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},wc.apply(this,arguments)}var Os;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Os||(Os={}));const Pw="popstate";function c3(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:l}=r.location;return dg("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:eh(a)}return u3(t,n,null,e)}function ht(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qk(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function d3(){return Math.random().toString(36).substr(2,8)}function Tw(e,t){return{usr:e.state,key:e.key,idx:t}}function dg(e,t,n,r){return n===void 0&&(n=null),wc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Fo(t):t,{state:n,key:t&&t.key||r||d3()})}function eh(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 Fo(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 u3(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,l=Os.Pop,c=null,d=u();d==null&&(d=0,o.replaceState(wc({},o.state,{idx:d}),""));function u(){return(o.state||{idx:null}).idx}function h(){l=Os.Pop;let y=u(),x=y==null?null:y-d;d=y,c&&c({action:l,location:g.location,delta:x})}function p(y,x){l=Os.Push;let w=dg(g.location,y,x);d=u()+1;let v=Tw(w,d),j=g.createHref(w);try{o.pushState(v,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;a.location.assign(j)}i&&c&&c({action:l,location:g.location,delta:1})}function m(y,x){l=Os.Replace;let w=dg(g.location,y,x);d=u();let v=Tw(w,d),j=g.createHref(w);o.replaceState(v,"",j),i&&c&&c({action:l,location:g.location,delta:0})}function b(y){let x=a.location.origin!=="null"?a.location.origin:a.location.href,w=typeof y=="string"?y:eh(y);return w=w.replace(/ $/,"%20"),ht(x,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,x)}let g={get action(){return l},get location(){return e(a,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Pw,h),c=y,()=>{a.removeEventListener(Pw,h),c=null}},createHref(y){return t(a,y)},createURL:b,encodeLocation(y){let x=b(y);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:m,go(y){return o.go(y)}};return g}var Aw;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Aw||(Aw={}));function h3(e,t,n){return n===void 0&&(n="/"),f3(e,t,n,!1)}function f3(e,t,n,r){let a=typeof t=="string"?Fo(t):t,i=wy(a.pathname||"/",n);if(i==null)return null;let o=Yk(e);m3(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=k3(i);l=N3(o[c],d,r)}return l}function Yk(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(ht(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
495id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=Ws([r,c.relativePath]),u=n.concat(c);i.children&&i.children.length>0&&(ht(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Yk(i.children,t,u,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:b3(d,i.index),routesMeta:u})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of Qk(i.path))a(i,o,c)}),t}function Qk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=Qk(r.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function m3(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:j3(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const p3=/^:[\w-]+$/,g3=3,x3=2,y3=1,v3=10,w3=-2,Rw=e=>e==="*";function b3(e,t){let n=e.split("/"),r=n.length;return n.some(Rw)&&(r+=w3),t&&(r+=x3),n.filter(a=>!Rw(a)).reduce((a,i)=>a+(p3.test(i)?g3:i===""?y3:v3),r)}function j3(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function N3(e,t,n){let{routesMeta:r}=e,a={},i="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,u=i==="/"?t:t.slice(i.length)||"/",h=Iw({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),p=c.route;if(!h&&d&&n&&!r[r.length-1].route.index&&(h=Iw({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!h)return null;
vendor: 9,307 bytes, lines 495-504
495Object.assign(a,h.params),o.push({params:a,pathname:Ws([i,h.pathname]),pathnameBase:P3(Ws([i,h.pathnameBase])),route:p}),h.pathnameBase!=="/"&&(i=Ws([i,h.pathnameBase]))}return o}function Iw(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=S3(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((d,u,h)=>{let{paramName:p,isOptional:m}=u;if(p==="*"){let g=l[h]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const b=l[h];return m&&!b?d[p]=void 0:d[p]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function S3(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),qk(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=[],a="^"+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:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function k3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return qk(!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 wy(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 C3(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Fo(e):e;return{pathname:n?n.startsWith("/")?n:_3(n,t):t,search:T3(r),hash:A3(a)}}function _3(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function pm(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 E3(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Jk(e,t){let n=E3(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Xk(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Fo(e):(a=wc({},e),ht(!a.pathname||!a.pathname.includes("?"),pm("?","pathname","search",a)),ht(!a.pathname||!a.pathname.includes("#"),pm("#","pathname","hash",a)),ht(!a.search||!a.search.includes("#"),pm("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=n;else{let h=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),h-=1;a.pathname=p.join("/")}l=h>=0?t[h]:"/"}let c=C3(a,l),d=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Ws=e=>e.join("/").replace(/\/\/+/g,"/"),P3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),T3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,A3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function R3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Zk=["post","put","patch","delete"];new Set(Zk);const I3=["get",...Zk];new Set(I3);/**
496 * React Router v6.30.1
497 *
498 * Copyright (c) Remix Software Inc.
499 *
500 * This source code is licensed under the MIT license found in the
501 * LICENSE.md file in the root directory of this source tree.
502 *
503 * @license MIT
504 */function bc(){return bc=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},bc.apply(this,arguments)}const by=f.createContext(null),M3=f.createContext(null),si=f.createContext(null),Jh=f.createContext(null),aa=f.createContext({outlet:null,matches:[],isDataRoute:!1}),eC=f.createContext(null);function O3(e,t){let{relative:n}=t===void 0?{}:t;Yc()||ht(!1);let{basename:r,navigator:a}=f.useContext(si),{hash:i,pathname:o,search:l}=nC(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Ws([r,o])),a.createHref({pathname:c,search:l,hash:i})}function Yc(){return f.useContext(Jh)!=null}function ai(){return Yc()||ht(!1),f.useContext(Jh).location}function tC(e){f.useContext(si).static||f.useLayoutEffect(e)}function hr(){let{isDataRoute:e}=f.useContext(aa);return e?Q3():D3()}function D3(){Yc()||ht(!1);let e=f.useContext(by),{basename:t,future:n,navigator:r}=f.useContext(si),{matches:a}=f.useContext(aa),{pathname:i}=ai(),o=JSON.stringify(Jk(a,n.v7_relativeSplatPath)),l=f.useRef(!1);return tC(()=>{l.current=!0}),f.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){r.go(d);return}let h=Xk(d,JSON.parse(o),i,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Ws([t,h.pathname])),(u.replace?r.replace:r.push)(h,u.state,u)},[t,r,o,i,e])}const L3=f.createContext(null);function F3(e){let t=f.useContext(aa).outlet;return t&&f.createElement(L3.Provider,{value:e},t)}function nC(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=f.useContext(si),{matches:a}=f.useContext(aa),{pathname:i}=ai(),o=JSON.stringify(Jk(a,r.v7_relativeSplatPath));return f.useMemo(()=>Xk(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function $3(e,t){return U3(e,t)}function U3(e,t,n,r){Yc()||ht(!1);let{navigator:a}=f.useContext(si),{matches:i}=f.useContext(aa),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=ai(),u;if(t){var h;let y=typeof t=="string"?Fo(t):t;c==="/"||(h=y.pathname)!=null&&h.startsWith(c)||ht(!1),u=y}else u=d;let p=u.pathname||"/",m=p;if(c!=="/"){let y=c.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(y.length).join("/")}let b=h3(e,{pathname:m}),g=H3(b&&b.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:Ws([c,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:Ws([c,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return t&&g?f.createElement(Jh.Provider,{value:{location:bc({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Os.Pop}},g):g}function B3(){let e=Y3(),t=R3(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:a},n):null,null)}const V3=f.createElement(B3,null);class z3 extends f.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?f.createElement(aa.Provider,{value:this.props.routeContext},f.createElement(eC.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function W3(e){let{routeContext:t,match:n,children:r}=e,a=f.useContext(by);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(aa.Provider,{value:t},r)}function H3(e,t,n,r){var a;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=(a=n)==null?void 0:a.errors;if(l!=null){let u=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);u>=0||ht(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let h=o[u];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(d=u),h.route.id){let{loaderData:p,errors:m}=n,b=h.route.loader&&p[h.route.id]===void 0&&(!m||m[h.route.id]===void 0);if(h.route.lazy||b){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((u,h,p)=>{let m,b=!1,g=null,y=null;n&&(m=l&&h.route.id?l[h.route.id]:void 0,g=h.route.errorElement||V3,c&&(d<0&&p===0?(b=!0,y=null):d===p&&(b=!0,y=h.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,p+1)),w=()=>{let v;return m?v=g:b?v=y:h.route.Component?v=f.createElement(h.route.Component,null):h.route.element?v=h.route.element:v=u,f.createElement(W3,{match:h,routeC
504ontext:{outlet:u,matches:x,isDataRoute:n!=null},children:v})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?f.createElement(z3,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:w(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):w()},null)}var rC=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rC||{}),th=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}(th||{});function K3(e){let t=f.useContext(by);return t||ht(!1),t}function G3(e){let t=f.useContext(M3);return t||ht(!1),t}function q3(e){let t=f.useContext(aa);return t||ht(!1),t}function sC(e){let t=q3(),n=t.matches[t.matches.length-1];return n.route.id||ht(!1),n.route.id}function Y3(){var e;let t=f.useContext(eC),n=G3(th.UseRouteError),r=sC(th.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Q3(){let{router:e}=K3(rC.UseNavigateStable),t=sC(th.UseNavigateStable),n=f.useRef(!1);return tC(()=>{n.current=!0}),f.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,bc({fromRouteId:t},i)))},[e,t])}function J3(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function X3(e){return F3(e.context)}function Fe(e){ht(!1)}function Z3(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Os.Pop,navigator:i,static:o=!1,future:l}=e;Yc()&&ht(!1);let c=t.replace(/^\/*/,"/"),d=f.useMemo(()=>({basename:c,navigator:i,static:o,future:bc({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof r=="string"&&(r=Fo(r));let{pathname:u="/",search:h="",hash:p="",state:m=null,key:b="default"}=r,g=f.useMemo(()=>{let y=wy(u,c);return y==null?null:{location:{pathname:y,search:h,hash:p,state:m,key:b},navigationType:a}},[c,u,h,p,m,b,a]);return g==null?null:f.createElement(si.Provider,{value:d},f.createElement(Jh.Provider,{children:n,value:g}))}function eL(e){let{children:t,location:n}=e;return $3(ug(t),n)}new Promise(()=>{});function ug(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(r,a)=>{if(!f.isValidElement(r))return;let i=[...t,a];if(r.type===f.Fragment){n.push.apply(n,ug(r.props.children,i));return}r.type!==Fe&&ht(!1),!r.props.index||!r.props.children||ht(!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=ug(r.props.children,i)),n.push(o)}),n}/**
505 * React Router DOM v6.30.1
506 *
507 * Copyright (c) Remix Software Inc.
508 *
509 * This source code is licensed under the MIT license found in the
510 * LICENSE.md file in the root directory of this source tree.
511 *
512 * @license MIT
513 */function hg(){return hg=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},hg.apply(this,arguments)}function tL(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function nL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rL(e,t){return e.button===0&&(!t||t==="_self")&&!nL(e)}function fg(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function sL(e,t){let n=fg(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const aL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],iL="6";try{window.__reactRouterVersion=iL}catch{}const oL="startTransition",Mw=ox[oL];function lL(e){let{basename:t,children:n,future:r,window:a}=e,i=f.useRef();
513i.current==null&&(i.current=c3({window:a,v5Compat:!0}));let o=i.current,[l,c]=f.useState({action:o.action,location:o.location}),{v7_startTransition:d}=r||{},u=f.useCallback(h=>{d&&Mw?Mw(()=>c(h)):c(h)},[c,d]);return f.useLayoutEffect(()=>o.listen(u),[o,u]),f.useEffect(()=>J3(r),[r]),f.createElement(Z3,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const cL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ye=f.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:d,preventScrollReset:u,viewTransition:h}=t,p=tL(t,aL),{basename:m}=f.useContext(si),b,g=!1;if(typeof d=="string"&&dL.test(d)&&(b=d,cL))try{let v=new URL(window.location.href),j=d.startsWith("//")?new URL(v.protocol+d):new URL(d),N=wy(j.pathname,m);j.origin===v.origin&&N!=null?d=N+j.search+j.hash:g=!0}catch{}let y=O3(d,{relative:a}),x=uL(d,{replace:o,state:l,target:c,preventScrollReset:u,relative:a,viewTransition:h});function w(v){r&&r(v),v.defaultPrevented||x(v)}return f.createElement("a",hg({},p,{href:b||y,onClick:g||i?r:w,ref:n,target:c}))});var Ow;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ow||(Ow={}));var Dw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Dw||(Dw={}));function uL(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=hr(),d=ai(),u=nC(e,{relative:o});return f.useCallback(h=>{if(rL(h,n)){h.preventDefault();let p=r!==void 0?r:eh(d)===eh(u);c(e,{replace:p,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[d,c,u,r,a,n,e,i,o,l])}function hL(e){let t=f.useRef(fg(e)),n=f.useRef(!1),r=ai(),a=f.useMemo(()=>sL(r.search,n.current?null:t.current),[r.search]),i=hr(),o=f.useCallback((l,c)=>{const d=fg(typeof l=="function"?l(a):l);n.current=!0,i("?"+d,c)},[i,a]);return[a,o]}const jy=f.createContext({});function Ny(e){const t=f.useRef(null);return t.current===null&&(t.current=e()),t.current}const Sy=typeof window<"u",aC=Sy?f.useLayoutEffect:f.useEffect,Xh=f.createContext(null);function ky(e,t){e.indexOf(t)===-1&&e.push(t)}function Cy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const is=(e,t,n)=>n>t?t:n<e?e:n;let nh=()=>{};const os={},iC=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function oC(e){return typeof e=="object"&&e!==null}const lC=e=>/^0[^.\s]+$/u.test(e);function _y(e){let t;return()=>(t===void 0&&(t=e()),t)}const Dn=e=>e,fL=(e,t)=>n=>t(e(n)),Qc=(...e)=>e.reduce(fL),jc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ey{constructor(){this.subscriptions=[]}add(t){return ky(this.subscriptions,t),()=>Cy(this.subscriptions,t)}notify(t,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,n,r);else for(let i=0;i<a;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Mr=e=>e*1e3,In=e=>e/1e3;function cC(e,t){return t?e*(1e3/t):0}const dC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,mL=1e-7,pL=12;function gL(e,t,n,r,a){let i,o,l=0;do o=t+(n-t)/2,i=dC(o,r,a)-e,i>0?n=o:t=o;while(Math.abs(i)>mL&&++l<pL);return o}function Jc(e,t,n,r){if(e===t&&n===r)return Dn;const a=i=>gL(i,0,1,e,n);return i=>i===0||i===1?i:dC(a(i),t,r)}const uC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,hC=e=>t=>1-e(1-t),fC=Jc(.33,1.53,.69,.99),Py=hC(fC),mC=uC(Py),pC=e=>(e*=2)<1?.5*Py(e):.5*(2-Math.pow(2,-10*(e-1))),Ty=e=>1-Math.sin(Math.acos(e)),gC=hC(Ty),xC=uC(Ty),xL=Jc(.42,0,1,1),yL=Jc(0,0,.58,1),yC=Jc(.42,0,.58,1),vL=e=>Array.isArray(e)&&typeof e[0]!="number",vC=e=>Array.isArray(e)&&typeof e[0]=="number",Lw={linear:Dn,easeIn:xL,easeInOut:yC,easeOut:yL,circIn:Ty,circInOut:xC,circOut:gC,backIn:Py,backInOut:mC,backOut:fC,anticipate:pC},wL=e=>typeof e=="string",Fw=e=>{if(vC(e)){nh(e.length===4);const[t,n,r,a]=e;return Jc(t,n,r,a)}else if(wL(e))return nh(Lw[e]!==void 0),Lw[e];return e},Bd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],$w={value:null,addProjectionMetrics:null};function bL(e,t){let n=new Set,r=new Set,a=!1,i=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function d(h){o.has(h)&&(u.schedule(h),e()),c++,h(l)}const u={schedule:(h,p=!1,m=!1)=>{const g=m&&a?n:r;return p&&o.add(h),g.has(h)||g.add(h),h},cancel:h=>{r.delete(h),o.delete(h)},process:h=>{if(l=h,a){i=!0;return}
vendor: 5,179 bytes, line 513
513a=!0,[n,r]=[r,n],n.forEach(d),t&&$w.value&&$w.value.frameloop[t].push(c),c=0,n.clear(),a=!1,i&&(i=!1,u.process(h))}};return u}const jL=40;function wC(e,t){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Bd.reduce((v,j)=>(v[j]=bL(i,t?j:void 0),v),{}),{setup:l,read:c,resolveKeyframes:d,preUpdate:u,update:h,preRender:p,render:m,postRender:b}=o,g=()=>{const v=os.useManualTiming?a.timestamp:performance.now();n=!1,os.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(v-a.timestamp,jL),1)),a.timestamp=v,a.isProcessing=!0,l.process(a),c.process(a),d.process(a),u.process(a),h.process(a),p.process(a),m.process(a),b.process(a),a.isProcessing=!1,n&&t&&(r=!1,e(g))},y=()=>{n=!0,r=!0,a.isProcessing||e(g)};return{schedule:Bd.reduce((v,j)=>{const N=o[j];return v[j]=(S,k=!1,C=!1)=>(n||y(),N.schedule(S,k,C)),v},{}),cancel:v=>{for(let j=0;j<Bd.length;j++)o[Bd[j]].cancel(v)},state:a,steps:o}}const{schedule:Qe,cancel:Zs,state:bt,steps:gm}=wC(typeof requestAnimationFrame<"u"?requestAnimationFrame:Dn,!0);let pu;function NL(){pu=void 0}const an={now:()=>(pu===void 0&&an.set(bt.isProcessing||os.useManualTiming?bt.timestamp:performance.now()),pu),set:e=>{pu=e,queueMicrotask(NL)}},bC=e=>t=>typeof t=="string"&&t.startsWith(e),Ay=bC("--"),SL=bC("var(--"),Ry=e=>SL(e)?kL.test(e.split("/*")[0].trim()):!1,kL=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,$o={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Nc={...$o,transform:e=>is(0,1,e)},Vd={...$o,default:1},Ul=e=>Math.round(e*1e5)/1e5,Iy=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function CL(e){return e==null}const _L=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,My=(e,t)=>n=>!!(typeof n=="string"&&_L.test(n)&&n.startsWith(e)||t&&!CL(n)&&Object.prototype.hasOwnProperty.call(n,t)),jC=(e,t,n)=>r=>{if(typeof r!="string")return r;const[a,i,o,l]=r.match(Iy);return{[e]:parseFloat(a),[t]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},EL=e=>is(0,255,e),xm={...$o,transform:e=>Math.round(EL(e))},Ca={test:My("rgb","red"),parse:jC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+xm.transform(e)+", "+xm.transform(t)+", "+xm.transform(n)+", "+Ul(Nc.transform(r))+")"};function PL(e){let t="",n="",r="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,r+=r,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const mg={test:My("#"),parse:PL,transform:Ca.transform},Xc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ws=Xc("deg"),Or=Xc("%"),ue=Xc("px"),TL=Xc("vh"),AL=Xc("vw"),Uw={...Or,parse:e=>Or.parse(e)/100,transform:e=>Or.transform(e*100)},Di={test:My("hsl","hue"),parse:jC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Or.transform(Ul(t))+", "+Or.transform(Ul(n))+", "+Ul(Nc.transform(r))+")"},dt={test:e=>Ca.test(e)||mg.test(e)||Di.test(e),parse:e=>Ca.test(e)?Ca.parse(e):Di.test(e)?Di.parse(e):mg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ca.transform(e):Di.transform(e),getAnimatableNone:e=>{const t=dt.parse(e);return t.alpha=0,dt.transform(t)}},RL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function IL(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Iy))==null?void 0:t.length)||0)+(((n=e.match(RL))==null?void 0:n.length)||0)>0}const NC="number",SC="color",ML="var",OL="var(",Bw="${}",DL=/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 Sc(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},a=[];let i=0;const l=t.replace(DL,c=>(dt.test(c)?(r.color.push(i),a.push(SC),n.push(dt.parse(c))):c.startsWith(OL)?(r.var.push(i),a.push(ML),n.push(c)):(r.number.push(i),a.push(NC),n.push(parseFloat(c))),++i,Bw)).split(Bw);return{values:n,split:l,indexes:r,types:a}}function kC(e){return Sc(e).values}function CC(e){const{split:t,types:n}=Sc(e),r=t.length;return a=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],a[o]!==void 0){const l=n[o];l===NC?i+=Ul(a[o]):l===SC?i+=dt.transform(a[o]):i+=a[o]}return i}}const LL=e=>typeof e=="number"?0:dt.test(e)?dt.getAnimatableNone(e):e;function FL(e){const t=kC(e);return CC(e)(t.map(LL))}const ea={test:IL,parse:kC,createTransformer:CC,getAnimatableNone:FL};function ym(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 $L({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let a=0,i=0,o=0;if(!t)a=i=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;a=ym(c,l,e+1/3),i=ym(c,l,e),o=ym(c,l,e-1/3)}return{red:Math.round(a*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function rh(e,t){return n=>n>0?t:e}const Xe=(e,t,n)=>
vendor: 20,358 bytes, line 513
513e+(t-e)*n,vm=(e,t,n)=>{const r=e*e,a=n*(t*t-r)+r;return a<0?0:Math.sqrt(a)},UL=[mg,Ca,Di],BL=e=>UL.find(t=>t.test(e));function Vw(e){const t=BL(e);if(!t)return!1;let n=t.parse(e);return t===Di&&(n=$L(n)),n}const zw=(e,t)=>{const n=Vw(e),r=Vw(t);if(!n||!r)return rh(e,t);const a={...n};return i=>(a.red=vm(n.red,r.red,i),a.green=vm(n.green,r.green,i),a.blue=vm(n.blue,r.blue,i),a.alpha=Xe(n.alpha,r.alpha,i),Ca.transform(a))},pg=new Set(["none","hidden"]);function VL(e,t){return pg.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function zL(e,t){return n=>Xe(e,t,n)}function Oy(e){return typeof e=="number"?zL:typeof e=="string"?Ry(e)?rh:dt.test(e)?zw:KL:Array.isArray(e)?_C:typeof e=="object"?dt.test(e)?zw:WL:rh}function _C(e,t){const n=[...e],r=n.length,a=e.map((i,o)=>Oy(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=a[o](i);return n}}function WL(e,t){const n={...e,...t},r={};for(const a in n)e[a]!==void 0&&t[a]!==void 0&&(r[a]=Oy(e[a])(e[a],t[a]));return a=>{for(const i in r)n[i]=r[i](a);return n}}function HL(e,t){const n=[],r={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],o=e.indexes[i][r[i]],l=e.values[o]??0;n[a]=l,r[i]++}return n}const KL=(e,t)=>{const n=ea.createTransformer(t),r=Sc(e),a=Sc(t);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?pg.has(e)&&!a.values.length||pg.has(t)&&!r.values.length?VL(e,t):Qc(_C(HL(r,a),a.values),n):rh(e,t)};function EC(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Xe(e,t,n):Oy(e)(e,t)}const GL=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Qe.update(t,n),stop:()=>Zs(t),now:()=>bt.isProcessing?bt.timestamp:an.now()}},PC=(e,t,n=10)=>{let r="";const a=Math.max(Math.round(t/n),2);for(let i=0;i<a;i++)r+=Math.round(e(i/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},sh=2e4;function Dy(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<sh;)t+=n,r=e.next(t);return t>=sh?1/0:t}function qL(e,t=100,n){const r=n({...e,keyframes:[0,t]}),a=Math.min(Dy(r),sh);return{type:"keyframes",ease:i=>r.next(a*i).value/t,duration:In(a)}}const YL=5;function TC(e,t,n){const r=Math.max(t-YL,0);return cC(n-e(r),t-r)}const nt={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},wm=.001;function QL({duration:e=nt.duration,bounce:t=nt.bounce,velocity:n=nt.velocity,mass:r=nt.mass}){let a,i,o=1-t;o=is(nt.minDamping,nt.maxDamping,o),e=is(nt.minDuration,nt.maxDuration,In(e)),o<1?(a=d=>{const u=d*o,h=u*e,p=u-n,m=gg(d,o),b=Math.exp(-h);return wm-p/m*b},i=d=>{const h=d*o*e,p=h*n+n,m=Math.pow(o,2)*Math.pow(d,2)*e,b=Math.exp(-h),g=gg(Math.pow(d,2),o);return(-a(d)+wm>0?-1:1)*((p-m)*b)/g}):(a=d=>{const u=Math.exp(-d*e),h=(d-n)*e+1;return-wm+u*h},i=d=>{const u=Math.exp(-d*e),h=(n-d)*(e*e);return u*h});const l=5/e,c=XL(a,i,l);if(e=Mr(e),isNaN(c))return{stiffness:nt.stiffness,damping:nt.damping,duration:e};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:e}}}const JL=12;function XL(e,t,n){let r=n;for(let a=1;a<JL;a++)r=r-e(r)/t(r);return r}function gg(e,t){return e*Math.sqrt(1-t*t)}const ZL=["duration","bounce"],eF=["stiffness","damping","mass"];function Ww(e,t){return t.some(n=>e[n]!==void 0)}function tF(e){let t={velocity:nt.velocity,stiffness:nt.stiffness,damping:nt.damping,mass:nt.mass,isResolvedFromDuration:!1,...e};if(!Ww(e,eF)&&Ww(e,ZL))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,i=2*is(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:nt.mass,stiffness:a,damping:i}}else{const n=QL(e);t={...t,...n,mass:nt.mass},t.isResolvedFromDuration=!0}return t}function ah(e=nt.visualDuration,t=nt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:a}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:d,mass:u,duration:h,velocity:p,isResolvedFromDuration:m}=tF({...n,velocity:-In(n.velocity||0)}),b=p||0,g=d/(2*Math.sqrt(c*u)),y=o-i,x=In(Math.sqrt(c/u)),w=Math.abs(y)<5;r||(r=w?nt.restSpeed.granular:nt.restSpeed.default),a||(a=w?nt.restDelta.granular:nt.restDelta.default);let v;if(g<1){const N=gg(x,g);v=S=>{const k=Math.exp(-g*x*S);return o-k*((b+g*x*y)/N*Math.sin(N*S)+y*Math.cos(N*S))}}else if(g===1)v=N=>o-Math.exp(-x*N)*(y+(b+x*y)*N);else{const N=x*Math.sqrt(g*g-1);v=S=>{const k=Math.exp(-g*x*S),C=Math.min(N*S,300);return o-k*((b+g*x*y)*Math.sinh(C)+N*y*Math.cosh(C))/N}}const j={calculatedDuration:m&&h||null,next:N=>{const S=v(N);if(m)l.done=N>=h;else{let k=N===0?b:0;g<1&&(k=N===0?Mr(b):TC(v,N,S));const C=Math.abs(k)<=r,A=Math.abs(o-S)<=a;l.done=C&&A}return l.value=l.done?o:S,l},toString:()=>{const N=Math.min(Dy(j),sh),S=PC(k=>j.next(N*k).value,N,30);return N+"ms "+S},toTransition:()=>{}};return j}ah.applyToOptions=e=>{const t=qL(e,100,ah);return e.ease=t.ease,e.duration=Mr(t.duration),e.type="keyframes",e};function xg({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:c,restDelta:d=.5,restSpeed:u}){const h=e[0],p={done:!1,value:h},m=C=>l!==void 0&&C<l||c!==void 0&&C>c,b=C=>l===void 0?c:c===void 0||Math.abs(l-C)<Math.abs(c-C)?l:c;let g=n*t;const y=h+g,x=o===void 0?y:o(y);x!==y&&(g=x-h);const w=C=>-g*Math.exp(-C/r),v=C=>x+w(C),j=C=>{const A=w(C),R=v(C);p.done=Math.abs(A)<=d,p.value=p.done?x:R};let N,S;const k=C=>{m(p.value)&&(N=C,S=ah({keyframes:[p.value,b(p.value)],velocity:TC(v,C,p.value),damping:a,stiffness:i,restDelta:d,restSpeed:u}))};return k(0),{calculatedDuration:null,next:C=>{let A=!1;return!S&&N===void 0&&(A=!0,j(C),k(C)),N!==void 0&&C>=N?S.next(C-N):(!A&&j(C),p)}}}function nF(e,t,n){const r=[],a=n||os.mix||EC,i=e.length-1;for(let o=0;o<i;o++){let l=a(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||Dn:t;l=Qc(c,l)}r.push(l)}return r}function rF(e,t,{clamp:n=!0,ease:r,mixer:a}={}){const i=e.length;if(nh(i===t.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=nF(t,r,a),c=l.length,d=u=>{if(o&&u<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const p=jc(e[h],e[h+1],u);return l[h](p)};return n?u=>d(is(e[0],e[i-1],u)):d}function sF(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const a=jc(0,t,r);e.push(Xe(n,1,a))}}function aF(e){const t=[0];return sF(t,e.length-1),t}function iF(e,t){return e.map(n=>n*t)}function oF(e,t){return e.map(()=>t||yC).splice(0,e.length-1)}function Bl({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const a=vL(r)?r.map(Fw):Fw(r),i={done:!1,value:t[0]},o=iF(n&&n.length===t.length?n:aF(t),e),l=rF(o,t,{ease:Array.isArray(a)?a:oF(t,a)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const lF=e=>e!==null;function Ly(e,{repeat:t,repeatType:n="loop"},r,a=1){const i=e.filter(lF),l=a<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const cF={decay:xg,inertia:xg,tween:Bl,keyframes:Bl,spring:ah};function AC(e){typeof e.type=="string"&&(e.type=cF[e.type])}class Fy{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 dF=e=>e/100;class $y extends Fy{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,a;const{motionValue:n}=this.options;n&&n.updatedAt!==an.now()&&this.tick(an.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(a=(r=this.options).onStop)==null||a.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;AC(t);const{type:n=Bl,repeat:r=0,repeatDelay:a=0,repeatType:i,velocity:o=0}=t;let{keyframes:l}=t;const c=n||Bl;c!==Bl&&typeof l[0]!="number"&&(this.mixKeyframes=Qc(dF,EC(l[0],l[1])),l=[0,100]);const d=c({...t,keyframes:l});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Dy(d));const{calculatedDuration:u}=d;this.calculatedDuration=u,this.resolvedDuration=u+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=d}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:a,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:u,repeat:h,repeatType:p,repeatDelay:m,type:b,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const x=this.currentTime-d*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?x<0:x>a;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let v=this.currentTime,j=r;if(h){const C=Math.min(this.currentTime,a)/l;let A=Math.floor(C),R=C%1;!R&&C>=1&&(R=1),R===1&&A--,A=Math.min(A,h+1),!!(A%2)&&(p==="reverse"?(R=1-R,m&&(R-=m/l)):p==="mirror"&&(j=o)),v=is(0,1,R)*l}const N=w?{done:!1,value:u[0]}:j.next(v);i&&(N.value=i(N.value));let{done:S}=N;!w&&c!==null&&(S=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return k&&b!==xg&&(N.value=Ly(u,this.options,y,this.speed)),g&&g(N.value),k&&this.finish(),N}then(t,n){return this.finished.then(t,n)}get duration(){return In(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+In(t)}get time(){return In(this.currentTime)}set time(t){var n;t=Mr(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),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(an.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=In(this.currentTime))}play(){var a,i;if(this.isStopped)return;const{driver:t=GL,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(a=this.options).onPlay)==null||i.call(a);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(an.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 uF(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const _a=e=>e*180/Math.PI,yg=e=>{const t=_a(Math.atan2(e[1],e[0]));return vg(t)},hF={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:yg,rotateZ:yg,skewX:e=>_a(Math.atan(e[1])),skewY:e=>_a(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vg=e=>(e=e%360,e<0&&(e+=360),e),Hw=yg,Kw=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Gw=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),fF={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Kw,scaleY:Gw,scale:e=>(Kw(e)+Gw(e))/2,rotateX:e=>vg(_a(Math.atan2(e[6],e[5]))),rotateY:e=>vg(_a(Math.atan2(-e[2],e[0]))),rotateZ:Hw,rotate:Hw,skewX:e=>_a(Math.atan(e[4])),skewY:e=>_a(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function wg(e){return e.includes("scale")?1:0}function bg(e,t){if(!e||e==="none")return wg(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=fF,a=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=hF,a=l}if(!a)return wg(t);const i=r[t],o=a[1].split(",").map(pF);return typeof i=="function"?i(o):o[i]}const mF=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return bg(n,t)};function pF(e){return parseFloat(e.trim())}const Uo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Bo=new Set(Uo),qw=e=>e===$o||e===ue,gF=new Set(["x","y","z"]),xF=Uo.filter(e=>!gF.has(e));function yF(e){const t=[];return xF.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Fa={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-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})=>bg(t,"x"),y:(e,{transform:t})=>bg(t,"y")};Fa.translateX=Fa.x;Fa.translateY=Fa.y;const $a=new Set;let jg=!1,Ng=!1,Sg=!1;function RC(){if(Ng){const e=Array.from($a).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const a=yF(r);a.length&&(n.set(r,a),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const a=n.get(r);a&&a.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)})}Ng=!1,jg=!1,$a.forEach(e=>e.complete(Sg)),$a.clear()}function IC(){$a.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ng=!0)})}function vF(){Sg=!0,IC(),RC(),Sg=!1}class Uy{constructor(t,n,r,a,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=a,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?($a.add(this),jg||(jg=!0,Qe.read(IC),Qe.resolveKeyframes(RC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:a}=this;if(t[0]===null){const i=a==null?void 0:a.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),a&&i===void 0&&a.set(t[0])}uF(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),$a.delete(this)}cancel(){this.state==="scheduled"&&($a.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const wF=e=>e.startsWith("--");function bF(e,t,n){wF(t)?e.style.setProperty(t,n):e.style[t]=n}const jF=_y(()=>window.ScrollTimeline!==void 0),NF={};function SF(e,t){const n=_y(e);return()=>NF[t]??n()}const MC=SF(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Sl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Yw={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Sl([0,.65,.55,1]),circOut:Sl([.55,0,1,.45]),backIn:Sl([.31,.01,.66,-.59]),backOut:Sl([.33,1.53,.69,.99])};function OC(e,t){if(e)return typeof e=="function"?MC()?PC(e,t):"ease-out":vC(e)?Sl(e):Array.isArray(e)?e.map(n=>OC(n,t)||Yw.easeOut):Yw[e]}function kF(e,t,n,{delay:r=0,duration:a=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:c}={},d=void 0){const u={[t]:n};c&&(u.offset=c);const h=OC(l,a);Array.isArray(h)&&(u.easing=h);const p={delay:r,duration:a,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(p.pseudoElement=d),e.animate(u,p)}function DC(e){return typeof e=="function"&&"applyToOptions"in e}function CF({type:e,...t}){return DC(e)&&MC()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class _F extends Fy{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:a,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,nh(typeof t.type!="string");const d=CF(t);this.animation=kF(n,r,a,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Ly(a,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(u):bF(n,r,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(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 t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}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 In(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+In(t)}get time(){return In(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Mr(t)}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 Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&jF()?(this.animation.timeline=t,Dn):n(this)}}const LC={anticipate:pC,backInOut:mC,circInOut:xC};function EF(e){return e in LC}function PF(e){typeof e.ease=="string"&&EF(e.ease)&&(e.ease=LC[e.ease])}const Qw=10;class TF extends _F{constructor(t){PF(t),AC(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:a,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new $y({...o,autoplay:!1}),c=Mr(this.finishedTime??this.time);n.setWithVelocity(l.sample(c-Qw).value,l.sample(c).value,Qw),l.stop()}}const Jw=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ea.test(e)||e==="0")&&!e.startsWith("url("));function AF(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 RF(e,t,n,r){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=Jw(a,t),l=Jw(i,t);return!o||!l?!1:AF(e)||(n==="spring"||DC(n))&&r}function kg(e){e.duration=0,e.type="keyframes"}const IF=new Set(["opacity","clipPath","filter","transform"]),MF=_y(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function OF(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:a,damping:i,type:o}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=t.owner.getProps();return MF()&&n&&IF.has(n)&&(n!=="transform"||!d)&&!c&&!r&&a!=="mirror"&&i!==0&&o!=="inertia"}const DF=40;class LF extends Fy{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:i=0,repeatType:
513o="loop",keyframes:l,name:c,motionValue:d,element:u,...h}){var b;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=an.now();const p={autoplay:t,delay:n,type:r,repeat:a,repeatDelay:i,repeatType:o,name:c,motionValue:d,element:u,...h},m=(u==null?void 0:u.KeyframeResolver)||Uy;this.keyframeResolver=new m(l,(g,y,x)=>this.onKeyframesResolved(g,y,p,!x),c,d,u),(b=this.keyframeResolver)==null||b.scheduleResolve()}onKeyframesResolved(t,n,r,a){this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:c,isHandoff:d,onUpdate:u}=r;this.resolvedAt=an.now(),RF(t,i,o,l)||((os.instantAnimations||!c)&&(u==null||u(Ly(t,r,n))),t[0]=t[t.length-1],kg(r),r.repeat=0);const p={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>DF?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=!d&&OF(p)?new TF({...p,element:p.motionValue.owner.current}):new $y(p);m.finished.then(()=>this.notifyFinished()).catch(Dn),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}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(),vF()),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()}}const FF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $F(e){const t=FF.exec(e);if(!t)return[,];const[,n,r,a]=t;return[`--${n??r}`,a]}function FC(e,t,n=1){const[r,a]=$F(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return iC(o)?parseFloat(o):o}return Ry(a)?FC(a,t,n+1):a}function By(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const $C=new Set(["width","height","top","left","right","bottom",...Uo]),UF={test:e=>e==="auto",parse:e=>e},UC=e=>t=>t.test(e),BC=[$o,ue,Or,ws,AL,TL,UF],Xw=e=>BC.find(UC(e));function BF(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||lC(e):!0}const VF=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(Iy)||[];if(!r)return e;const a=n.replace(r,"");let i=VF.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+a+")"}const WF=/\b([a-z-]*)\(.*?\)/gu,Cg={...ea,getAnimatableNone:e=>{const t=e.match(WF);return t?t.map(zF).join(" "):e}},Zw={...$o,transform:Math.round},HF={rotate:ws,rotateX:ws,rotateY:ws,rotateZ:ws,scale:Vd,scaleX:Vd,scaleY:Vd,scaleZ:Vd,skew:ws,skewX:ws,skewY:ws,distance:ue,translateX:ue,translateY:ue,translateZ:ue,x:ue,y:ue,z:ue,perspective:ue,transformPerspective:ue,opacity:Nc,originX:Uw,originY:Uw,originZ:ue},Vy={borderWidth:ue,borderTopWidth:ue,borderRightWidth:ue,borderBottomWidth:ue,borderLeftWidth:ue,borderRadius:ue,radius:ue,borderTopLeftRadius:ue,borderTopRightRadius:ue,borderBottomRightRadius:ue,borderBottomLeftRadius:ue,width:ue,maxWidth:ue,height:ue,maxHeight:ue,top:ue,right:ue,bottom:ue,left:ue,padding:ue,paddingTop:ue,paddingRight:ue,paddingBottom:ue,paddingLeft:ue,margin:ue,marginTop:ue,marginRight:ue,marginBottom:ue,marginLeft:ue,backgroundPositionX:ue,backgroundPositionY:ue,...HF,zIndex:Zw,fillOpacity:Nc,strokeOpacity:Nc,numOctaves:Zw},KF={...Vy,color:dt,backgroundColor:dt,outlineColor:dt,fill:dt,stroke:dt,borderColor:dt,borderTopColor:dt,borderRightColor:dt,borderBottomColor:dt,borderLeftColor:dt,filter:Cg,WebkitFilter:Cg},VC=e=>KF[e];function zC(e,t){let n=VC(e);return n!==Cg&&(n=ea),n.getAnimatableNone?n.getAnimatableNone(t):void 0}
vendor: 13,017 bytes, lines 513-521
513const GF=new Set(["auto","none","0"]);function qF(e,t,n){let r=0,a;for(;r<e.length&&!a;){const i=e[r];typeof i=="string"&&!GF.has(i)&&Sc(i).values.length&&(a=e[r]),r++}if(a&&n)for(const i of t)e[i]=zC(n,a)}class YF extends Uy{constructor(t,n,r,a,i){super(t,n,r,a,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let d=t[c];if(typeof d=="string"&&(d=d.trim(),Ry(d))){const u=FC(d,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!$C.has(r)||t.length!==2)return;const[a,i]=t,o=Xw(a),l=Xw(i);if(o!==l)if(qw(o)&&qw(l))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else Fa[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let a=0;a<t.length;a++)(t[a]===null||BF(t[a]))&&r.push(a);r.length&&qF(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=Fa[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&t.getValue(r,a).jump(a,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const a=t.getValue(n);a&&a.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=Fa[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,d])=>{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}function WC(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const a=document.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}const HC=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function KC(e){return oC(e)&&"offsetHeight"in e}const eb=30,QF=e=>!isNaN(parseFloat(e));class JF{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const a=an.now();if(this.updatedAt!==a&&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=an.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=QF(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 Ey);const r=this.events[t].add(n);return t==="change"?()=>{r(),Qe.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=an.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>eb)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,eb);return cC(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 No(e,t){return new JF(e,t)}const{schedule:zy,cancel:Sq}=wC(queueMicrotask,!1),Jn={x:!1,y:!1};function GC(){return Jn.x||Jn.y}function XF(e){return e==="x"||e==="y"?Jn[e]?null:(Jn[e]=!0,()=>{Jn[e]=!1}):Jn.x||Jn.y?null:(Jn.x=Jn.y=!0,()=>{Jn.x=Jn.y=!1})}function qC(e,t){const n=WC(e),r=new AbortController,a={passive:!0,...t,signal:r.signal};return[n,a,()=>r.abort()]}function tb(e){return!(e.pointerType==="touch"||GC())}function ZF(e,t,n={}){const[r,a,i]=qC(e,n),o=l=>{if(!tb(l))return;const{target:c}=l,d=t(c,l);if(typeof d!="function"||!c)return;const u=h=>{tb(h)&&(d(h),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,a)};return r.forEach(l=>{l.addEventListener("pointerenter",o,a)}),i}const YC=(e,t)=>t?e===t?!0:YC(e,t.parentElement):!1,Wy=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,e$=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function t$(e){return e$.has(e.tagName)||e.tabIndex!==-1}const gu=new WeakSet;function nb(e){return t=>{t.key==="Enter"&&e(t)}}function bm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const n$=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=nb(()=>{if(gu.has(n))return;bm(n,"down");const a=nb(()=>{bm(n,"up")}),i=()=>bm(n,"cancel");n.addEventListener("keyup",a,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function rb(e){return Wy(e)&&!GC()}function r$(e,t,n={}){const[r,a,i]=qC(e,n),o=l=>{const c=l.currentTarget;if(!rb(l))return;gu.add(c);const d=t(c,l),u=(m,b)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",p),gu.has(c)&&gu.delete(c),rb(m)&&typeof d=="function"&&d(m,{success:b})},h=m=>{u(m,c===window||c===document||n.useGlobalTarget||YC(c,m.target))},p=m=>{u(m,!1)};window.addEventListener("pointerup",h,a),window.addEventListener("pointercancel",p,a)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,a),KC(l)&&(l.addEventListener("focus",d=>n$(d,a)),!t$(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function QC(e){return oC(e)&&"ownerSVGElement"in e}function s$(e){return QC(e)&&e.tagName==="svg"}const Ot=e=>!!(e&&e.getVelocity),a$=[...BC,dt,ea],i$=e=>a$.find(UC(e)),Hy=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function sb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function o$(...e){return t=>{let n=!1;const r=e.map(a=>{const i=sb(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():sb(e[a],null)}}}}function l$(...e){return f.useCallback(o$(...e),e)}class c$ extends f.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,a=KC(r)&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=a-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function d$({children:e,isPresent:t,anchorX:n,root:r}){const a=f.useId(),i=f.useRef(null),o=f.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=f.useContext(Hy),c=l$(i,e==null?void 0:e.ref);return f.useInsertionEffect(()=>{const{width:d,height:u,top:h,left:p,right:m}=o.current;if(t||!i.current||!d||!u)return;const b=n==="left"?`left: ${p}`:`right: ${m}`;i.current.dataset.motionPopId=a;const g=document.createElement("style");l&&(g.nonce=l);const y=r??document.head;return y.appendChild(g),g.sheet&&g.sheet.insertRule(`
514          [data-motion-pop-id="${a}"] {
515            position: absolute !important;
516            width: ${d}px !important;
517            height: ${u}px !important;
518            ${b}px !important;
519            top: ${h}px !important;
520          }
521        `),()=>{y.contains(g)&&y.removeChild(g)}},[t]),s.jsx(c$,{isPresent:t,childRef:i,sizeRef:o,children:f.cloneElement(e,{ref:c})})}const u$=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:a,presenceAffectsLayout:i,mode:o,anchorX:l,root:c})=>{const d=Ny(h$),u=f.useId();let h=!0,p=f.useMemo(()=>(h=!1,{id:u,initial:t,isPresent:n,custom:a,onExitComplete:m=>{d.set(m,!0);for(const b of d.values())if(!b)return;r&&r()},register:m=>(d.set(m,!1),()=>d.delete(m))}),[n,d,r]);return i&&h&&(p={...p}),f.useMemo(()=>{d.forEach((m,b)=>d.set(b,!1))},[n]),f.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),o==="popLayout"&&(e=s.jsx(d$,{isPresent:n,anchorX:l,root:c,children:e})),s.jsx(Xh.Provider,{value:p,children:e})};function h$(){return new Map}function JC(e=!0){const t=f.useContext(Xh);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=t,i=f.useId();f.useEffect(()=>{if(e)return a(i)},[e]);const o=f.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const zd=e=>e.key||"";function ab(e){const t=[];return f.Children.forEach(e,n=>{f.isValidElement(n)&&t.push(n)}),t}const f$=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",root:c})=>{const[d,u]=JC(o),h=f.useMemo(()=>ab(e),[e]),p=o&&!d?[]:h.map(zd),m=f.useRef(!0),b=f.useRef(h),g=Ny(()=>new Map),[y,x]=f.useState(h),[w,v]=f.useState(h);aC(()=>{m.current=!1,b.current=h;for(let S=0;S<w.length;S++){const k=zd(w[S]);p.includes(k)?g.delete(k):g.get(k)!==!0&&g.set(k,!1)}},[w,p.length,p.join("-")]);const j=[];if(h!==y){let S=[...h];for(let k=0;k<w.length;k++){const C=w[k],A=zd(C);p.includes(A)||(S.splice(k,0,C),j.push(C))}return i==="wait"&&j.length&&(S=j),v(ab(S)),x(h),null}const{forceRender:N}=f.useContext(jy);return s.jsx(s.Fragment,{children:w.map(S=>{const k=zd(S),C=o&&!d?!1:h===w||p.includes(k),A=()=>{if(g.has(k))g.set(k,!0);else return;let R=!0;g.forEach(G=>{G||(R=!1)}),R&&(N==null||N(),v(b.current),o&&(u==null||u()),r&&r())};return s.jsx(u$,{isPresent:C,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:a,mode:i,root:c,onExitComplete:C?void 0:A,anchorX:l,children:S},k)})})},XC=f.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"]},So={};for(const e in ib)So[e]={isEnabled:t=>ib[e].some(n=>!!t[n])};function m$(e){for(const t in e)So[t]={...So[t],...e[t]}}const p$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ih(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||p$.has(e)}let ZC=e=>!ih(e);function g$(e){typeof e=="function"&&(ZC=t=>t.startsWith("on")?!ih(t):e(t))}try{g$(require("@emotion/is-prop-valid").default)}catch{}function x$(e,t,n){const r={};for(const a in e)a==="values"&&typeof e.values=="object"||(ZC(a)||n===!0&&ih(a)||!t&&!ih(a)||e.draggable&&a.startsWith("onDrag"))&&(r[a]=e[a]);return r}const Zh=f.createContext({});function ef(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function kc(e){return typeof e=="string"||Array.isArray(e)}const Ky=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Gy=["initial",...Ky];function tf(e){return ef(e.animate)||Gy.some(t=>kc(e[t]))}function e_(e){return!!(tf(e)||e.variants)}function y$(e,t){if(tf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||kc(n)?n:void 0,animate:kc(r)?r:void 0}}return e.inherit!==!1?t:{}}function v$(e){const{initial:t,animate:n}=y$(e,f.useContext(Zh));return f.useMemo(()=>({initial:t,animate:n}),[ob(t),ob(n)])}function ob(e){return Array.isArray(e)?e.join(" "):e}const Cc={};function w$(e){for(const t in e)Cc[t]=e[t],Ay(t)&&(Cc[t].isCSSVariable=!0)}function t_(e,{layout:t,layoutId:n}){return Bo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Cc[e]||e==="opacity")}
vendor: 5,592 bytes, line 521
521const b$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},j$=Uo.length;function N$(e,t,n){let r="",a=!0;for(let i=0;i<j$;i++){const o=Uo[i],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const d=HC(l,Vy[o]);if(!c){a=!1;const u=b$[o]||o;r+=`${u}(${d}) `}n&&(t[o]=d)}}return r=r.trim(),n?r=n(t,a?"":r):a&&(r="none"),r}function qy(e,t,n){const{style:r,vars:a,transformOrigin:i}=e;let o=!1,l=!1;for(const c in t){const d=t[c];if(Bo.has(c)){o=!0;continue}else if(Ay(c)){a[c]=d;continue}else{const u=HC(d,Vy[c]);c.startsWith("origin")?(l=!0,i[c]=u):r[c]=u}}if(t.transform||(o||n?r.transform=N$(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:d="50%",originZ:u=0}=i;r.transformOrigin=`${c} ${d} ${u}`}}const Yy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function n_(e,t,n){for(const r in t)!Ot(t[r])&&!t_(r,n)&&(e[r]=t[r])}function S$({transformTemplate:e},t){return f.useMemo(()=>{const n=Yy();return qy(n,t,e),Object.assign({},n.vars,n.style)},[t])}function k$(e,t){const n=e.style||{},r={};return n_(r,n,e),Object.assign(r,S$(e,t)),r}function C$(e,t){const n={},r=k$(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 _$={offset:"stroke-dashoffset",array:"stroke-dasharray"},E$={offset:"strokeDashoffset",array:"strokeDasharray"};function P$(e,t,n=1,r=0,a=!0){e.pathLength=1;const i=a?_$:E$;e[i.offset]=ue.transform(-r);const o=ue.transform(t),l=ue.transform(n);e[i.array]=`${o} ${l}`}function r_(e,{attrX:t,attrY:n,attrScale:r,pathLength:a,pathSpacing:i=1,pathOffset:o=0,...l},c,d,u){if(qy(e,l,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p}=e;h.transform&&(p.transform=h.transform,delete h.transform),(p.transform||h.transformOrigin)&&(p.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),p.transform&&(p.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),a!==void 0&&P$(h,a,i,o,!1)}const s_=()=>({...Yy(),attrs:{}}),a_=e=>typeof e=="string"&&e.toLowerCase()==="svg";function T$(e,t,n,r){const a=f.useMemo(()=>{const i=s_();return r_(i,t,a_(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};n_(i,e.style,e),a.style={...i,...a.style}}return a}const A$=["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 Qy(e){return typeof e!="string"||e.includes("-")?!1:!!(A$.indexOf(e)>-1||/[A-Z]/u.test(e))}function R$(e,t,n,{latestValues:r},a,i=!1){const l=(Qy(e)?T$:C$)(t,r,a,e),c=x$(t,typeof e=="string",i),d=e!==f.Fragment?{...c,...l,ref:n}:{},{children:u}=t,h=f.useMemo(()=>Ot(u)?u.get():u,[u]);return f.createElement(e,{...d,children:h})}function lb(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Jy(e,t,n,r){if(typeof t=="function"){const[a,i]=lb(r);t=t(n!==void 0?n:e.custom,a,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,i]=lb(r);t=t(n!==void 0?n:e.custom,a,i)}return t}function xu(e){return Ot(e)?e.get():e}function I$({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,a){return{latestValues:M$(n,r,a,e),renderState:t()}}function M$(e,t,n,r){const a={},i=r(e,{});for(const p in i)a[p]=xu(i[p]);let{initial:o,animate:l}=e;const c=tf(e),d=e_(e);t&&d&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const h=u?l:o;if(h&&typeof h!="boolean"&&!ef(h)){const p=Array.isArray(h)?h:[h];for(let m=0;m<p.length;m++){const b=Jy(e,p[m]);if(b){const{transitionEnd:g,transition:y,...x}=b;for(const w in x){let v=x[w];if(Array.isArray(v)){const j=u?v.length-1:0;v=v[j]}v!==null&&(a[w]=v)}for(const w in g)a[w]=g[w]}}}return a}const i_=e=>(t,n)=>{const r=f.useContext(Zh),a=f.useContext(Xh),i=()=>I$(e,t,r,a);return n?i():Ny(i)};function Xy(e,t,n){var i;const{style:r}=e,a={};for(const o in r)(Ot(r[o])||t.style&&Ot(t.style[o])||t_(o,e)||((i=n==null?void 0:n.getValue(o))==null?void 0:i.liveStyle)!==void 0)&&(a[o]=r[o]);return a}const O$=i_({scrapeMotionValuesFromProps:Xy,createRenderState:Yy});function o_(e,t,n){const r=Xy(e,t,n);for(const a in e)if(Ot(e[a])||Ot(t[a])){const i=Uo.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[i]=e[a]}return r}const D$=i_({scrapeMotionValuesFromProps:o_,createRenderState:s_}),L$=Symbol.for("motionComponentSymbol");function Li(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function F$(e,t,n){return f.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Li(n)&&(n.current=r))},[t])}const Zy=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),$$="framerAppearId",l_="data-"+Zy($$),c_=f.createContext({});function U$(e,t,n,r,a){var g,y;const{visualElement:i}=f.useContext(Zh),o=f.useContext(XC),l=f.useContext(Xh),c=f.useContext(Hy).reducedMotion,d=f.useRef(null);r=r||o.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}
vendor: 4,440 bytes, line 521
521));const u=d.current,h=f.useContext(c_);u&&!u.projection&&a&&(u.type==="html"||u.type==="svg")&&B$(d.current,n,a,h);const p=f.useRef(!1);f.useInsertionEffect(()=>{u&&p.current&&u.update(n,l)});const m=n[l_],b=f.useRef(!!m&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,m))&&((y=window.MotionHasOptimisedAnimation)==null?void 0:y.call(window,m)));return aC(()=>{u&&(p.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),b.current&&u.animationState&&u.animationState.animateChanges())}),f.useEffect(()=>{u&&(!b.current&&u.animationState&&u.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,m)}),b.current=!1),u.enteringChildren=void 0)}),u}function B$(e,t,n,r){const{layoutId:a,layout:i,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:d,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:d_(e.parent)),e.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:!!o||l&&Li(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:d})}function d_(e){if(e)return e.options.allowProjection!==!1?e.projection:d_(e.parent)}function jm(e,{forwardMotionProps:t=!1}={},n,r){n&&m$(n);const a=Qy(e)?D$:O$;function i(l,c){let d;const u={...f.useContext(Hy),...l,layoutId:V$(l)},{isStatic:h}=u,p=v$(l),m=a(l,h);if(!h&&Sy){z$();const b=W$(u);d=b.MeasureLayout,p.visualElement=U$(e,m,u,r,b.ProjectionNode)}return s.jsxs(Zh.Provider,{value:p,children:[d&&p.visualElement?s.jsx(d,{visualElement:p.visualElement,...u}):null,R$(e,l,F$(m,p.visualElement,c),m,h,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=f.forwardRef(i);return o[L$]=e,o}function V$({layoutId:e}){const t=f.useContext(jy).id;return t&&e!==void 0?t+"-"+e:e}function z$(e,t){f.useContext(XC).strict}function W$(e){const{drag:t,layout:n}=So;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function H$(e,t){if(typeof Proxy>"u")return jm;const n=new Map,r=(i,o)=>jm(i,o,e,t),a=(i,o)=>r(i,o);return new Proxy(a,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,jm(o,void 0,e,t)),n.get(o))})}function u_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function K$({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function G$(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 Nm(e){return e===void 0||e===1}function _g({scale:e,scaleX:t,scaleY:n}){return!Nm(e)||!Nm(t)||!Nm(n)}function ya(e){return _g(e)||h_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function h_(e){return cb(e.x)||cb(e.y)}function cb(e){return e&&e!=="0%"}function oh(e,t,n){const r=e-n,a=t*r;return n+a}function db(e,t,n,r,a){return a!==void 0&&(e=oh(e,a,r)),oh(e,n,r)+t}function Eg(e,t=0,n=1,r,a){e.min=db(e.min,t,n,r,a),e.max=db(e.max,t,n,r,a)}function f_(e,{x:t,y:n}){Eg(e.x,t.translate,t.scale,t.originPoint),Eg(e.y,n.translate,n.scale,n.originPoint)}const ub=.999999999999,hb=1.0000000000001;function q$(e,t,n,r=!1){const a=n.length;if(!a)return;t.x=t.y=1;let i,o;for(let l=0;l<a;l++){i=n[l],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&$i(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,f_(e,o)),r&&ya(i.latestValues)&&$i(e,i.latestValues))}t.x<hb&&t.x>ub&&(t.x=1),t.y<hb&&t.y>ub&&(t.y=1)}function Fi(e,t){e.min=e.min+t,e.max=e.max+t}function fb(e,t,n,r,a=.5){const i=Xe(e.min,e.max,a);Eg(e,t,n,i,r)}function $i(e,t){fb(e.x,t.x,t.scaleX,t.scale,t.originX),fb(e.y,t.y,t.scaleY,t.scale,t.originY)}function m_(e,t){return u_(G$(e.getBoundingClientRect(),t))}function Y$(e,t,n){const r=m_(e,n),{scroll:a}=t;return a&&(Fi(r.x,a.offset.x),Fi(r.y,a.offset.y)),r}const mb=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ui=()=>({x:mb(),y:mb()}),pb=()=>({min:0,max:0}),st=()=>({x:pb(),y:pb()}),Pg={current:null},p_={current:!1};function Q$(){if(p_.current=!0,!!Sy)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Pg.current=e.matches;e.addEventListener("change",t),t()}else Pg.current=!1}const J$=new WeakMap;
vendor: 5,109 bytes, line 521
521function X$(e,t,n){for(const r in t){const a=t[r],i=n[r];if(Ot(a))e.addValue(r,a);else if(Ot(i))e.addValue(r,No(a,{owner:e}));else if(i!==a)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(a):o.hasAnimated||o.set(a)}else{const o=e.getStaticValue(r);e.addValue(r,No(o!==void 0?o:a,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const gb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Z${scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:a,blockInitialAnimation:i,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Uy,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=an.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,Qe.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=tf(n),this.isVariantNode=e_(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];c[p]!==void 0&&Ot(m)&&m.set(c[p])}}mount(t){var n;this.current=t,J$.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((r,a)=>this.bindToMotionValue(a,r)),p_.current||Q$(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Pg.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Zs(this.notifyUpdate),Zs(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){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Bo.has(t);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Qe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{a(),i&&i(),n.owner&&n.stop()})}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 So){const n=So[t];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[t]&&a&&r(this.props)&&(this.features[t]=new a(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):st()}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<gb.length;r++){const a=gb[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const i="on"+a,o=t[i];o&&(this.propEventSubscriptions[a]=this.on(a,o))}this.prevMotionValues=X$(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}
vendor: 2,235 bytes, line 521
521addVariantChild(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=No(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"&&(iC(r)||lC(r))?r=parseFloat(r):!i$(r)&&ea.test(n)&&(r=zC(t,n)),this.setBaseTarget(t,Ot(r)?r.get():r)),Ot(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=Jy(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Ot(a)?a:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ey),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){zy.render(this.render)}}class g_ extends Z${constructor(){super(...arguments),this.KeyframeResolver=YF}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[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;Ot(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function x_(e,{style:t,vars:n},r,a){const i=e.style;let o;
vendor: 8,532 bytes, line 521
521for(o in t)i[o]=t[o];a==null||a.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function e6(e){return window.getComputedStyle(e)}class t6 extends g_{constructor(){super(...arguments),this.type="html",this.renderInstance=x_}readValueFromInstance(t,n){var r;if(Bo.has(n))return(r=this.projection)!=null&&r.isProjecting?wg(n):mF(t,n);{const a=e6(t),i=(Ay(n)?a.getPropertyValue(n):a[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return m_(t,n)}build(t,n,r){qy(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Xy(t,n,r)}}const y_=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function n6(e,t,n,r){x_(e,t,void 0,r);for(const a in t.attrs)e.setAttribute(y_.has(a)?a:Zy(a),t.attrs[a])}class r6 extends g_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=st}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Bo.has(n)){const r=VC(n);return r&&r.default||0}return n=y_.has(n)?n:Zy(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return o_(t,n,r)}build(t,n,r){r_(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,a){n6(t,n,r,a)}mount(t){this.isSVGTag=a_(t.tagName),super.mount(t)}}const s6=(e,t)=>Qy(e)?new r6(t):new t6(t,{allowProjection:e!==f.Fragment});function Xi(e,t,n){const r=e.getProps();return Jy(r,t,n!==void 0?n:r.custom,e)}const Tg=e=>Array.isArray(e);function a6(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,No(n))}function i6(e){return Tg(e)?e[e.length-1]||0:e}function o6(e,t){const n=Xi(e,t);let{transitionEnd:r={},transition:a={},...i}=n||{};i={...i,...r};for(const o in i){const l=i6(i[o]);a6(e,o,l)}}function l6(e){return!!(Ot(e)&&e.add)}function Ag(e,t){const n=e.getValue("willChange");if(l6(n))return n.add(t);if(!n&&os.WillChange){const r=new os.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function v_(e){return e.props[l_]}const c6=e=>e!==null;function d6(e,{repeat:t,repeatType:n="loop"},r){const a=e.filter(c6),i=t&&n!=="loop"&&t%2===1?0:a.length-1;return!i||r===void 0?a[i]:r}const u6={type:"spring",stiffness:500,damping:25,restSpeed:10},h6=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),f6={type:"keyframes",duration:.8},m6={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},p6=(e,{keyframes:t})=>t.length>2?f6:Bo.has(e)?e.startsWith("scale")?h6(t[1]):u6:m6;function g6({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:i,repeatType:o,repeatDelay:l,from:c,elapsed:d,...u}){return!!Object.keys(u).length}const ev=(e,t,n,r={},a,i)=>o=>{const l=By(r,e)||{},c=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Mr(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-d,onUpdate:p=>{t.set(p),l.onUpdate&&l.onUpdate(p)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:a};g6(l)||Object.assign(u,p6(e,u)),u.duration&&(u.duration=Mr(u.duration)),u.repeatDelay&&(u.repeatDelay=Mr(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(kg(u),u.delay===0&&(h=!0)),(os.instantAnimations||os.skipAnimations)&&(h=!0,kg(u),u.delay=0),u.allowFlatten=!l.type&&!l.ease,h&&!i&&t.get()!==void 0){const p=d6(u.keyframes,l);if(p!==void 0){Qe.update(()=>{u.onUpdate(p),u.onComplete()});return}}return l.isSync?new $y(u):new LF(u)};function x6({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function w_(e,t,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(i=r);const c=[],d=a&&e.animationState&&e.animationState.getState()[a];for(const u in l){const h=e.getValue(u,e.latestValues[u]??null),p=l[u];if(p===void 0||d&&x6(d,u))continue;const m={delay:n,...By(i||{},u)},b=h.get();if(b!==void 0&&!h.isAnimating&&!Array.isArray(p)&&p===b&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const x=v_(e);if(x){const w=window.MotionHandoffAnimation(x,u,Qe);w!==null&&(m.startTime=w,g=!0)}}Ag(e,u),h.start(ev(u,h,p,e.shouldReduceMotion&&$C.has(u)?{type:!1}:m,e,g));const y=h.animation;y&&c.push(y)}return o&&Promise.all(c).then(()=>{Qe.update(()=>{o&&o6(e,o)})}),c}function b_(e,t,n,r=0,a=1){const i=Array.from(e).sort((d,u)=>d.sortNodePosition(u)).indexOf(t),o=e.size,l=(o-1)*r;return typeof n=="function"?n(i,o):a===1?i*r:l-i*r}function Rg(e,t,n={}){var c;const r=Xi(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const i=r?()=>Promise.all(w_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:p}=a;return y6(e,t,d,u,h,p,n)}:()=>Promise.resolve(),{when:l}=a;if(l){const[d,u]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>u())}else return Promise.all([i(),o(n.delay)])}function y6(e,t,n=0,r=0,a=0,i=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(Rg(c,t,{...o,delay:n+(typeof r=="function"?0:r)+b_(e.variantChildren,c,r,a,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function v6(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const a=t.map(i=>Rg(e,i,n));r=Promise.all(a)}else if(typeof t=="string")r=Rg(e,t,n);else{const a=typeof t=="function"?Xi(e,t,n.custom):t;r=Promise.all(w_(e,a,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function j_(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 w6=Gy.length;function N_(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?N_(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<w6;n++){const r=Gy[n],a=e.props[r];(kc(a)||a===!1)&&(t[r]=a)}return t}const b6=[...Ky].reverse(),j6=Ky.length;function N6(e){return t=>Promise.all(t.map(({animation:n,options:r})=>v6(e,n,r)))}function S6(e){let t=N6(e),n=xb(),r=!0;const a=c=>(d,u)=>{var p;const h=Xi(e,u,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:b,...g}=h;d={...d,...g,...b}}return d};function i(c){t=c(e)}function o(c){const{props:d}=e,u=N_(e.parent)||{},h=[],p=new Set;let m={},b=1/0;for(let y=0;y<j6;y++){const x=b6[y],w=n[x],v=d[x]!==void 0?d[x]:u[x],j=kc(v),N=x===c?w.isActive:null;N===!1&&(b=y);let S=v===u[x]&&v!==d[x]&&j;if(S&&r&&e.manuallyAnimateOnMount&&(S=!1),w.protectedKeys={...m},!w.isActive&&N===null||!v&&!w.prevProp||ef(v)||typeof v=="boolean")continue;const k=k6(w.prevProp,v);let C=k||x===c&&w.isActive&&!S&&j||y>b&&j,A=!1;const R=Array.isArray(v)?v:[v];let G=R.reduce(a(x),{});N===!1&&(G={});const{prevResolvedValues:W={}}=w,$={...W,...G},M=I=>{C=!0,p.has(I)&&(A=!0,p.delete(I)),w.needsAnimating[I]=!0;const P=e.getValue(I);P&&(P.liveStyle=!1)};for(const I in $){const P=G[I],_=W[I];if(m.hasOwnProperty(I))continue;let U=!1;Tg(P)&&Tg(_)?U=!j_(P,_):U=P!==_,U?P!=null?M(I):p.add(I):P!==void 0&&p.has(I)?M(I):w.protectedKeys[I]=!0}w.prevProp=v,w.prevResolvedValues=G,w.isActive&&(m={...m,...G}),r&&e.blockInitialAnimation&&(C=!1);const K=S&&k;C&&(!K||A)&&h.push(...R.map(I=>{const P={type:x};if(typeof I=="string"&&r&&!K&&e.manuallyAnimateOnMount&&e.parent){const{parent:_}=e,U=Xi(_,I);if(_.enteringChildren&&U){const{delayChildren:Z}=U.transition||{};P.delay=b_(_.enteringChildren,e,Z)}}return{animation:I,options:P}}))}if(p.size){const y={};if(typeof d.initial!="boolean"){const x=Xi(e,Array.isArray(d.initial)?d.initial[0]:d.initial);x&&x.transition&&(y.transition=x.transition)}p.forEach(x=>{const w=e.getBaseTarget(x),v=e.getValue(x);v&&(v.liveStyle=!0),y[x]=w??null}),h.push({animation:y})}let g=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(h):Promise.resolve()}function l(c,d){var h;if(n[c].isActive===d)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(c,d)}),n[c].isActive=d;const u=o(c);for(const p in n)n[p].protectedKeys={};return u}
vendor: 21,866 bytes, line 521
521return{animateChanges:o,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=xb()}}}function k6(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!j_(t,e):!1}function fa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xb(){return{animate:fa(!0),whileInView:fa(),whileHover:fa(),whileTap:fa(),whileDrag:fa(),whileFocus:fa(),exit:fa()}}class ia{constructor(t){this.isMounted=!1,this.node=t}update(){}}class C6 extends ia{constructor(t){super(t),t.animationState||(t.animationState=S6(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ef(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 _6=0;class E6 extends ia{constructor(){super(...arguments),this.id=_6++}update(){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;const a=this.node.animationState.setActive("exit",!t);n&&!t&&a.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const P6={animation:{Feature:C6},exit:{Feature:E6}};function _c(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Zc(e){return{point:{x:e.pageX,y:e.pageY}}}const T6=e=>t=>Wy(t)&&e(t,Zc(t));function Vl(e,t,n,r){return _c(e,t,T6(n),r)}const S_=1e-4,A6=1-S_,R6=1+S_,k_=.01,I6=0-k_,M6=0+k_;function Vt(e){return e.max-e.min}function O6(e,t,n){return Math.abs(e-t)<=n}function yb(e,t,n,r=.5){e.origin=r,e.originPoint=Xe(t.min,t.max,e.origin),e.scale=Vt(n)/Vt(t),e.translate=Xe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=A6&&e.scale<=R6||isNaN(e.scale))&&(e.scale=1),(e.translate>=I6&&e.translate<=M6||isNaN(e.translate))&&(e.translate=0)}function zl(e,t,n,r){yb(e.x,t.x,n.x,r?r.originX:void 0),yb(e.y,t.y,n.y,r?r.originY:void 0)}function vb(e,t,n){e.min=n.min+t.min,e.max=e.min+Vt(t)}function D6(e,t,n){vb(e.x,t.x,n.x),vb(e.y,t.y,n.y)}function wb(e,t,n){e.min=t.min-n.min,e.max=e.min+Vt(t)}function Wl(e,t,n){wb(e.x,t.x,n.x),wb(e.y,t.y,n.y)}function En(e){return[e("x"),e("y")]}const C_=({current:e})=>e?e.ownerDocument.defaultView:null,bb=(e,t)=>Math.abs(e-t);function L6(e,t){const n=bb(e.x,t.x),r=bb(e.y,t.y);return Math.sqrt(n**2+r**2)}class __{constructor(t,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=km(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,b=L6(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!b)return;const{point:g}=p,{timestamp:y}=bt;this.history.push({...g,timestamp:y});const{onStart:x,onMove:w}=this.handlers;m||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=Sm(m,this.transformPagePoint),Qe.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:b,onSessionEnd:g,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=km(p.type==="pointercancel"?this.lastMoveEventInfo:Sm(m,this.transformPagePoint),this.history);this.startEvent&&b&&b(p,x),g&&g(p,x)},!Wy(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=a||window;const l=Zc(t),c=Sm(l,this.transformPagePoint),{point:d}=c,{timestamp:u}=bt;this.history=[{...d,timestamp:u}];const{onSessionStart:h}=n;h&&h(t,km(c,this.history)),this.removeListeners=Qc(Vl(this.contextWindow,"pointermove",this.handlePointerMove),Vl(this.contextWindow,"pointerup",this.handlePointerUp),Vl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Zs(this.updatePoint)}}function Sm(e,t){return t?{point:t(e.point)}:e}function jb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function km({point:e},t){return{point:e,delta:jb(e,E_(t)),offset:jb(e,F6(t)),velocity:$6(t,.1)}}function F6(e){return e[0]}function E_(e){return e[e.length-1]}function $6(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const a=E_(e);for(;n>=0&&(r=e[n],!(a.timestamp-r.timestamp>Mr(t)));)n--;if(!r)return{x:0,y:0};const i=In(a.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(a.x-r.x)/i,y:(a.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function U6(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Xe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Xe(n,e,r.max):Math.min(e,n)),e}function Nb(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 B6(e,{top:t,left:n,bottom:r,right:a}){return{x:Nb(e.x,n,a),y:Nb(e.y,t,r)}}function Sb(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 V6(e,t){return{x:Sb(e.x,t.x),y:Sb(e.y,t.y)}}function z6(e,t){let n=.5;const r=Vt(e),a=Vt(t);return a>r?n=jc(t.min,t.max-r,e.min):r>a&&(n=jc(e.min,e.max-a,t.min)),is(0,1,n)}function W6(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 Ig=.35;function H6(e=Ig){return e===!1?e=0:e===!0&&(e=Ig),{x:kb(e,"left","right"),y:kb(e,"top","bottom")}}function kb(e,t,n){return{min:Cb(e,t),max:Cb(e,n)}}function Cb(e,t){return typeof e=="number"?e:e[t]||0}const K6=new WeakMap;class G6{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=st(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const i=h=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Zc(h).point)},o=(h,p)=>{const{drag:m,dragPropagation:b,onDragStart:g}=this.getProps();if(m&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=XF(m),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),En(x=>{let w=this.getAxisMotionValue(x).get()||0;if(Or.test(w)){const{projection:v}=this.visualElement;if(v&&v.layout){const j=v.layout.layoutBox[x];j&&(w=Vt(j)*(parseFloat(w)/100))}}this.originPoint[x]=w}),g&&Qe.postRender(()=>g(h,p)),Ag(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},l=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p;const{dragPropagation:m,dragDirectionLock:b,onDirectionLock:g,onDrag:y}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:x}=p;if(b&&this.currentDirection===null){this.currentDirection=q6(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",p.point,x),this.updateAxis("y",p.point,x),this.visualElement.render(),y&&y(h,p)},c=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p,this.stop(h,p),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>En(h=>{var p;return this.getAnimationState(h)==="paused"&&((p=this.getAxisMotionValue(h).animation)==null?void 0:p.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new __(t,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:C_(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,a=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!a||!r)return;const{velocity:o}=a;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Qe.postRender(()=>l(r,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:a}=this.getProps();if(!r||!Wd(t,a,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=U6(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,a=this.constraints;t&&Li(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=B6(r.layoutBox,t):this.constraints=!1,this.elastic=H6(n),a!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&En(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=W6(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Li(t))return!1;const r=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const i=Y$(r,a.root,this.visualElement.getTransformPagePoint());let o=V6(a.layout.layoutBox,i);if(n){const l=n(K$(o));this.hasMutatedConstraints=!!l,l&&(o=u_(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},d=En(u=>{if(!Wd(u,n,this.currentDirection))return;let h=c&&c[u]||{};o&&(h={min:0,max:0});const p=a?200:1e6,m=a?40:1e7,b={type:"inertia",velocity:r?t[u]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(u,b)});return Promise.all(d).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ag(this.visualElement,t),r.start(ev(t,r,0,n,this.visualElement,!1))}stopAnimation(){En(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){En(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),a=r[n];return a||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){En(n=>{const{drag:r}=this.getProps();if(!Wd(n,r,this.currentDirection))return;const{projection:a}=this.visualElement,i=this.getAxisMotionValue(n);if(a&&a.layout){const{min:o,max:l}=a.layout.layoutBox[n];i.set(t[n]-Xe(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Li(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};En(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();a[o]=z6({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.resolveConstraints(),En(o=>{if(!Wd(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:d}=this.constraints[o];l.set(Xe(c,d,a[o]))})}addListeners(){if(!this.visualElement.current)return;K6.set(this.visualElement,this);const t=this.visualElement.current,n=Vl(t,"pointerdown",c=>{const{drag:d,dragListener:u=!0}=this.getProps();d&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Li(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,i=a.addEventListener("measure",r);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),Qe.read(r);const o=_c(window,"resize",()=>this.scalePositionWithinConstraints()),l=a.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(En(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=c[u].translate,h.set(h.get()+c[u].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:i=!1,dragElastic:o=Ig,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function Wd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function q6(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Y6 extends ia{constructor(t){super(t),this.removeGroupControls=Dn,this.removeListeners=Dn,this.controls=new G6(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Dn}unmount(){this.removeGroupControls(),this.removeListeners()}}const _b=e=>(t,n)=>{e&&Qe.postRender(()=>e(t,n))};class Q6 extends ia{constructor(){super(...arguments),this.removePointerDownListener=Dn}onPointerDown(t){this.session=new __(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:C_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:_b(t),onStart:_b(n),onMove:r,onEnd:(i,o)=>{delete this.session,a&&Qe.postRender(()=>a(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()}}const yu={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Eb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const fl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ue.test(e))e=parseFloat(e);else return e;const n=Eb(e,t.target.x),r=Eb(e,t.target.y);return`${n}% ${r}%`}},J6={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,a=ea.parse(e);if(a.length>5)return r;const i=ea.createTransformer(e),o=typeof a[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;a[0+o]/=l,a[1+o]/=c;const d=Xe(l,c,.5);return typeof a[2+o]=="number"&&(a[2+o]/=d),typeof a[3+o]=="number"&&(a[3+o]/=d),i(a)}};let Cm=!1;class X6 extends f.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:i}=t;w$(Z6),i&&(n.group&&n.group.add(i),r&&r.register&&a&&r.register(i),Cm&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),yu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:a,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,Cm=!0,a||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||Qe.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zy.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=t;Cm=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function P_(e){const[t,n]=JC(),r=f.useContext(jy);return s.jsx(X6,{...e,layoutGroup:r,switchLayoutGroup:f.useContext(c_),isPresent:t,safeToRemove:n})}const Z6={borderRadius:{...fl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fl,borderTopRightRadius:fl,borderBottomLeftRadius:fl,borderBottomRightRadius:fl,boxShadow:J6};function eU(e,t,n){const r=Ot(e)?e:No(e);return r.start(ev("",r,t,n)),r.animation}const tU=(e,t)=>e.depth-t.depth;class nU{constructor(){this.children=[],this.isDirty=!1}add(t){ky(this.children,t),this.isDirty=!0}remove(t){Cy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tU),this.isDirty=!1,this.children.forEach(t)}}function rU(e,t){const n=an.now(),r=({timestamp:a})=>{const i=a-n;i>=t&&(Zs(r),e(i-t))};return Qe.setup(r,!0),()=>Zs(r)}const T_=["TopLeft","TopRight","BottomLeft","BottomRight"],sU=T_.length,Pb=e=>typeof e=="string"?parseFloat(e):e,Tb=e=>typeof e=="number"||ue.test(e);function aU(e,t,n,r,a,i){a?(e.opacity=Xe(0,n.opacity??1,iU(r)),e.opacityExit=Xe(t.opacity??1,0,oU(r))):i&&(e.opacity=Xe(t.opacity??1,n.opacity??1,r));for(let o=0;o<sU;o++){const l=`border${T_[o]}Radius`;let c=Ab(t,l),d=Ab(n,l);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||Tb(c)===Tb(d)?(e[l]=Math.max(Xe(Pb(c),Pb(d),r),0),(Or.test(d)||Or.test(c))&&(e[l]+="%")):e[l]=d}(t.rotate||n.rotate)&&(e.rotate=Xe(t.rotate||0,n.rotate||0,r))}function Ab(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const iU=A_(0,.5,gC),oU=A_(.5,.95,Dn);function A_(e,t,n){return r=>r<e?0:r>t?1:n(jc(e,t,r))}function Rb(e,t){e.min=t.min,e.max=t.max}function _n(e,t){Rb(e.x,t.x),Rb(e.y,t.y)}function Ib(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Mb(e,t,n,r,a){return e-=t,e=oh(e,1/n,r),a!==void 0&&(e=oh(e,1/a,r)),e}function lU(e,t=0,n=1,r=.5,a,i=e,o=e){if(Or.test(t)&&(t=parseFloat(t),t=Xe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Xe(i.min,i.max,r);e===i&&(l-=t),e.min=Mb(e.min,t,n,l,a),e.max=Mb(e.max,t,n,l,a)}function Ob(e,t,[n,r,a],i,o){lU(e,t[n],t[r],t[a],t.scale,i,o)}const cU=["x","scaleX","originX"],dU=["y","scaleY","originY"];function Db(e,t,n,r){Ob(e.x,t,cU,n?n.x:void 0,r?r.x:void 0),Ob(e.y,t,dU,n?n.y:void 0,r?r.y:void 0)}function Lb(e){return e.translate===0&&e.scale===1}function R_(e){return Lb(e.x)&&Lb(e.y)}function Fb(e,t){return e.min===t.min&&e.max===t.max}function uU(e,t){return Fb(e.x,t.x)&&Fb(e.y,t.y)}function $b(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function I_(e,t){return $b(e.x,t.x)&&$b(e.y,t.y)}function Ub(e){return Vt(e.x)/Vt(e.y)}function Bb(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class hU{constructor(){this.members=[]}add(t){ky(this.members,t),t.scheduleRender()}remove(t){if(Cy(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){const n=this.members.findIndex(a=>t===a);if(n===0)return!1;let r;for(let a=n;a>=0;a--){const i=this.members[a];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:a}=t.options;a===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function fU(e,t,n){let r="";const a=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((a||i||o)&&(r=`translate3d(${a}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:u,rotateX:h,rotateY:p,skewX:m,skewY:b}=n;d&&(r=`perspective(${d}px) ${r}`),u&&(r+=`rotate(${u}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),b&&(r+=`skewY(${b}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 _m=["","X","Y","Z"],mU=1e3;let pU=0;function Em(e,t,n,r){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function M_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=v_(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Qe,!(a||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&M_(r)}function O_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(o={},l=t==null?void 0:t()){this.id=pU++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>
vendor: 5,564 bytes, line 521
521{this.projectionUpdateScheduled=!1,this.nodes.forEach(yU),this.nodes.forEach(jU),this.nodes.forEach(NU),this.nodes.forEach(vU)},this.resolvedRelativeTargetAt=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 nU)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Ey),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=QC(o)&&!s$(o),this.instance=o;const{layoutId:l,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let u,h=0;const p=()=>this.root.updateBlockedByResize=!1;Qe.read(()=>{h=window.innerWidth}),e(o,()=>{const m=window.innerWidth;m!==h&&(h=m,this.root.updateBlockedByResize=!0,u&&u(),u=rU(p,250),yu.hasAnimatedSinceResize&&(yu.hasAnimatedSinceResize=!1,this.nodes.forEach(Wb)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||EU,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=d.getProps(),x=!this.targetLayout||!I_(this.targetLayout,m),w=!h&&p;if(this.options.layoutRoot||this.resumeFrom||w||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...By(b,"layout"),onPlay:g,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,w)}else h||Wb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}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(),Zs(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&&M_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Vb);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zb);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(bU),this.nodes.forEach(gU),this.nodes.forEach(xU)):this.nodes.forEach(zb),this.clearAllSnapshots();const l=an.now();bt.delta=is(0,1e3/60,l-bt.timestamp),bt.timestamp=l,bt.isProcessing=!0,gm.update.process(bt),gm.preRender.process(bt),gm.render.process(bt),bt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zy.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(wU),this.sharedNodes.forEach(kU)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Qe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Qe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Vt(this.snapshot.measuredBox.x)&&!Vt(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.layoutCorrected=st(),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);
vendor: 4,945 bytes, line 521
521this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!a)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!R_(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,u=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||ya(this.latestValues)||u)&&(a(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),PU(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return st();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(TU))){const{scroll:u}=this.root;u&&(Fi(l.x,u.offset.x),Fi(l.y,u.offset.y))}return l}removeElementScroll(o){var c;const l=st();if(_n(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let d=0;d<this.path.length;d++){const u=this.path[d],{scroll:h,options:p}=u;u!==this.root&&h&&p.layoutScroll&&(h.wasRoot&&_n(l,o),Fi(l.x,h.offset.x),Fi(l.y,h.offset.y))}return l}applyTransform(o,l=!1){const c=st();_n(c,o);for(let d=0;d<this.path.length;d++){const u=this.path[d];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&$i(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),ya(u.latestValues)&&$i(c,u.latestValues)}return ya(this.latestValues)&&$i(c,this.latestValues),c}removeTransform(o){const l=st();_n(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];if(!d.instance||!ya(d.latestValues))continue;_g(d.latestValues)&&d.updateSnapshot();const u=st(),h=d.measurePageBox();_n(u,h),Db(l,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,u)}return ya(this.latestValues)&&Db(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!==bt.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:u,layoutId:h}=this.options;if(!(!this.layout||!(u||h))){if(this.resolvedRelativeTargetAt=bt.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=st(),this.relativeTargetOrigin=st(),Wl(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),_n(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=st(),this.targetWithTransforms=st()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),D6(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):_n(this.target,this.layout.layoutBox),f_(this.target,this.targetDelta)):_n(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=st(),this.relativeTargetOrigin=st(),Wl(this.relativeTargetOrigin,this.target,m.target),_n(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||_g(this.parent.latestValues)||h_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var b;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(b=this.parent)!=null&&b.isProjectionDirty)&&
vendor: 4,119 bytes, line 521
521(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===bt.timestamp&&(c=!1),c)return;const{layout:d,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||u))return;_n(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;q$(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=st());const{target:m}=o;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ib(this.prevProjectionDelta.x,this.projectionDelta.x),Ib(this.prevProjectionDelta.y,this.projectionDelta.y)),zl(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!Bb(this.projectionDelta.x,this.prevProjectionDelta.x)||!Bb(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}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=Ui(),this.projectionDelta=Ui(),this.projectionDeltaWithTransform=Ui()}setAnimationOrigin(o,l=!1){const c=this.snapshot,d=c?c.latestValues:{},u={...this.latestValues},h=Ui();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=st(),m=c?c.source:void 0,b=this.layout?this.layout.source:void 0,g=m!==b,y=this.getStack(),x=!y||y.members.length<=1,w=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(_U));this.animationProgress=0;let v;this.mixTargetDelta=j=>{const N=j/1e3;Hb(h.x,o.x,N),Hb(h.y,o.y,N),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Wl(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),CU(this.relativeTarget,this.relativeTargetOrigin,p,N),v&&uU(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=st()),_n(v,this.relativeTarget)),g&&(this.animationValues=u,aU(u,d,this.latestValues,N,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(Zs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Qe.update(()=>{yu.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=No(0)),this.currentAnimation=eU(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},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(mU),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:d,latestValues:u}=o;if(!(!l||!c||!d)){if(this!==o&&this.layout&&d&&D_(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||st
vendor: 5,363 bytes, line 521
521();const h=Vt(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const p=Vt(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+p}_n(l,c),$i(l,u),zl(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new hU),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.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 d=this.getStack();d&&d.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 d={};c.z&&Em("z",o,d,this.animationValues);for(let u=0;u<_m.length;u++)Em(`rotate${_m[u]}`,o,d,this.animationValues),Em(`skew${_m[u]}`,o,d,this.animationValues);o.render();for(const u in d)o.setStaticValue(u,d[u]),this.animationValues&&(this.animationValues[u]=d[u]);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=xu(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=xu(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!ya(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=d.animationValues||d.latestValues;this.applyTransformsToTarget();let h=fU(this.projectionDeltaWithTransform,this.treeScale,u);c&&(h=c(u,h)),o.transform=h;const{x:p,y:m}=this.projectionDelta;o.transformOrigin=`${p.origin*100}% ${m.origin*100}% 0`,d.animationValues?o.opacity=d===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=d===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const b in Cc){if(u[b]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:x}=Cc[b],w=h==="none"?u[b]:g(u[b],d);if(y){const v=y.length;for(let j=0;j<v;j++)o[y[j]]=w}else x?this.options.visualElement.renderState.vars[b]=w:o[b]=w}this.options.layoutId&&(o.pointerEvents=d===this?xu(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(Vb),this.root.sharedNodes.clear()}}}function gU(e){e.updateLayout()}function xU(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:a}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;i==="size"?En(h=>{const p=o?t.measuredBox[h]:t.layoutBox[h],m=Vt(p);p.min=r[h].min,p.max=p.min+m}):D_(i,t.layoutBox,r)&&En(h=>{const p=o?t.measuredBox[h]:t.layoutBox[h],m=Vt(r[h]);p.max=p.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+m)});const l=Ui();zl(l,r,t.layoutBox);const c=Ui();o?zl(c,e.applyTransform(a,!0),t.measuredBox):zl(c,r,t.layoutBox);const d=!R_(l);let u=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:m}=h;if(p&&m){const b=st();Wl(b,t.layoutBox,p.layoutBox);const g=st();Wl(g,r,m.layoutBox),I_(b,g)||(u=!0),h.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=b,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function yU(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 vU(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function wU(e){e.clearSnapshot()}function Vb(e){e.clearMeasurements()}function zb(e){e.isLayoutDirty=!1}function bU(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Wb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function jU(e){e.resolveTargetDelta()}function NU(e){e.calcProjection()}
vendor: 4,677 bytes, line 521
521function SU(e){e.resetSkewAndRotation()}function kU(e){e.removeLeadSnapshot()}function Hb(e,t,n){e.translate=Xe(t.translate,0,n),e.scale=Xe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Kb(e,t,n,r){e.min=Xe(t.min,n.min,r),e.max=Xe(t.max,n.max,r)}function CU(e,t,n,r){Kb(e.x,t.x,n.x,r),Kb(e.y,t.y,n.y,r)}function _U(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const EU={duration:.45,ease:[.4,0,.1,1]},Gb=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),qb=Gb("applewebkit/")&&!Gb("chrome/")?Math.round:Dn;function Yb(e){e.min=qb(e.min),e.max=qb(e.max)}function PU(e){Yb(e.x),Yb(e.y)}function D_(e,t,n){return e==="position"||e==="preserve-aspect"&&!O6(Ub(t),Ub(n),.2)}function TU(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const AU=O_({attachResizeListener:(e,t)=>_c(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Pm={current:void 0},L_=O_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Pm.current){const e=new AU({});e.mount(window),e.setOptions({layoutScroll:!0}),Pm.current=e}return Pm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),RU={pan:{Feature:Q6},drag:{Feature:Y6,ProjectionNode:L_,MeasureLayout:P_}};function Qb(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,i=r[a];i&&Qe.postRender(()=>i(t,Zc(t)))}class IU extends ia{mount(){const{current:t}=this.node;t&&(this.unmount=ZF(t,(n,r)=>(Qb(this.node,r,"Start"),a=>Qb(this.node,a,"End"))))}unmount(){}}class MU extends ia{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=Qc(_c(this.node.current,"focus",()=>this.onFocus()),_c(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Jb(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 a="onTap"+(n==="End"?"":n),i=r[a];i&&Qe.postRender(()=>i(t,Zc(t)))}class OU extends ia{mount(){const{current:t}=this.node;t&&(this.unmount=r$(t,(n,r)=>(Jb(this.node,r,"Start"),(a,{success:i})=>Jb(this.node,a,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Mg=new WeakMap,Tm=new WeakMap,DU=e=>{const t=Mg.get(e.target);t&&t(e)},LU=e=>{e.forEach(DU)};function FU({root:e,...t}){const n=e||document;Tm.has(n)||Tm.set(n,{});const r=Tm.get(n),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(LU,{root:e,...t})),r[a]}function $U(e,t,n){const r=FU(t);return Mg.set(e,n),r.observe(e),()=>{Mg.delete(e),r.unobserve(e)}}const UU={some:0,all:1};class BU extends ia{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:UU[a]},l=c=>{const{isIntersecting:d}=c;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:u,onViewportLeave:h}=this.node.getProps(),p=d?u:h;p&&p(c)};return $U(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(VU(t,n))&&this.startObserver()}unmount(){}}function VU({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const zU={inView:{Feature:BU},tap:{Feature:OU},focus:{Feature:MU},hover:{Feature:IU}},WU={layout:{ProjectionNode:L_,MeasureLayout:P_}},HU={...P6,...zU,...RU,...WU},Sr=H$(HU,s6),KU={some:0,all:1};function GU(e,t,{root:n,margin:r,amount:a="some"}={}){const i=WC(e),o=new WeakMap,l=d=>{d.forEach(u=>{const h=o.get(u.target);if(u.isIntersecting!==!!h)if(u.isIntersecting){const p=t(u.target,u);typeof p=="function"?o.set(u.target,p):c.unobserve(u.target)}else typeof h=="function"&&(h(u),o.delete(u.target))})},c=new IntersectionObserver(l,{root:n,rootMargin:r,threshold:typeof a=="number"?a:KU[a]});
521return i.forEach(d=>c.observe(d)),()=>c.disconnect()}function F_(e,{root:t,margin:n,amount:r,once:a=!1,initial:i=!1}={}){const[o,l]=f.useState(i);return f.useEffect(()=>{if(!e.current||a&&o)return;const c=()=>(l(!0),a?void 0:()=>l(!1)),d={root:t&&t.current||void 0,margin:n,amount:r};return GU(e.current,c,d)},[t,e,n,a,r]),o}const tv=ri("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-primary/30 bg-card text-card-foreground hover:bg-primary hover:text-primary-foreground transition-all duration-300",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"text-card-foreground 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"}}),E=f.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?Ao:"button";return s.jsx(o,{className:F(tv({variant:t,size:n,className:e})),ref:i,...a})});E.displayName="Button";const L=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:F("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));L.displayName="Card";const Te=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:F("flex flex-col space-y-1.5 p-6",e),...t}));Te.displayName="CardHeader";const Ae=f.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:F("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ae.displayName="CardTitle";const We=f.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:F("text-sm text-muted-foreground",e),...t}));We.displayName="CardDescription";const Ne=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:F("p-6 pt-0",e),...t}));Ne.displayName="CardContent";const qU=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:F("flex items-center p-6 pt-0",e),...t}));qU.displayName="CardFooter";const YU=ri("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 ae({className:e,variant:t,...n}){return s.jsx("div",{className:F(YU({variant:t}),e),...n})}const QU="/assets/hero-dashboard-D_SjwpRn.png",JU="modulepreload",XU=function(e){return"/"+e},Xb={}
521,qa=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.allSettled(n.map(c=>{if(c=XU(c),c in Xb)return;Xb[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":JU,d||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),d)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return a.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},ZU=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>qa(async()=>{const{default:r}=await Promise.resolve().then(()=>Vo);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)};class nv extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class Zb extends nv{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class ej extends nv{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class tj extends nv{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Og;(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"})(Og||(Og={}));var eB=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(h){o(h)}}function c(u){try{d(r.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};class tB{constructor(t,{headers:n={},customFetch:r,region:a=Og.Any}={}){this.url=t,this.headers=n,this.region=a,this.fetch=ZU(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return eB(this,arguments,void 0,function*(n,r={}){var a;try{const{headers:i,method:o,body:l,signal:c}=r;let d={},{region:u}=r;u||(u=this.region);const h=new URL(`${this.url}/${n}`);u&&u!=="any"&&(d["x-region"]=u,h.searchParams.set("forceFunctionRegion",u));let p;l&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&l instanceof Blob||l instanceof ArrayBuffer?(d["Content-Type"]="application/octet-stream",p=l):typeof l=="string"?(d["Content-Type"]="text/plain",p=l):typeof FormData<"u"&&l instanceof FormData?p=l:(d["Content-Type"]="application/json",p=JSON.stringify(l)));const m=yield this.fetch(h.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),i),body:p,signal:c}).catch(x=>{throw x.name==="AbortError"?x:new Zb(x)}),b=m.headers.get("x-relay-error");if(b&&b==="true")throw new ej(m);if(!m.ok)throw new tj(m);let g=((a=m.headers.get("Content-Type"))!==null&&a!==void 0?a:"text/plain").split(";")[0].trim(),y;return g==="application/json"?y=yield m.json():g==="application/octet-stream"?y=yield m.blob():g==="text/event-stream"?y=m:g==="multipart/form-data"?y=yield m.formData():y=yield m.text(),{data:y,error:null,response:m}}catch(i){return i instanceof Error&&i.name==="AbortError"?{data:null,error:new Zb(i)}:{data:null,error:i,response:i instanceof tj||i instanceof ej?i.context:void 0}}})}}var nn={},rv={},nf={},ed={},rf={},sf={},nB=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},ko=nB();const rB=ko.fetch,$_=ko.fetch.bind(ko),U_=ko.Headers,sB=ko.Request,aB=ko.Response,Vo=Object.freeze(Object.defineProperty({__proto__:null,Headers:U_,Request:sB,Response:aB,default:$_,fetch:rB},Symbol.toStringTag,{value:"Module"})),iB=BA(Vo);var af={};
521Object.defineProperty(af,"__esModule",{value:!0});let oB=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};af.default=oB;var B_=Fn&&Fn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sf,"__esModule",{value:!0});const lB=B_(iB),cB=B_(af);let dB=class{constructor(t){var n,r;this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(n=t.shouldThrowOnError)!==null&&n!==void 0?n:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=lB.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,n){return this.headers=new Headers(this.headers),this.headers.set(t,n),this}then(t,n){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");const r=this.fetch;let a=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{var o,l,c,d;let u=null,h=null,p=null,m=i.status,b=i.statusText;if(i.ok){if(this.method!=="HEAD"){const w=await i.text();w===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((o=this.headers.get("Accept"))===null||o===void 0)&&o.includes("application/vnd.pgrst.plan+text"))?h=w:h=JSON.parse(w))}const y=(l=this.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),x=(c=i.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");y&&x&&x.length>1&&(p=parseInt(x[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(h)&&(h.length>1?(u={code:"PGRST116",details:`Results contain ${h.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},h=null,p=null,m=406,b="Not Acceptable"):h.length===1?h=h[0]:h=null)}else{const y=await i.text();try{u=JSON.parse(y),Array.isArray(u)&&i.status===404&&(h=[],u=null,m=200,b="OK")}catch{i.status===404&&y===""?(m=204,b="No Content"):u={message:y}}if(u&&this.isMaybeSingle&&(!((d=u==null?void 0:u.details)===null||d===void 0)&&d.includes("0 rows"))&&(u=null,m=200,b="OK"),u&&this.shouldThrowOnError)throw new cB.default(u)}return{error:u,data:h,count:p,status:m,statusText:b}});return this.shouldThrowOnError||(a=a.catch(i=>{var o,l,c;return{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:`${(l=i==null?void 0:i.stack)!==null&&l!==void 0?l:""}`,hint:"",code:`${(c=i==null?void 0:i.code)!==null&&c!==void 0?c:""}`},data:null,count:null,status:0,statusText:""}})),a.then(t,n)}returns(){return this}overrideTypes(){return this}};sf.default=dB;var uB=Fn&&Fn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rf,"__esModule",{value:!0});const hB=uB(sf);let fB=class extends hB.default{select(t){let n=!1;const r=(t??"*").split("").map(a=>/\s/.test(a)&&!n?"":(a==='"'&&(n=!n),a)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:n=!0,nullsFirst:r,foreignTable:a,referencedTable:i=a}={}){const o=i?`${i}.order`:"order",l=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${l?`${l},`:""}${t}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:n,referencedTable:r=n}={}){const a=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(a,`${t}`),this}range(t,n,{foreignTable:r,referencedTable:a=r}={}){const i=typeof a>"u"?"offset":`${a}.offset`,o=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(o,`${n-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
521explain({analyze:t=!1,verbose:n=!1,settings:r=!1,buffers:a=!1,wal:i=!1,format:o="text"}={}){var l;const c=[t?"analyze":null,n?"verbose":null,r?"settings":null,a?"buffers":null,i?"wal":null].filter(Boolean).join("|"),d=(l=this.headers.get("Accept"))!==null&&l!==void 0?l:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${d}"; options=${c};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};rf.default=fB;var mB=Fn&&Fn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ed,"__esModule",{value:!0});const pB=mB(rf);let gB=class extends pB.default{eq(t,n){return this.url.searchParams.append(t,`eq.${n}`),this}neq(t,n){return this.url.searchParams.append(t,`neq.${n}`),this}gt(t,n){return this.url.searchParams.append(t,`gt.${n}`),this}gte(t,n){return this.url.searchParams.append(t,`gte.${n}`),this}lt(t,n){return this.url.searchParams.append(t,`lt.${n}`),this}lte(t,n){return this.url.searchParams.append(t,`lte.${n}`),this}like(t,n){return this.url.searchParams.append(t,`like.${n}`),this}likeAllOf(t,n){return this.url.searchParams.append(t,`like(all).{${n.join(",")}}`),this}likeAnyOf(t,n){return this.url.searchParams.append(t,`like(any).{${n.join(",")}}`),this}ilike(t,n){return this.url.searchParams.append(t,`ilike.${n}`),this}ilikeAllOf(t,n){return this.url.searchParams.append(t,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(t,n){return this.url.searchParams.append(t,`ilike(any).{${n.join(",")}}`),this}is(t,n){return this.url.searchParams.append(t,`is.${n}`),this}in(t,n){const r=Array.from(new Set(n)).map(a=>typeof a=="string"&&new RegExp("[,()]").test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}contains(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cs.{${n.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(n)}`),this}containedBy(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cd.{${n.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(n)}`),this}rangeGt(t,n){return this.url.searchParams.append(t,`sr.${n}`),this}rangeGte(t,n){return this.url.searchParams.append(t,`nxl.${n}`),this}rangeLt(t,n){return this.url.searchParams.append(t,`sl.${n}`),this}rangeLte(t,n){return this.url.searchParams.append(t,`nxr.${n}`),this}rangeAdjacent(t,n){return this.url.searchParams.append(t,`adj.${n}`),this}overlaps(t,n){return typeof n=="string"?this.url.searchParams.append(t,`ov.${n}`):this.url.searchParams.append(t,`ov.{${n.join(",")}}`),this}textSearch(t,n,{config:r,type:a}={}){let i="";a==="plain"?i="pl":a==="phrase"?i="ph":a==="websearch"&&(i="w");const o=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${i}fts${o}.${n}`),this}match(t){return Object.entries(t).forEach(([n,r])=>{this.url.searchParams.append(n,`eq.${r}`)}),this}not(t,n,r){return this.url.searchParams.append(t,`not.${n}.${r}`),this}or(t,{foreignTable:n,referencedTable:r=n}={}){const a=r?`${r}.or`:"or";return this.url.searchParams.append(a,`(${t})`),this}filter(t,n,r){return this.url.searchParams.append(t,`${n}.${r}`),this}};ed.default=gB;var xB=Fn&&Fn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nf,"__esModule",{value:!0});const ml=xB(ed);let yB=class{constructor(t,{headers:n={},schema:r,fetch:a}){this.url=t,this.headers=new Headers(n),this.schema=r,this.fetch=a}select(t,n){const{head:r=!1,count:a}=n??{},i=r?"HEAD":"GET";let o=!1;const l=(t??"*").split("").map(c=>/\s/.test(c)&&!o?"":(c==='"'&&(o=!o),c)).join("");return this.url.searchParams.set("select",l),a&&this.headers.append("Prefer",`count=${a}`),new ml.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(t,{count:n,defaultToNull:r=!0}={}){var a;const i="POST";if(n&&this.headers.append("Prefer",`count=${n}`),r||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const o=t.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(o.length>0){const l=[...new Set(o)].map(c=>`"${c}"`);this.url.searchParams.set("columns",l.join(","))}}return new ml.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}upsert(t,{onConflict:n,ignoreDuplicates:r=!1,count:a,defaultToNull:i=!0}={}){var o;const l="POST";if(this.headers.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),n!==void 0&&this.url.searchParams.set("on_conflict",n),a&&this.headers.append("Prefer",`count=${a}`),i||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const c=t.reduce((d,u)=>d.concat(Object.keys(u)),[]);if(c.length>0){const d=[...new Set(c)].map(u=>`"${u}"`);this.url.searchParams.set("columns",d.join(","))}}return new ml.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}update(t,{count:n}={}){var r;const a="PATCH";return n&&this.headers.append("Prefer",`count=${n}`),new ml.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}delete({count:t}={}){var n;const r="DELETE";return t&&this.headers.append("Prefer",`count=${t}`),new ml.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}};nf.default=yB;
521var V_=Fn&&Fn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rv,"__esModule",{value:!0});const vB=V_(nf),wB=V_(ed);let bB=class z_{constructor(t,{headers:n={},schema:r,fetch:a}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.fetch=a}from(t){const n=new URL(`${this.url}/${t}`);return new vB.default(n,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new z_(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:r=!1,get:a=!1,count:i}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let d;r||a?(l=r?"HEAD":"GET",Object.entries(n).filter(([h,p])=>p!==void 0).map(([h,p])=>[h,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([h,p])=>{c.searchParams.append(h,p)})):(l="POST",d=n);const u=new Headers(this.headers);return i&&u.set("Prefer",`count=${i}`),new wB.default({method:l,url:c,headers:u,schema:this.schemaName,body:d,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}};rv.default=bB;var zo=Fn&&Fn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nn,"__esModule",{value:!0});nn.PostgrestError=nn.PostgrestBuilder=nn.PostgrestTransformBuilder=nn.PostgrestFilterBuilder=nn.PostgrestQueryBuilder=nn.PostgrestClient=void 0;const W_=zo(rv);nn.PostgrestClient=W_.default;const H_=zo(nf);nn.PostgrestQueryBuilder=H_.default;const K_=zo(ed);nn.PostgrestFilterBuilder=K_.default;const G_=zo(rf);nn.PostgrestTransformBuilder=G_.default;const q_=zo(sf);nn.PostgrestBuilder=q_.default;const Y_=zo(af);nn.PostgrestError=Y_.default;var jB=nn.default={PostgrestClient:W_.default,PostgrestQueryBuilder:H_.default,PostgrestFilterBuilder:K_.default,PostgrestTransformBuilder:G_.default,PostgrestBuilder:q_.default,PostgrestError:Y_.default};const{PostgrestClient:NB,PostgrestQueryBuilder:Aq,PostgrestFilterBuilder:Rq,PostgrestTransformBuilder:Iq,PostgrestBuilder:Mq,PostgrestError:Oq}=jB;class SB{static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.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"&&globalThis.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."};if(typeof process<"u"){const n=process.versions;if(n&&n.node){const r=n.node,a=parseInt(r.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
522import ws from "ws"
523new 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.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
524
525Suggested solution: ${t.workaround}`),new Error(n)}static createWebSocket(t,n){const r=this.getWebSocketConstructor();return new r(t,n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const kB="2.75.1",CB=`realtime-js/${kB}`,_B="1.0.0",Dg=1e4,EB=1e3,PB=100;var Hl;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(Hl||(Hl={}));var ft;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(ft||(ft={}));var sr;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(sr||(sr={}));var Lg;(function(e){e.websocket="websocket"})(Lg||(Lg={}));var ba;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(ba||(ba={}));class TB{constructor(){this.HEADER_LENGTH=1}decode(t,n){return t.constructor===ArrayBuffer?n(this._binaryDecode(t)):n(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){const n=new DataView(t),r=new TextDecoder;return this._decodeBroadcast(t,n,r)}_decodeBroadcast(t,n,r){const a=n.getUint8(1),i=n.getUint8(2);let o=this.HEADER_LENGTH+2;const l=r.decode(t.slice(o,o+a));o=o+a;const c=r.decode(t.slice(o,o+i));o=o+i;const d=JSON.parse(r.decode(t.slice(o,t.byteLength)));return{ref:null,topic:l,event:c,payload:d}}}class Q_{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Ve;(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"})(Ve||(Ve={}));const nj=(e,t,n={})=>{var r;const a=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=AB(o,e,t,a),i),{}):{}},AB=(e,t,n,r)=>{const a=t.find(l=>
vendor: 15,614 bytes, lines 525-530
525l.name===e),i=a==null?void 0:a.type,o=n[e];return i&&!r.includes(i)?J_(i,o):Fg(o)},J_=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return OB(t,n)}switch(e){case Ve.bool:return RB(t);case Ve.float4:case Ve.float8:case Ve.int2:case Ve.int4:case Ve.int8:case Ve.numeric:case Ve.oid:return IB(t);case Ve.json:case Ve.jsonb:return MB(t);case Ve.timestamp:return DB(t);case Ve.abstime:case Ve.date:case Ve.daterange:case Ve.int4range:case Ve.int8range:case Ve.money:case Ve.reltime:case Ve.text:case Ve.time:case Ve.timestamptz:case Ve.timetz:case Ve.tsrange:case Ve.tstzrange:return Fg(t);default:return Fg(t)}},Fg=e=>e,RB=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},IB=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},MB=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},OB=(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=>J_(t,l))}return e},DB=e=>typeof e=="string"?e.replace(" ","T"):e,X_=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")+"/api/broadcast"};class Am{constructor(t,n,r={},a=Dg){this.channel=t,this.event=n,this.payload=r,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var r;return this._hasReceived(t)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var rj;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(rj||(rj={}));class Kl{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Kl.syncState(this.state,a,i,o),this.pendingDiffs.forEach(c=>{this.state=Kl.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],l()}),this.channel._on(r.diff,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=Kl.syncDiff(this.state,a,i,o),l())}),this.onJoin((a,i,o)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:i,newPresences:o})}),this.onLeave((a,i,o)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,a){const i=this.cloneDeep(t),o=this.transformState(n),l={},c={};return this.map(i,(d,u)=>{o[d]||(c[d]=u)}),this.map(o,(d,u)=>{const h=i[d];if(h){const p=u.map(y=>y.presence_ref),m=h.map(y=>y.presence_ref),b=u.filter(y=>m.indexOf(y.presence_ref)<0),g=h.filter(y=>p.indexOf(y.presence_ref)<0);b.length>0&&(l[d]=b),g.length>0&&(c[d]=g)}else l[d]=u}),this.syncDiff(i,{joins:l,leaves:c},r,a)}static syncDiff(t,n,r,a){const{joins:i,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),a||(a=()=>{}),this.map(i,(l,c)=>{var d;const u=(d=t[l])!==null&&d!==void 0?d:[];if(t[l]=this.cloneDeep(c),u.length>0){const h=t[l].map(m=>m.presence_ref),p=u.filter(m=>h.indexOf(m.presence_ref)<0);t[l].unshift(...p)}r(l,u,c)}),this.map(o,(l,c)=>{let d=t[l];if(!d)return;const u=c.map(h=>h.presence_ref);d=d.filter(h=>u.indexOf(h.presence_ref)<0),t[l]=d,a(l,d,c),d.length===0&&delete t[l]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const a=t[r];return"metas"in a?n[r]=a.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):n[r]=a,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var sj;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(sj||(sj={}));var Gl;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Gl||(Gl={}));var Gr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Gr||(Gr={}));class sv{constructor(t,n={config:{}},r){var a,i;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=ft.closed,this.joinedOnce=!1,this.pushBuffer=[],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.timeout=this.socket.timeout,this.joinPush=new Am(this,sr.join,this.params,this.timeout),this.rejoinTimer=new Q_(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=ft.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=ft.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=ft.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=ft.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=ft.errored,this.rejoinTimer.scheduleTimeout())}),this._on(sr.reply,{},(o,l)=>{this._trigger(this._replyEventName(l),o)}),this.presence=new Kl(this),this.broadcastEndpointURL=X_(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(a=this.params.config)===null||a===void 0?void 0:a.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var r,a,i;if(this.socket.isConnected()||this.socket.connect(),this.state==ft.closed){const{config:{broadcast:o,presence:l,private:c}}=this.params,d=(a=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(m=>m.filter))!==null&&a!==void 0?a:[],u=!!this.bindings[Gl.PRESENCE]&&this.bindings[Gl.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,h={},p={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:u}),postgres_changes:d,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(m=>t==null?void 0:t(Gr.CHANNEL_ERROR,m)),this._onClose(()=>t==null?void 0:t(Gr.CLOSED)),this.updateJoinPayload(Object.assign({config:p},h)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:m})=>{var b;if(this.socket.setAuth(),m===void 0){t==null||t(Gr.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,y=(b=g==null?void 0:g.length)!==null&&b!==void 0?b:0,x=[];for(let w=0;w<y;w++){const v=g[w],{filter:{event:j,schema:N,table:S,filter:k}}=v,C=m&&m[w];if(C&&C.event===j&&C.schema===N&&C.table===S&&C.filter===k)x.push(Object.assign(Object.assign({},v),{id:C.id}));else{this.unsubscribe(),this.state=ft.errored,t==null||t(Gr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,t&&t(Gr.SUBSCRIBED);return}}).receive("error",m=>{this.state=ft.errored,t==null||t(Gr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(m).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Gr.TIMED_OUT)})}return this}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){return this.state===ft.joined&&t===Gl.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(t,n,r)}async send(t,n={}){var r,a;if(!this._canPush()&&t.type==="broadcast"){const{event:i,payload:o}=t,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((a=d.body)===null||a===void 0?void 0:a.cancel()),d.ok?"ok":"error"}catch(d){return d.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,l,c;const d=this._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"),d.receive("ok",()=>i("ok")),d.receive("error",()=>i("error")),d.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=ft.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(sr.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(a=>{r=new Am(this,sr.leave,{},t),r.receive("ok",()=>{n(),a("ok")}).receive("timeout",()=>{n(),a("timed out")}).receive("error",()=>{a("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=ft.closed,this.bindings={}}async _fetchWithTimeout(t,n,r){const a=new AbortController,i=setTimeout(()=>a.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:a.signal}));return clearTimeout(i),o}_push(t,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new Am(this,t,n,r);return this._canPush()?a.send():this._addToPushBuffer(a),a}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>PB){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var a,i;const o=t.toLocaleLowerCase(),{close:l,error:c,leave:d,join:u}=sr;if(r&&[l,c,d,u].indexOf(o)>=0&&r!==this._joinRef())return;let p=this._onMessage(o,n,r);if(n&&!p)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(m=>{var b,g,y;return((b=m.filter)===null||b===void 0?void 0:b.event)==="*"||((y=(g=m.filter)===null||g===void 0?void 0:g.event)===null||y===void 0?void 0:y.toLocaleLowerCase())===o}).map(m=>m.callback(p,r)):(i=this.bindings[o])===null||i===void 0||i.filter(m=>{var b,g,y,x,w,v;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in m){const j=m.id,N=(b=m.filter)===null||b===void 0?void 0:b.event;return j&&((g=n.ids)===null||g===void 0?void 0:g.includes(j))&&(N==="*"||(N==null?void 0:N.toLocaleLowerCase())===((y=n.data)===null||y===void 0?void 0:y.type.toLocaleLowerCase()))}else{const j=(w=(x=m==null?void 0:m.filter)===null||x===void 0?void 0:x.event)===null||w===void 0?void 0:w.toLocaleLowerCase();return j==="*"||j===((v=n==null?void 0:n.event)===null||v===void 0?void 0:v.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===o}).map(m=>{if(typeof p=="object"&&"ids"in p){const b=p.data,{schema:g,table:y,commit_timestamp:x,type:w,errors:v}=b;p=Object.assign(Object.assign({},{schema:g,table:y,commit_timestamp:x,eventType:w,new:{},old:{},errors:v}),this._getPayloadRecords(b))}m.callback(p,r)})}_isClosed(){return this.state===ft.closed}_isJoined(){return this.state===ft.joined}_isJoining(){return this.state===ft.joining}_isLeaving(){return this.state===ft.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const a=t.toLocaleLowerCase(),i={type:a,filter:n,callback:r};return this.bindings[a]?this.bindings[a].push(i):this.bindings[a]=[i],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(a=>{var i;return!(((i=a.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===r&&sv.isEqual(a.filter,n))})),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const r in t)if(t[r]!==n[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(sr.close,{},t)}_onError(t){this._on(sr.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=ft.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=nj(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=nj(t.columns,t.old_record)),n}}const Rm=()=>{},Hd={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},LB=[1e3,2e3,5e3,1e4],FB=1e4,$B=`
526  addEventListener("message", (e) => {
527    if (e.data.event === "start") {
528      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
529    }
530  });`;class UB{constructor(t,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Dg,this.transport=null,this.heartbeatIntervalMs=Hd.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Rm,this.ref=0,this.reconnectTimer=null,this.logger=Rm,this.conn=null,this.sendBuffer=[],this.serializer
530=new TB,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=a=>{let i;return a?i=a:typeof fetch>"u"?i=(...o)=>qa(async()=>{const{default:l}=await Promise.resolve().then(()=>Vo);return{default:l}},void 0).then(({default:l})=>l(...o)).catch(l=>{throw new Error(`Failed to load @supabase/node-fetch: ${l.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):i=fetch,(...o)=>i(...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,this.endPoint=`${t}/${Lg.websocket}`,this.httpEndpoint=X_(t),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=SB.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const n=t.message;throw n.includes("Node.js")?new Error(`${n}
531
532To use Realtime in Node.js, you need to provide a WebSocket implementation:
533
534Option 1: Use Node.js 22+ which has native WebSocket support
535Option 2: Install and provide the "ws" package:
536
537  npm install ws
538
539  import ws from "ws"
540  const client = new RealtimeClient(url, {
541    ...options,
542    transport: ws
543  })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:_B}))}disconnect(t,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},t?this.conn.close(t,n??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,n,r){this.logger(t,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case Hl.connecting:return ba.Connecting;case Hl.open:return ba.Open;case Hl.closing:return ba.Closing;default:return ba.Closed}}isConnected(){return this.connectionState()===ba.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,n={config:{}}){const r=`realtime:${t}`,a=this.getChannels().find(i=>i.topic===r);if(a)return a;{const i=new sv(`realtime:${t}`,n,this);return this.channels.push(i),i}}push(t){const{topic:n,event:r,payload:a,ref:i}=t,o=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${n} ${r} (${i})`,a),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(EB,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},Hd.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,n=>
543{if(n.topic==="phoenix"&&n.event==="phx_reply")try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error")}catch(d){this.log("error","error in heartbeat callback",d)}n.ref&&n.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:r,event:a,payload:i,ref:o}=n,l=o?`(${o})`:"",c=i.status||"";this.log("receive",`${c} ${r} ${a} ${l}`.trim(),i),this.channels.filter(d=>d._isMember(r)).forEach(d=>d._trigger(a,i,o)),this._triggerStateCallbacks("message",n)})}_clearTimer(t){var n;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),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))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_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.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){var n;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(sr.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",a=new URLSearchParams(n);return`${t}${r}${a}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([$B],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(t,n=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(t=null){let n;t?n=t:this.accessToken?n=await this.accessToken():n=this.accessTokenValue,this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(r=>{const a={access_token:n,version:CB};n&&r.updateJoinPayload(a),r.joinedOnce&&r._isJoined()&&r._push(sr.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this.setAuth().catch(n=>{this.log("error",`error setting auth in ${t}`,n)})}_triggerStateCallbacks(t,n){try{this.stateChangeCallbacks[t].forEach(r=>{try{r(n)}catch(a){this.log("error",`error in ${t} callback`,a)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new Q_(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Hd.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var n,r,a,i,o,l,c,d,u;if(this.transport=(n=t==null?void 0:t.transport)!==null&&n!==void 0?n:null,this.timeout=(r=t==null?void 0:t.t
543imeout)!==null&&r!==void 0?r:Dg,this.heartbeatIntervalMs=(a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:Hd.HEARTBEAT_INTERVAL,this.worker=(i=t==null?void 0:t.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=t==null?void 0:t.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(l=t==null?void 0:t.heartbeatCallback)!==null&&l!==void 0?l:Rm,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(c=t==null?void 0:t.reconnectAfterMs)!==null&&c!==void 0?c:h=>LB[h-1]||FB,this.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:(h,p)=>p(JSON.stringify(h)),this.decode=(u=t==null?void 0:t.decode)!==null&&u!==void 0?u:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}class av extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function ct(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class BB extends av{constructor(t,n,r){super(t),this.name="StorageApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class $g extends av{constructor(t,n){super(t),this.name="StorageUnknownError",this.originalError=n}}var VB=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(h){o(h)}}function c(u){try{d(r.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};const Z_=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>qa(async()=>{const{default:r}=await Promise.resolve().then(()=>Vo);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},zB=()=>VB(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield qa(()=>Promise.resolve().then(()=>Vo),void 0)).Response:Response}),Ug=e=>{if(Array.isArray(e))return e.map(n=>Ug(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const a=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[a]=Ug(r)}),t},WB=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)};var ii=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(h){o(h)}}function c(u){try{d(r.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};const Im=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),HB=(e,t,n)=>ii(void 0,void 0,void 0,function*(){const r=yield zB();e instanceof r&&!(n!=null&&n.noResolveJson)?e.json().then(a=>{const i=e.status||500,o=(a==null?void 0:a.statusCode)||i+"";t(new BB(Im(a),i,o))}).catch(a=>{t(new $g(Im(a),a))}):t(new $g(Im(e),e))}),KB=(e,t,n,r)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!r?a:(WB(r)?(a.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(r)):a.body=r,t!=null&&t.duplex&&(a.duplex=t.duplex),Object.assign(Object.assign({},a),n))};function td(e,t,n,r,a,i){return ii(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(n,KB(t,r,a,i)).then(c=>{if(!c.ok)throw c;return r!=null&&r.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>HB(c,l,r))})})}function lh(e,t,n,r){return ii(this,void 0,void 0,function*(){return td(e,"GET",t,n,r)})}function Nr(e,t,n,r,a){return ii(this,void 0,void 0,function*(){return td(e,"POST",t,r,a,n)})}function Bg(e,t,n,r,a){return ii(this,void 0,void 0,function*(){return td(e,"PUT",t,r,a,n)})}function GB(e,t,n,r){return ii(this,void 0,void 0,function*(){return td(e,"HEAD",t,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function e2(e,t,n,r,a){return ii(this,void 0,void 0,function*(){return td(e,"DELETE",t,r,a,n)})}var qB=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}
543return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(h){o(h)}}function c(u){try{d(r.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};class YB{constructor(t,n){this.downloadFn=t,this.shouldThrowOnError=n}then(t,n){return this.execute().then(t,n)}execute(){return qB(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(ct(t))return{data:null,error:t};throw t}})}}var QB=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(h){o(h)}}function c(u){try{d(r.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})},t2;class JB{constructor(t,n){this.downloadFn=t,this.shouldThrowOnError=n,this[t2]="BlobDownloadBuilder",this.promise=null}asStream(){return new YB(this.downloadFn,this.shouldThrowOnError)}then(t,n){return this.getPromise().then(t,n)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return QB(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(ct(t))return{data:null,error:t};throw t}})}}t2=Symbol.toStringTag;var Zt=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(h){o(h)}}function c(u){try{d(r.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};const XB={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},aj={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class ZB{constructor(t,n={},r,a){this.shouldThrowOnError=!1,this.url=t,this.headers=n,this.bucketId=r,this.fetch=Z_(a)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(t,n,r,a){return Zt(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},aj),a);let l=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c))):(i=r,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),a!=null&&a.headers&&(l=Object.assign(Object.assign({},l),a.headers));const d=this._removeEmptyFolders(n),u=this._getFinalPath(d),h=yield(t=="PUT"?Bg:Nr)(this.fetch,`${this.url}/object/${u}`,i,Object.assign({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:d,id:h.Id,fullPath:h.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(ct(i))return{data:null,error:i};throw i}})}upload(t,n,r){return Zt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,n,r)})}uploadToSignedUrl(t,n,r,a){return Zt(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(t),o=this._getFinalPath(i),l=new URL(this.url+`/object/upload/sign/${o}`);l.searchParams.set("token",n);try{let c;const d=Object.assign({upsert:aj.upsert},a),u=Object.assign(Object.assign({},this.headers),{"x-upsert":String(d.upsert)});typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",d.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",d.cacheControl)):(c=r,u["cache-control"]=`max-age=${d.cacheControl}`,u["content-type"]=d.contentType);const h=yield Bg(this.fetch,l.toString(),c,{headers:u});return{data:{path:i,fullPath:h.Key},error:null}}catch(c){if(this.shouldThrowOnError)throw c;if(ct(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(t,n){return Zt(this,void 0,void 0,function*(){try{let r=this._getFinalPath(t);const a=Object.assign({},this.headers);n!=null&&n.upsert&&(a["x-upsert"]="true");const i=yield Nr(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:a}),o=new URL(this.url+i.url),l=o.searchParams.get("token");if(!l)throw new av("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:l},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ct(r))return{data:null,error:r};throw r}})}update(t,n,r){return Zt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,n,r)})}move(t,n,r){return Zt(this,void 0,void 0,function*(){try{return{data:yield Nr(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ct(a))return{data:null,error:a};throw a}})}copy(t,n,r){return Zt(this,void 0,void 0,function*(){try{return{data:{path:(yield Nr(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ct(a))return{data:null,error:a};throw a}})}createSignedUrl(t,n,r){return Zt(this,void 0,void 0,function*(){try{let a=this._getFinalPath(t),i=yield Nr(this.fetch,`${this.url}/object/sign/${a}
543`,Object.assign({expiresIn:n},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ct(a))return{data:null,error:a};throw a}})}createSignedUrls(t,n,r){return Zt(this,void 0,void 0,function*(){try{const a=yield Nr(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:t},{headers:this.headers}),i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:a.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ct(a))return{data:null,error:a};throw a}})}download(t,n){const a=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),o=i?`?${i}`:"",l=this._getFinalPath(t),c=()=>lh(this.fetch,`${this.url}/${a}/${l}${o}`,{headers:this.headers,noResolveJson:!0});return new JB(c,this.shouldThrowOnError)}info(t){return Zt(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{const r=yield lh(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:Ug(r),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ct(r))return{data:null,error:r};throw r}})}exists(t){return Zt(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{return yield GB(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ct(r)&&r instanceof $g){const a=r.originalError;if([400,404].includes(a==null?void 0:a.status))return{data:!1,error:r}}throw r}})}getPublicUrl(t,n){const r=this._getFinalPath(t),a=[],i=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";i!==""&&a.push(i);const l=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});c!==""&&a.push(c);let d=a.join("&");return d!==""&&(d=`?${d}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${r}${d}`)}}}remove(t){return Zt(this,void 0,void 0,function*(){try{return{data:yield e2(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ct(n))return{data:null,error:n};throw n}})}list(t,n,r){return Zt(this,void 0,void 0,function*(){try{const a=Object.assign(Object.assign(Object.assign({},XB),n),{prefix:t||""});return{data:yield Nr(this.fetch,`${this.url}/object/list/${this.bucketId}`,a,{headers:this.headers},r),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ct(a))return{data:null,error:a};throw a}})}listV2(t,n){return Zt(this,void 0,void 0,function*(){try{const r=Object.assign({},t);return{data:yield Nr(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,r,{headers:this.headers},n),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ct(r))return{data:null,error:r};throw r}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const n=[];return t.width&&n.push(`width=${t.width}`),t.height&&n.push(`height=${t.height}`),t.resize&&n.push(`resize=${t.resize}`),t.format&&n.push(`format=${t.format}`),t.quality&&n.push(`quality=${t.quality}`),n.join("&")}}const e8="2.75.1",t8={"X-Client-Info":`storage-js/${e8}`};var ui=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(h){o(h)}}function c(u){try{d(r.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};class n8{constructor(t,n={},r,a){this.shouldThrowOnError=!1;const i=new URL(t);a!=null&&a.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},t8),n),this.fetch=Z_(r)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(){return ui(this,void 0,void 0,function*(){try{return{data:yield lh(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(ct(t))return{data:null,error:t};throw t}})}getBucket(t){return ui(this,void 0,void 0,function*(){try{return{data:yield lh(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ct(n))return{data:null,error:n};throw n}})}createBucket(t){return ui(this,arguments,void 0,function*(n,r={public:!1}){try{return{data:yield Nr(this.fetch,`${this.url}/bucket`,{id:n,name:n,type:r.type,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ct(a))return{data:null,error:a};throw a}})}updateBucket(t,n){return ui(this,void 0,void 0,function*(){try{return{data:yield Bg(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ct(r))return{data:null,error:r};throw r}})}emptyBucket(t){return ui(this,void 0,void 0,function*(){try{return{data:yield Nr(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ct(n))return{data:null,error:n};throw n}})}deleteBucket(t){return ui(this,void 0,void 0,function*(){try{return{data:yield e2(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ct(n))return{data:null,error:n};throw n}})}}class r8 extends n8{constructor(t,n={},r,a){super(t,n,r,a)}from(t){return new ZB(this.url,this.headers,t,this.fetch)}}const s8="2.75.1";let kl="";typeof Deno<"u"?kl="deno":typeof document<"u"?kl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?kl="react-native":kl="node";const a8={"X-Client-Info":`supabase-js-${kl}/${s8}`},i8={headers:a8},o8={schema:"public"},l8={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},c8={};var d8=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}
543return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(h){o(h)}}function c(u){try{d(r.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};const u8=e=>{let t;return e?t=e:typeof fetch>"u"?t=$_:t=fetch,(...n)=>t(...n)},h8=()=>typeof Headers>"u"?U_:Headers,f8=(e,t,n)=>{const r=u8(n),a=h8();return(i,o)=>d8(void 0,void 0,void 0,function*(){var l;const c=(l=yield t())!==null&&l!==void 0?l:e;let d=new a(o==null?void 0:o.headers);return d.has("apikey")||d.set("apikey",e),d.has("Authorization")||d.set("Authorization",`Bearer ${c}`),r(i,Object.assign(Object.assign({},o),{headers:d}))})};var m8=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(h){o(h)}}function c(u){try{d(r.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};function p8(e){return e.endsWith("/")?e:e+"/"}function g8(e,t){var n,r;const{db:a,auth:i,realtime:o,global:l}=e,{db:c,auth:d,realtime:u,global:h}=t,p={db:Object.assign(Object.assign({},c),a),auth:Object.assign(Object.assign({},d),i),realtime:Object.assign(Object.assign({},u),o),storage:{},global:Object.assign(Object.assign(Object.assign({},h),l),{headers:Object.assign(Object.assign({},(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{}),(r=l==null?void 0:l.headers)!==null&&r!==void 0?r:{})}),accessToken:()=>m8(this,void 0,void 0,function*(){return""})};return e.accessToken?p.accessToken=e.accessToken:delete p.accessToken,p}function x8(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(p8(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const n2="2.75.1",ji=30*1e3,Vg=3,Mm=Vg*ji,y8="http://localhost:9999",v8="supabase.auth.token",w8={"X-Client-Info":`gotrue-js/${n2}`},zg="X-Supabase-Api-Version",r2={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},b8=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,j8=10*60*1e3;class Ec extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function oe(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class N8 extends Ec{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function S8(e){return oe(e)&&e.name==="AuthApiError"}class ja extends Ec{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class oa extends Ec{constructor(t,n,r,a){super(t,r,a),this.name=n,this.status=r}}class bs extends oa{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function k8(e){return oe(e)&&e.name==="AuthSessionMissingError"}class hi extends oa{constructor(){super("Auth session or user missing","AuthInvalidToken
543ResponseError",500,void 0)}}class Kd extends oa{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Gd extends oa{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function C8(e){return oe(e)&&e.name==="AuthImplicitGrantRedirectError"}class ij extends oa{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Wg extends oa{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Om(e){return oe(e)&&e.name==="AuthRetryableFetchError"}class oj extends oa{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class Hg extends oa{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const ch="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),lj=` 	
544\r=`.split(""),_8=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<lj.length;t+=1)e[lj[t].charCodeAt(0)]=-2;for(let t=0;t<ch.length;t+=1)e[ch[t].charCodeAt(0)]=t;return e})();function cj(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(ch[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(ch[r]),t.queuedBits-=6}}function s2(e,t,n){const r=_8[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 dj(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},i=o=>{T8(o,r,n)};for(let o=0;o<e.length;o+=1)s2(e.charCodeAt(o),a,i);return t.join("")}function E8(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 P8(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const a=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|a)+65536,n+=1}E8(r,t)}}function T8(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 Zi(e){const t=[],n={queue:0,queuedBits:0},r=a=>{t.push(a)};for(let a=0;a<e.length;a+=1)s2(e.charCodeAt(a),n,r);return new Uint8Array(t)}function A8(e){const t=[];return P8(e,n=>t.push(n)),new Uint8Array(t)}function Ea(e){const t=[],n={queue:0,queuedBits:0},r=a=>{t.push(a)};return e.forEach(a=>cj(a,n,r)),cj(null,n,r),t.join("")}function R8(e){return Math.round(Date.now()/1e3)+e}function I8(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const gn=()=>typeof window<"u"&&typeof document<"u",ma={tested:!1,writable:!1},a2=()=>{if(!gn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ma.tested)return ma.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),ma.tested=!0,ma.writable=!0}catch{ma.tested=!0,ma.writable=!1}return ma.writable};function M8(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((a,i)=>{t[i]=a})}catch{}return n.searchParams.forEach((r,a)=>{t[a]=r}),t}const i2=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>qa(async()=>{const{default:r}=await Promise.resolve().then(()=>Vo);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},O8=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Ni=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},pa=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},xs=async(e,t)=>{await e.removeItem(t)};class of{constructor(){this.promise=new of.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}of.promiseConstructor=Promise;function Dm(e){const t=e.split(".");if(t.length!==3)throw new Hg("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!b8.test(t[r]))throw new Hg("JWT not in base64url format");return{header:JSON.parse(dj(t[0])),payload:JSON.parse(dj(t[1])),signature:Zi(t[2]),raw:{header:t[0],payload:t[1]}}}async function D8(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function L8(e,t){return new Promise((r,a)=>{(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)){a(o);return}}})()})}function F8(e){return("0"+e.toString(16)).substr(-2)}function $8(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let a="";for(let i=0;i<56;i++)a+=n.charAt(Math.floor(Math.random()*r));return a}return crypto.getRandomValues(t),Array.from(t,F8).join("")}async function U8(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",
544n),a=new Uint8Array(r);return Array.from(a).map(i=>String.fromCharCode(i)).join("")}async function B8(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 U8(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function fi(e,t,n=!1){const r=$8();let a=r;n&&(a+="/PASSWORD_RECOVERY"),await Ni(e,`${t}-code-verifier`,a);const i=await B8(r);return[i,r===i?"plain":"s256"]}const V8=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function z8(e){const t=e.headers.get(zg);if(!t||!t.match(V8))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function W8(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 H8(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 K8=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function mi(e){if(!K8.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Lm(){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 uj(e){return JSON.parse(JSON.stringify(e))}var G8=function(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};const va=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),q8=[502,503,504];async function hj(e){var t;if(!O8(e))throw new Wg(va(e),0);if(q8.includes(e.status))throw new Wg(va(e),e.status);let n;try{n=await e.json()}catch(i){throw new ja(va(i),i)}let r;const a=z8(e);if(a&&a.getTime()>=r2["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 oj(va(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new bs}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)=>i&&typeof o=="string",!0))throw new oj(va(n),e.status,n.weak_password.reasons);throw new N8(va(n),e.status||500,r)}const Y8=(e,t,n,r)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),a.body=JSON.stringify(r),Object.assign(Object.assign({},a),n))};async function fe(e,t,n,r){var a;const i=Object.assign({},r==null?void 0:r.headers);i[zg]||(i[zg]=r2["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(a=r==null?void 0:r.query)!==null&&a!==void 0?a:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await Q8(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 Q8(e,t,n,r,a,i){const o=Y8(t,r,a,i);let l;try{l=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new Wg(va(c),0)}if(l.ok||await hj(l),r!=null&&r.noResolveJson)return l;try{return await l.json()}catch(c){await hj(c)}}function Qn(e){var t;let n=null;Z8(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=R8(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function fj(e){const t=Qn(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 _s(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function J8(e){return{data:e,error:null}}function X8(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:a,verification_type:i}=e,o=G8(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:r,redirect_to:a,verification_type:i},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function mj(e){return e}function Z8(e){return e.access_token&&e.refresh_token&&e.expires_in}const Fm=["global","local","others"];var eV=function(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};class tV{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=i2(r),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),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,n=Fm[0]){if(Fm.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Fm.join(", ")}`);try{return await fe(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(oe(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await fe(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:_s})}catch(r){if(oe(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=eV(t,["options"]),a=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(a.new_email=r==null?void 0:r.newEmail,delete a.newEmail),await fe(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:X8,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(oe(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await fe(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:_s})}catch(n){if(oe(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,a,i,o,l,c;try{const d={nextPage:null,lastPage:0,total:0},u=await fe(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=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:mj});if(u.error)throw u.error;const h=await u.json(),p=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(b=>{const g=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(b.split(";")[1].split("=")[1]);d[`${y}Page`]=g}),d.total=parseInt(p)),{data:Object.assign(Object.assign({},h),d),error:null}}
544catch(d){if(oe(d))return{data:{users:[]},error:d};throw d}}async getUserById(t){mi(t);try{return await fe(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:_s})}catch(n){if(oe(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){mi(t);try{return await fe(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:_s})}catch(r){if(oe(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){mi(t);try{return await fe(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:_s})}catch(r){if(oe(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){mi(t.userId);try{const{data:n,error:r}=await fe(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:n,error:r}}catch(n){if(oe(n))return{data:null,error:n};throw n}}async _deleteFactor(t){mi(t.userId),mi(t.id);try{return{data:await fe(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(oe(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,a,i,o,l,c;try{const d={nextPage:null,lastPage:0,total:0},u=await fe(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=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:mj});if(u.error)throw u.error;const h=await u.json(),p=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(b=>{const g=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(b.split(";")[1].split("=")[1]);d[`${y}Page`]=g}),d.total=parseInt(p)),{data:Object.assign(Object.assign({},h),d),error:null}}catch(d){if(oe(d))return{data:{clients:[]},error:d};throw d}}async _createOAuthClient(t){try{return await fe(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(oe(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await fe(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(oe(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await fe(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(oe(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await fe(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(oe(n))return{data:null,error:n};throw n}}}function pj(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const pi={debug:!!(globalThis&&a2()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class o2 extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class nV extends o2{}async function rV(e,t,n){pi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),pi.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async a=>{if(a){pi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await n()}finally{pi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw pi.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new nV(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(pi.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null,"  "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}function sV(){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 l2(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}
544" is invalid.`);return e.toLowerCase()}function aV(e){return parseInt(e,16)}function iV(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function oV(e){var t;const{chainId:n,domain:r,expirationTime:a,issuedAt:i=new Date,nonce:o,notBefore:l,requestId:c,resources:d,scheme:u,uri:h,version:p}=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(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
545`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const m=l2(e.address),b=u?`${u}://${r}
545`:r,g=e.statement?`${e.statement}
546`:"",y=`${b} wants you to sign in with your Ethereum account:
547${m}
548
549${g}`;let x=`URI: ${h}
550Version: ${p}
551Chain ID: ${n}${o?`
552Nonce: ${o}`:""}
553Issued At: ${i.toISOString()}`;if(a&&(x+=`
554Expiration Time: ${a.toISOString()}`),l&&(x+=`
555Not Before: ${l.toISOString()}`),c&&(x+=`
556Request ID: ${c}`),d){let w=`
557Resources:`;for(const v of d){if(!v||typeof v!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${v}`);w+=`
558- ${v}`}x+=w}return`${y}
559${x}`}class lt extends Error{constructor({message:t,code:n,cause:r,name:a}){var i;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(i=a??(r instanceof Error?r.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=n}}class dh extends lt{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function lV({error:e,options:t}){var n,r,a;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 lt({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 lt({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 lt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((a=i.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new lt({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 lt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new lt({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 lt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new lt({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(d2(o)){if(i.rp.id!==o)return new lt({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new lt({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 lt({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 lt({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 lt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function cV({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 lt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new lt({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(d2(r)){if(n.rpId!==r)return new lt({message:`The RP ID "${n.rpId}
559" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new lt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new lt({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 lt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}var c2=function(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};class dV{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 uV=new dV;function hV(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,a=c2(e,["challenge","user","excludeCredentials"]),i=Zi(t).buffer,o=Object.assign(Object.assign({},n),{id:Zi(n.id).buffer}),l=Object.assign(Object.assign({},a),{challenge:i,user:o});if(r&&r.length>0){l.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const d=r[c];l.excludeCredentials[c]=Object.assign(Object.assign({},d),{id:Zi(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return l}function fV(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=c2(e,["challenge","allowCredentials"]),a=Zi(t).buffer,i=Object.assign(Object.assign({},r),{challenge:a});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:Zi(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return i}function mV(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:Ea(new Uint8Array(e.response.attestationObject)),clientDataJSON:Ea(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function pV(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),a=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Ea(new Uint8Array(a.authenticatorData)),clientDataJSON:Ea(new Uint8Array(a.clientDataJSON)),signature:Ea(new Uint8Array(a.signature)),userHandle:a.userHandle?Ea(new Uint8Array(a.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function d2(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function gj(){var e,t;return!!(gn()&&"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 gV(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new dh("Browser returned unexpected credential type",t)}:{data:null,error:new dh("Empty credential response",t)}}
559catch(t){return{data:null,error:lV({error:t,options:e})}}}async function xV(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new dh("Browser returned unexpected credential type",t)}:{data:null,error:new dh("Empty credential response",t)}}catch(t){return{data:null,error:cV({error:t,options:e})}}}const yV={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"none"},vV={userVerification:"preferred",hints:["security-key"]};function uh(...e){const t=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),n=a=>a instanceof ArrayBuffer||ArrayBuffer.isView(a),r={};for(const a of e)if(a)for(const i in a){const o=a[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]=uh(l,o):r[i]=uh(o)}else r[i]=o}return r}function wV(e,t){return uh(yV,e,t||{})}function bV(e,t){return uh(vV,e,t||{})}class jV{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:a},i){try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!o)return{data:null,error:l};const c=a??uV.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:d}=o.webauthn.credential_options.publicKey;d.name||(d.name=`${d.id}:${r}`),d.displayName||(d.displayName=d.name)}switch(o.webauthn.type){case"create":{const d=wV(o.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:u,error:h}=await gV({publicKey:d,signal:c});return u?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:u}},error:null}:{data:null,error:h}}case"request":{const d=bV(o.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:u,error:h}=await xV(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:d,signal:c}));return u?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:u}},error:null}:{data:null,error:h}}}}catch(o){return oe(o)?{data:null,error:o}:{data:null,error:new ja("Unexpected error in challenge",o)}}}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:a}},i){if(!n)return{data:null,error:new Ec("rpId is required for WebAuthn authentication")};try{if(!gj())return{data:null,error:new ja("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:a},{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 oe(o)?{data:null,error:o}:{data:null,error:new ja("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:a},i){if(!n)return{data:null,error:new Ec("rpId is required for WebAuthn registration")};try{if(!gj())return{data:null,error:new ja("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(u=>{var h;return(h=u.data)===null||h===void 0?void 0:h.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===t&&p.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:l};const{data:c,error:d}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:a},{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:d}}catch(o){return oe(o)?{data:null,error:o}:{data:null,error:new ja("Unexpected error in register",o)}}}}sV();const NV={url:y8,storageKey:v8,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:w8,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function xj(e,t,n){return await n()}const gi={};class Pc{get jwks(){var t,n;return(n=(t=gi[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){gi[this.storageKey]=Object.assign(Object.assign({},gi[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=gi[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){gi[this.storageKey]=Object.assign(Object.assign({},gi[this.storageKey]),{cachedAt:t})}constructor(t){var n,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=Pc.nextInstanceID,Pc.nextInstanceID+=1,this.instanceID>0&&gn()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const a=Object.assign(Object.assign({},NV),t);
559if(this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.persistSession=a.persistSession,this.storageKey=a.storageKey,this.autoRefreshToken=a.autoRefreshToken,this.admin=new tV({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=i2(a.fetch),this.lock=a.lock||xj,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,a.lock?this.lock=a.lock:gn()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=rV:this.lock=xj,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 jV(this)},this.persistSession?(a.storage?this.storage=a.storage:a2()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=pj(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=pj(this.memoryStorage)),gn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${n2}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{const n=M8(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),gn()&&this.detectSessionInUrl&&r!=="none"){const{data:a,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),C8(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 await this._removeSession(),{error:i}}const{session:o,redirectType:l}=a;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 oe(n)?{error:n}:{error:new ja("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,a;try{const i=await fe(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:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}},xform:Qn}),{data:o,error:l}=i;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(i){if(oe(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(t){var n,r,a;try{let i;if("email"in t){const{email:u,password:h,options:p}=t;let m=null,b=null;this.flowType==="pkce"&&([m,b]=await fi(this.storage,this.storageKey)),i=await fe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:u,password:h,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:m,code_challenge_method:b},xform:Qn})}else if("phone"in t){const{phone:u,password:h,options:p}=t;i=await fe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:h,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},channel:(a=p==null?void 0:p.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:Qn})}else throw new Kd("You must provide either an email or phone number and a password");const{data:o,error:l}=i;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(i){if(oe(i))return{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 fe(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:fj})}else if("phone"in t){const{phone:i,password:o,options:l}=t;n=await fe(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:fj})}else throw new Kd("You must provide either an email or phone number and a password");const{data:r,error:a}=n;return a?{data:{user:null,session:null},error:a}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new hi}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:a})}catch(n){if(oe(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(t){var n,r,a,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:(a=t.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,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,a,i,o,l,c,d,u,h,p;let m,b;if("message"in t)m=t.message,b=t.signature;else{const{chain:g,wallet:y,statement:x,options:w}=t;let v;if(gn())if(typeof y=="object")v=y;else{const A=window;if("ethereum"in A&&typeof A.ethereum=="object"&&"request"in A.ethereum&&typeof A.ethereum.request=="function")v=A.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 y!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");v=y}const j=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href),N=await v.request({method:"eth_requestAccounts"}).then(A=>A).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!N||N.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const S=l2(N[0]);let k=(r=w==null?void 0:w.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!k){const A=await v.request({method:"eth_chainId"});k=aV(A)}const C={domain:j.host,address:S,statement:x,uri:j.href,version:"1",chainId:k,nonce:(a=w==null?void 0:w.signInWithEthereum)===null||a===void 0?void 0:a.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:(d=w==null?void 0:w.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(u=w==null?void 0:w.signInWithEthereum)===null||u===void 0?void 0:u.resources};m=oV(C),b=await v.request({method:"personal_sign",params:[iV(m),S]})}try{const{data:g,error:y}=await fe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:b}
559,!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Qn});if(y)throw y;return!g||!g.session||!g.user?{data:{user:null,session:null},error:new hi}:(g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),{data:Object.assign({},g),error:y})}catch(g){if(oe(g))return{data:{user:null,session:null},error:g};throw g}}async signInWithSolana(t){var n,r,a,i,o,l,c,d,u,h,p,m;let b,g;if("message"in t)b=t.message,g=t.signature;else{const{chain:y,wallet:x,statement:w,options:v}=t;let j;if(gn())if(typeof x=="object")j=x;else{const S=window;if("solana"in S&&typeof S.solana=="object"&&("signIn"in S.solana&&typeof S.solana.signIn=="function"||"signMessage"in S.solana&&typeof S.solana.signMessage=="function"))j=S.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 x!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=x}const N=new URL((n=v==null?void 0:v.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in j&&j.signIn){const S=await j.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},v==null?void 0:v.signInWithSolana),{version:"1",domain:N.host,uri:N.href}),w?{statement:w}:null));let k;if(Array.isArray(S)&&S[0]&&typeof S[0]=="object")k=S[0];else if(S&&typeof S=="object"&&"signedMessage"in S&&"signature"in S)k=S;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)b=typeof k.signedMessage=="string"?k.signedMessage:new TextDecoder().decode(k.signedMessage),g=k.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in j)||typeof j.signMessage!="function"||!("publicKey"in j)||typeof j!="object"||!j.publicKey||!("toBase58"in j.publicKey)||typeof j.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");b=[`${N.host} wants you to sign in with your Solana account:`,j.publicKey.toBase58(),...w?["",w,""]:[""],"Version: 1",`URI: ${N.href}`,`Issued At: ${(a=(r=v==null?void 0:v.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((i=v==null?void 0:v.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${v.signInWithSolana.notBefore}`]:[],...!((o=v==null?void 0:v.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${v.signInWithSolana.expirationTime}`]:[],...!((l=v==null?void 0:v.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${v.signInWithSolana.chainId}`]:[],...!((c=v==null?void 0:v.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${v.signInWithSolana.nonce}`]:[],...!((d=v==null?void 0:v.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${v.signInWithSolana.requestId}`]:[],...!((h=(u=v==null?void 0:v.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||h===void 0)&&h.length?["Resources",...v.signInWithSolana.resources.map(k=>`- ${k}`)]:[]].join(`
560`);const S=await j.signMessage(new TextEncoder().encode(b),"utf8");if(!S||!(S instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=S}}try{const{data:y,error:x}=await fe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:b,signature:Ea(g)},!((p=t.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:Qn});if(x)throw x;return!y||!y.session||!y.user?{data:{user:null,session:null},error:new hi}:(y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),{data:Object.assign({},y),error:x})}catch(y){if(oe(y))return{data:{user:null,session:null},error:y};throw y}}async _exchangeCodeForSession(t){const n=await pa(this.storage,`${this.storageKey}-code-verifier`),[r,a]=(n??"").split("/");try{const{data:i,error:o}=await fe(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Qn});if(await xs(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new hi}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:a??null}),error:o})}catch(i){if(oe(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(t){try{const{options:n,provider:r,token:a,access_token:i,nonce:o}=t,l=await fe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:a,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Qn}),{data:c,error:d}=l;return d?{data:{user:null,session:null},error:d}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new hi}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:d})}catch(n){if(oe(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(t){var n,r,a,i,o;try{if("email"in t){const{email:l,options:c}=t;let d=null,u=null;this.flowType==="pkce"&&([d,u]=await fi(this.storage,this.storageKey));const{error:h}=await fe(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:d,code_challenge_method:u},redirectTo:c==null?void 0:c.emailRedirectTo});return{data:{user:null,session:null},error:h}}if("phone"in t){const{phone:l,options:c}=t,{data:d,error:u}=await fe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(a=c==null?void 0:c.data)!==null&&a!==void 0?a:{},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{data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:u}}throw new Kd("You must provide either an email or phone number.")}catch(l){if(oe(l))return{data:{user:null,session:null},error:l};throw l}}async verifyOtp(t){var n,r;try{let a,i;"options"in t&&(a=(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 fe(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:a,xform:Qn});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,d=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(a){if(oe(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithSSO(t){var n,r,a;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await fi(this.storage,this.storageKey)),await fe(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}),!((a=t==null?void 0:t.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:J8})}catch(i){if(oe(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,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 bs;const{error:a}=await fe(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:a}})}catch(t){if(oe(t))return{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:a,options:i}=t,{error:o}=await fe(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in t){const{phone:r,type:a,options:i}=t,{data:o,error:l}=await fe(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l}}throw new Kd("You must provide either an email or phone number and a type")}catch(n){if(oe(n))return{data:{user:null,session:null},error:n};throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,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(),a=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}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 a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.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 pa(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
560id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<Mm:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const o=await pa(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=Lm()}if(this.storage.isServer&&t.user){let o=this.suppressGetSessionWarning;t=new Proxy(t,{get:(c,d,u)=>(!o&&d==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,d,u))})}return{data:{session:t},error:null}}const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{session:null},error:i}:{data:{session:a},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await fe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:_s}):await this._useSession(async n=>{var r,a,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 bs}:await fe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(a=o.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0,xform:_s})})}catch(n){if(oe(n))return k8(n)&&(await this._removeSession(),await xs(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:n};throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:a,error:i}=r;if(i)throw i;if(!a.session)throw new bs;const o=a.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await fi(this.storage,this.storageKey));const{data:d,error:u}=await fe(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:_s});if(u)throw u;return o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(r){if(oe(r))return{data:{user:null},error:r};throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new bs;const n=Date.now()/1e3;let r=n,a=!0,i=null;const{payload:o}=Dm(t.access_token);if(o.exp&&(r=o.exp,a=r<=n),a){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return{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)throw 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{data:{user:i.user,session:i},error:null}}catch(n){if(oe(n))return{data:{session:null,user:null},error:n};throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,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 bs;const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{user:null,session:null},error:i}:a?{data:{user:a.user,session:a},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(oe(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(t,n){try{if(!gn())throw new Gd("No browser detected.");
560if(t.error||t.error_description||t.error_code)throw new Gd(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 ij("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Gd("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 ij("No code detected.");const{data:w,error:v}=await this._exchangeCodeForSession(t.code);if(v)throw v;const j=new URL(window.location.href);return j.searchParams.delete("code"),window.history.replaceState(window.history.state,"",j.toString()),{data:{session:w.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:a,access_token:i,refresh_token:o,expires_in:l,expires_at:c,token_type:d}=t;if(!i||!l||!o||!d)throw new Gd("No session defined in URL");const u=Math.round(Date.now()/1e3),h=parseInt(l);let p=u+h;c&&(p=parseInt(c));const m=p-u;m*1e3<=ji&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${h}s`);const b=p-h;u-b>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",b,p,u):u-b<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",b,p,u);const{data:g,error:y}=await this._getUser(i);if(y)throw y;const x={provider_token:r,provider_refresh_token:a,access_token:i,expires_in:h,expires_at:p,refresh_token:o,token_type:d,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:x,redirectType:t.type},error:null}}catch(r){if(oe(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await pa(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:a,error:i}=n;if(i)return{error:i};const o=(r=a.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(S8(l)&&(l.status===404||l.status===401||l.status===403)))return{error:l}}return t!=="others"&&(await this._removeSession(),await xs(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){const n=I8(),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(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,a;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((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),console.error(i)}})}async resetPasswordForEmail(t,n={}){let r=null,a=null;this.flowType==="pkce"&&([r,a]=await fi(this.storage,this.storageKey,!0));try{return await fe(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:a,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(oe(i))return{data:null,error:i};throw i}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(n){if(oe(n))return{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:a}=await this._useSession(async i=>{var o,l,c,d,u;const{data:h,error:p}=i;if(p)throw p;const m=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 fe(this.fetch,"GET",m,{headers:this.headers,jwt:(u=(d=h.session)===null||d===void 0?void 0:d.access_token)!==null&&u!==void 0?u:void 0})});if(a)throw a;return gn()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),{data:{provider:t.provider,url:r==null?void 0:r.url},error:null}}catch(r){if(oe(r))return{data:{provider:t.provider,url:null},error:r};throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:a,data:{session:i}}=n;
560if(a)throw a;const{options:o,provider:l,token:c,access_token:d,nonce:u}=t,h=await fe(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:d,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Qn}),{data:p,error:m}=h;return m?{data:{user:null,session:null},error:m}:!p||!p.session||!p.user?{data:{user:null,session:null},error:new hi}:(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),{data:p,error:m})}catch(a){if(oe(a))return{data:{user:null,session:null},error:a};throw a}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,a;const{data:i,error:o}=n;if(o)throw o;return await fe(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(a=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&a!==void 0?a:void 0})})}catch(n){if(oe(n))return{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 L8(async a=>(a>0&&await D8(200*Math.pow(2,a-1)),this._debug(n,"refreshing attempt",a),await fe(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Qn})),(a,i)=>{const o=200*Math.pow(2,a);return i&&Om(i)&&Date.now()+o-r<ji})}catch(r){if(this._debug(n,"error",r),oe(r))return{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),gn()&&!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 a=await pa(this.storage,this.storageKey);if(a&&this.userStorage){let o=await pa(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:a.user},await Ni(this.userStorage,this.storageKey+"-user",o)),a.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:Lm()}else if(a&&!a.user&&!a.user){const o=await pa(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(a.user=o.user,await xs(this.storage,this.storageKey+"-user"),await Ni(this.storage,this.storageKey,a)):a.user=Lm()}if(this._debug(r,"session from storage",a),!this._isValidSession(a)){this._debug(r,"session is not valid"),a!==null&&await this._removeSession();return}const i=((n=a.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<Mm;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${Mm}s`),i){if(this.autoRefreshToken&&a.refresh_token){const{error:o}=await this._callRefreshToken(a.refresh_token);o&&(console.error(o),Om(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(a.access_token);!l&&(o!=null&&o.user)?(a.user=o.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):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",a)}catch(a){this._debug(r,"error",a),console.error(a);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new bs;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new of;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new bs;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(a,"error",i),oe(i)){const o={data:null,error:i};return Om(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(a,"end")}}async _notifyAllSubscribers(t,n,r=!0){const a=`#_notifyAllSubscribers(${t})`;this._debug(a,"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(a,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Ni(this.userStorage,this.storageKey+"-user",{user:n.user});const a=Object.assign({},n);delete a.user;
560const i=uj(a);await Ni(this.storage,this.storageKey,i)}else{const a=uj(n);await Ni(this.storage,this.storageKey,a)}}async _removeSession(){this._debug("#_removeSession()"),await xs(this.storage,this.storageKey),await xs(this.storage,this.storageKey+"-code-verifier"),await xs(this.storage,this.storageKey+"-user"),this.userStorage&&await xs(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&gn()&&(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(),ji);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}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 a=Math.floor((r.expires_at*1e3-t)/ji);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${ji}ms, refresh threshold is ${Vg} ticks`),a<=Vg&&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.isAcquireTimeout||t instanceof o2)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!gn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(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(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,r){const a=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&a.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&a.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await fi(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});a.push(l.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);a.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&a.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${a.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;return i?{data:null,error:i}
560:await fe(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(oe(n))return{data:null,error:n};throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,a;const{data:i,error:o}=n;if(o)return{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:d}=await fe(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 d?{data:null,error:d}:(t.factorType==="totp"&&c.type==="totp"&&(!((a=c==null?void 0:c.totp)===null||a===void 0)&&a.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(n){if(oe(n))return{data:null,error:n};throw n}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;if(i)return{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"?mV(t.webauthn.credential_response):pV(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await fe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});return c?{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),{data:l,error:c})})}catch(n){if(oe(n))return{data:null,error:n};throw n}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;if(i)return{data:null,error:i};const o=await fe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=a==null?void 0:a.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:hV(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:fV(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(oe(n))return{data:null,error:n};throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?{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 a={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])a.all.push(i),i.status==="verified"&&a[i.factor_type].push(i);return{data:a,error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var n,r;const{data:{session:a},error:i}=t;if(i)return{data:null,error:i};if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=Dm(a.access_token);let l=null;o.aal&&(l=o.aal);let c=l;((r=(n=a.user.factors)===null||n===void 0?void 0:n.filter(h=>h.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(c="aal2");const u=o.amr||[];return{data:{currentLevel:l,nextLevel:c,currentAuthenticationMethods:u},error:null}}))}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(l=>l.kid===t);if(r)return r;const a=Date.now();if(r=this.jwks.keys.find(l=>l.kid===t),r&&this.jwks_cached_at+j8>a)return r;const{data:i,error:o}=await fe(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=a,r=i.keys.find(l=>l.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:m,error:b}
560=await this.getSession();if(b||!m.session)return{data:null,error:b};r=m.session.access_token}const{header:a,payload:i,signature:o,raw:{header:l,payload:c}}=Dm(r);n!=null&&n.allowExpired||W8(i.exp);const d=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!d){const{error:m}=await this.getUser(r);if(m)throw m;return{data:{claims:i,header:a,signature:o},error:null}}const u=H8(a.alg),h=await crypto.subtle.importKey("jwk",d,u,!0,["verify"]);if(!await crypto.subtle.verify(u,h,o,A8(`${l}.${c}`)))throw new Hg("Invalid JWT signature");return{data:{claims:i,header:a,signature:o},error:null}}catch(r){if(oe(r))return{data:null,error:r};throw r}}}Pc.nextInstanceID=0;const SV=Pc;class kV extends SV{constructor(t){super(t)}}var CV=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(u){try{d(r.next(u))}catch(h){o(h)}}function c(u){try{d(r.throw(u))}catch(h){o(h)}}function d(u){u.done?i(u.value):a(u.value).then(l,c)}d((r=r.apply(e,t||[])).next())})};class _V{constructor(t,n,r){var a,i,o;this.supabaseUrl=t,this.supabaseKey=n;const l=x8(t);if(!n)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);const c=`sb-${l.hostname.split(".")[0]}-auth-token`,d={db:o8,realtime:c8,auth:Object.assign(Object.assign({},l8),{storageKey:c}),global:i8},u=g8(r??{},d);this.storageKey=(a=u.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(i=u.global.headers)!==null&&i!==void 0?i:{},u.accessToken?(this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(h,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=u.auth)!==null&&o!==void 0?o:{},this.headers,u.global.fetch),this.fetch=f8(n,this._getAccessToken.bind(this),u.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},u.realtime)),this.rest=new NB(new URL("rest/v1",l).href,{headers:this.headers,schema:u.db.schema,fetch:this.fetch}),this.storage=new r8(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),u.accessToken||this._listenForAuthEvents()}get functions(){return new tB(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,n={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,n,r)}channel(t,n={config:{}}){return this.realtime.channel(t,n)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){return CV(this,void 0,void 0,function*(){var t,n;if(this.accessToken)return yield this.accessToken();const{data:r}=yield this.auth.getSession();return(n=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&n!==void 0?n:this.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:a,userStorage:i,storageKey:o,flowType:l,lock:c,debug:d},u,h){const p={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new kV({url:this.authUrl.href,headers:Object.assign(Object.assign({},p),u),storageKey:o,autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:a,userStorage:i,flowType:l,lock:c,debug:d,fetch:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new UB(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(t,n,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const EV=(e,t,n)=>new _V(e,t,n);function PV(){if(typeof window<"u"||typeof process>"u")return!1;const e=process.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}PV()&&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 N
560ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const TV="https://cjduqinlhflxzaalynzt.supabase.co",AV="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNqZHVxaW5saGZseHphYWx5bnp0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjA4NjY4ODEsImV4cCI6MjA3NjQ0Mjg4MX0.c75w6Op7wY6fcB007vKZTx1M7-UqETo4x1EzLwhPYs4",V=EV(TV,AV,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),RV=Object.freeze(Object.defineProperty({__proto__:null,supabase:V},Symbol.toStringTag,{value:"Module"})),pl="altify_free_usage",qd=3,IV=24,$m=200;function MV(){const[e,t]=f.useState(null),[n,r]=f.useState(null),[a,i]=f.useState(null),[o,l]=f.useState(!1),[c,d]=f.useState(null),[u,h]=f.useState(qd),[p,m]=f.useState(!1),[b,g]=f.useState(""),[y,x]=f.useState(!1),[w,v]=f.useState(!1),[j,N]=f.useState(!1);f.useEffect(()=>{const $=localStorage.getItem(pl);if($)try{const M=JSON.parse($),K=new Date(M.lastReset),z=new Date;if((z.getTime()-K.getTime())/(1e3*60*60)>=IV){const P={tries:qd,lastReset:z.toISOString()};localStorage.setItem(pl,JSON.stringify(P)),h(qd)}else h(M.tries)}catch(M){console.error("Error parsing free usage data:",M)}else{const M={tries:qd,lastReset:new Date().toISOString()};localStorage.setItem(pl,JSON.stringify(M))}},[]);const S=()=>{const $=localStorage.getItem(pl);if($){const M=JSON.parse($),K=Math.max(0,M.tries-1),z={...M,tries:K};localStorage.setItem(pl,JSON.stringify(z)),h(K)}},k=f.useCallback($=>{if(!["image/png","image/jpeg","image/jpg","image/gif","image/webp","image/svg+xml"].includes($.type)){bi({title:"Invalid file type",description:"Please upload PNG, JPG, GIF, WebP, or SVG files only.",variant:"destructive"});return}const K=10*1024*1024;if($.size>K){bi({title:"File too large",description:"Please use a file under 10MB.",variant:"destructive"});return}t($);const z=new FileReader;z.onloadend=()=>{r(z.result)},z.readAsDataURL($),i(null)},[]),C=f.useCallback($=>{$.preventDefault(),x(!1);const M=$.dataTransfer.files[0];M&&k(M)},[k]),A=async()=>{var $,M,K,z;if(!(!e||!n)){if(u<=0){N(!0);return}l(!0);try{const{data:I,error:P}=await V.functions.invoke("generate-alt-text",{body:{image:n,context:b||"",keywords:[],originalFilename:e.name,primaryLanguage:"en",additionalLanguages:[]}});if(P)throw P;const _={altText:(I==null?void 0:I.altText)||(($=I==null?void 0:I.generated)==null?void 0:$.altText)||"Alt text generated",title:(I==null?void 0:I.titleTag)||((M=I==null?void 0:I.generated)==null?void 0:M.titleTag)||(I==null?void 0:I.title)||"Image title",caption:(I==null?void 0:I.caption)||((K=I==null?void 0:I.generated)==null?void 0:K.caption)||"Image caption",filename:(I==null?void 0:I.suggestedFilename)||(I==null?void 0:I.filename)||((z=I==null?void 0:I.generated)==null?void 0:z.filename)||"optimized-filename.jpg"};i(_),S(),bi({title:"✨ Your alt text is ready!",description:`${u-1} free generations remaining`})}catch(I){console.error("Generation error:",I),bi({title:"Generation failed",description:I.message||"Oops! Something went wrong. Please try again.",variant:"destructive"})}finally{l(!1)}}},R=($,M)=>{navigator.clipboard.writeText($),d(M),setTimeout(()=>d(null),2e3),bi({title:"✅ Copied to clipboard!",description:"Sign up to save your results and generate unlimited alt text"})},G=["Did you know? Alt text boosts SEO by 10%","Tip: Describe what you see, not what you think","Fun fact: 1.3 billion people rely on alt text"],W=G[Math.floor(Math.random()*G.length)];return s.jsxs("div",{className:"grid md:grid-cols-2 gap-8 max-w-6xl mx-auto",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{onDrop:C,onDragOver:$=>{$.preventDefault(),x(!0)},onDragLeave:()=>x(!1),onClick:()=>{var $;return!e&&(($=document.getElementById("file-input"))==null?void 0:$.click())},className:`min-h-[400px] border-3 border-dashed rounded-2xl p-12 flex flex-col items-center justify-center text-center cursor-pointer transition-all duration-300 ${y?"border-coral-500 bg-coral-500/10 scale-[1.02]":e?"border-coral-500 bg-navy-800":"border-coral-500/50 bg-navy-800 hover:border-coral-500 hover:shadow-[0_0_30px_rgba(255,107,107,0.3)]"}`,children:[e&&n?s.jsxs(Sr.div,{initial:{opacity:0,scale:.9}
560,animate:{opacity:1,scale:1},className:"space-y-4",children:[s.jsx("img",{src:n,alt:"Preview",className:"w-48 h-48 object-cover rounded-lg mx-auto shadow-lg"}),s.jsx("p",{className:"text-white font-semibold",children:e.name}),s.jsx(E,{variant:"outline",size:"sm",onClick:$=>{$.stopPropagation(),t(null),r(null),i(null)},className:"border-coral-500 text-coral-500 hover:bg-coral-500/10",children:"Remove Image"})]}):s.jsxs(Sr.div,{initial:{opacity:0},animate:{opacity:1},className:"space-y-6",children:[s.jsx(rs,{className:"w-20 h-20 text-coral-500 mx-auto"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xl text-white font-semibold mb-2",children:"Drop your image here"}),s.jsx("p",{className:"text-white/60",children:"or click to upload"})]}),s.jsx("p",{className:"text-sm text-white/40",children:"PNG, JPG, GIF, WebP, SVG"}),s.jsx("p",{className:"text-sm text-white/40",children:"Max 10MB"})]}),s.jsx("input",{id:"file-input",type:"file",accept:"image/png,image/jpeg,image/jpg,image/gif,image/webp,image/svg+xml",onChange:$=>{var M;return((M=$.target.files)==null?void 0:M[0])&&k($.target.files[0])},className:"hidden"})]}),p?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"text-sm text-white/60 flex items-center justify-between",children:[s.jsx("span",{children:"Add context (optional)"}),b&&s.jsx("span",{className:"text-coral-500 text-xs",children:"✓ Context added"})]}),s.jsx("textarea",{value:b,onChange:$=>{$.target.value.length<=$m&&g($.target.value)},placeholder:"e.g., This is a portrait of a cosmetic dentist for our clinic website...",rows:3,className:"w-full px-4 py-3 bg-white/5 border border-white/20 rounded-lg text-white placeholder:text-white/40 focus:outline-none focus:border-coral-500 resize-none transition-all"}),s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("p",{className:"text-white/40",children:"Tip: Describe the image purpose, target audience, or key details"}),s.jsxs("span",{className:`${b.length>=$m?"text-coral-500":"text-white/40"}`,children:[b.length,"/",$m]})]}),s.jsx("button",{onClick:()=>m(!1),className:"text-coral-500 text-xs hover:underline",children:"Remove context"})]}):s.jsxs("button",{onClick:()=>m(!0),className:"flex items-center gap-2 text-coral-500 text-sm hover:underline transition-colors",children:[s.jsx(Ys,{className:"w-4 h-4"}),"+ Add context for better results"]}),s.jsx(E,{onClick:A,disabled:!e||o||u<=0,className:"w-full h-14 bg-blue-600 hover:bg-blue-700 text-white text-lg font-bold rounded-xl transition-all hover:shadow-lg disabled:opacity-50 disabled:cursor-not-allowed",children:o?s.jsxs(s.Fragment,{children:[s.jsx(On,{className:"w-5 h-5 mr-2 animate-spin"}),"Analyzing..."]}):u<=0?"Sign up for more generations":"Generate Alt Text"}),u>0&&s.jsxs("p",{className:"text-center text-sm text-white/60",children:[u," free generation",u!==1?"s":""," remaining today"]}),o&&s.jsx(Sr.p,{initial:{opacity:0}
560,animate:{opacity:1},className:"text-center text-sm text-coral-500 italic",children:W})]}),s.jsx("div",{className:"bg-navy-800 border border-navy-700 rounded-2xl p-8",children:s.jsx(f$,{mode:"wait",children:a?s.jsxs(Sr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[s.jsx("img",{src:n,alt:"Result preview",className:"w-24 h-24 object-cover rounded-lg"}),s.jsx("h3",{className:"text-xl font-bold text-white",children:"Your Generated Metadata"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("label",{className:"text-sm font-semibold text-coral-500 flex items-center gap-2",children:[s.jsx(ry,{className:"w-[18px] h-[18px]"}),"Alt Text:",s.jsx("span",{className:"bg-blue-500/20 text-blue-300 text-xs px-2 py-1 rounded-full",children:"Accessibility"})]}),s.jsx("button",{onClick:()=>R(a.altText,"altText"),className:"flex items-center gap-1 text-sm text-coral-500 hover:text-coral-400 transition-colors",children:c==="altText"?s.jsxs(s.Fragment,{children:[s.jsx(Me,{className:"w-4 h-4"})," Copied!"]}):s.jsxs(s.Fragment,{children:[s.jsx(jt,{className:"w-4 h-4"})," Copy"]})})]}),s.jsx("p",{className:"text-white bg-navy-900 p-3 rounded-lg",children:a.altText})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("label",{className:"text-sm font-semibold text-coral-500 flex items-center gap-2",children:[s.jsx(iw,{className:"w-[18px] h-[18px]"}),"Title:",s.jsx("span",{className:"bg-green-500/20 text-green-300 text-xs px-2 py-1 rounded-full",children:"SEO"})]}),s.jsx("button",{onClick:()=>R(a.title,"title"),className:"flex items-center gap-1 text-sm text-coral-500 hover:text-coral-400 transition-colors",children:c==="title"?s.jsxs(s.Fragment,{children:[s.jsx(Me,{className:"w-4 h-4"})," Copied!"]}):s.jsxs(s.Fragment,{children:[s.jsx(jt,{className:"w-4 h-4"})," Copy"]})})]}),s.jsx("p",{className:"text-white bg-navy-900 p-3 rounded-lg",children:a.title})]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>v(!w),className:"flex items-center gap-2 text-coral-500 hover:text-coral-400 transition-all duration-300",children:w?s.jsxs(s.Fragment,{children:[s.jsx(zc,{className:"w-4 h-4"}),"Hide metadata"]}):s.jsxs(s.Fragment,{children:[s.jsx(Ys,{className:"w-4 h-4"}),"Show more metadata (2 hidden)"]})}),w&&s.jsxs(Sr.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3,ease:"easeInOut"},className:"mt-4 space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("label",{className:"text-sm font-semibold text-coral-500 flex items-center gap-2",children:[s.jsx(PM,{className:"w-[18px] h-[18px]"}),"Caption:",s.jsx("span",{className:"bg-purple-500/20 text-purple-300 text-xs px-2 py-1 rounded-full",children:"Social Media"})]}),s.jsx("button",{onClick:()=>R(a.caption,"caption"),className:"flex items-center gap-1 text-sm text-coral-500 hover:text-coral-400 transition-colors",children:c==="caption"?s.jsxs(s.Fragment,{children:[s.jsx(Me,{className:"w-4 h-4"})," Copied!"]}):s.jsxs(s.Fragment,{children:[s.jsx(jt,{className:"w-4 h-4"})," Copy"]})})]}),s.jsx("p",{className:"text-white bg-navy-900 p-3 rounded-lg",children:a.caption})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("label",{className:"text-sm font-semibold text-coral-500 flex items-center gap-2",children:[s.jsx(Bn,{className:"w-[18px] h-[18px]"}),"Filename:",s.jsx("span",{className:"bg-orange-500/20 text-orange-300 text-xs px-2 py-1 rounded-full",children:"File Optimization"})]}),s.jsx("button",{onClick:()=>R(a.filename,"filename"),className:"flex items-center gap-1 text-sm text-coral-500 hover:text-coral-400 transition-colors",children:c==="filename"?s.jsxs(s.Fragment,{children:[s.jsx(Me,{className:"w-4 h-4"})," Copied!"]}):s.jsxs(s.Fragment,{children:[s.jsx(jt,{className:"w-4 h-4"})," Copy"]})})]}),s.jsx("p",{className:"text-white bg-navy-900 p-3 rounded-lg font-mono text-sm",children:a.filename})]})]})]}),s.jsxs("div",{className:"mt-6 p-6 bg-gradient-to-br from-coral-500/20 to-coral-600/20 border border-coral-500/30 rounded-xl",children:[s.jsx("h4",{className:"text-white font-semibold mb-4 text-center",children:"🎨 Unlock 2 More Metadata Types"}),s.jsxs("div",{className:"space-y-3 mb-6",children:[s.jsxs("div",{className:"relative bg-navy-900/50 p-4 rounded-lg overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 backdrop-blur-sm bg-navy-900/30 flex items-center justify-center z-10",children:s.jsx("span",{className:"text-white font-semibold bg-coral-500 px-4 py-2 rounded-full text-sm",children:"🔒 Sign up to unlock"})}),s.jsxs("div",{className:"filter blur-sm select-none",children:[s.jsxs("p",{className:"text-xs text-coral-500 font-semibold mb-2 flex items-center gap-2",children:[s.jsx(iw,{className:"w-4 h-4"}),"OG Tags",s.jsx("span",{className:"bg-purple-500/20 text-purple-300 text-xs px-2 py-1 rounded-full",children:"Social Media"})]}),s.jsx("pre",{className:"text-xs text-white/60 font-mono",children:`og:title: "Your Amazing Image Title"
561og:description: "Optimized description..."
562og:image: "https://..."`})]})]}),s.jsxs("div",{className:"relative bg-navy-900/50 p-4 rounded-lg overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 backdrop-blur-sm bg-navy-900/30 flex items-center justify-center z-10",children:s.jsx("span",{className:"text-white font-semibold bg-coral-500 px-4 py-2 rounded-full text-sm",children:"🔒 Sign up to unlock"})}),s.jsxs("div",{className:"filter blur-sm select-none",children:[s.jsxs("p",{className:"text-xs text-coral-500 font-semibold mb-2 flex items-center gap-2",children:[s.jsx(Bn,{className:"w-4 h-4"}),"Schema Markup",s.jsx("span",{className:"bg-green-500/20 text-green-300 text-xs px-2 py-1 rounded-full",children:"SEO"})]}),s.jsx("pre",{className:"text-xs text-white/60 font-mono",children:`{
563  "@context": "https://schema.org",
564  "@type": "ImageObject",
565  "name": "...",
566  "description": "..."
567}`})]})]})]}),s.jsx(ye,{to:"/auth",children:s.jsx(E,{className:"w-full bg-coral-500 hover:bg-coral-600 text-white font-bold",children:"Sign Up Free - Get 25 Credits"})}),s.jsx("p",{className:"text-sm text-white/60 text-center mt-3",children:"✓ No credit card required • ✓ Save results • ✓ Export CSV"})]})]},"result"):s.jsxs(Sr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"space-y-6",children:[s.jsx("h3",{className:"text-2xl font-bold text-white mb-6",children:"What You'll Get:"}),["Alt Text (SEO-optimized)","Title Tags","Image Captions","Optimized Filenames","Open Graph Tags","Schema Markup"].map(($,M)=>s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Me,{className:"w-6 h-6 text-coral-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"text-lg text-white",children:$})]},M)),s.jsx("div",{className:"pt-6 border-t border-navy-700",children:s.jsx("p",{className:"text-white/80 text-center",children:"All generated automatically in one click!"})})]},"teaser")})}),j&&s.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 p-4",children:s.jsxs(Sr.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"bg-navy-800 border border-coral-500 rounded-2xl p-8 max-w-md w-full text-center",children:[s.jsx("h3",{className:"text-2xl font-bold text-white mb-4",children:"You've used your 3 free tries today!"}),s.jsx("p",{className:"text-white/80 mb-6",children:"Ready for unlimited access?"}),s.jsxs("ul",{className:"text-left space-y-2 mb-6",children:[s.jsxs("li",{className:"flex items-center gap-2 text-white",children:[s.jsx(Me,{className:"w-5 h-5 text-coral-500"}),"25 free credits when you sign up"]}),s.jsxs("li",{className:"flex items-center gap-2 text-white",children:[s.jsx(Me,{className:"w-5 h-5 text-coral-500"}),"No credit card required"]}),s.jsxs("li",{className:"flex items-center gap-2 text-white",children:[s.jsx(Me,{className:"w-5 h-5 text-coral-500"}),"Cancel anytime"]})]}),s.jsx(ye,{to:"/auth",children:s.jsx(E,{className:"w-full bg-coral-500 hover:bg-coral-600 text-white font-bold mb-3",children:"Start Free Trial"})}),s.jsx(E,{variant:"ghost",onClick:()=>N(!1),className:"w-full text-white/60",children:"Close"})]})})]})}const OV=({id:e,name:t,icon:n,description:r,available:a,route:i})=>{const o=hr(),l=()=>{a&&i?o(i):T.info(`${t} integration coming soon!`,{description:"Join our waitlist to be notified when it's available"})};return s.jsxs(L,{className:"p-6 bg-navy-800 border-navy-700 hover:border-coral-500/30 transition-all duration-300 hover:shadow-coral hover:-translate-y-1 group relative",children:[!a&&s.jsx(ae,{className:"absolute top-4 right-4 bg-coral-500/20 text-coral-500 border-coral-500/30",children:"Coming Soon"}),s.jsxs("div",{className:"flex flex-col items-center text-center space-y-4",children:[s.jsx("div",{className:"w-16 h-16 rounded-lg bg-coral-500/10 flex items-center justify-center group-hover:bg-coral-500/20 transition-colors",children:s.jsx(n,{className:"w-8 h-8 text-coral-500"})}),s.jsx("h3",{className:"text-xl font-heading font-bold text-white",children:t}),s.jsx("p",{className:"text-sm text-navy-400 min-h-[40px]",children:r}),s.jsx(E,{onClick:l,className:"w-full bg-coral-500 hover:bg-coral-600 text-white transition-all",children:a?`Connect ${t}`:"Notify Me"})]})]})};var lf="Collapsible",[DV,u2]=vt(lf),[LV,iv]=DV(lf),h2=f.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...l}=e,[c,d]=hn({prop:r,defaultProp:a??!1,onChange:o,caller:lf});return s.jsx(LV,{scope:n,disabled:i,contentId:dn(),open:c,onOpenToggle:f.useCallback(()=>d(u=>!u),[d]),children:s.jsx(ne.div,{"data-state":cv(c),"data-disabled":i?"":void 0,...l,ref:t})})});h2.displayName=lf;var f2="CollapsibleTrigger",m2=f.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=iv(f2,n);return s.jsx(ne.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":cv(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:q(e.onClick,a.onOpenToggle)})});m2.displayName=f2;var ov="CollapsibleContent",lv=f.forwardRef((e,t)=>
vendor: 4,177 bytes, line 567
567{const{forceMount:n,...r}=e,a=iv(ov,e.__scopeCollapsible);return s.jsx(qt,{present:n||a.open,children:({present:i})=>s.jsx(FV,{...r,ref:t,present:i})})});lv.displayName=ov;var FV=f.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=iv(ov,n),[l,c]=f.useState(r),d=f.useRef(null),u=xe(t,d),h=f.useRef(0),p=h.current,m=f.useRef(0),b=m.current,g=o.open||l,y=f.useRef(g),x=f.useRef(void 0);return f.useEffect(()=>{const w=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(w)},[]),ot(()=>{const w=d.current;if(w){x.current=x.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const v=w.getBoundingClientRect();h.current=v.height,m.current=v.width,y.current||(w.style.transitionDuration=x.current.transitionDuration,w.style.animationName=x.current.animationName),c(r)}},[o.open,r]),s.jsx(ne.div,{"data-state":cv(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!g,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:g&&a})});function cv(e){return e?"open":"closed"}var p2=h2,$V=m2,UV=lv,BV=f.createContext(void 0);function nd(e){const t=f.useContext(BV);return e||t||"ltr"}var fr="Accordion",VV=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[dv,zV,WV]=Bc(fr),[cf,Dq]=vt(fr,[WV,u2]),uv=u2(),g2=B.forwardRef((e,t)=>{const{type:n,...r}=e,a=r,i=r;return s.jsx(dv.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?s.jsx(qV,{...i,ref:t}):s.jsx(GV,{...a,ref:t})})});g2.displayName=fr;var[x2,HV]=cf(fr),[y2,KV]=cf(fr,{collapsible:!1}),GV=B.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},collapsible:i=!1,...o}=e,[l,c]=hn({prop:n,defaultProp:r??"",onChange:a,caller:fr});return s.jsx(x2,{scope:e.__scopeAccordion,value:B.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:B.useCallback(()=>i&&c(""),[i,c]),children:s.jsx(y2,{scope:e.__scopeAccordion,collapsible:i,children:s.jsx(v2,{...o,ref:t})})})}),qV=B.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},...i}=e,[o,l]=hn({prop:n,defaultProp:r??[],onChange:a,caller:fr}),c=B.useCallback(u=>l((h=[])=>[...h,u]),[l]),d=B.useCallback(u=>l((h=[])=>h.filter(p=>p!==u)),[l]);return s.jsx(x2,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:d,children:s.jsx(y2,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(v2,{...i,ref:t})})})}),[YV,df]=cf(fr),v2=B.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:a,orientation:i="vertical",...o}=e,l=B.useRef(null),c=xe(l,t),d=zV(n),h=nd(a)==="ltr",p=q(e.onKeyDown,m=>{var C;if(!VV.includes(m.key))return;const b=m.target,g=d().filter(A=>{var R;return!((R=A.ref.current)!=null&&R.disabled)}),y=g.findIndex(A=>A.ref.current===b),x=g.length;if(y===-1)return;m.preventDefault();let w=y;const v=0,j=x-1,N=()=>{w=y+1,w>j&&(w=v)},S=()=>{w=y-1,w<v&&(w=j)};switch(m.key){case"Home":w=v;break;case"End":w=j;break;case"ArrowRight":i==="horizontal"&&(h?N():S());break;case"ArrowDown":i==="vertical"&&N();break;case"ArrowLeft":i==="horizontal"&&(h?S():N());break;case"ArrowUp":i==="vertical"&&S();break}const k=w%x;(C=g[k].ref.current)==null||C.focus()});return s.jsx(YV,{scope:n,disabled:r,direction:a,orientation:i,children:s.jsx(dv.Slot,{scope:n,children:s.jsx(ne.div,{...o,"data-orientation":i,ref:c,onKeyDown:r?void 0:p})})})}),hh="AccordionItem",[QV,hv]=cf(hh),w2=B.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...a}=e,i=df(hh,n),o=HV(hh,n),l=uv(n),c=dn(),d=r&&o.value.includes(r)||!1,u=i.disabled||e.disabled;return s.jsx(QV,{scope:n,open:d,disabled:u,triggerId:c,children:s.jsx(p2,{"data-orientation":i.orientation,"data-state":C2(d),...l,...a,ref:t,disabled:u,open:d,onOpenChange:h=>{h?o.onItemOpen(r):o.onItemClose(r)}})})});w2.displayName=hh;var b2="AccordionHeader",j2=B.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=df(fr,n),i=hv(b2,n);return s.jsx(ne.h3,{"data-orientation":a.orientation,"data-state":C2(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});j2.displayName=b2;var Kg="AccordionTrigger",N2=B.forwardRef((e,t)=>
567{const{__scopeAccordion:n,...r}=e,a=df(fr,n),i=hv(Kg,n),o=KV(Kg,n),l=uv(n);return s.jsx(dv.ItemSlot,{scope:n,children:s.jsx($V,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":a.orientation,id:i.triggerId,...l,...r,ref:t})})});N2.displayName=Kg;var S2="AccordionContent",k2=B.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=df(fr,n),i=hv(S2,n),o=uv(n);return s.jsx(UV,{role:"region","aria-labelledby":i.triggerId,"data-orientation":a.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});k2.displayName=S2;function C2(e){return e?"open":"closed"}var JV=g2,XV=w2,ZV=j2,_2=N2,E2=k2;const P2=JV,Bi=f.forwardRef(({className:e,...t},n)=>s.jsx(XV,{ref:n,className:F("border-b",e),...t}));Bi.displayName="AccordionItem";const Vi=f.forwardRef(({className:e,children:t,...n},r)=>s.jsx(ZV,{className:"flex",children:s.jsxs(_2,{ref:r,className:F("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,s.jsx(Ys,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Vi.displayName=_2.displayName;const zi=f.forwardRef(({className:e,children:t,...n},r)=>s.jsx(E2,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:s.jsx("div",{className:F("pb-4 pt-0",e),children:t})}));zi.displayName=E2.displayName;const ez=({items:e})=>s.jsx(P2,{type:"single",collapsible:!0,className:"w-full max-w-3xl mx-auto space-y-4",children:e.map((t,n)=>s.jsxs(Bi,{value:`item-${n}`,className:"bg-navy-800 border border-navy-700 rounded-lg px-6 hover:border-coral-500/30 transition-colors",children:[s.jsx(Vi,{className:"text-left text-white font-heading hover:text-coral-500 py-6",children:t.question}),s.jsx(zi,{className:"text-navy-400 leading-relaxed pb-6",children:t.answer})]},n))}),Um=768;function T2(){const[e,t]=f.useState(void 0);return f.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Um-1}px)`),r=()=>{t(window.innerWidth<Um)};return n.addEventListener("change",r),t(window.innerWidth<Um),()=>n.removeEventListener("change",r)},[]),!!e}const tz=()=>s.jsx("img",{src:new URL("/assets/logo-new-BJNegEHP.png",import.meta.url).href,alt:"Altify Pro Logo",className:"h-10"}),nz=({icon:e,title:t,description:n})=>{const r=f.useRef(null),a=F_(r,{once:!0,margin:"-100px"});return s.jsx(Sr.div,{ref:r,initial:{opacity:0,y:20},animate:a?{opacity:1,y:0}:{opacity:0,y:20},transition:{duration:.5},children:s.jsxs(L,{className:"p-6 h-full bg-navy-800 border-navy-700 hover:border-coral-500/30 transition-all duration-300 hover:shadow-coral hover:-translate-y-1 group",children:[s.jsx("div",{className:"w-12 h-12 rounded-lg bg-coral-500/10 flex items-center justify-center mb-4 group-hover:bg-coral-500/20 transition-colors",children:s.jsx(e,{className:"w-6 h-6 text-coral-500"})}),s.jsx("h3",{className:"text-xl font-heading font-bold text-white mb-2",children:t}),s.jsx("p",{className:"text-navy-400",children:n})]})})},rz=()=>{const[e,t]=f.useState(!1),[n,r]=f.useState(null),a=T2(),i=f.useRef(null),o=F_(i,{once:!0}),l=async(m,b)=>{r(m);try{const{data:{user:g}}=await V.auth.getUser();if(!g){window.location.href="/auth";return}const{data:y,error:x}=await V.functions.invoke("create-checkout-session",{body:{priceId:b,planName:m}});if(x)throw x;y!=null&&y.url&&(window.location.href=y.url)}catch(g){T.error(g.message||"Failed to start checkout")}finally{r(null)}},c=[{id:"shopify",name:"Shopify",icon:Ka,description:"Bulk generate alt text for all product images",available:!0,route:"/integrations/shopify"},{id:"wordpress",name:"WordPress",icon:Bn,description:"Optimize your entire media library instantly",available:!0,route:"/integrations/wordpress"},{id:"woocommerce",name:"WooCommerce",icon:Gu,description:"Perfect alt text for all product variations",available:!0,route:"/integrations/wordpress"},{id:"wix",name:"Wix",icon:Ku,description:"Seamless integration with your Wix store",available:!0,route:"/integrations/wix"},{id:"squarespace",name:"Squarespace",icon:sy,description:"Accessibility for your Squarespace site",available:!0,route:"/integrations/squarespace"},{id:"bigcommerce",name:"BigCommerce",icon:Ka,description:"Enterprise-grade alt text automation",available:!1,route:""},{id:"webflow",name:"Webflow",icon:Ku,description:"Designer-friendly alt text solution",available:!1,route:""},{id:"custom_api",name:"Custom API",icon:Wc,description:"Integrate with any platform using our API",available:!0,route:"/api-keys"}],d=[{icon:ay,title:"Lightning Fast",description:"Generate 100+ alt texts per minute. What takes hours manually takes minutes with Altify Pro."},{icon:OM,title:"SEO Optimized",description:"Naturally includes target keywords to improve your search rankings and drive organic traffic."},{icon:rw,title:"WCAG 2.1 AA Compliant",description:"Automatically meets accessibility standards to serve all customers and avoid legal issues."},{icon:Io,title:"Multi-Language Support",description:"Generate alt text in 20+ languages including English, Spanish, French, German, and more."},{icon:TM,title:"Customizable Styles",description:"Choose from Descriptive, Concise, SEO-focused, or E-commerce styles to match your brand voice."},{icon:rn,title:"Auto-Generate",description:"Set it and forget it. Automatically generate alt text for new products as you upload them."},{icon:FM,title:"Agency-Friendly",description:"White-label solution for managing multiple client sites. Deliver professional results at scale."},{icon:hM,title:"API-First",description:"Developer-ready API with webhooks and custom integrations. Build accessibility into your workflow."}],u=[{name:"Starter",price:"$19",period:"per month",features:["200 images per month","All integrations included","SEO optimization","WCAG compliance","Email support","Bulk processing"],cta:"Start Free Trial",popular:!0,badge:"Most Popular",priceId:"price_1SKX5TDLNWqA0awM5g0SLbQP"},{name:"Pro",price:"$49",period:"per month",features:["1,000 images per month","All Starter features","Priority support","Auto-generate on upload","Custom brand voice","Multi-language support","API access"],cta:"Start Free Trial",popular:!1,priceId:"price_1SKXHyDLNWqA0awMvs1rqmU4"},{name:"Business",price:"$99",period:"per month",features:["5,000 images per month","All Pro features","White-label option","Dedicated account manager","Custom integrations","99.9% uptime SLA","Priority processing"],cta:"Contact Sales",popular:!1,badge:"Best Value",priceId:"price_1SKXGJDLNWqA0awMQCTiInM0"}],h=[{quote:"This tool saved me literally 40 hours. I had 800+ products with no alt text and was quoted $5K by my developer. Altify Pro did it in 15 minutes for $49. Absolute game-changer.",name:"Sarah M.",title:"Shopify Store Owner",avatar:"SM",rating:5},{quote:"Our organic traffic increased 27% in the first month after optimizing our alt text. The SEO improvements alone paid for itself 10x over. Can't recommend enough.",name:"James T.",title:"E-commerce Manager",avatar:"JT",rating:5},{quote:"As someone who cares deeply about accessibility, this tool is perfect. WCAG compliant alt text in seconds, and my customers using screen readers can finally shop properly.",name:"Maria L.",title:"WordPress Developer",avatar:"ML",rating:5}
567],p=[{question:"What is alt text and why do I need it?",answer:"Alt text (alternative text) is a description of an image that helps search engines understand your images and allows people using screen readers to know what the image contains. It improves your SEO, ensures accessibility compliance, and can protect you from ADA lawsuits."},{question:"How does the AI generate alt text?",answer:"Our AI uses advanced computer vision and natural language processing to analyze your images and generate contextual, descriptive alt text that's both human-readable and SEO-optimized."},{question:"Can I edit the generated alt text?",answer:"Absolutely! You can preview and edit any alt text before publishing. We also learn from your edits to improve future generations."},{question:"Which platforms do you support?",answer:"We currently support Shopify, WordPress, WooCommerce, Wix, Squarespace, and custom integrations via our API. BigCommerce and Webflow support coming soon!"},{question:"What happens after I use my monthly credits?",answer:"You can upgrade your plan or purchase additional credits as needed. We'll notify you at 80% usage so you're never caught off guard."},{question:"Can I upgrade or downgrade anytime?",answer:"Yes! You can change your plan at any time. Upgrades take effect immediately, and downgrades apply at your next billing cycle."},{question:"Do unused credits roll over?",answer:"Credits are monthly and do not roll over. We recommend choosing a plan that matches your typical monthly usage."},{question:"Is there a free plan?",answer:"We offer a 14-day free trial on all paid plans. This gives you full access to test all features before committing."},{question:"Is my data secure?",answer:"Yes. We use bank-level encryption and never store your images longer than necessary to generate alt text. We're GDPR compliant and take security seriously."},{question:"Do you offer refunds?",answer:"Yes! We offer a 30-day money-back guarantee, no questions asked. We're confident you'll love Altify Pro."}];return s.jsxs("div",{className:"min-h-screen bg-navy-900 text-white",children:[s.jsx("nav",{className:"sticky top-0 z-50 bg-navy-900/80 backdrop-blur-lg border-b border-navy-800",children:s.jsxs("div",{className:"container mx-auto px-4 md:px-6 py-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(tz,{}),s.jsxs("div",{className:"hidden md:flex items-center gap-8",children:[s.jsx("a",{href:"#platforms",className:"text-navy-400 hover:text-white transition-colors",children:"Integrations"}),s.jsx("a",{href:"#features",className:"text-navy-400 hover:text-white transition-colors",children:"Features"}),s.jsx("a",{href:"#pricing",className:"text-navy-400 hover:text-white transition-colors",children:"Pricing"}),s.jsx(ye,{to:"/resources",className:"text-navy-400 hover:text-white transition-colors",children:"Resources"})]}),s.jsxs("div",{className:"hidden md:flex items-center gap-4",children:[s.jsx(ye,{to:"/auth",className:"text-navy-400 hover:text-white transition-colors",children:"Login"}),s.jsx(ye,{to:"/try-free",children:s.jsx(E,{className:"bg-coral-500 hover:bg-coral-600 text-white shadow-coral transition-all hover:shadow-coral-lg hover:-translate-y-0.5",children:"Start Free Trial"})})]}),s.jsx("button",{className:"md:hidden text-white",onClick:()=>t(!e),children:e?s.jsx(cs,{}):s.jsx(EM,{})})]}),e&&s.jsxs("div",{className:"md:hidden mt-4 pb-4 space-y-4",children:[s.jsx("a",{href:"#platforms",className:"block text-navy-400 hover:text-white transition-colors",onClick:()=>t(!1),children:"Integrations"}),s.jsx("a",{href:"#features",className:"block text-navy-400 hover:text-white transition-colors",onClick:()=>t(!1),children:"Features"}),s.jsx("a",{href:"#pricing",className:"block text-navy-400 hover:text-white transition-colors",onClick:()=>t(!1),children:"Pricing"}),s.jsx(ye,{to:"/resources",className:"block text-navy-400 hover:text-white transition-colors",onClick:()=>t(!1),children:"Resources"}),s.jsx(ye,{to:"/auth",className:"block text-navy-400 hover:text-white transition-colors",onClick:()=>t(!1),children:"Login"}),s.jsx(ye,{to:"/try-free",children:s.jsx(E,{className:"w-full bg-coral-500 hover:bg-coral-600 text-white",children:"Start Free Trial"})})]})]})}),s.jsxs("section",{ref:i,className:"relative overflow-hidden py-12 md:py-20 lg:py-32",children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-navy-850 to-navy-900"}),s.jsx("div",{className:"container mx-auto px-4 md:px-6 relative z-10",children:s.jsxs("div",{className:"grid md:grid-cols-2 gap-8 md:gap-12 items-center",children:[s.jsxs(Sr.div,{initial:{opacity:0,x:-20},animate:o?{opacity:1,x:0}:{opacity:0,x:-20},transition:{duration:.6},children:[s.jsxs("h1",{className:"text-3xl md:text-5xl lg:text-6xl font-heading font-bold mb-4 md:mb-6 leading-tight",children:["Generate Perfect Alt Text for Your"," ",s.jsx("span",{className:"text-coral-500",children:"Entire Store"}
567)," ","in Minutes"]}),s.jsx("p",{className:"text-lg md:text-xl text-navy-400 mb-6 md:mb-8 leading-relaxed",children:"AI-powered alt text generator that boosts SEO, ensures accessibility compliance, and saves you 50+ hours of manual work. Works seamlessly with Shopify, WordPress, WooCommerce, and more."}),s.jsxs("ul",{className:"space-y-2 mb-6 md:mb-8 text-navy-300",children:[s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(Me,{className:"w-5 h-5 text-coral-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{children:"Save 50+ hours of manual work"})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(Me,{className:"w-5 h-5 text-coral-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{children:"Avoid costly ADA lawsuits"})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(Me,{className:"w-5 h-5 text-coral-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{children:"Boost SEO with perfect alt text"})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 md:gap-4 mb-6 md:mb-8",children:[s.jsx(ye,{to:"/try-free",className:"flex-1 sm:flex-initial",children:s.jsxs(E,{size:"lg",className:"w-full sm:w-auto bg-coral-500 hover:bg-coral-600 text-white shadow-coral hover:shadow-coral-lg transition-all hover:-translate-y-0.5 text-base md:text-lg px-6 md:px-8",children:["Start Free Trial",s.jsx(uc,{className:"ml-2 w-4 h-4 md:w-5 md:h-5"})]})}),s.jsx(E,{size:"lg",variant:"outline",className:"border-2 border-coral-500 text-coral-500 hover:bg-coral-500/10 text-base md:text-lg px-6 md:px-8",onClick:()=>{var m;return(m=document.getElementById("try-now"))==null?void 0:m.scrollIntoView({behavior:"smooth"})},children:"Watch Demo"})]}),s.jsxs("div",{className:"flex flex-wrap gap-4 md:gap-6 text-xs md:text-sm text-navy-400",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Me,{className:"w-4 h-4 text-coral-500"}),s.jsx("span",{children:"No credit card required"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Me,{className:"w-4 h-4 text-coral-500"}),s.jsx("span",{children:"14-day free trial"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Me,{className:"w-4 h-4 text-coral-500"}),s.jsx("span",{children:"Cancel anytime"})]})]})]}),s.jsx(Sr.div,{initial:{opacity:0,x:20},animate:o?{opacity:1,x:0}:{opacity:0,x:20},transition:{duration:.6,delay:.2},className:"relative",children:s.jsxs("div",{className:"relative bg-navy-800 rounded-2xl border border-coral-500/20 shadow-coral-lg p-4 md:p-8",children:[s.jsx("div",{className:"absolute -top-6 -right-6 w-24 h-24 bg-coral-500/20 rounded-full blur-3xl"}),s.jsx("div",{className:"absolute -bottom-6 -left-6 w-32 h-32 bg-coral-500/20 rounded-full blur-3xl"}),s.jsx("img",{src:QU,alt:"Altify Pro dashboard showing AI-powered alt text generation for e-commerce stores",className:"w-full h-auto rounded-lg"})]})})]})})]}),s.jsx("section",{id:"platforms",className:"py-12 md:py-20 lg:py-32 bg-navy-850",children:s.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[s.jsx("div",{className:"text-center mb-10 md:mb-16",children:s.jsxs("h2",{className:"text-2xl md:text-4xl lg:text-5xl font-heading font-bold mb-4",children:["Works With Your ",s.jsx("span",{className:"text-coral-500",children:"Favorite Platforms"})]})}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 md:gap-6 max-w-7xl mx-auto",children:c.map((m,b)=>s.jsx(OV,{...m},b))})]})}),s.jsx("section",{className:"py-12 md:py-20 lg:py-32",children:s.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[s.jsx("div",{className:"text-center mb-10 md:mb-16",children:s.jsxs("h2",{className:"text-2xl md:text-4xl lg:text-5xl font-heading font-bold mb-4",children:["How ",s.jsx("span",{className:"text-coral-500",children:"Altify Pro"})," Works"]})}),s.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-8 md:gap-12 max-w-6xl mx-auto",children:[{icon:SM,title:"Connect Your Store",description:"Link your store in 60 seconds. No technical knowledge required."},{icon:hc,title:"Select Images",description:"Bulk select your entire product catalog. Process thous
567ands at once."},{icon:Nt,title:"AI Generates Alt Text",description:"SEO-optimized, WCAG-compliant alt text in seconds."},{icon:ny,title:"Review & Publish",description:"Preview, edit, and publish directly to your store."}].map((m,b)=>s.jsx("div",{className:"relative",children:s.jsxs("div",{className:"flex flex-col items-center text-center",children:[s.jsx("div",{className:"w-14 h-14 md:w-16 md:h-16 rounded-full bg-coral-500 flex items-center justify-center mb-4 shadow-coral",children:s.jsx(m.icon,{className:"w-7 h-7 md:w-8 md:h-8 text-white"})}),s.jsxs("div",{className:"text-coral-500 font-bold text-sm mb-2",children:["STEP ",b+1]}),s.jsx("h3",{className:"text-lg md:text-xl font-heading font-bold mb-2 text-white",children:m.title}),s.jsx("p",{className:"text-sm md:text-base text-navy-400",children:m.description})]})},b))})]})}),s.jsx("section",{id:"features",className:"py-12 md:py-20 lg:py-32 bg-navy-850",children:s.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[s.jsx("div",{className:"text-center mb-10 md:mb-16",children:s.jsxs("h2",{className:"text-2xl md:text-4xl lg:text-5xl font-heading font-bold mb-4",children:["Everything You Need for ",s.jsx("span",{className:"text-coral-500",children:"Perfect Alt Text"})]})}),s.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-6 md:gap-8 max-w-7xl mx-auto",children:d.map((m,b)=>s.jsx(nz,{...m},b))})]})}),s.jsx("section",{id:"pricing",className:"py-12 md:py-20 lg:py-32",children:s.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[s.jsxs("div",{className:"text-center mb-10 md:mb-16",children:[s.jsxs("h2",{className:"text-2xl md:text-4xl lg:text-5xl font-heading font-bold mb-4",children:["Simple, ",s.jsx("span",{className:"text-coral-500",children:"Transparent"})," Pricing"]}),s.jsx("p",{className:"text-lg md:text-xl text-navy-400",children:"Start free. No credit card required. Cancel anytime."})]}),s.jsx("div",{className:"grid md:grid-cols-3 gap-6 md:gap-8 max-w-6xl mx-auto mb-10 md:mb-16",children:u.map((m,b)=>{const g=a&&m.features.length>3?[...m.features.slice(0,3),`+ ${m.features.length-3} more features`]:m.features;return s.jsxs(L,{className:`p-6 md:p-8 ${m.popular?"bg-navy-800 border-coral-500 shadow-coral-lg relative":"bg-navy-800 border-navy-700"} hover:border-coral-500/50 transition-all duration-300`,children:[m.badge&&s.jsx(ae,{className:"absolute -top-3 left-1/2 -translate-x-1/2 bg-coral-500 text-white",children:m.badge}),s.jsxs("div",{className:"text-center mb-6",children:[s.jsx("h3",{className:"text-xl md:text-2xl font-heading font-bold text-white mb-2",children:m.name}),s.jsxs("div",{className:"flex items-baseline justify-center mb-2",children:[s.jsx("span",{className:"text-4xl md:text-5xl font-bold text-coral-500",children:m.price}),s.jsxs("span",{className:"text-navy-400 ml-2",children:["/",m.period.split(" ")[1]]})]}),s.jsxs("p",{className:"text-sm text-navy-400",children:["Billed ",m.period.split(" ")[1]]})]}),s.jsx("ul",{className:"space-y-3 mb-8",children:g.map((y,x)=>s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx(Me,{className:"w-5 h-5 text-coral-500 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"text-sm md:text-base text-navy-300",children:y})]},x))}),s.jsx(E,{className:"w-full bg-coral-500 hover:bg-coral-600 text-white",onClick:()=>m.priceId&&l(m.name,m.priceId),disabled:n===m.name,children:n===m.name?"Loading...":m.cta})]},b)})}),s.jsx("div",{className:"text-center mb-10 md:mb-12",children:s.jsxs("p",{className:"text-sm md:text-base text-navy-400",children:["Need more? ",s.jsx(ye,{to:"/auth",className:"text-coral-500 hover:underline",children:"Enterprise plans available"})," for unlimited images and custom solutions."]})})]})}),s.jsx("section",{id:"try-now",children:s.jsx(MV,{})}),s.jsx("section",{className:"py-12 md:py-20 lg:py-32 bg-navy-850",children:s.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[s.jsx("div",{className:"text-center mb-10 md:mb-16",children:s.jsxs("h2",{className:"text-2xl md:text-4xl lg:text-5xl font-heading font-bold mb-4",children:["Trusted by ",s.jsx("span",{className:"text-coral-500",children:"Store Owners"})," Worldwide"]})}),s.jsx("div",{className:"grid md:grid-cols-3 gap-6 md:gap-8 max-w-6xl mx-auto mb-10 md:mb-12",children:h.map((m,b)=>s.jsxs(L,{className:"p-6 md:p-8 bg-navy-800 border-navy-700 hover:border-coral-500/30 transition-all",children:[s.jsx("div",{className:"flex mb-4",children:[...Array(m.rating)].map((g,y)=>s.jsx(qu,{className:"w-4 h-4 md:w-5 md:h-5 fill-coral-500 text-coral-500"},y))}
567),s.jsxs("p",{className:"text-sm md:text-base text-navy-300 mb-6 italic",children:['"',m.quote,'"']}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-coral-500/20 flex items-center justify-center",children:s.jsx("span",{className:"text-coral-500 font-bold text-sm",children:m.avatar})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-bold text-white text-sm md:text-base",children:m.name}),s.jsx("p",{className:"text-xs md:text-sm text-navy-400",children:m.title})]})]})]},b))}),s.jsxs("div",{className:"flex flex-wrap justify-center gap-8 md:gap-12 max-w-4xl mx-auto",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-3xl md:text-4xl font-bold text-coral-500 mb-2",children:"4.9/5"}),s.jsx("p",{className:"text-sm md:text-base text-navy-400",children:"Average Rating"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-3xl md:text-4xl font-bold text-coral-500 mb-2",children:"500+"}),s.jsx("p",{className:"text-sm md:text-base text-navy-400",children:"Five-Star Reviews"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-3xl md:text-4xl font-bold text-coral-500 mb-2",children:"98%"}),s.jsx("p",{className:"text-sm md:text-base text-navy-400",children:"Customer Satisfaction"})]})]})]})}),s.jsx("section",{className:"py-12 md:py-20 lg:py-32",children:s.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[s.jsx("div",{className:"text-center mb-10 md:mb-16",children:s.jsxs("h2",{className:"text-2xl md:text-4xl lg:text-5xl font-heading font-bold mb-4",children:["Frequently Asked ",s.jsx("span",{className:"text-coral-500",children:"Questions"})]})}),s.jsx(ez,{items:p})]})}),s.jsx("section",{className:"py-12 md:py-20 lg:py-32 bg-gradient-to-br from-coral-600 via-coral-500 to-coral-400",children:s.jsxs("div",{className:"container mx-auto px-4 md:px-6 text-center",children:[s.jsx("h2",{className:"text-2xl md:text-4xl lg:text-5xl font-heading font-bold mb-4 md:mb-6 text-white",children:"Ready to Save 50+ Hours and Boost Your SEO?"}),s.jsx("p",{className:"text-lg md:text-xl text-white/90 mb-8 md:mb-10 max-w-3xl mx-auto",children:"Join stores using Altify Pro to automate their alt text and improve accessibility."}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 md:gap-4 justify-center mb-6 md:mb-8",children:[s.jsx(ye,{to:"/try-free",children:s.jsxs(E,{size:"lg",className:"w-full sm:w-auto bg-white text-coral-500 hover:bg-white/90 shadow-lg text-base md:text-lg px-6 md:px-8",children:["Start Your Free Trial",s.jsx(uc,{className:"ml-2 w-4 h-4 md:w-5 md:h-5"})]})}),s.jsx(ye,{to:"/auth",children:s.jsx(E,{size:"lg",variant:"outline",className:"w-full sm:w-auto border-2 border-white text-white text-base md:text-lg px-6 md:px-8 bg-transparent hover:bg-white/10",children:"Schedule a Demo"})})]}),s.jsxs("div",{className:"flex flex-wrap justify-center gap-4 md:gap-8 text-sm md:text-base text-white/90",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Me,{className:"w-4 h-4 md:w-5 md:h-5"}),s.jsx("span",{children:"14-day free trial"})]}),s.jsx("span",{className:"hidden sm:inline",children:"•"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Me,{className:"w-4 h-4 md:w-5 md:h-5"}),s.jsx("span",{children:"No credit card required"})]}),s.jsx("span",{className:"hidden sm:inline",children:"•"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Me,{className:"w-4 h-4 md:w-5 md:h-5"}),s.jsx("span",{children:"Setup in 60 seconds"})]})]})]})}),s.jsx("footer",{className:"bg-navy-900 border-t border-navy-800 py-10 md:py-16",children:s.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[s.jsxs("div",{className:"flex flex-wrap justify-center gap-6 md:gap-8 mb-8 md:mb-12 pb-8 md:pb-12 border-b border-navy-800",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-navy-400",children:[s.jsx(QS,{className:"w-4 h-4 md:w-5 md:h-5 text-coral-500"}),s.jsx("span",{children:"SSL Secure"})]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-navy-400",children:[s.jsx(cM,{className:"w-4 h-4 md:w-5 md:h-5 text-coral-500"}),s.jsx("span",{children:"GDPR Compliant"})]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-navy-400",children:[s.jsx(rw,{className:"w-4 h-4 md:w-5 md:h-5 text-coral-500"}),s.jsx("span",{children:"WCAG 2.1 AA"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-8 mb-8 md:mb-12",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-heading font-bold text-white mb-4 text-sm md:text-base",children:"Product"}),s.jsxs("ul",{className:"space-y-2 text-xs md:text-sm",children:[s.jsx("li",{children:s.jsx("a",{href:"#features",className:"text-navy-400 hover:text-coral-500 transition-colors",children:"Features"})}),s.jsx("li",{children:s.jsx("a",{href:"#platforms",className:"text-navy-400 hover:text-coral-500 transition-colors",children:"Integrations"})}),s.jsx("li",{children:s.jsx("a",{href:"#pricing",className:"text-navy-400 hover:text-coral-500 transition-colors",children:"Pricing"})}),s.jsx("li",{children:s.jsx(ye,{to:"/api-keys",className:"text-navy-400 hover:text-coral-500 transition-colors",children:"API Docs"})})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-heading font-bold text-white mb-4 text-sm md:text-base",children:"Resources"}),s.jsxs("ul",{className:"space-y-2 text-xs md:text-sm",children:[s.jsx("li",{children:s.jsx(ye,{to:"/resources",className:"text-navy-400 hover:text-coral-500 transition-colors",children:"Help Center"})}),s.jsx("li",{children:s.jsx(ye,{to:"/resources/how-to-write-alt-text",className:"text-navy-400 hover:text-coral-500 transition-colors",children:"Alt Text Guide"})}),s.jsx("li",{children:s.jsx(ye,{to:"/resources/best-practices-checklist",className:"text-navy-400 hover:text-coral-500 transition-colors",children:"Best Practices"})})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-heading font-bold text-white mb-4 text-sm md:text-base",children:"Company"}),s.jsxs("ul",{className:"space-y-2 text-xs md:text-sm",children:[s.jsx("li",{children:s.jsx(ye,{to:"/auth",className:"text-navy-400 hover:text-coral-500 transition-colors",children:"About"})}),s.jsx("li",{children:s.jsx(ye,{to:"/auth",className:"text-navy-400 hover:text-coral-500 transition-colors",children:"Contact"})}),s.jsx("li",{children:s.jsx("a",{href:"#",className:"text-navy-400 hover:text-coral-500 transition-colors",children:"Privacy"})}),s.jsx("li",{children:s.jsx("a",{href:"#",className:"text-navy-400 hover:text-coral-500 transition-colors",children:"Terms"})})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-heading font-bold text-white mb-4 text-sm md:text-base",children:"Connect"}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx("a",{href:"#",className:"text-navy-400 hover:text-coral-500 transition-colors",children:s.jsx(ZS,{className:"w-5 h-5"})}),s.jsx("a",{href:"#",className:"text-navy-400 hover:text-coral-500 transition-colors",children:s.jsx(YS,{className:"w-5 h-5"})}),s.jsx("a",{href:"#",className:"text-navy-400 hover:text-coral-500 transition-colors",children:s.jsx(wM,{className:"w-5 h-5"})})]}),s.jsx("p",{className:"text-xs md:text-sm text-navy-400 mt-4",children:"[email protected]"})]})]}),s.jsx("div",{className:"text-center text-xs md:text-sm text-navy-400 pt-8 border-t border-navy-800",children:"© 2025 Altify Pro. All rights reserved. Made with ❤️ for accessibility."})]})})]})},uf="/assets/logo-new-BJNegEHP.png",sz=async e=>new Promise((t,n)=>{const r=new Image,a=new FileReader;a.onload=i=>{var c;const o=(c=i.target)==null?void 0:c.result;if(!(e.type!=="image/jpeg"&&e.type!=="image/png"&&e.type!=="image/webp")&&e.size<5*1024*1024){t({dataUrl:o,wasConverted:!1});return}r.onload=()=>{const d=document.createElement("canvas");let u=r.width,h=r.height;const p=1600;(u>p||h>p)&&(u>h?(h=Math.round(h*p/u),u=p):(u=Math.round(u*p/h),h=p)),d.width=u,d.height=h;const m=d.getContext("2d");if(!m){n(new Error("Failed to get canvas context"));return}m.drawImage(r,0,0,u,h);const b=e.size>5*1024*1024?.75:.85,g=d.toDataURL("image/jpeg",b);if(g.length>12*1024*1024){n(new Error("Image too large after conversion. Please use a smaller image."));return}t({dataUrl:g,wasConverted:!0})},r.onerror=()=>n(new Error("Failed to load image")),r.src=o},a.onerror=()=>n(new Error("Failed to read file")),a.readAsDataURL(e)}),az=()=>{const[e,t]=f.useState(null),[n,r]=f.useState(null),[a,i]=f.useState(null),[o,l]=f.useState(!1),[c,d]=f.useState(!1),[u,h]=f.useState(()=>{const v=localStorage.getItem("altify-free-usage");return v?parseInt(v,10):0}),{toast:p}=Uc(),m=3,b=f.useCallback(v=>{if(v&&v.type.startsWith("image/")){if(v.size>10*1024*1024){p({title:"File too large",description:"Please select an image under 10MB",variant:"destructive"});return}t(v);const j=new FileReader;j.onloadend=()=>{r(j.result)},j.readAsDataURL(v),i(null),d(!1)}else p({title:"Invalid file type",description:"Please select an image file",variant:"destructive"})},[p]),g=f.useCallback(v=>{v.preventDefault();const j=v.dataTransfer.files[0];j&&b(j)},[b]),y=f.useCallback(v=>{var N;const j=(N=v.target.files)==null?void 0:N[0];j&&b(j)},[b]),x=async()=>{var v;if(e){if(u>=m){p({title:"Free limit reached",description:"Please sign up to continue generating alt text",variant:"destructive"});return}l(!0);try{const{dataUrl:j,wasConverted:N}=await sz(e);N&&p({title:"Image optimized",description:"Your image was automatically converted for processing"});const{data:S,error:k}=await V.functions.invoke("generate-alt-text",{body:{image:j,context:"",keywords:[],assignedKeywords:[],originalFilename:e.name,primaryLanguage:"en",additionalLanguages:[]}});if(k)throw console.error("Edge function error:",k),k;console.log("Edge function response:",S);const C={id:Date.now().toString(),fileName:e.name,preview:j,altText:(S==null?void 0:S.altText)||((v=S==null?void 0:S.generated)==null?void 0:v.altText)||"Failed to generate alt text"};i(C);const A=u+1;h(A),localStorage.setItem("altify-free-usage",A.toString());const R=JSON.parse(localStorage.getItem("altify-history")||"[]");R.unshift(C),R.length>50&&R.pop(),localStorage.setItem("altify-history",JSON.stringify(R)),p({title:"Success!",description:"Alt text generated successfully"})}catch(j){console.error("Generation error:",j),p({title:"Error",description:j.message||"Failed to generate alt text. Please try again.",variant:"destructive"})}finally{l(!1)}}},w=()=>{a&&(navigator.clipboard.writeText(a.altText),d(!0),setTimeout(()=>d(!1),2e3),p({title:"Copied!",description:"Alt text copied to clipboard"}))};return s.jsxs("div",{className:"min-h-screen bg-[hsl(var(--navy-900))]",children:[s.jsx("header",{className:"border-b border-white/10 bg-[hsl(var(--navy-800))]/50 backdrop-blur-sm sticky top-0 z-50",children:s.jsxs("div",{className:"container mx-auto px-4 py-4 flex items-center justify-between",children:[s.jsxs(ye,{to:"/",className:"flex items-center gap-3",children:[s.jsx("img",{src:uf,alt:"Altify Pro",className:"h-10 w-auto"}),s.jsx("span",{className:"text-2xl font-bold text-white",children:"Altify Pro"})]}),s.jsx(ye,{to:"/auth",children:s.jsxs(E,{variant:"outline",className:"gap-2 border-white/20 text-neutral-950 bg-zinc-50",children:[s.jsx(aw,{className:"h-4 w-4"}),"Sign In"]})})]})}),s.jsxs("div",{className:"container mx-auto px-4 py-12 max-w-4xl",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4 text-white",children:"Generate Perfect Alt Text with AI"}),s.jsxs("p",{className:"text-lg text-white/80 max-w-2xl mx-auto",children:["Upload your image and get SEO-optimized, accessibility-friendly alt text instantly.",u<m&&s.jsxs("span",{className:"block mt-2 text-[hsl(var(--primary))] font-medium",children:[m-u," free ",m-u===1?"generation":"generations"," remaining"]})]})]}),s.jsxs(L,{className:"p-8 mb-8 bg-[hsl(var(--navy-800))] border-white/10",children:[s.jsxs("div",{onDrop:g,onDragOver:v=>v.preventDefault(),className:"border-2 border-dashed border-white/20 rounded-lg p-12 text-center hover:border-[hsl(var(--primary))]/50 transition-colors cursor-pointer",onClick:()=>{var v;return(v=document.getElementById("file-input"))==null?void 0:v.click()},children:[n?s.jsxs("div",{className:"space-y-4",children:[s.jsx("img",{src:n,alt:"Preview",className:"max-h-[500px] mx-auto rounded-lg shadow-lg border-4 border-white/20"}),s.jsx("p",{className:"text-sm text-white/70",children:"Click or drop to select a new image"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsx(rs,{className:"h-16 w-16 mx-auto text-white/50"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-lg font-medium text-white mb-2",children:"Click to select or drag and drop"}),s.jsx("p",{className:"text-sm text-white/70",children:"Any image format up to 10MB"})]})]}),s.jsx("input",{id:"file-input",type:"file",accept:"image/*",onChange:y,className:"hidden"})]}),n&&!a&&s.jsx("div",{className:"text-center mt-6",children:s.jsx(E,{size:"lg",onClick:x,disabled:o,className:"px-8 py-6 text-lg bg-gradient-to-r from-[hsl(var(--primary))] to-[hsl(var(--primary))]/80 hover:from-[hsl(var(--primary))]/90 hover:to-[hsl(var(--primary))]/70 text-white",children:o?"Generating...":"Generate Alt Text"})})]}),a&&s.jsxs(L,{className:"p-8 bg-[hsl(var(--navy-800))] border-white/10",children:[s.jsx("h2",{className:"text-2xl font-bold mb-6 text-white",children:"Generated Alt Text"}),s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"bg-[hsl(var(--navy-900))] rounded-lg p-6 border border-white/10",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsx("p",{className:"text-xl leading-relaxed text-white flex-1",children:a.altText}),s.jsx(E,{variant:"outline",size:"sm",onClick:w,className:"flex-shrink-0 border-white/20 text-stone-800 bg-neutral-50",children:c?s.jsxs(s.Fragment,{children:[s.jsx(Me,{className:"h-4 w-4 mr-2"}),"Copied"]}):s.jsxs(s.Fragment,{children:[s.jsx(jt,{className:"h-4 w-4 mr-2"}),"Copy"]})})]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(E,{onClick:()=>{i(null),r(null),t(null),d(!1)},variant:"outline",className:"border-white/20 text-stone-800 bg-neutral-50",children:"Generate Another"}),s.jsx(ye,{to:"/auth",children:s.jsx(E,{className:"bg-gradient-to-r from-[hsl(var(--primary))] to-[hsl(var(--primary))]/80 hover:from-[hsl(var(--primary))]/90 hover:to-[hsl(var(--primary))]/70 text-white",children:"Sign Up for More Features"})})]})]})]}),u>=m&&s.jsxs(L,{className:"p-8 text-center bg-[hsl(var(--primary))]/10 border-[hsl(var(--primary))]/20",children:[s.jsx("h2",{className:"text-2xl font-bold mb-4 text-white",children:"Free Trial Complete!"}),s.jsxs("p",{className:"text-white/80 mb-6",children:["You've used all ",m," free generations. Sign up to continue generating alt text and unlock advanced features."]}),s.jsx(ye,{to:"/auth",children:s.jsxs(E,{size:"lg",className:"gap-2 bg-gradient-to-r from-[hsl(var(--primary))] to-[hsl(var(--primary))]/80 hover:from-[hsl(var(--primary))]/90 hover:to-[hsl(var(--primary))]/70 text-white",children:[s.jsx(aw,{className:"h-5 w-5"}),"Sign Up Free"]})})]}),s.jsxs("div",{className:"mt-16 grid md:grid-cols-3 gap-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"bg-[hsl(var(--primary))]/20 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(rs,{className:"h-8 w-8 text-[hsl(var(--primary))]"})}),s.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"AI-Powered"}),s.jsx("p",{className:"text-white/70",children:"Advanced AI creates contextual, SEO-friendly alt text"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"bg-[hsl(var(--primary))]/20 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(Me,{className:"h-8 w-8 text-[hsl(var(--primary))]"})}),s.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Instant Results"}),s.jsx("p",{className:"text-white/70",children:"Get optimized alt text in seconds"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"bg-[hsl(var(--primary))]/20 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(jt,{className:"h-8 w-8 text-[hsl(var(--primary))]"
567})}),s.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Easy to Use"}),s.jsx("p",{className:"text-white/70",children:"One-click copy to clipboard"})]})]})]}),s.jsx("footer",{className:"border-t border-white/10 mt-16 py-8 bg-[hsl(var(--navy-800))]/30",children:s.jsx("div",{className:"container mx-auto px-4 text-center text-white/70",children:s.jsx("p",{children:"© 2024 Altify Pro. All rights reserved."})})})]})},me=f.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:F("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background text-foreground 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 [&:-webkit-autofill]:text-foreground [&:-webkit-autofill]:[-webkit-text-fill-color:hsl(var(--foreground))] [&:-webkit-autofill]:shadow-[0_0_0_1000px_hsl(var(--background))_inset]",e),ref:r,...n}));me.displayName="Input";var iz="Label",A2=f.forwardRef((e,t)=>s.jsx(ne.label,{...e,ref:t,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));A2.displayName=iz;var R2=A2;const oz=ri("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),se=f.forwardRef(({className:e,...t},n)=>s.jsx(R2,{ref:n,className:F(oz(),e),...t}));se.displayName=R2.displayName;const lz=()=>{const[e,t]=f.useState(!0),[n,r]=f.useState(!1),[a,i]=f.useState(!1),[o,l]=f.useState(""),[c,d]=f.useState(""),[u,h]=f.useState(""),[p,m]=f.useState(!1),b=hr(),[g]=hL();f.useEffect(()=>{const v=g.get("type")==="recovery"||window.location.hash.includes("type=recovery");if(v){i(!0);return}V.auth.getSession().then(({data:{session:N}})=>{N&&!v&&b("/dashboard")});const{data:{subscription:j}}=V.auth.onAuthStateChange((N,S)=>{N==="SIGNED_IN"&&S&&!v&&b("/dashboard"),N==="PASSWORD_RECOVERY"&&i(!0)});return()=>j.unsubscribe()},[b,g]);const y=async v=>{v.preventDefault(),m(!0);try{if(e){const{error:j}=await V.auth.signInWithPassword({email:o,password:c});if(j)throw j;T.success("Welcome back!")}else{const{error:j}=await V.auth.signUp({email:o,password:c,options:{emailRedirectTo:`${window.location.origin}/dashboard`}});if(j)throw j;T.success("Account created! Please check your email to confirm.")}}catch(j){T.error(j.message||"An error occurred")}finally{m(!1)}},x=async v=>{v.preventDefault(),m(!0);try{const{error:j}=await V.auth.resetPasswordForEmail(o,{redirectTo:`${window.location.origin}/auth`});if(j)throw j;T.success("Password reset email sent! Check your inbox."),r(!1)}catch(j){T.error(j.message||"Failed to send reset email")}finally{m(!1)}},w=async v=>{if(v.preventDefault(),c!==u){T.error("Passwords don't match");return}if(c.length<6){T.error("Password must be at least 6 characters");return}m(!0);try{const{error:j}=await V.auth.updateUser({password:c});if(j)throw j;T.success("Password updated successfully!"),b("/dashboard")}catch(j){T.error(j.message||"Failed to update password")}finally{m(!1)}};return s.jsx("div",{className:"min-h-screen bg-gradient-subtle flex items-center justify-center p-4",children:s.jsxs(L,{className:"w-full max-w-md p-8 bg-card/50 backdrop-blur-sm border-border/50 shadow-elevated",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("h1",{className:"text-2xl font-bold gradient-text mb-4",children:"Altify Pro"}),s.jsx("h2",{className:"text-3xl font-bold mb-2",children:a?"Set New Password":n?"Reset Password":e?"Welcome Back":"Create Account"}),s.jsx("p",{className:"text-foreground/80",children:a?"Enter your new password below":n?"Enter your email to receive a password reset link":e?"Sign in to continue generating alt text":"Start generating perfect alt text today"})]}),s.jsxs("form",{onSubmit:a?w:n?x:y,className:"space-y-4",children:[!a&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"email",children:"Email"}),s.jsx(me,{id:"email",type:"email",placeholder:"[email protected]",value:o,onChange:v=>l(v.target.value),required:!0,disabled:p})]}),!n&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"password",children:"Password"}),s.jsx(me,{id:"password",type:"password",placeholder:"••••••••",value:c,onChange:v=>d(v.target.value),required:!0,disabled:p,minLength:6})]}),a&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"confirmPassword",children:"Confirm Password"}),s.jsx(me,{id:"confirmPassword",type:"password",placeholder:"••••••••",value:u,onChange:v=>h(v.target.value),required:!0,disabled:p,minLength:6})]}),s.jsx(E,{type:"submit",className:"w-full bg-gradient-hero hover:opacity-90 transition-opacity shadow-glow-primary",disabled:p,children:p?"Loading...":a?"Update Password":n?"Send Reset Link":e?"Sign In":"Sign Up"}),e&&!n&&s.jsx("div",{className:"text-center",children:s.jsx("button",{type:"button",onClick:()=>
vendor: 5,492 bytes, line 567
567r(!0),className:"text-sm text-foreground hover:text-foreground/80 transition-colors underline",disabled:p,children:"Forgot password?"})})]}),!a&&s.jsx("div",{className:"mt-6 text-center",children:s.jsx("button",{type:"button",onClick:()=>{n?r(!1):t(!e)},disabled:p,className:"text-sm transition-colors text-foreground/70",children:n?s.jsx(s.Fragment,{children:s.jsx("span",{className:"text-foreground font-medium underline",children:"Back to Sign In"})}):s.jsxs(s.Fragment,{children:[e?"Don't have an account? ":"Already have an account? ",s.jsx("span",{className:"text-foreground font-medium underline",children:e?"Sign Up":"Sign In"})]})})})]})})},cz=()=>{const e=ai();return f.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-100",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),s.jsx("p",{className:"mb-4 text-xl text-gray-600",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-blue-500 underline hover:text-blue-700",children:"Return to Home"})]})})};var dz="Separator",yj="horizontal",uz=["horizontal","vertical"],I2=f.forwardRef((e,t)=>{const{decorative:n,orientation:r=yj,...a}=e,i=hz(r)?r:yj,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(ne.div,{"data-orientation":i,...l,...a,ref:t})});I2.displayName=dz;function hz(e){return uz.includes(e)}var M2=I2;const fv=f.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(M2,{ref:a,decorative:n,orientation:t,className:F("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));fv.displayName=M2.displayName;var Bm="focusScope.autoFocusOnMount",Vm="focusScope.autoFocusOnUnmount",vj={bubbles:!1,cancelable:!0},fz="FocusScope",rd=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=f.useState(null),d=Wt(a),u=Wt(i),h=f.useRef(null),p=xe(t,g=>c(g)),m=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let g=function(v){if(m.paused||!l)return;const j=v.target;l.contains(j)?h.current=j:js(h.current,{select:!0})},y=function(v){if(m.paused||!l)return;const j=v.relatedTarget;j!==null&&(l.contains(j)||js(h.current,{select:!0}))},x=function(v){if(document.activeElement===document.body)for(const N of v)N.removedNodes.length>0&&js(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const w=new MutationObserver(x);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),w.disconnect()}}},[r,l,m.paused]),f.useEffect(()=>{if(l){bj.add(m);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(Bm,vj);l.addEventListener(Bm,d),l.dispatchEvent(x),x.defaultPrevented||(mz(vz(O2(l)),{select:!0}),document.activeElement===g&&js(l))}return()=>{l.removeEventListener(Bm,d),setTimeout(()=>{const x=new CustomEvent(Vm,vj);l.addEventListener(Vm,u),l.dispatchEvent(x),x.defaultPrevented||js(g??document.body,{select:!0}),l.removeEventListener(Vm,u),bj.remove(m)},0)}}},[l,d,u,m]);const b=f.useCallback(g=>{if(!n&&!r||m.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(y&&x){const w=g.currentTarget,[v,j]=pz(w);v&&j?!g.shiftKey&&x===j?(g.preventDefault(),n&&js(v,{select:!0})):g.shiftKey&&x===v&&(g.preventDefault(),n&&js(j,{select:!0})):x===w&&g.preventDefault()}},[n,r,m.paused]);return s.jsx(ne.div,{tabIndex:-1,...o,ref:p,onKeyDown:b})});rd.displayName=fz;function mz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(js(r,{select:t}),document.activeElement!==n)return}function pz(e){const t=O2(e),n=wj(t,e),r=wj(t.reverse(),e);return[n,r]}function O2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wj(e,t){for(const n of e)if(!gz(n,{upTo:t}))return n}function gz(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 xz(e){return e instanceof HTMLInputElement&&"select"in e}function js(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xz(e)&&t&&e.select()}}var bj=yz();function yz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=jj(e,t),e.unshift(t)},remove(t){var n;e=jj(e,t),(n=e[0])==null||n.resume()}}}function jj(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function vz(e){return e.filter(t=>t.tagName!=="A")}var zm=0;function hf(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Nj()),document.body.insertAdjacentElement("beforeend",e[1]??Nj()),zm++,()=>{zm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zm--}},[])}function Nj(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.
vendor: 5,651 bytes, lines 567-582
567style.position="fixed",e.style.pointerEvents="none",e}var Pr=function(){return Pr=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Pr.apply(this,arguments)};function D2(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function wz(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;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 vu="right-scroll-bar-position",wu="width-before-scroll-bar",bz="with-scroll-bars-hidden",jz="--removed-body-scroll-bar-size";function Wm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Nz(e,t){var n=f.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var Sz=typeof window<"u"?f.useLayoutEffect:f.useEffect,Sj=new WeakMap;function kz(e,t){var n=Nz(null,function(r){return e.forEach(function(a){return Wm(a,r)})});return Sz(function(){var r=Sj.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||Wm(l,null)}),i.forEach(function(l){a.has(l)||Wm(l,o)})}Sj.set(n,e)},[e]),n}function Cz(e){return e}function _z(e,t){t===void 0&&(t=Cz);var n=[],r=!1,a={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 u=o;o=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(u){o.push(u),d()},filter:function(u){return o=o.filter(u),n}}}};return a}function Ez(e){e===void 0&&(e={});var t=_z(null);return t.options=Pr({async:!0,ssr:!1},e),t}var L2=function(e){var t=e.sideCar,n=D2(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 f.createElement(r,Pr({},n))};L2.isSideCarExport=!0;function Pz(e,t){return e.useMedium(t),L2}var F2=Ez(),Hm=function(){},ff=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:Hm,onWheelCapture:Hm,onTouchMoveCapture:Hm}),a=r[0],i=r[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,h=e.shards,p=e.sideCar,m=e.noRelative,b=e.noIsolation,g=e.inert,y=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,v=e.gapMode,j=D2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,S=kz([n,t]),k=Pr(Pr({},j),a);return f.createElement(f.Fragment,null,u&&f.createElement(N,{sideCar:F2,removeScrollBar:d,shards:h,noRelative:m,noIsolation:b,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:v}),o?f.cloneElement(f.Children.only(l),Pr(Pr({},k),{ref:S})):f.createElement(w,Pr({},k,{className:c,ref:S}),l))});ff.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ff.classNames={fullWidth:wu,zeroRight:vu};var Tz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Az(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Tz();return t&&e.setAttribute("nonce",t),e}function Rz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Iz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Mz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Az())&&(Rz(t,n),Iz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Oz=function(){var e=Mz();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},$2=function(){var e=Oz(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},Dz={left:0,top:0,right:0,gap:0},Km=function(e){return parseInt(e||"",10)||0},Lz=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Km(n),Km(r),Km(a)]},Fz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Dz;var t=Lz(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])}},$z=$2(),eo="data-scroll-locked",Uz=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
568  .`.concat(bz,` {
569   overflow: hidden `).concat(r,`;
570   padding-right: `).concat(l,"px ").concat(r,`;
571  }
572  body[`).concat(eo,`] {
573    overflow: hidden `).concat(r,`;
574    overscroll-behavior: contain;
575    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
576    padding-left: `.concat(a,`px;
577    padding-top: `).concat(i,`px;
578    padding-right: `).concat(o,`px;
579    margin-left:0;
580    margin-top:0;
581    margin-right: `).concat(l,"px ").concat(r,`;
582    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";
582")].filter(Boolean).join(""),`
583  }
584  
585  .`).concat(vu,` {
586    right: `).concat(l,"px ").concat(r,`;
587  }
588  
589  .`).concat(wu,` {
590    margin-right: `).concat(l,"px ").concat(r,`;
591  }
592  
593  .`).concat(vu," .").concat(vu,` {
594    right: 0 `).concat(r,`;
595  }
596  
597  .`).concat(wu," .").concat(wu,` {
598    margin-right: 0 `).concat(r,`;
599  }
600  
601  body[`).concat(eo,`] {
602    `).concat(jz,": ").concat(l,`px;
603  }
604`)},kj=function(){var e=parseInt(document.body.getAttribute(eo)||"0",10);return isFinite(e)?e:0},Bz=function(){f.useEffect(function(){return document.body.setAttribute(eo,(kj()+1).toString()),function(){var e=kj()-1;e<=0?document.body.removeAttribute(eo):document.body.setAttribute(eo,e.toString())}},[])},Vz=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;Bz();var i=f.useMemo(function(){return Fz(a)},[a]);return f.createElement($z,{styles:Uz(i,!t,a,n?"":"!important")})},Gg=!1;if(typeof window<"u")try{var Yd=Object.defineProperty({},"passive",{get:function(){return Gg=!0,!0}});window.addEventListener("test",Yd,Yd),window.removeEventListener("test",Yd,Yd)}catch{Gg=!1}var xi=Gg?{passive:!1}:!1,zz=function(e){return e.tagName==="TEXTAREA"},U2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zz(e)&&n[t]==="visible")},Wz=function(e){return U2(e,"overflowY")},Hz=function(e){return U2(e,"overflowX")},Cj=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=B2(e,r);if(a){var i=V2(e,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Kz=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Gz=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},B2=function(e,t){return e==="v"?Wz(t):Hz(t)},V2=function(e,t){return e==="v"?Kz(t):Gz(t)},qz=function(e,t){return e==="h"&&t==="rtl"?-1:1},Yz=function(e,t,n,r,a){var i=qz(e,window.getComputedStyle(t).direction),o=i*r,l=n.target,c=t.contains(l),d=!1,u=o>0,h=0,p=0;do{if(!l)break;var m=V2(e,l),b=m[0],g=m[1],y=m[2],x=g-y-i*b;(b||x)&&B2(e,l)&&(h+=x,p+=b);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(u&&(Math.abs(h)<1||!a)||!u&&(Math.abs(p)<1||!a))&&(d=!0),d},Qd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_j=function(e){return[e.deltaX,e.deltaY]},Ej=function(e){return e&&"current"in e?e.current:e},Qz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Jz=function(e){return`
605  .block-interactivity-`.concat(e,` {pointer-events: none;}
606  .allow-interactivity-`).concat(e,` {pointer-events: all;}
607`)},Xz=0,yi=[];function Zz(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),a=f.useState(Xz++)[0],i=f.useState($2)[0],o=f.useRef(e);f.useEffect(function(){o.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var g=wz([e.lockRef.current],(e.shards||[]).map(Ej),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=f.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var x=Qd(g),w=n.current,v="deltaX"in g?g.deltaX:w[0]-x[0],j="deltaY"in g?g.deltaY:w[1]-x[1],N,S=g.target,k=Math.abs(v)>Math.abs(j)?"h":"v";if("touches"in g&&k==="h"&&S.type==="range")return!1;var C=Cj(k,S);if(!C)return!0;if(C?N=k:(N=k==="v"?"h":"v",C=Cj(k,S)),!C)return!1;if(!r.current&&"changedTouches"in g&&(v||j)&&(r.current=N),!N)return!0;var A=r.current||N;return Yz(A,y,g,A==="h"?v:j,!0)},[]),c=f.useCallback(function(g){var y=g;if(!(!yi.length||yi[yi.length-1]!==i)){var x="deltaY"in y?_j(y):Qd(y),w=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&Qz(N.delta,x)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}
vendor: 4,332 bytes, line 607
607if(!w){var v=(o.current.shards||[]).map(Ej).filter(Boolean).filter(function(N){return N.contains(y.target)}),j=v.length>0?l(y,v[0]):!o.current.noIsolation;j&&y.cancelable&&y.preventDefault()}}},[]),d=f.useCallback(function(g,y,x,w){var v={name:g,delta:y,target:x,should:w,shadowParent:eW(x)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(j){return j!==v})},1)},[]),u=f.useCallback(function(g){n.current=Qd(g),r.current=void 0},[]),h=f.useCallback(function(g){d(g.type,_j(g),g.target,l(g,e.lockRef.current))},[]),p=f.useCallback(function(g){d(g.type,Qd(g),g.target,l(g,e.lockRef.current))},[]);f.useEffect(function(){return yi.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",c,xi),document.addEventListener("touchmove",c,xi),document.addEventListener("touchstart",u,xi),function(){yi=yi.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,xi),document.removeEventListener("touchmove",c,xi),document.removeEventListener("touchstart",u,xi)}},[]);var m=e.removeScrollBar,b=e.inert;return f.createElement(f.Fragment,null,b?f.createElement(i,{styles:Jz(a)}):null,m?f.createElement(Vz,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function eW(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const tW=Pz(F2,Zz);var sd=f.forwardRef(function(e,t){return f.createElement(ff,Pr({},e,{ref:t,sideCar:tW}))});sd.classNames=ff.classNames;var nW=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vi=new WeakMap,Jd=new WeakMap,Xd={},Gm=0,z2=function(e){return e&&(e.host||z2(e.parentNode))},rW=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=z2(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})},sW=function(e,t,n,r){var a=rW(t,Array.isArray(e)?e:[e]);Xd[n]||(Xd[n]=new WeakMap);var i=Xd[n],o=[],l=new Set,c=new Set(a),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};a.forEach(d);var u=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(p){if(l.has(p))u(p);else try{var m=p.getAttribute(r),b=m!==null&&m!=="false",g=(vi.get(p)||0)+1,y=(i.get(p)||0)+1;vi.set(p,g),i.set(p,y),o.push(p),g===1&&b&&Jd.set(p,!0),y===1&&p.setAttribute(n,"true"),b||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return u(t),l.clear(),Gm++,function(){o.forEach(function(h){var p=vi.get(h)-1,m=i.get(h)-1;vi.set(h,p),i.set(h,m),p||(Jd.has(h)||h.removeAttribute(r),Jd.delete(h)),m||h.removeAttribute(n)}),Gm--,Gm||(vi=new WeakMap,vi=new WeakMap,Jd=new WeakMap,Xd={})}},mf=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=nW(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),sW(r,a,n,"aria-hidden")):function(){return null}},pf="Dialog",[W2,H2]=vt(pf),[aW,mr]=W2(pf),K2=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=f.useRef(null),c=f.useRef(null),[d,u]=hn({prop:r,defaultProp:a??!1,onChange:i,caller:pf});return s.jsx(aW,{scope:t,triggerRef:l,contentRef:c,contentId:dn(),titleId:dn(),descriptionId:dn(),open:d,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(h=>!h),[u]),modal:o,children:n})};K2.displayName=pf;var G2="DialogTrigger",q2=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=mr(G2,n),i=xe(t,a.triggerRef);return s.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":gv(a.open),...r,ref:i,onClick:q(e.onClick,a.onOpenToggle)})});q2.displayName=G2;var mv="DialogPortal",[iW,Y2]=W2(mv,{forceMount:void 0}),Q2=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=mr(mv,t);return s.jsx(iW,{scope:t,forceMount:n,children:f.Children.map(r,o=>s.jsx(qt,{present:n||i.open,children:s.jsx(Ro,{asChild:!0,container:a,children:o})}))})};Q2.displayName=mv;var fh="DialogOverlay",J2=f.forwardRef((e,t)=>{const n=Y2(fh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=mr(fh,e.__scopeDialog);return i.modal?s.jsx(qt,{present:r||i.open,children:s.jsx(lW,{...a,ref:t})}):null});J2.displayName=fh;var oW=qs("DialogOverlay.RemoveScroll"),lW=f.forwardRef((e,t)=>
vendor: 4,968 bytes, lines 607-611
607{const{__scopeDialog:n,...r}=e,a=mr(fh,n);return s.jsx(sd,{as:oW,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(ne.div,{"data-state":gv(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ya="DialogContent",X2=f.forwardRef((e,t)=>{const n=Y2(Ya,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=mr(Ya,e.__scopeDialog);return s.jsx(qt,{present:r||i.open,children:i.modal?s.jsx(cW,{...a,ref:t}):s.jsx(dW,{...a,ref:t})})});X2.displayName=Ya;var cW=f.forwardRef((e,t)=>{const n=mr(Ya,e.__scopeDialog),r=f.useRef(null),a=xe(t,n.contentRef,r);return f.useEffect(()=>{const i=r.current;if(i)return mf(i)},[]),s.jsx(Z2,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:q(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:q(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:q(e.onFocusOutside,i=>i.preventDefault())})}),dW=f.forwardRef((e,t)=>{const n=mr(Ya,e.__scopeDialog),r=f.useRef(!1),a=f.useRef(!1);return s.jsx(Z2,{...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,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),Z2=f.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=mr(Ya,n),c=f.useRef(null),d=xe(t,c);return hf(),s.jsxs(s.Fragment,{children:[s.jsx(rd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(ni,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":gv(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(hW,{titleId:l.titleId}),s.jsx(mW,{contentRef:c,descriptionId:l.descriptionId})]})]})}),pv="DialogTitle",eE=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=mr(pv,n);return s.jsx(ne.h2,{id:a.titleId,...r,ref:t})});eE.displayName=pv;var tE="DialogDescription",nE=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=mr(tE,n);return s.jsx(ne.p,{id:a.descriptionId,...r,ref:t})});nE.displayName=tE;var rE="DialogClose",sE=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=mr(rE,n);return s.jsx(ne.button,{type:"button",...r,ref:t,onClick:q(e.onClick,()=>a.onOpenChange(!1))})});sE.displayName=rE;function gv(e){return e?"open":"closed"}var aE="DialogTitleWarning",[uW,iE]=x4(aE,{contentName:Ya,titleName:pv,docsSlug:"dialog"}),hW=({titleId:e})=>{const t=iE(aE),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
608
609If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
610
611For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},fW="DialogDescriptionWarning",mW=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${iE(fW).contentName}}.`;return f.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},xv=K2,pW=q2,yv=Q2,ad=J2,id=X2,od=eE,ld=nE,gf=sE;const gW=xv,xW=yv,oE=f.forwardRef(({className:e,...t},n)=>s.jsx(ad,{className:F("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}));oE.displayName=ad.displayName;const yW=ri("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),lE=f.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(xW,{children:[s.jsx(oE,{}),s.jsxs(id,{ref:a,className:F(yW({side:e}),t),...r,children:[n,s.jsxs(gf,{className:"absolute right-4 top-4 roun
611ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(cs,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));lE.displayName=id.displayName;const vW=f.forwardRef(({className:e,...t},n)=>s.jsx(od,{ref:n,className:F("text-lg font-semibold text-foreground",e),...t}));vW.displayName=od.displayName;const wW=f.forwardRef(({className:e,...t},n)=>s.jsx(ld,{ref:n,className:F("text-sm text-muted-foreground",e),...t}));wW.displayName=ld.displayName;function Ua({className:e,...t}){return s.jsx("div",{className:F("animate-pulse rounded-md bg-muted",e),...t})}const bW="sidebar:state",jW=60*60*24*7,NW="16rem",SW="18rem",kW="3rem",CW="b",cE=f.createContext(null);function cd(){const e=f.useContext(cE);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const dE=f.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},l)=>{const c=T2(),[d,u]=f.useState(!1),[h,p]=f.useState(e),m=t??h,b=f.useCallback(w=>{const v=typeof w=="function"?w(m):w;n?n(v):p(v),document.cookie=`${bW}=${v}; path=/; max-age=${jW}`},[n,m]),g=f.useCallback(()=>c?u(w=>!w):b(w=>!w),[c,b,u]);f.useEffect(()=>{const w=v=>{v.key===CW&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),g())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[g]);const y=m?"expanded":"collapsed",x=f.useMemo(()=>({state:y,open:m,setOpen:b,isMobile:c,openMobile:d,setOpenMobile:u,toggleSidebar:g}),[y,m,b,c,d,u,g]);return s.jsx(cE.Provider,{value:x,children:s.jsx(bo,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":NW,"--sidebar-width-icon":kW,...a},className:F("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:l,...o,children:i})})})});dE.displayName="SidebarProvider";const uE=f.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:a,...i},o)=>{const{isMobile:l,state:c,openMobile:d,setOpenMobile:u}=cd();return n==="none"?s.jsx("div",{className:F("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):l?s.jsx(gW,{open:d,onOpenChange:u,...i,children:s.jsx(lE,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":SW},side:e,children:s.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):s.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":t,"data-side":e,children:[s.jsx("div",{className:F("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),s.jsx("div",{className:F("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})});uE.displayName="Sidebar";const hE=f.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=cd();return s.jsxs(E,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:F("h-7 w-7",e),onClick:i=>{t==null||t(i),a()},...n,children:[s.jsx(AM,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});hE.displayName="SidebarTrigger";const _W=f.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=cd();return s.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:F("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});
611_W.displayName="SidebarRail";const fE=f.forwardRef(({className:e,...t},n)=>s.jsx("main",{ref:n,className:F("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));fE.displayName="SidebarInset";const EW=f.forwardRef(({className:e,...t},n)=>s.jsx(me,{ref:n,"data-sidebar":"input",className:F("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));EW.displayName="SidebarInput";const PW=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:F("flex flex-col gap-2 p-2",e),...t}));PW.displayName="SidebarHeader";const TW=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:F("flex flex-col gap-2 p-2",e),...t}));TW.displayName="SidebarFooter";const AW=f.forwardRef(({className:e,...t},n)=>s.jsx(fv,{ref:n,"data-sidebar":"separator",className:F("mx-2 w-auto bg-sidebar-border",e),...t}));AW.displayName="SidebarSeparator";const mE=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"content",className:F("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));mE.displayName="SidebarContent";const pE=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:F("relative flex w-full min-w-0 flex-col p-2",e),...t}));pE.displayName="SidebarGroup";const gE=f.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Ao:"div";return s.jsx(a,{ref:r,"data-sidebar":"group-label",className:F("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});gE.displayName="SidebarGroupLabel";const RW=f.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Ao:"button";return s.jsx(a,{ref:r,"data-sidebar":"group-action",className:F("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});RW.displayName="SidebarGroupAction";const xE=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:F("w-full text-sm",e),...t}));xE.displayName="SidebarGroupContent";const yE=f.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:F("flex w-full min-w-0 flex-col gap-1",e),...t}));yE.displayName="SidebarMenu";const vE=f.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:F("group/menu-item relative",e),...t}));vE.displayName="SidebarMenuItem";const IW=ri("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),wE=f.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},l)=>{const c=e?Ao:"button",{isMobile:d,state:u}=cd(),h=s.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:F(IW({variant:n,size:r}),i),...o});
611return a?(typeof a=="string"&&(a={children:a}),s.jsxs(gc,{children:[s.jsx(xc,{asChild:!0,children:h}),s.jsx(jo,{side:"right",align:"center",hidden:u!=="collapsed"||d,...a})]})):h});wE.displayName="SidebarMenuButton";const MW=f.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?Ao:"button";return s.jsx(i,{ref:a,"data-sidebar":"menu-action",className:F("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})});MW.displayName="SidebarMenuAction";const OW=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:F("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));OW.displayName="SidebarMenuBadge";const DW=f.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const a=f.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:F("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&s.jsx(Ua,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(Ua,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});DW.displayName="SidebarMenuSkeleton";const LW=f.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:F("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));LW.displayName="SidebarMenuSub";const FW=f.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));FW.displayName="SidebarMenuSubItem";const $W=f.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?Ao:"a";return s.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:F("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...a})});$W.displayName="SidebarMenuSubButton";const UW=[{label:null,items:[{title:"Dashboard",path:"/dashboard",icon:GS},{title:"Upload Images",path:"/upload",icon:rs},{title:"Results",path:"/results",icon:Bn},{title:"History",path:"/history",icon:Zp},{title:"Settings",path:"/settings",icon:Mo}]},{label:"FEATURES",items:[{title:"Templates",path:"/templates",icon:qS},{title:"Languages",path:"/languages",icon:bM},{title:"Integrations",path:"/integrations",icon:RM},{title:"API Keys",path:"/api-keys",icon:La}]},{label:"ACCOUNT",items:[{title:"Upgrade",path:"/#pricing",icon:vM},{title:"Usage",path:"/usage",icon:mM},{title:"Profile",path:"/profile",icon:$h}]}];function BW(){const{open:e}=cd(),t=ai();return s.jsx(uE,{collapsible:"icon",className:"border-r border-border/50 bg-secondary",children:s.jsxs(mE,{children:[s.jsxs("div",{className:"flex items-center gap-3 px-6 py-8 border-b border-primary/20",children:[s.jsx("img",{src:uf,alt:"Altify Pro",className:"h-12 w-auto"}),e&&s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground tracking-wider up
611percase",children:"Premium Edition"})})]}),UW.map((n,r)=>s.jsxs(pE,{className:`px-3 ${r>0?"mt-6":"py-6"}`,children:[n.label&&s.jsx(gE,{className:"text-xs text-muted-foreground tracking-widest uppercase font-medium mb-3 px-3",children:n.label}),s.jsx(xE,{children:s.jsx(yE,{className:"space-y-1",children:n.items.map(a=>{const i=t.pathname===a.path;return s.jsx(vE,{children:s.jsx(wE,{asChild:!0,children:s.jsxs(ye,{to:a.path,className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all duration-200 ${i?"bg-primary text-white font-medium":"text-muted-foreground hover:bg-card/5 hover:text-foreground"}`,children:[s.jsx(a.icon,{className:"h-[18px] w-[18px] flex-shrink-0"}),e&&s.jsx("span",{className:"tracking-wide text-sm",children:a.title})]})})},a.title)})})})]},r))]})})}var qm="rovingFocusGroup.onEntryFocus",VW={bubbles:!1,cancelable:!0},dd="RovingFocusGroup",[qg,bE,zW]=Bc(dd),[WW,xf]=vt(dd,[zW]),[HW,KW]=WW(dd),jE=f.forwardRef((e,t)=>s.jsx(qg.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(qg.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(GW,{...e,ref:t})})}));jE.displayName=dd;var GW=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...h}=e,p=f.useRef(null),m=xe(t,p),b=nd(i),[g,y]=hn({prop:o,defaultProp:l??null,onChange:c,caller:dd}),[x,w]=f.useState(!1),v=Wt(d),j=bE(n),N=f.useRef(!1),[S,k]=f.useState(0);return f.useEffect(()=>{const C=p.current;if(C)return C.addEventListener(qm,v),()=>C.removeEventListener(qm,v)},[v]),s.jsx(HW,{scope:n,orientation:r,dir:b,loop:a,currentTabStopId:g,onItemFocus:f.useCallback(C=>y(C),[y]),onItemShiftTab:f.useCallback(()=>w(!0),[]),onFocusableItemAdd:f.useCallback(()=>k(C=>C+1),[]),onFocusableItemRemove:f.useCallback(()=>k(C=>C-1),[]),children:s.jsx(ne.div,{tabIndex:x||S===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:q(e.onMouseDown,()=>{N.current=!0}),onFocus:q(e.onFocus,C=>{const A=!N.current;if(C.target===C.currentTarget&&A&&!x){const R=new CustomEvent(qm,VW);if(C.currentTarget.dispatchEvent(R),!R.defaultPrevented){const G=j().filter(z=>z.focusable),W=G.find(z=>z.active),$=G.find(z=>z.id===g),K=[W,$,...G].filter(Boolean).map(z=>z.ref.current);kE(K,u)}}N.current=!1}),onBlur:q(e.onBlur,()=>w(!1))})})}),NE="RovingFocusGroupItem",SE=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...l}=e,c=dn(),d=i||c,u=KW(NE,n),h=u.currentTabStopId===d,p=bE(n),{onFocusableItemAdd:m,onFocusableItemRemove:b,currentTabStopId:g}=u;return f.useEffect(()=>{if(r)return m(),()=>b()},[r,m,b]),s.jsx(qg.ItemSlot,{scope:n,id:d,focusable:r,active:a,children:s.jsx(ne.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:q(e.onMouseDown,y=>{r?u.onItemFocus(d):y.preventDefault()}),onFocus:q(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:q(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=QW(y,u.orientation,u.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let v=p().filter(j=>j.focusable).map(j=>j.ref.current);if(x==="last")v.reverse();else if(x==="prev"||x==="next"){x==="prev"&&v.reverse();const j=v.indexOf(y.currentTarget);v=u.loop?JW(v,j+1):v.slice(j+1)}setTimeout(()=>kE(v))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:g!=null}):o})})});SE.displayName=NE;var qW={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function YW(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function QW(e,t,n){const r=YW(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return qW[r]}function kE(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function JW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CE=jE,_E=SE,Yg=["Enter"," "],XW=["ArrowDown","PageUp","Home"],EE=["ArrowUp","PageDown","End"],ZW=[...XW,...EE],e7={ltr:[...Yg,"ArrowRight"],rtl:[...Yg,"ArrowLeft"]},t7={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ud="Menu",[Tc,n7,r7]=Bc(ud),[oi,PE]=vt(ud,[r7,sa,xf]),yf=sa(),TE=xf(),[s7,li]=oi(ud),[a7,hd]=oi(ud),AE=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,l=yf(t),[c,d]=f.useState(null),u=f.useRef(!1),h=Wt(i),p=nd(a);return f.useEffect(()=>{const m=()=>{u.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>u.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),s.jsx(zh,{...l,children:s.jsx(s7,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:d,children:s.jsx(a7,{scope:t,onClose:f.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:u,dir:p,modal:o,children:r})})})};AE.displayName=ud;var i7="MenuAnchor",vv=f.forwardRef((e,t)=>
vendor: 12,890 bytes, line 611
611{const{__scopeMenu:n,...r}=e,a=yf(n);return s.jsx(qc,{...a,...r,ref:t})});vv.displayName=i7;var wv="MenuPortal",[o7,RE]=oi(wv,{forceMount:void 0}),IE=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=li(wv,t);return s.jsx(o7,{scope:t,forceMount:n,children:s.jsx(qt,{present:n||i.open,children:s.jsx(Ro,{asChild:!0,container:a,children:r})})})};IE.displayName=wv;var Ln="MenuContent",[l7,bv]=oi(Ln),ME=f.forwardRef((e,t)=>{const n=RE(Ln,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=li(Ln,e.__scopeMenu),o=hd(Ln,e.__scopeMenu);return s.jsx(Tc.Provider,{scope:e.__scopeMenu,children:s.jsx(qt,{present:r||i.open,children:s.jsx(Tc.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(c7,{...a,ref:t}):s.jsx(d7,{...a,ref:t})})})})}),c7=f.forwardRef((e,t)=>{const n=li(Ln,e.__scopeMenu),r=f.useRef(null),a=xe(t,r);return f.useEffect(()=>{const i=r.current;if(i)return mf(i)},[]),s.jsx(jv,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:q(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),d7=f.forwardRef((e,t)=>{const n=li(Ln,e.__scopeMenu);return s.jsx(jv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),u7=qs("MenuContent.ScrollLock"),jv=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:p,onDismiss:m,disableOutsideScroll:b,...g}=e,y=li(Ln,n),x=hd(Ln,n),w=yf(n),v=TE(n),j=n7(n),[N,S]=f.useState(null),k=f.useRef(null),C=xe(t,k,y.onContentChange),A=f.useRef(0),R=f.useRef(""),G=f.useRef(0),W=f.useRef(null),$=f.useRef("right"),M=f.useRef(0),K=b?sd:f.Fragment,z=b?{as:u7,allowPinchZoom:!0}:void 0,I=_=>{var Q,be;const U=R.current+_,Z=j().filter(ve=>!ve.disabled),ee=document.activeElement,ie=(Q=Z.find(ve=>ve.ref.current===ee))==null?void 0:Q.textValue,de=Z.map(ve=>ve.textValue),Re=N7(de,U,ie),Ee=(be=Z.find(ve=>ve.textValue===Re))==null?void 0:be.ref.current;(function ve(Se){R.current=Se,window.clearTimeout(A.current),Se!==""&&(A.current=window.setTimeout(()=>ve(""),1e3))})(U),Ee&&setTimeout(()=>Ee.focus())};f.useEffect(()=>()=>window.clearTimeout(A.current),[]),hf();const P=f.useCallback(_=>{var Z,ee;return $.current===((Z=W.current)==null?void 0:Z.side)&&k7(_,(ee=W.current)==null?void 0:ee.area)},[]);return s.jsx(l7,{scope:n,searchRef:R,onItemEnter:f.useCallback(_=>{P(_)&&_.preventDefault()},[P]),onItemLeave:f.useCallback(_=>{var U;P(_)||((U=k.current)==null||U.focus(),S(null))},[P]),onTriggerLeave:f.useCallback(_=>{P(_)&&_.preventDefault()},[P]),pointerGraceTimerRef:G,onPointerGraceIntentChange:f.useCallback(_=>{W.current=_},[]),children:s.jsx(K,{...z,children:s.jsx(rd,{asChild:!0,trapped:a,onMountAutoFocus:q(i,_=>{var U;_.preventDefault(),(U=k.current)==null||U.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(ni,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:p,onDismiss:m,children:s.jsx(CE,{asChild:!0,...v,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:S,onEntryFocus:q(c,_=>{x.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Wh,{role:"menu","aria-orientation":"vertical","data-state":QE(y.open),"data-radix-menu-content":"",dir:x.dir,...w,...g,ref:C,style:{outline:"none",...g.style},onKeyDown:q(g.onKeyDown,_=>{const Z=_.target.closest("[data-radix-menu-content]")===_.currentTarget,ee=_.ctrlKey||_.altKey||_.metaKey,ie=_.key.length===1;Z&&(_.key==="Tab"&&_.preventDefault(),!ee&&ie&&I(_.key));const de=k.current;if(_.target!==de||!ZW.includes(_.key))return;_.preventDefault();const Ee=j().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);EE.includes(_.key)&&Ee.reverse(),b7(Ee)}),onBlur:q(e.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(A.current),R.current="")}),onPointerMove:q(e.onPointerMove,Ac(_=>{const U=_.target,Z=M.current!==_.clientX;if(_.currentTarget.contains(U)&&Z){const ee=_.clientX>M.current?"right":"left";$.current=ee,M.current=_.clientX}}))})})})})})})});ME.displayName=Ln;var h7="MenuGroup",Nv=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ne.div,{role:"group",...r,ref:t})});Nv.displayName=h7;var f7="MenuLabel",OE=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ne.div,{...r,ref:t})});OE.displayName=f7;var mh="MenuItem",Pj="menu.itemSelect",vf=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=f.useRef(null),o=hd(mh,e.__scopeMenu),l=bv(mh,e.__scopeMenu),c=xe(t,i),d=f.useRef(!1),u=()=>{const h=i.current;if(!n&&h){const p=new CustomEvent(Pj,{bubbles:!0,cancelable:!0});h.addEventListener(Pj,m=>r==null?void 0:r(m),{once:!0}),Xx(h,p),p.defaultPrevented?d.current=!1:o.onClose()}};return s.jsx(DE,{...a,ref:c,disabled:n,onClick:q(e.onClick,u),onPointerDown:h=>{var p;(p=e.onPointerDown)==null||p.call(e,h),d.current=!0},onPointerUp:q(e.onPointerUp,h=>{var p;d.current||(p=h.currentTarget)==null||p.click()}),onKeyDown:q(e.onKeyDown,h=>{const p=l.searchRef.current!=="";n||p&&h.key===" "||Yg.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});vf.displayName=mh;var DE=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=bv(mh,n),l=TE(n),c=f.useRef(null),d=xe(t,c),[u,h]=f.useState(!1),[p,m]=f.useState("");return f.useEffect(()=>{const b=c.current;b&&m((b.textContent??"").trim())},[i.children]),s.jsx(Tc.ItemSlot,{scope:n,disabled:r,textValue:a??p,children:s.jsx(_E,{asChild:!0,...l,focusable:!r,children:s.jsx(ne.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:q(e.onPointerMove,Ac(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:q(e.onPointerLeave,Ac(b=>o.onItemLeave(b))),onFocus:q(e.onFocus,()=>h(!0)),onBlur:q(e.onBlur,()=>h(!1))})})})}),m7="MenuCheckboxItem",LE=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(VE,{scope:e.__scopeMenu,checked:n,children:s.jsx(vf,{role:"menuitemcheckbox","aria-checked":ph(n)?"mixed":n,...a,ref:t,"data-state":kv(n),onSelect:q(a.onSelect,()=>r==null?void 0:r(ph(n)?!0:!n),{checkForDefaultPrevented:!1})})})});LE.displayName=m7;var FE="MenuRadioGroup",[p7,g7]=oi(FE,{value:void 0,onValueChange:()=>{}}),$E=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Wt(r);return s.jsx(p7,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(Nv,{...a,ref:t})})});$E.displayName=FE;var UE="MenuRadioItem",BE=f.forwardRef((e,t)=>{const{value:n,...r}=e,a=g7(UE,e.__scopeMenu),i=n===a.value;return s.jsx(VE,{scope:e.__scopeMenu,checked:i,children:s.jsx(vf,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":kv(i),onSelect:q(r.onSelect,()=>{var o;return(o=a.onValueChange)==null?void 0:o.call(a,n)},{checkForDefaultPrevented:!1})})})});BE.displayName=UE;var Sv="MenuItemIndicator",[VE,x7]=oi(Sv,{checked:!1}),zE=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=x7(Sv,n);return s.jsx(qt,{present:r||ph(i.checked)||i.checked===!0,children:s.jsx(ne.span,{...a,ref:t,"data-state":kv(i.checked)})})});zE.displayName=Sv;var y7="MenuSeparator",WE=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ne.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});WE.displayName=y7;var v7="MenuArrow",HE=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=yf(n);return s.jsx(Hh,{...a,...r,ref:t})});HE.displayName=v7;var w7="MenuSub",[Lq,KE]=oi(w7),Cl="MenuSubTrigger",GE=f.forwardRef((e,t)=>{const n=li(Cl,e.__scopeMenu),r=hd(Cl,e.__scopeMenu),a=KE(Cl,e.__scopeMenu),i=bv(Cl,e.__scopeMenu),o=f.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:e.__scopeMenu},u=f.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return f.useEffect(()=>u,[u]),f.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),c(null)}},[l,c]),s.jsx(vv,{asChild:!0,...d,children:s.jsx(DE,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":QE(n.open),...e,ref:Oh(t,a.onTriggerChange),onClick:h=>{var p;(p=e.onClick)==null||p.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:q(e.onPointerMove,Ac(h=>{i.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:q(e.onPointerLeave,Ac(h=>{var m,b;u();const p=(m=n.content)==null?void 0:m.getBoundingClientRect();if(p){const g=(b=n.content)==null?void 0:b.dataset.side,y=g==="right",x=y?-5:5,w=p[y?"left":"right"],v=p[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:h.clientX+x,y:h.clientY},{x:w,y:p.top},{x:v,y:p.top},{x:v,y:p.bottom},{x:w,y:p.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(h),h.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:q(e.onKeyDown,h=>{var m;const p=i.searchRef.current!=="";e.disabled||p&&h.key===" "||e7[r.dir].includes(h.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),h.preventDefault())})})})});GE.displayName=Cl;var qE="MenuSubContent",YE=f.forwardRef((e,t)=>{const n=RE(Ln,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=li(Ln,e.__scopeMenu),o=hd(Ln,e.__scopeMenu),l=KE(qE,e.__scopeMenu),c=f.useRef(null),d=xe(t,c);return s.jsx(Tc.Provider,{scope:e.__scopeMenu,children:s.jsx(qt,{present:r||i.open,children:s.jsx(Tc.Slot,{scope:e.__scopeMenu,children:s.jsx(jv,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var h;o.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:q(e.onFocusOutside,u=>{u.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:q(e.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:q(e.onKeyDown,u=>{var m;const h=u.currentTarget.contains(u.target),p=t7[o.dir].includes(u.key);h&&p&&(i.onOpenChange(!1),(m=l.trigger)==null||m.focus(),u.preventDefault())})})})})})});YE.displayName=qE;function QE(e){return e?"open":"closed"}function ph(e){return e==="indeterminate"}function kv(e){return ph(e)?"indeterminate":e?"checked":"unchecked"}function b7(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function j7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function N7(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=j7(e,Math.max(i,0));a.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function S7(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],d=l.x,u=l.y,h=c.x,p=c.y;u>r!=p>r&&n<(h-d)*(r-u)/(p-u)+d&&(a=!a)}return a}function k7(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return S7(n,t)}function Ac(e){return t=>t.pointerType==="mouse"?e(t):void 0}var C7=AE,_7=vv,E7=IE,P7=ME,T7=Nv,A7=OE,R7=vf,I7=LE,M7=$E,O7=BE,D7=zE,L7=WE,F7=HE,$7=GE,U7=YE,wf="DropdownMenu",[B7,Fq]=vt(wf,[PE]),Yt=PE(),[V7,JE]=B7(wf),XE=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,c=Yt(t),d=f.useRef(null),[u,h]=hn({prop:a,defaultProp:i??!1,onChange:o,caller:wf});return s.jsx(V7,{scope:t,triggerId:dn(),triggerRef:d,contentId:dn(),open:u,onOpenChange:h,onOpenToggle:f.useCallback(()=>h(p=>!p),[h]),modal:l,children:s.jsx(C7,{...c,open:u,onOpenChange:h,dir:r,modal:l,children:n})})};XE.displayName=wf;var ZE="DropdownMenuTrigger",eP=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=JE(ZE,n),o=Yt(n);return s.jsx(_7,{asChild:!0,...o,children:s.jsx(ne.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Oh(t,i.triggerRef),onPointerDown:q(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:q(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});eP.displayName=ZE;var z7="DropdownMenuPortal",tP=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Yt(t);return s.jsx(E7,{...r,...n})};tP.displayName=z7;var nP="DropdownMenuContent",rP=f.forwardRef((e,t)=>
611{const{__scopeDropdownMenu:n,...r}=e,a=JE(nP,n),i=Yt(n),o=f.useRef(!1);return s.jsx(P7,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:q(e.onCloseAutoFocus,l=>{var c;o.current||(c=a.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:q(e.onInteractOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,u=c.button===2||d;(!a.modal||u)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});rP.displayName=nP;var W7="DropdownMenuGroup",H7=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yt(n);return s.jsx(T7,{...a,...r,ref:t})});H7.displayName=W7;var K7="DropdownMenuLabel",sP=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yt(n);return s.jsx(A7,{...a,...r,ref:t})});sP.displayName=K7;var G7="DropdownMenuItem",aP=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yt(n);return s.jsx(R7,{...a,...r,ref:t})});aP.displayName=G7;var q7="DropdownMenuCheckboxItem",iP=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yt(n);return s.jsx(I7,{...a,...r,ref:t})});iP.displayName=q7;var Y7="DropdownMenuRadioGroup",Q7=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yt(n);return s.jsx(M7,{...a,...r,ref:t})});Q7.displayName=Y7;var J7="DropdownMenuRadioItem",oP=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yt(n);return s.jsx(O7,{...a,...r,ref:t})});oP.displayName=J7;var X7="DropdownMenuItemIndicator",lP=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yt(n);return s.jsx(D7,{...a,...r,ref:t})});lP.displayName=X7;var Z7="DropdownMenuSeparator",cP=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yt(n);return s.jsx(L7,{...a,...r,ref:t})});cP.displayName=Z7;var eH="DropdownMenuArrow",tH=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yt(n);return s.jsx(F7,{...a,...r,ref:t})});tH.displayName=eH;var nH="DropdownMenuSubTrigger",dP=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yt(n);return s.jsx($7,{...a,...r,ref:t})});dP.displayName=nH;var rH="DropdownMenuSubContent",uP=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Yt(n);return s.jsx(U7,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uP.displayName=rH;var sH=XE,aH=eP,iH=tP,hP=rP,fP=sP,mP=aP,pP=iP,gP=oP,xP=lP,yP=cP,vP=dP,wP=uP;const oH=sH,lH=aH,cH=f.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(vP,{ref:a,className:F("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,s.jsx(Xp,{className:"ml-auto h-4 w-4"})]}));cH.displayName=vP.displayName;const dH=f.forwardRef(({className:e,...t},n)=>s.jsx(wP,{ref:n,className:F("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...t}));dH.displayName=wP.displayName;const bP=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(iH,{children:s.jsx(hP,{ref:r,sideOffset:t,className:F("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg 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]:sli
611de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));bP.displayName=hP.displayName;const Qg=f.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(mP,{ref:r,className:F("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm text-popover-foreground outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));Qg.displayName=mP.displayName;const uH=f.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(pP,{ref:a,className:F("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm text-popover-foreground outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(xP,{children:s.jsx(Me,{className:"h-4 w-4"})})}),t]}));uH.displayName=pP.displayName;const hH=f.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(gP,{ref:r,className:F("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm text-popover-foreground outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(xP,{children:s.jsx(WS,{className:"h-2 w-2 fill-current"})})}),t]}));hH.displayName=gP.displayName;const jP=f.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(fP,{ref:r,className:F("px-2 py-1.5 text-sm font-semibold text-popover-foreground",t&&"pl-8",e),...n}));jP.displayName=fP.displayName;const Jg=f.forwardRef(({className:e,...t},n)=>s.jsx(yP,{ref:n,className:F("-mx-1 my-1 h-px bg-muted",e),...t}));Jg.displayName=yP.displayName;var NP={exports:{}},SP={};/**
612 * @license React
613 * use-sync-external-store-shim.production.js
614 *
615 * Copyright (c) Meta Platforms, Inc. and affiliates.
616 *
617 * This source code is licensed under the MIT license found in the
618 * LICENSE file in the root directory of this source tree.
619 */var Co=f;function fH(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mH=typeof Object.is=="function"?Object.is:fH,pH=Co.useState,gH=Co.useEffect,xH=Co.useLayoutEffect,yH=Co.useDebugValue;function vH(e,t){var n=t(),r=pH({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return xH(function(){a.value=n,a.getSnapshot=t,Ym(a)&&i({inst:a})},[e,n,t]),gH(function(){return Ym(a)&&i({inst:a}),e(function(){Ym(a)&&i({inst:a})})},[e]),yH(n),n}function Ym(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mH(e,n)}catch{return!0}}function wH(e,t){return t()}var bH=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?wH:vH;SP.useSyncExternalStore=Co.useSyncExternalStore!==void 0?Co.useSyncExternalStore:bH;NP.exports=SP;var jH=NP.exports;function NH(){return jH.useSyncExternalStore(SH,()=>!0,()=>!1)}function SH(){return()=>{}}var Cv="Avatar",[kH,$q]=vt(Cv),[CH,kP]=kH(Cv),CP=f.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[a,i]=f.useState("idle");return s.jsx(CH,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:s.jsx(ne.span,{...r,ref:t})})});CP.displayName=Cv;var _P="AvatarImage",EP=f.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:a=()=>{},...i}=e,o=kP(_P,n),l=_H(r,i),c=Wt(d=>{a(d),o.onImageLoadingStatusChange(d)});return ot(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?s.jsx(ne.img,{...i,ref:t,src:r}):null});EP.displayName=_P;var PP="AvatarFallback",TP=f.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...a}=e,i=kP(PP,n),[o,l]=f.useState(r===void 0);return f.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&i.imageLoadingStatus!=="loaded"?s.jsx(ne.span,{...a,ref:t}):null});TP.displayName=PP;function Tj(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function _H(e,{referrerPolicy:t,crossOrigin:n}
vendor: 4,362 bytes, lines 619-624
619){const r=NH(),a=f.useRef(null),i=r?(a.current||(a.current=new window.Image),a.current):null,[o,l]=f.useState(()=>Tj(i,e));return ot(()=>{l(Tj(i,e))},[i,e]),ot(()=>{const c=h=>()=>{l(h)};if(!i)return;const d=c("loaded"),u=c("error");return i.addEventListener("load",d),i.addEventListener("error",u),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",d),i.removeEventListener("error",u)}},[i,n,t]),o}var AP=CP,RP=EP,IP=TP;const _v=f.forwardRef(({className:e,...t},n)=>s.jsx(AP,{ref:n,className:F("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));_v.displayName=AP.displayName;const MP=f.forwardRef(({className:e,...t},n)=>s.jsx(RP,{ref:n,className:F("aspect-square h-full w-full",e),...t}));MP.displayName=RP.displayName;const Ev=f.forwardRef(({className:e,...t},n)=>s.jsx(IP,{ref:n,className:F("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Ev.displayName=IP.displayName;var Pv="Progress",Tv=100,[EH,Uq]=vt(Pv),[PH,TH]=EH(Pv),OP=f.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=AH,...o}=e;(a||a===0)&&!Aj(a)&&console.error(RH(`${a}`,"Progress"));const l=Aj(a)?a:Tv;r!==null&&!Rj(r,l)&&console.error(IH(`${r}`,"Progress"));const c=Rj(r,l)?r:null,d=gh(c)?i(c,l):void 0;return s.jsx(PH,{scope:n,value:c,max:l,children:s.jsx(ne.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":gh(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":FP(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});OP.displayName=Pv;var DP="ProgressIndicator",LP=f.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=TH(DP,n);return s.jsx(ne.div,{"data-state":FP(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});LP.displayName=DP;function AH(e,t){return`${Math.round(e/t*100)}%`}function FP(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function gh(e){return typeof e=="number"}function Aj(e){return gh(e)&&!isNaN(e)&&e>0}function Rj(e,t){return gh(e)&&!isNaN(e)&&e<=t&&e>=0}function RH(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Tv}\`.`}function IH(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
620  - a positive number
621  - less than the value passed to \`max\` (or ${Tv} if no \`max\` prop is set)
622  - \`null\` or \`undefined\` if the progress is indeterminate.
623
624Defaulting to \`null\`.`}var $P=OP,MH=LP;const Vn=f.forwardRef(({className:e,value:t,...n},r)=>s.jsx($P,{ref:r,className:F("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(MH,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Vn.displayName=$P.displayName;var bf="Popover",[UP,Bq]=vt(bf,[sa]),fd=sa(),[OH,la]=UP(bf),BP=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=fd(t),c=f.useRef(null),[d,u]=f.useState(!1),[h,p]=hn({prop:r,defaultProp:a??!1,onChange:i,caller:bf});return s.jsx(zh,{...l,children:s.jsx(OH,{scope:t,contentId:dn(),triggerRef:c,open:h,onOpenChange:p,onOpenToggle:f.useCallback(()=>p(m=>!m),[p]),hasCustomAnchor:d,onCustomAnchorAdd:f.useCallback(()=>u(!0),[]),onCustomAnchorRemove:f.useCallback(()=>u(!1),[]),modal:o,children:n})})};BP.displayName=bf;var VP="PopoverAnchor",DH=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=la(VP,n),i=fd(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return f.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(qc,{...i,...r,ref:t})});DH.displayName=VP;var zP="PopoverTrigger",WP=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=la(zP,n),i=fd(n),o=xe(t,a.triggerRef),l=s.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":YP(a.open),...r,ref:o,onClick:q(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:s.jsx(qc,{asChild:!0,...i,children:l})});WP.displayName=zP;var Av="PopoverPortal",[LH,FH]=UP(Av,{forceMount:void 0}),HP=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=la(Av,t);return s.jsx(LH,{scope:t,forceMount:n,children:s.jsx(qt,{present:n||i.open,children:s.jsx(Ro,{asChild:!0,container:a,children:r})})})};HP.displayName=Av;var _o="PopoverContent",KP=f.forwardRef((e,t)=>
624{const n=FH(_o,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=la(_o,e.__scopePopover);return s.jsx(qt,{present:r||i.open,children:i.modal?s.jsx(UH,{...a,ref:t}):s.jsx(BH,{...a,ref:t})})});KP.displayName=_o;var $H=qs("PopoverContent.RemoveScroll"),UH=f.forwardRef((e,t)=>{const n=la(_o,e.__scopePopover),r=f.useRef(null),a=xe(t,r),i=f.useRef(!1);return f.useEffect(()=>{const o=r.current;if(o)return mf(o)},[]),s.jsx(sd,{as:$H,allowPinchZoom:!0,children:s.jsx(GP,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:q(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:q(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:q(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),BH=f.forwardRef((e,t)=>{const n=la(_o,e.__scopePopover),r=f.useRef(!1),a=f.useRef(!1);return s.jsx(GP,{...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,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),GP=f.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...h}=e,p=la(_o,n),m=fd(n);return hf(),s.jsx(rd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(ni,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>p.onOpenChange(!1),children:s.jsx(Wh,{"data-state":YP(p.open),role:"dialog",id:p.contentId,...m,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),qP="PopoverClose",VH=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=la(qP,n);return s.jsx(ne.button,{type:"button",...r,ref:t,onClick:q(e.onClick,()=>a.onOpenChange(!1))})});VH.displayName=qP;var zH="PopoverArrow",WH=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=fd(n);return s.jsx(Hh,{...a,...r,ref:t})});WH.displayName=zH;function YP(e){return e?"open":"closed"}var HH=BP,KH=WP,GH=HP,QP=KP;const qH=HH,YH=KH,JP=f.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(GH,{children:s.jsx(QP,{ref:a,align:t,sideOffset:n,className:F("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",e),...r})}));JP.displayName=QP.displayName;function QH({used:e,limit:t,onClose:n}){const r=hr(),a=e/t*100,i=t-e,o=()=>{n(),r("/usage")},l=()=>{n(),r("/settings")};return s.jsxs(L,{className:"w-80 shadow-lg",children:[s.jsxs(Te,{children:[s.jsx(Ae,{className:"text-lg",children:"Credit Usage"}),s.jsx(We,{children:"This month's activity"})]}),s.jsxs(Ne,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Images processed"}),s.jsxs("span",{className:"font-medium",children:[e," / ",t]})]}),s.jsx(Vn,{value:a,className:"h-2"}),s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:[i," credits remaining"]}),s.jsxs("span",{children:[a.toFixed(0),"% used"]})]})]}),a>=80&&s.jsx("div",{className:"p-3 bg-warning/10 border border-warning/20 rounded-lg",children:s.jsxs("p",{className:"text-sm text-warning-foreground flex items-center gap-2",children:[s.jsx(JS,{className:"h-4 w-4"}),"You're running low on credits"]})}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(E,{variant:"outline",size:"sm",onClick:o,className:"flex-1",children:["View Details",s.jsx(uc,{className:"ml-2 h-4 w-4"})]}),s.jsx(E,{size:"sm",onClick:l,className:"flex-1",children:"Upgrade Plan"})]})]})]})}const JH=({used:e,limit:t})=>{const n=hr(),[r,a]=f.useState(!1),i=e/t*100,o=t-e,l=()=>i>=90?"text-destructive":i>=70?"text-yellow-600":"text-primary",c=()=>i>=90?"[&>div]:bg-destructive":i>=70?"[&>div]:bg-yellow-500":"[&>div]:bg-primary",d=()=>{a(!1),n("/settings")};return s.jsxs(qH,{open:r,onOpenChange:a,children:[s.jsx(YH,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 rounded-lg bg-background/30 border border-primary/20 cursor-pointer hover:bg-background/40 transition-all duration-300",children:[s.jsx(gM,{className:`h-4 w-4 ${l()}`}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground tracking-wider up
624percase font-medium",children:"Credits"}),s.jsx("span",{className:`text-sm font-semibold ${l()}`,children:o})]}),s.jsx(Vn,{value:i,className:`h-1.5 w-24 bg-background/50 ${c()}`})]}),i>=70&&s.jsx(E,{size:"sm",variant:"outline",className:"text-xs border-primary/30 hover:bg-primary/10 hover:text-primary",onClick:u=>{u.stopPropagation(),d()},children:"Upgrade"})]})}),s.jsx(JP,{className:"w-auto p-0 z-50",align:"end",children:s.jsx(QH,{used:e,limit:t,onClose:()=>a(!1)})})]})},Ij={free:{name:"Free",priceId:"price_1SKX1KDLNWqA0awMpf8m8aPv",productId:"prod_TH5BFkBipUWTWa",imagesPerMonth:25,price:0,features:["25 images per month","Basic alt text generation"]},starter:{name:"Starter",priceId:"price_1SKX5TDLNWqA0awM5g0SLbQP",productId:"prod_TH5FAElcXJTIUS",imagesPerMonth:200,price:29,features:["200 images per month","Full metadata generation","Alt Text, Title, Description","Caption, Filename, Keywords"]},pro:{name:"Pro",priceId:"price_1SKXHyDLNWqA0awMvs1rqmU4",productId:"prod_TH5SeEAcWEGAed",imagesPerMonth:1e3,price:79,features:["1,000 images per month","Priority processing","OG Tags & Schema Markup","API access"]},enterprise:{name:"Enterprise",priceId:"price_1SKXGJDLNWqA0awMQCTiInM0",productId:"prod_TH5Rp2aJT9I6f7",imagesPerMonth:5e3,price:199,features:["5,000 images per month","Unlimited API access","Priority support","Custom integrations"]}},Rv=()=>{const[e,t]=f.useState(null),[n,r]=f.useState(null),[a,i]=f.useState(!0),{toast:o}=Uc();return f.useEffect(()=>{const l=async()=>{try{const{data:{user:d}}=await V.auth.getUser();if(!d){i(!1);return}const{data:u,error:h}=await V.functions.invoke("check-subscription");h&&console.error("Error checking subscription:",h);const p=u!=null&&u.plan?u.plan.charAt(0).toUpperCase()+u.plan.slice(1):"Free",m=p.toLowerCase(),b=Ij[m]||Ij.free;t({id:(u==null?void 0:u.product_id)||"",plan_name:p,status:u!=null&&u.subscribed?"active":"inactive",current_period_end:(u==null?void 0:u.subscription_end)||null,cancel_at_period_end:!1,image_limit:b.imagesPerMonth,storage_limit_gb:5,stripe_customer_id:null,stripe_subscription_id:null});const g=new Date().toISOString().slice(0,7)+"-01",{data:y,error:x}=await V.from("usage_tracking").select("*").eq("user_id",d.id).eq("month",g).single();x&&x.code!=="PGRST116"&&console.error("Error fetching usage:",x),r({images_processed:(y==null?void 0:y.images_processed)||0,month:g})}catch(d){console.error("Error in fetchSubscriptionAndUsage:",d),o({title:"Error",description:"Failed to load subscription data",variant:"destructive"})}finally{i(!1)}};l();const c=setInterval(l,6e4);return()=>{clearInterval(c)}},[o]),{subscription:e,usage:n,loading:a}},XH=()=>{const e=hr(),{subscription:t,usage:n,loading:r}=Rv(),a=async()=>{await V.auth.signOut(),T.success("Logged out successfully"),e("/")},i=(n==null?void 0:n.images_processed)||0,o=(t==null?void 0:t.image_limit)||100;return s.jsx("header",{className:"sticky top-0 z-50 border-b border-primary/20 bg-secondary/95 backdrop-blur supports-[backdrop-filter]:bg-secondary/80",children:s.jsxs("div",{className:"flex h-16 items-center justify-between px-6",children:[s.jsx("div",{className:"flex items-center gap-4",children:s.jsx(hE,{className:"text-muted-foreground hover:text-foreground transition-colors"})}),s.jsxs("div",{className:"flex items-center gap-6",children:[!r&&s.jsx("div",{className:"hidden md:block",children:s.jsx(JH,{used:i,limit:o})}),s.jsxs(oH,{children:[s.jsx(lH,{asChild:!0,children:s.jsx(E,{variant:"ghost",className:"relative h-10 w-10 rounded-full hover:bg-background/30",children:s.jsx(_v,{className:"h-10 w-10 ring-1 ring-primary/20",children:s.jsx(Ev,{className:"bg-primary/10 text-primary font-medium",children:s.jsx($h,{className:"h-5 w-5"})})})})}),s.jsxs(bP,{className:"w-56 bg-popover text-popover-foreground border-border shadow-lg z-50",align:"end",forceMount:!0,children:[s.jsx(jP,{className:"font-heading text-popover-foreground",children:"Premium Account"}),s.jsx(Jg,{className:"bg-border"}),s.jsxs(Qg,{onClick:()=>e("/dashboard#settings"),className:"cursor-pointer text-popover-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[s.jsx(Mo,{className:"mr-2 h-4 w-4"}),s.jsx("span",{children:"Settings"})]}),s.jsx(Jg,{className:"bg-border"}),s.jsxs(Qg,{onClick:a,className:"cursor-pointer text-popover-foreground hover:bg-destructive/10 hover:text-destructive focus:bg-destructive/10 focus:text-destructive",children:[s.jsx(CM,{className:"mr-2 h-4 w-4"}),s.jsx("span",{children:"Log out"})]})]})]})]})]})})};function ZH(){return s.jsx(dE,{children:s.jsxs("div",{className:"min-h-screen flex w-full bg-background",children:[s.jsx(BW,{}),s.jsxs(fE,{className:"flex-1",children:[s.jsx(XH,{}),s.jsx("main",{className:"p-6 lg:p-12",children:s.jsx(X3,{})})]})]})})}function eK(){const e={imagesThisMonth:5,imageLimit:10,apiCalls:0,storageUsedMB:2.4,storageLimitMB:100,languagesUsed:1},t=[{id:1,fileName:"product-hero.jpg",altText:"Modern laptop on wooden desk with coffee",timestamp:"2 hours ago"},{id:2,fileName:"team-photo.png",altText:"Professional team meeting in conference room",timestamp:"5 hours ago"},{id:3,fileName:"blog-header.jpg",altText:"Developer coding on multiple monitors",timestamp:"1 day ago"},{id:4,fileName:"feature-image.png",altText:"SEO analytics dashboard showing traffic growth",timestamp:"2 days ago"},{id:5,fileName:"social-post.jpg",altText:"Woman presenting data visualization on screen",timestamp:"3 days ago"}],n=["Alt Text (SEO-optimized)","Title Tags","Image Captions","Optimized Filenames","Open Graph Tags","Schema Markup"],r=e.imagesThisMonth/e.imageLimit*100,a=r>70;return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-heading text-4xl font-bold mb-2",children:"Welcome back, Pro User 👋"}),s.jsx("p",{className:"text-muted-foreground",children:"Here's what's happening with your SEO content today"})]}),s.jsxs(ae,{variant:"outline",className:"text-sm px-4 py-2",children:["Free Plan • ",s.jsx("a",{href:"/#pricing",className:"ml-1 text-primary hover:underline",children:"Upgrade"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[s.jsx(L,{className:"p-6 hover:shadow-lg transition-shadow",children:s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Images This Month"}),s.jsxs("p",{className:"text-3xl font-bold",children:[e.imagesThisMonth," / ",e.imageLimit]})]}),s.jsx("div",{className:"p-3 rounded-lg bg-primary/10",children:s.jsx(hc,{className:"h-6 w-6 text-primary"})})]})}),s.jsxs(L,{className:"p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"API Calls"}),s.jsx("p",{className:"text-3xl font-bold",children:e.apiCalls})]}),s.jsx("div",{className:"p-3 rounded-lg bg-yellow-500/10",children:s.jsx(ay,{className:"h-6 w-6 text-yellow-500"})})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"This month"})]}),s.jsxs(L,{className:"p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Languages Used"}),s.jsx("p",{className:"text-3xl font-bold",children:e.languagesUsed})]}),s.jsx("div",{className:"p-3 rounded-lg bg-green-500/10",children:s.jsx(Io,{className:"h-6 w-6 text-green-500"})})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Supported"})]}),s.jsxs(L,{className:"p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Storage Used"}),s.jsxs("p",{className:"text-3xl font-bold",children:[e.storageUsedMB," MB"]})]}),s.jsx("div",{className:"p-3 rounded-lg bg-purple-500/10",children:s.jsx(KS,{className:"h-6 w-6 text-purple-500"})})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.storageLimitMB," MB limit"]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsxs(L,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:s.jsx(rs,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-heading font-bold",children:"Upload New Images"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Generate alt text quickly"})]})]}),s.jsx(ye,{to:"/upload",children:s.jsx(E,{className:"w-full",children:"Upload Images"})})]}),s.jsxs(L,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:s.jsx(qS,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-heading font-bold",children:"View Templates"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Use pre-made templates"})]})]}),s.jsx(ye,{to:"/templates",children:s.jsx(E,{variant:"outline",className:"w-full",children:"Browse Templates"})})]}),s.jsxs(L,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:s.jsx(uM,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-heading font-bold",children:"API Documentation"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Integrate with your tools"})]})]}),s.jsx(ye,{to:"/api-keys",children:s.jsx(E,{variant:"outline",className:"w-full",children:"View Docs"})})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[s.jsxs(L,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h2",{className:"font-heading text-2xl font-bold",children:"Recent Generations"}),s.jsx(ye,{to:"/history",className:"text-primary hover:underline text-sm font-medium",children:"View All History â
624†’"})]}),s.jsx("div",{className:"space-y-3",children:t.map(i=>s.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg hover:bg-secondary/50 transition-colors",children:[s.jsx(hc,{className:"h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-sm truncate",children:i.fileName}),s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-1",children:i.altText}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:i.timestamp})]})]},i.id))})]}),s.jsxs(L,{className:"p-6",children:[s.jsx("h2",{className:"font-heading text-2xl font-bold mb-6",children:"What You Can Generate"}),s.jsx("div",{className:"space-y-3 mb-6",children:n.map(i=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-1 rounded-full bg-primary/10",children:s.jsx(Me,{className:"h-4 w-4 text-primary"})}),s.jsx("p",{className:"text-sm",children:i})]},i))}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"All generated automatically with one click"})]})]}),s.jsx(L,{className:"p-6",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-heading font-bold mb-1",children:"Monthly Usage"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.imagesThisMonth," / ",e.imageLimit," images used this month"]})]}),a]}),s.jsx(Vn,{value:r,className:"h-3"}),a]})})]})}const tK=ri("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),kt=f.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:F(tK({variant:t}),e),...n}));kt.displayName="Alert";const nK=f.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:F("mb-1 font-medium leading-none tracking-tight",e),...t}));nK.displayName="AlertTitle";const Ct=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:F("text-sm [&_p]:leading-relaxed",e),...t}));Ct.displayName="AlertDescription";const pr=xv,rK=yv,XP=f.forwardRef(({className:e,...t},n)=>s.jsx(ad,{ref:n,className:F("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}));XP.displayName=ad.displayName;const zn=f.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(rK,{children:[s.jsx(XP,{}),s.jsxs(id,{ref:r,className:F("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,s.jsxs(gf,{className:"absolute right-4 top-4 roun
624ded-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:[s.jsx(cs,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zn.displayName=id.displayName;const Wn=({className:e,...t})=>s.jsx("div",{className:F("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Wn.displayName="DialogHeader";const Iv=({className:e,...t})=>s.jsx("div",{className:F("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Iv.displayName="DialogFooter";const Hn=f.forwardRef(({className:e,...t},n)=>s.jsx(od,{ref:n,className:F("text-lg font-semibold leading-none tracking-tight",e),...t}));Hn.displayName=od.displayName;const ds=f.forwardRef(({className:e,...t},n)=>s.jsx(ld,{ref:n,className:F("text-sm text-muted-foreground",e),...t}));ds.displayName=ld.displayName;function Mv(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var jf="Checkbox",[sK,Vq]=vt(jf),[aK,Ov]=sK(jf);function iK(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:i,form:o,name:l,onCheckedChange:c,required:d,value:u="on",internal_do_not_use_render:h}=e,[p,m]=hn({prop:n,defaultProp:a??!1,onChange:c,caller:jf}),[b,g]=f.useState(null),[y,x]=f.useState(null),w=f.useRef(!1),v=b?!!o||!!b.closest("form"):!0,j={checked:p,disabled:i,setChecked:m,control:b,setControl:g,name:l,form:o,value:u,hasConsumerStoppedPropagationRef:w,required:d,defaultChecked:Hs(a)?!1:a,isFormControl:v,bubbleInput:y,setBubbleInput:x};return s.jsx(aK,{scope:t,...j,children:oK(h)?h(j):r})}var ZP="CheckboxTrigger",eT=f.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:i,value:o,disabled:l,checked:c,required:d,setControl:u,setChecked:h,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:b}=Ov(ZP,e),g=xe(a,u),y=f.useRef(c);return f.useEffect(()=>{const x=i==null?void 0:i.form;if(x){const w=()=>h(y.current);return x.addEventListener("reset",w),()=>x.removeEventListener("reset",w)}},[i,h]),s.jsx(ne.button,{type:"button",role:"checkbox","aria-checked":Hs(c)?"mixed":c,"aria-required":d,"data-state":aT(c),"data-disabled":l?"":void 0,disabled:l,value:o,...r,ref:g,onKeyDown:q(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:q(n,x=>{h(w=>Hs(w)?!0:!w),b&&m&&(p.current=x.isPropagationStopped(),p.current||x.stopPropagation())})})});eT.displayName=ZP;var Dv=f.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:o,disabled:l,value:c,onCheckedChange:d,form:u,...h}=e;return s.jsx(iK,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:l,required:o,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:p})=>s.jsxs(s.Fragment,{children:[s.jsx(eT,{...h,ref:t,__scopeCheckbox:n}),p&&s.jsx(sT,{__scopeCheckbox:n})]})})});Dv.displayName=jf;var tT="CheckboxIndicator",nT=f.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=Ov(tT,n);return s.jsx(qt,{present:r||Hs(i.checked)||i.checked===!0,children:s.jsx(ne.span,{"data-state":aT(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});nT.displayName=tT;var rT="CheckboxBubbleInput",sT=f.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:l,disabled:c,name:d,value:u,form:h,bubbleInput:p,setBubbleInput:m}=Ov(rT,e),b=xe(n,m),g=Mv(i),y=my(r);f.useEffect(()=>{const w=p;if(!w)return;const v=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(v,"checked").set,S=!a.current;if(g!==i&&N){const k=new Event("click",{bubbles:S});w.indeterminate=Hs(i),N.call(w,Hs(i)?!1:i),w.dispatchEvent(k)}},[p,g,i,a]);const x=f.useRef(Hs(i)?!1:i);return s.jsx(ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??x.current,required:l,disabled:c,name:d,value:u,form:h,...t,tabIndex:-1,ref:b,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});sT.displayName=rT;function oK(e){return typeof e=="function"}function Hs(e){return e==="indeterminate"}function aT(e){return Hs(e)?"indeterminate":e?"checked":"unchecked"}const un=f.forwardRef(({className:e,...t},n)=>s.jsx(Dv,{ref:n,className:F("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:s.jsx(nT,{className:F("flex items-center justify-center text-current"),children:s.jsx(Me,{className:"h-4 w-4"})})}));un.displayName=Dv.displayName;const lK=({open:e,onOpenChange:t,keywords:n,onSelect:r,context:a,warning:i})=>{const[o,l]=f.useState(n.map((g,y)=>({...g,selected:y<5}))),[c,d]=f.useState(""),u=g=>{l(y=>y.map((x,w)=>w===g?{...x,selected:!x.selected}:x))},h=()=>
624{if(!c.trim())return;const g={keyword:c.trim(),relevance:3,difficulty:"medium",searchVolume:"medium",category:"secondary",variations:[],lsiKeywords:[],selected:!0};l(y=>[...y,g]),d("")},p=()=>{const g=o.filter(y=>y.selected);r(g),t(!1)},m=g=>{switch(g){case"easy":return"bg-accent/10 text-accent border-accent/20";case"medium":return"bg-yellow-500/10 text-yellow-700 border-yellow-500/20";case"hard":return"bg-orange-500/10 text-orange-700 border-orange-500/20";default:return"bg-muted text-muted-foreground"}},b=g=>{switch(g){case"primary":return"🎯";case"secondary":return"📌";case"long-tail":return"🔍";default:return"•"}};return s.jsx(pr,{open:e,onOpenChange:t,children:s.jsxs(zn,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(Wn,{children:[s.jsxs(Hn,{className:"flex items-center gap-2 text-2xl",children:[s.jsx(Nt,{className:"h-6 w-6 text-primary"}),"Recommended SEO Keywords"]}),s.jsx(ds,{children:a?`Based on your images and context: ${a}`:"Based on your uploaded images"})]}),i&&s.jsxs(kt,{children:[s.jsx(yo,{className:"h-4 w-4"}),s.jsx(Ct,{children:i})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:o.map((g,y)=>s.jsxs("div",{className:"flex items-start gap-3 p-4 border rounded-lg hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>u(y),children:[s.jsx(un,{checked:g.selected,onCheckedChange:()=>u(y),onClick:x=>x.stopPropagation()}),s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-medium",children:g.keyword}),s.jsx(ae,{variant:"outline",className:m(g.difficulty),children:g.difficulty}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[b(g.category)," ",g.category]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[Array.from({length:5}).map((x,w)=>s.jsx(qu,{className:`h-3 w-3 ${w<g.relevance?"fill-primary text-primary":"text-muted"}`},w)),s.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:[g.searchVolume," volume"]})]}),g.variations.length>0&&s.jsx(bo,{children:s.jsxs(gc,{children:[s.jsx(xc,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground cursor-help",children:[s.jsx(yo,{className:"h-3 w-3"}),s.jsxs("span",{children:["+",g.variations.length," variations"]})]})}),s.jsx(jo,{className:"max-w-xs",children:s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"font-semibold",children:"Variations:"}),s.jsx("p",{className:"text-sm",children:g.variations.join(", ")}),g.lsiKeywords.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"font-semibold mt-2",children:"Related terms:"}),s.jsx("p",{className:"text-sm",children:g.lsiKeywords.join(", ")})]})]})})]})})]})]},y))}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(me,{placeholder:"Add custom keyword...",value:c,onChange:g=>d(g.target.value),onKeyDown:g=>g.key==="Enter"&&h()}),s.jsx(E,{variant:"outline",onClick:h,children:"Add"})]}),s.jsxs("div",{className:"flex items-center justify-between pt-4 border-t",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[o.filter(g=>g.selected).length," keyword(s) selected"]}),s.jsxs(E,{onClick:p,size:"lg",className:"gap-2",children:[s.jsx(Nt,{className:"h-4 w-4"}),"Use Selected Keywords"]})]})]})]})})},cK=p2,dK=lv,Mj=({keywords:e,onRemove:t,onReorder:n,onAddManual:r})=>{const[a,i]=f.useState(null),[o,l]=f.useState(null),c=g=>{switch(g){case"easy":return{label:"Low",color:"text-green-600 dark:text-green-400"};case"medium":return{label:"Med",color:"text-amber-600 dark:text-amber-400"};case"hard":return{label:"High",color:"text-orange-600 dark:text-orange-400"};default:return{label:"Unknown",color:"text-muted-foreground"}}},d=g=>{switch(g){case"image":return{label:"From Image",icon:hc,variant:"default"};case"context":return{label:"From Context",icon:Bn,variant:"secondary"};case"both":return{label:"Both",icon:jM,variant:"outline"};default:return null}},h=(()=>
624{if(e.length===0)return null;const g=e.reduce((w,v)=>w+v.relevance,0)/e.length,y={easy:0,medium:0,hard:0};e.forEach(w=>{y[w.difficulty]++});const x=Object.entries(y).reduce((w,v)=>y[w[0]]>y[v[0]]?w:v)[0];return{avgRelevance:g.toFixed(1),dominantDifficulty:x,coverage:g>=4?"Excellent":g>=3?"Good":"Needs Improvement"}})(),p=g=>{l(g)},m=(g,y)=>{if(g.preventDefault(),o===null||o===y)return;const x=[...e],w=x[o];x.splice(o,1),x.splice(y,0,w),l(y),n(x)},b=()=>{l(null)};return e.length===0?s.jsx(L,{className:"p-8 border-2 border-dashed",children:s.jsxs("div",{className:"text-center space-y-3",children:[s.jsx("p",{className:"text-muted-foreground",children:"No keywords selected yet"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add keywords to improve your SEO and help guide the AI in generating relevant alt text"}),s.jsx(E,{variant:"outline",onClick:r,children:"Add Keywords"})]})}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h3",{className:"font-semibold text-foreground",children:"Selected Keywords"}),s.jsx(bo,{children:s.jsxs(gc,{children:[s.jsx(xc,{asChild:!0,children:s.jsx(yo,{className:"h-4 w-4 text-muted-foreground cursor-help"})}),s.jsx(jo,{className:"max-w-xs",children:s.jsx("p",{className:"text-xs",children:"These keywords will be used in your generated alt text. Keywords at the top are prioritized and will appear more frequently. Competition level indicates how hard it is to rank for each keyword."})})]})})]}),s.jsx(E,{variant:"outline",size:"sm",onClick:r,children:"+ Add Keyword"})]}),s.jsx(L,{className:"p-3 bg-muted border-2",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-foreground",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(sw,{className:"h-3 w-3"}),s.jsx("span",{children:"Drag to reorder"})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(ae,{variant:"outline",className:"text-xs py-0 px-1.5 h-5",children:"#1"}),s.jsx("span",{children:"Priority order"})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-green-600 dark:text-green-400 font-medium",children:"Low"}),s.jsx("span",{children:"/"}),s.jsx("span",{className:"text-amber-600 dark:text-amber-400 font-medium",children:"Med"}),s.jsx("span",{children:"/"}),s.jsx("span",{className:"text-orange-600 dark:text-orange-400 font-medium",children:"High"}),s.jsx("span",{children:"= Competition"})]})]})}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((g,y)=>{const x=c(g.difficulty),w=d(g.source);return s.jsx(bo,{children:s.jsxs(gc,{children:[s.jsx(xc,{asChild:!0,children:s.jsxs("div",{draggable:!0,onDragStart:()=>p(y),onDragOver:v=>m(v,y),onDragEnd:b,className:`group flex items-center gap-1.5 px-3 py-2 rounded-lg border-2 bg-background hover:bg-accent/50 transition-all cursor-move ${o===y?"opacity-50 scale-95":""}`,role:"button","aria-label":`Keyword: ${g.keyword}, Priority: ${y+1}, Difficulty: ${g.difficulty}`,tabIndex:0,children:[s.jsx(sw,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0","aria-hidden":"true"}),s.jsxs(ae,{variant:"outline",className:"text-xs py-0 px-1.5 h-5 font-bold shrink-0",children:["#",y+1]}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:g.keyword}),s.jsx("span",{className:"text-xs mx-0.5 text-muted-foreground",children:"|"}),s.jsx("span",{className:`text-xs font-medium shrink-0 ${x.color}`,children:x.label}),s.jsx("span",{className:"text-xs mx-0.5 text-muted-foreground",children:"|"}),s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[g.relevance,"/5"]}),w&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-xs mx-0.5 text-muted-foreground",children:"|"}),s.jsxs(ae,{variant:w.variant,className:"text-xs py-0 px-1.5 h-5 gap-1 shrink-0",children:[s.jsx(w.icon,{className:"h-3 w-3"}),w.label]})]}),(g.variations.length>0||g.lsiKeywords.length>0)&&s.jsx(E,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0 hover:bg-accent shrink-0",onClick:v=>{v.stopPropagation(),i(a===g.keyword?null:g.keyword)},"aria-label":`${a===g.keyword?"Hide":"Show"} variations for ${g.keyword}`,children:a===g.keyword?s.jsx(zc,{className:"h-3 w-3"}):s.jsx(Ys,{className:"h-3 w-3"})}),s.jsx("button",{onClick:v=>{v.stopPropagation(),t(g.keyword)},className:"opacity-0 group-hover:opacity-100 transition-opacity hover:scale-110 shrink-0","aria-label":`Remove ${g.keyword}`,children:s.jsx(cs,{className:"h-3.5 w-3.5 text-destructive"})})]})}),s.jsx(jo,{children:s.jsxs("div",{className:"text-xs space-y-1",children:[s.jsxs("p",{children:[s.jsx("span",{className:"font-semibold",children:"Priority:"})," #",y+1," (higher = more usage)"]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-semibold",children:"Competition:"})," ",x.label]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-semibold",children:"Relevance:"})," ",g.relevance,"/5"]}),(g.variations.length>0||g.lsiKeywords.length>0)&&s.jsx("p",{className:"text-muted-foreground pt-1",children:"Click chevron to see variations"})]})})]})},g.keyword)})}),e.map(g=>s.jsx(cK,{open:a===g.keyword,onOpenChange:y=>
624i(y?g.keyword:null),children:s.jsxs(dK,{className:"space-y-2 p-4 bg-muted/30 rounded-lg border border-border",children:[g.variations.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-semibold mb-2 text-foreground",children:"Variations:"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.variations.map(y=>s.jsx(ae,{variant:"secondary",className:"text-xs",children:y},y))})]}),g.lsiKeywords.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-semibold mb-2 text-foreground",children:"Related Terms (LSI):"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.lsiKeywords.map(y=>s.jsx(ae,{variant:"outline",className:"text-xs",children:y},y))})]}),s.jsx("p",{className:"text-xs text-muted-foreground italic mt-2",children:"💡 These variations will be intelligently incorporated for better semantic SEO"})]})},g.keyword)),h&&s.jsxs(L,{className:"p-4 bg-muted/20 border border-border",children:[s.jsx("h4",{className:"text-sm font-semibold mb-3 text-foreground",children:"Keyword Summary"}),s.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-bold text-primary",children:e.length}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Keywords"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-bold text-foreground capitalize",children:h.dominantDifficulty}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Avg Competition"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-bold text-foreground",children:h.coverage}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Quality Score"})]})]})]}),s.jsx(L,{className:"p-4 bg-primary/5 border-primary/20",children:s.jsxs("div",{className:"space-y-2 text-xs text-muted-foreground",children:[s.jsxs("p",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"shrink-0",children:"💡"}),s.jsx("span",{children:"Drag keywords to change priority order - top keywords appear more frequently"})]}),s.jsxs("p",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"shrink-0",children:"💡"}),s.jsx("span",{children:"Mix low and medium competition keywords for best SEO results"})]}),s.jsxs("p",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"shrink-0",children:"💡"}),s.jsx("span",{children:"3-5 highly relevant keywords work better than many generic ones"})]})]})})]})};function iT(e,t){const n=[],r={primary:3,secondary:2,"long-tail":1},a=[...t].sort((c,d)=>{const u=c.relevance*r[c.category];return d.relevance*r[d.category]-u}),i=Math.max(1,Math.floor(e*.2)),o=Math.min(Math.ceil(e*.6),e),l=new Map;a.forEach(c=>l.set(c.keyword,0));for(let c=0;c<e;c++){const d=[],u=Math.min(3,a.length);for(let h=0;h<u;h++){const p=a.find(m=>(l.get(m.keyword)||0)<o&&!d.includes(m.keyword));p&&(d.push(p.keyword),l.set(p.keyword,(l.get(p.keyword)||0)+1))}if(c%3===0&&d.length>0){const h=a.find(p=>p.keyword===d[0]);if((h==null?void 0:h.variations.length)>0){const p=h.variations[c%h.variations.length];d.includes(p)||d.push(p)}}n.push({imageId:`image-${c}`,keywords:d})}return a.forEach(c=>{const d=l.get(c.keyword)||0;d<i&&n.filter(h=>h.keywords.length<3&&!h.keywords.includes(c.keyword)).slice(0,i-d).forEach(h=>{h.keywords.push(c.keyword),l.set(c.keyword,(l.get(c.keyword)||0)+1)})}),n}const uK=({keywords:e,imageCount:t})=>{const n=iT(t,e);return s.jsxs(L,{className:"p-4 space-y-3 bg-muted/30",children:[s.jsx("h4",{className:"text-sm font-semibold flex items-center gap-2",children:"📊 Keyword Distribution Preview"}),s.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:n.map((r,a)=>s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:"font-medium min-w-[60px]",children:["Image ",a+1,":"]}),s.jsx("div",{className:"flex flex-wrap gap-1",children:r.keywords.map(i=>s.jsx(ae,{variant:"secondary",className:"text-xs py-0",children:i},i))})]},a))}),s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"💡 Keywords intelligently matched to most relevant images"})]})};function gl(e){if(e.length===0)return null;const t=e.length,n=e.reduce((m,b)=>m+b.relevance,0)/t,r=e.filter(m=>m.difficulty==="easy").length,a=e.filter(m=>m.difficulty==="medium").length,i=e.filter(m=>m.difficulty==="hard").length,o=e.filter(m=>m.keyword.split(" ").length>=3).length;let l=0;t>=3&&t<=5?l=35:t<3?l=15:t<=7?l=25:l=10,l+=(n-3)*5;const c=(r+a)/t;l+=c*15;const d=o/t;l+=d*10,l=Math.min(60,Math.max(10,Math.round(l)));let u;n>=4&&t>=3&&t<=5?u="high":n>=3&&t>=2&&t<=7?u="medium":u="low";const h=[];t>=3&&t<=5?h.push(`${t} keywords (optimal range)`):t<3?h.push(`only ${t} keyword${t===1?"":"s"} (add more for better coverage)`):h.push(`${t} keywords (consider reducing to 3-5)`),n>=4?h.push("high relevance scores"):n>=3?h.push("good relevance scores"):h.push("lower relevance scores"),c>=.6?h.push("mostly easy-to-rank keywords"):i>t/2&&h.push("competitive keywords (may be harder to rank)"),o>0&&h.push(`${o} long-tail keyword${o===1?"":"s"}`);const p="Based on "+h.join(", ");return{estimatedImprovement:l,confidenceLevel:u,reasoning:p}}async function hK(e,t){try{const{data:{user:n}}=await V.auth.getUser();if(!n)return;for(const r of e){const{data:a,error:i}=await V.from("keyword_history").select("*").eq("user_id",n.id).eq("keyword",r.keyword).maybeSingle();if(i){console.error("Error fetching keyword history:",i);continue}if(a){const{error:o}=await V.from("keyword_history").update({times_used:a.times_used+1,images_tagged:a.images_tagged+t,last_used:new Date().toISOString()}).eq("id",a.id);o&&console.error("Error updating keyword history:",o)}else{const{error:o}=await V.from("keyword_history").insert({user_id:n.id,keyword:r.keyword,times_used:1,images_tagged:t,was_recommended:!0});o&&console.error("Error inserting keyword history:",o)}}}catch(n){console.error("Error tracking keyword usage:",n)}}const fK=()=>{const[e,t]=f.useState(!1);return s.jsxs(L,{className:"p-4 border-primary/20",children:[s.jsxs(E,{variant:"ghost",className:"w-full flex items-center justify-between",onClick:()=>t(!e),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(yo,{className:"h-5 w-5 text-primary"}),s.jsx("span",{className:"font-heading font-semibold",children:"What makes good SEO keywords?"})]}),e?s.jsx(zc,{className:"h-4 w-4"}):s.jsx(Ys,{className:"h-4 w-4"})]}),e&&s.jsxs("div",{className:"mt-4 space-y-4",children:[s.jsxs(P2,{type:"single",collapsible:!0,className:"w-full",children:[s.jsxs(Bi,{value:"what-they-do",children:[s.jsx(Vi,{className:"text-sm font-medium",children:"What alt text keywords do for SEO"}),s.jsxs(zi,{className:"text-sm text-muted-foreground space-y-2",children:[s.jsx("p",{children:"Alt text keywords help search engines understand and index your images. When users search for terms related to your images, well-optimized alt text increases the chances your images will appear in search results."}),s.jsx(kt,{children:s.jsxs(Ct,{children:["💡 ",s.jsx("strong",{children:"Pro tip:"})," Images with keyword-rich alt text can drive 20-40% more traffic through image search results."]})})]})]}),s.jsxs(Bi,{value:"how-used",children:[s.jsx(Vi,{className:"text-sm font-medium",children:"How search engines use them"}),s.jsxs(zi,{className:"text-sm text-muted-foreground space-y-2",children:[s.jsx("p",{children:"Search engines like Google use alt text to:"}),s.jsxs("ul",{className:"list-disc list-inside space-y-1 ml-2",children:[s.jsx("li",{children:"Understand image content and context"}),s.jsx("li",{children:"Rank images in Google Image Search"}),s.jsx("li",{children:"Improve overall page relevance for text searches"}),s.jsx("li",{children:"Provide accessibility for visually impaired users"})]}),s.jsx("p",{className:"mt-2",children:"Natural, descriptive alt text with relevant keywords signals high-quality content to search engines."})]})]}),s.jsxs(Bi,{value:"best-practices",children:[s.jsx(Vi,{className:"text-sm font-medium",children:"Best practices"}),s.jsx(zi,{className:"text-sm text-muted-foreground space-y-2",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-accent text-lg",children:"✓"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Use 3-5 keywords per batch:"})," This provides good coverage without overwhelming the content."]})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-accent text-lg",children:"✓"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Be specific, not generic:"}
vendor: 4,303 bytes, line 624
624),' "laptop workspace setup" beats "computer" every time.']})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-accent text-lg",children:"✓"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Use natural language:"})," Alt text should read naturally, not like a list of keywords."]})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-accent text-lg",children:"✓"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Match relevance:"})," Keywords should accurately describe the image content."]})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-accent text-lg",children:"✓"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Include long-tail keywords:"}),' 3+ word phrases like "ergonomic home office setup" are easier to rank for.']})]})]})})]}),s.jsxs(Bi,{value:"mistakes",children:[s.jsx(Vi,{className:"text-sm font-medium",children:"Common mistakes to avoid"}),s.jsx(zi,{className:"text-sm text-muted-foreground space-y-2",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-destructive text-lg",children:"✗"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Keyword stuffing:"}),' "laptop laptop computer laptop workspace laptop desk" - unnatural and penalized by search engines.']})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-destructive text-lg",children:"✗"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Too generic:"}),` "image", "photo", "picture" don't add SEO value.`]})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-destructive text-lg",children:"✗"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Irrelevant keywords:"})," Using trending terms that don't match your image content hurts credibility."]})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-destructive text-lg",children:"✗"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Too many keywords:"})," Using 10+ keywords dilutes their effectiveness."]})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-destructive text-lg",children:"✗"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Brand names only:"})," Unless specifically needed, focus on descriptive terms instead of brands."]})]})]})})]})]}),s.jsx(kt,{className:"bg-primary/5 border-primary/20",children:s.jsxs(Ct,{className:"text-sm",children:[s.jsx("strong",{children:"Quick tip:"}),' Our AI analyzes your images and suggests keywords optimized for both relevance and SEO impact. Use the "✨ Get Keyword Suggestions" button to get started!']})})]})]})};var Nf="Tabs",[mK,zq]=vt(Nf,[xf]),oT=xf(),[pK,Lv]=mK(Nf),lT=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=nd(l),[h,p]=hn({prop:r,onChange:a,defaultProp:i??"",caller:Nf});return s.jsx(pK,{scope:n,baseId:dn(),value:h,onValueChange:p,orientation:o,dir:u,activationMode:c,children:s.jsx(ne.div,{dir:u,"data-orientation":o,...d,ref:t})})});lT.displayName=Nf;var cT="TabsList",dT=f.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=Lv(cT,n),o=oT(n);return s.jsx(CE,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(ne.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});dT.displayName=cT;var uT="TabsTrigger",hT=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=Lv(uT,n),l=oT(n),c=pT(o.baseId,r),d=gT(o.baseId,r),u=r===o.value;return s.jsx(_E,{asChild:!0,...l,focusable:!a,active:u,children:s.jsx(ne.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:q(e.onMouseDown,h=>{!a&&h.button===0&&h.ctrlKey===!1?o.onValueChange(r):h.preventDefault()}),onKeyDown:q(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(r)}),onFocus:q(e.onFocus,()=>{const h=o.activationMode!=="manual";!u&&!a&&h&&o.onValueChange(r)})})})});hT.displayName=uT;var fT="TabsContent",mT=f.forwardRef((e,t)=>
624{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,l=Lv(fT,n),c=pT(l.baseId,r),d=gT(l.baseId,r),u=r===l.value,h=f.useRef(u);return f.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),s.jsx(qt,{present:a||u,children:({present:p})=>s.jsx(ne.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&i})})});mT.displayName=fT;function pT(e,t){return`${e}-trigger-${t}`}function gT(e,t){return`${e}-content-${t}`}var gK=lT,xT=dT,yT=hT,vT=mT;const ca=gK,us=f.forwardRef(({className:e,...t},n)=>s.jsx(xT,{ref:n,className:F("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));us.displayName=xT.displayName;const De=f.forwardRef(({className:e,...t},n)=>s.jsx(yT,{ref:n,className:F("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}));De.displayName=yT.displayName;const it=f.forwardRef(({className:e,...t},n)=>s.jsx(vT,{ref:n,className:F("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));it.displayName=vT.displayName;const xK=({open:e,onOpenChange:t})=>{const n={ecommerce:[{without:"Man sitting at desk",with:"Professional using ergonomic laptop workspace for remote work",keywords:["laptop","workspace","remote work"],why:["Specific and descriptive","Natural language flow","Multiple relevant keywords","Matches search intent for product buyers"]},{without:"Coffee cup",with:"Stainless steel insulated travel mug with modern minimalist design",keywords:["travel mug","insulated","minimalist"],why:["Highlights product features","Includes material and style","Appeals to specific buyer intent","Uses adjectives that sell"]}],blog:[{without:"Person typing",with:"Freelance writer creating content on laptop with notepad and coffee",keywords:["freelance writing","content creation","laptop"],why:["Tells a story about the activity","Uses informational keywords","Contextual and descriptive","Appeals to blog readers"]},{without:"Food on table",with:"Healthy meal prep bowls with quinoa vegetables and grilled chicken",keywords:["meal prep","healthy eating","quinoa"],why:["Specific ingredients mentioned","Health-focused language","Appeals to how-to content","Long-tail keyword friendly"]}],portfolio:[{without:"Building photo",with:"Modern architectural photography showcasing minimalist concrete facade design",keywords:["architectural photography","minimalist design","concrete"],why:["Industry-specific terminology","Highlights photographic technique","Describes artistic style","Appeals to potential clients"]},{without:"Logo design",with:"Professional brand identity design with geometric logo and color palette",keywords:["brand identity","logo design","geometric"],why:["Professional service keywords","Technique-focused language","Style descriptors included","Attracts design clients"]}],marketing:[{without:"Team working",with:"Collaborative business team brainstorming innovative solutions in modern office",keywords:["business team","collaboration","innovation"],why:["Action-oriented language","Benefit-driven keywords","Professional context","Emotional appeal words"]},{without:"Phone screen",with:"Mobile app interface demonstrating intuitive user experience design",keywords:["mobile app","user experience","interface design"],why:["Feature and benefit focused","Technical but accessible","Appeals to decision makers","Highlights value proposition"]}]};return s.jsx(pr,{open:e,onOpenChange:t,children:s.jsxs(zn,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[s.jsxs(Wn,{children:[s.jsx(Hn,{className:"font-heading text-2xl",children:"SEO Alt Text Examples"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"See how keywords transform basic descriptions into SEO-optimized alt text"})]}),s.jsxs(ca,{defaultValue:"ecommerce",className:"w-full",children:[s.jsxs(us,{className:"grid w-full grid-cols-4",children:[s.jsx(De,{value:"ecommerce",children:"E-commerce"}),s.jsx(De,{value:"blog",children:"Blog Content"}),s.jsx(De,{value:"portfolio",children:"Portfolio"}),s.jsx(De,{value:"marketing",children:"Marketing"})]}),Object.entries(n).map(([r,a])=>s.jsx(it,{value:r,className:"space-y-4",children:a.map((i,o)=>s.jsxs(L,{className:"p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Ht,{className:"h-5 w-5 text-destructive mt-0.5"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Without keywords:"}),s.jsxs("p",{className:"text-base mt-1",children:['"',i.without,'"']})]})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(ny,{className:"h-5 w-5 text-accent mt-0.5"}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("p",{className:"text-sm font-medium text-muted-foreground",children:["With keywords (",i.keywords.join(", "),"):"]}),s.jsxs("p",{className:"text-base mt-1 font-medium",children:['"',i.with,'"']})]})]}),s.jsxs("div",{className:"mt-3 pt-3 border-t",children:[s.jsx("p",{className:"text-sm font-medium mb-2",children:"Why this works:"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:i.why.map((l,c)=>s.jsx(ae,{variant:"secondary",className:"text-xs",children:l},c))})]})]},o))},r))]})]})})};function Oj(e,[t,n]){return Math.min(n,Math.max(t,e))}var yK=[" ","Enter","ArrowUp","ArrowDown"],vK=[" ","Enter"],Qa="Select",[Sf,kf,wK]=Bc(Qa),[Wo,Wq]=vt(Qa,[wK,sa]),Cf=sa(),[bK,da]=Wo(Qa),[jK,NK]=Wo(Qa),wT=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:h,disabled:p,required:m,form:b}=e,g=Cf(t),[y,x]=f.useState(null),[w,v]=f.useState(null),[j,N]=f.useState(!1),S=nd(d),[k,C]=hn({prop:r,defaultProp:a??!1,onChange:i,caller:Qa}),[A,R]=hn({prop:o,defaultProp:l,onChange:c,caller:Qa}),G=f.useRef(null),W=y?b||!!y.closest("form"):!0,[$,M]=f.useState(new Set),K=Array.from($).map(z=>z.props.value).join(";");return s.jsx(zh,{...g,children:s.jsxs(bK,{required:m,scope:t,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:v,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:dn(),value:A,onValueChange:R,open:k,onOpenChange:C,dir:S,triggerPointerDownPosRef:G,disabled:p,children:[s.jsx(Sf.Provider,{scope:t,children:s.jsx(jK,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(z=>{M(I=>new Set(I).add(z))},[]),onNativeOptionRemove:f.useCallback(z=>{M(I=>{const P=new Set(I);return P.delete(z),P})},[]),children:n})}),W?s.jsxs(WT,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:h,value:A,onChange:z=>R(z.target.value),disabled:p,form:b,children:[A===void 0?s.jsx("option",{value:""}):null,Array.from($)]},K):null]})})};wT.displayName=Qa;var bT="SelectTrigger",jT=f.forwardRef((e,t)=>
vendor: 16,824 bytes, line 624
624{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Cf(n),o=da(bT,n),l=o.disabled||r,c=xe(t,o.onTriggerChange),d=kf(n),u=f.useRef("touch"),[h,p,m]=KT(g=>{const y=d().filter(v=>!v.disabled),x=y.find(v=>v.value===o.value),w=GT(y,g,x);w!==void 0&&o.onValueChange(w.value)}),b=g=>{l||(o.onOpenChange(!0),m()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return s.jsx(qc,{asChild:!0,...i,children:s.jsx(ne.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":HT(o.value)?"":void 0,...a,ref:c,onClick:q(a.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&b(g)}),onPointerDown:q(a.onPointerDown,g=>{u.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(b(g),g.preventDefault())}),onKeyDown:q(a.onKeyDown,g=>{const y=h.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(y&&g.key===" ")&&yK.includes(g.key)&&(b(),g.preventDefault())})})})});jT.displayName=bT;var NT="SelectValue",ST=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...l}=e,c=da(NT,n),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,h=xe(t,c.onValueNodeChange);return ot(()=>{d(u)},[d,u]),s.jsx(ne.span,{...l,ref:h,style:{pointerEvents:"none"},children:HT(c.value)?s.jsx(s.Fragment,{children:o}):i})});ST.displayName=NT;var SK="SelectIcon",kT=f.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(ne.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});kT.displayName=SK;var kK="SelectPortal",CT=e=>s.jsx(Ro,{asChild:!0,...e});CT.displayName=kK;var Ja="SelectContent",_T=f.forwardRef((e,t)=>{const n=da(Ja,e.__scopeSelect),[r,a]=f.useState();if(ot(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?ti.createPortal(s.jsx(ET,{scope:e.__scopeSelect,children:s.jsx(Sf.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(PT,{...e,ref:t})});_T.displayName=Ja;var Xn=10,[ET,ua]=Wo(Ja),CK="SelectContentImpl",_K=qs("SelectContent.RemoveScroll"),PT=f.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:b,hideWhenDetached:g,avoidCollisions:y,...x}=e,w=da(Ja,n),[v,j]=f.useState(null),[N,S]=f.useState(null),k=xe(t,Q=>j(Q)),[C,A]=f.useState(null),[R,G]=f.useState(null),W=kf(n),[$,M]=f.useState(!1),K=f.useRef(!1);f.useEffect(()=>{if(v)return mf(v)},[v]),hf();const z=f.useCallback(Q=>{const[be,...ve]=W().map(ke=>ke.ref.current),[Se]=ve.slice(-1),je=document.activeElement;for(const ke of Q)if(ke===je||(ke==null||ke.scrollIntoView({block:"nearest"}),ke===be&&N&&(N.scrollTop=0),ke===Se&&N&&(N.scrollTop=N.scrollHeight),ke==null||ke.focus(),document.activeElement!==je))return},[W,N]),I=f.useCallback(()=>z([C,v]),[z,C,v]);f.useEffect(()=>{$&&I()},[$,I]);const{onOpenChange:P,triggerPointerDownPosRef:_}=w;f.useEffect(()=>{if(v){let Q={x:0,y:0};const be=Se=>{var je,ke;Q={x:Math.abs(Math.round(Se.pageX)-(((je=_.current)==null?void 0:je.x)??0)),y:Math.abs(Math.round(Se.pageY)-(((ke=_.current)==null?void 0:ke.y)??0))}},ve=Se=>{Q.x<=10&&Q.y<=10?Se.preventDefault():v.contains(Se.target)||P(!1),document.removeEventListener("pointermove",be),_.current=null};return _.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",ve,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",ve,{capture:!0})}}},[v,P,_]),f.useEffect(()=>{const Q=()=>P(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[P]);const[U,Z]=KT(Q=>{const be=W().filter(je=>!je.disabled),ve=be.find(je=>je.ref.current===document.activeElement),Se=GT(be,Q,ve);Se&&setTimeout(()=>Se.ref.current.focus())}),ee=f.useCallback((Q,be,ve)=>{const Se=!K.current&&!ve;(w.value!==void 0&&w.value===be||Se)&&(A(Q),Se&&(K.current=!0))},[w.value]),ie=f.useCallback(()=>v==null?void 0:v.focus(),[v]),de=f.useCallback((Q,be,ve)=>{const Se=!K.current&&!ve;(w.value!==void 0&&w.value===be||Se)&&G(Q)},[w.value]),Re=r==="popper"?Xg:TT,Ee=Re===Xg?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:b,hideWhenDetached:g,avoidCollisions:y}:{};return s.jsx(ET,{scope:n,content:v,viewport:N,onViewportChange:S,itemRefCallback:ee,selectedItem:C,onItemLeave:ie,itemTextRefCallback:de,focusSelectedItem:I,selectedItemText:R,position:r,isPositioned:$,searchRef:U,children:s.jsx(sd,{as:_K,allowPinchZoom:!0,children:s.jsx(rd,{asChild:!0,trapped:w.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:q(a,Q=>{var be;(be=w.trigger)==null||be.focus({preventScroll:!0}),Q.preventDefault()}),children:s.jsx(ni,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:s.jsx(Re,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Q=>Q.preventDefault(),...x,...Ee,onPlaced:()=>M(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:q(x.onKeyDown,Q=>{const be=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!be&&Q.key.length===1&&Z(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let Se=W().filter(je=>!je.disabled).map(je=>je.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(Se=Se.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const je=Q.target,ke=Se.indexOf(je);Se=Se.slice(ke+1)}setTimeout(()=>z(Se)),Q.preventDefault()}})})})})})})});PT.displayName=CK;var EK="SelectItemAlignedPosition",TT=f.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=da(Ja,n),o=ua(Ja,n),[l,c]=f.useState(null),[d,u]=f.useState(null),h=xe(t,k=>u(k)),p=kf(n),m=f.useRef(!1),b=f.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:x,focusSelectedItem:w}=o,v=f.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&g&&y&&x){const k=i.trigger.getBoundingClientRect(),C=d.getBoundingClientRect(),A=i.valueNode.getBoundingClientRect(),R=x.getBoundingClientRect();if(i.dir!=="rtl"){const je=R.left-C.left,ke=A.left-je,gt=k.left-ke,Qt=k.width+gt,$r=Math.max(Qt,C.width),Kn=window.innerWidth-Xn,Ur=Oj(ke,[Xn,Math.max(Xn,Kn-$r)]);l.style.minWidth=Qt+"px",l.style.left=Ur+"px"}else{const je=C.right-R.right,ke=window.innerWidth-A.right-je,gt=window.innerWidth-k.right-ke,Qt=k.width+gt,$r=Math.max(Qt,C.width),Kn=window.innerWidth-Xn,Ur=Oj(ke,[Xn,Math.max(Xn,Kn-$r)]);l.style.minWidth=Qt+"px",l.style.right=Ur+"px"}const G=p(),W=window.innerHeight-Xn*2,$=g.scrollHeight,M=window.getComputedStyle(d),K=parseInt(M.borderTopWidth,10),z=parseInt(M.paddingTop,10),I=parseInt(M.borderBottomWidth,10),P=parseInt(M.paddingBottom,10),_=K+z+$+P+I,U=Math.min(y.offsetHeight*5,_),Z=window.getComputedStyle(g),ee=parseInt(Z.paddingTop,10),ie=parseInt(Z.paddingBottom,10),de=k.top+k.height/2-Xn,Re=W-de,Ee=y.offsetHeight/2,Q=y.offsetTop+Ee,be=K+z+Q,ve=_-be;if(be<=de){const je=G.length>0&&y===G[G.length-1].ref.current;l.style.bottom="0px";const ke=d.clientHeight-g.offsetTop-g.offsetHeight,gt=Math.max(Re,Ee+(je?ie:0)+ke+I),Qt=be+gt;l.style.height=Qt+"px"}else{const je=G.length>0&&y===G[0].ref.current;l.style.top="0px";const gt=Math.max(de,K+g.offsetTop+(je?ee:0)+Ee)+ve;l.style.height=gt+"px",g.scrollTop=be-de+g.offsetTop}l.style.margin=`${Xn}px 0`,l.style.minHeight=U+"px",l.style.maxHeight=W+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,i.trigger,i.valueNode,l,d,g,y,x,i.dir,r]);ot(()=>v(),[v]);const[j,N]=f.useState();ot(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const S=f.useCallback(k=>{k&&b.current===!0&&(v(),w==null||w(),b.current=!1)},[v,w]);return s.jsx(TK,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:S,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:s.jsx(ne.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});TT.displayName=EK;var PK="SelectPopperPosition",Xg=f.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Xn,...i}=e,o=Cf(n);return s.jsx(Wh,{...o,...i,ref:t,align:r,collisionPadding:a,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)"}})});Xg.displayName=PK;var[TK,Fv]=Wo(Ja,{}),Zg="SelectViewport",AT=f.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=ua(Zg,n),o=Fv(Zg,n),l=xe(t,i.onViewportChange),c=f.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(Sf.Slot,{scope:n,children:s.jsx(ne.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:q(a.onScroll,d=>{const u=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&h){const m=Math.abs(c.current-u.scrollTop);if(m>0){const b=window.innerHeight-Xn*2,g=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),x=Math.max(g,y);if(x<b){const w=x+m,v=Math.min(b,w),j=w-v;h.style.height=v+"px",h.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,h.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});AT.displayName=Zg;var RT="SelectGroup",[AK,RK]=Wo(RT),IK=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=dn();return s.jsx(AK,{scope:n,id:a,children:s.jsx(ne.div,{role:"group","aria-labelledby":a,...r,ref:t})})});IK.displayName=RT;var IT="SelectLabel",MT=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=RK(IT,n);return s.jsx(ne.div,{id:a.id,...r,ref:t})});MT.displayName=IT;var xh="SelectItem",[MK,OT]=Wo(xh),DT=f.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,l=da(xh,n),c=ua(xh,n),d=l.value===r,[u,h]=f.useState(i??""),[p,m]=f.useState(!1),b=xe(t,w=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,w,r,a)}),g=dn(),y=f.useRef("touch"),x=()=>{a||(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 s.jsx(MK,{scope:n,value:r,disabled:a,textId:g,isSelected:d,onItemTextChange:f.useCallback(w=>{h(v=>v||((w==null?void 0:w.textContent)??"").trim())},[]),children:s.jsx(Sf.ItemSlot,{scope:n,value:r,disabled:a,textValue:u,children:s.jsx(ne.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:b,onFocus:q(o.onFocus,()=>m(!0)),onBlur:q(o.onBlur,()=>m(!1)),onClick:q(o.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:q(o.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:q(o.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:q(o.onPointerMove,w=>{var v;y.current=w.pointerType,a?(v=c.onItemLeave)==null||v.call(c):y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:q(o.onPointerLeave,w=>{var v;w.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:q(o.onKeyDown,w=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&w.key===" "||(vK.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});DT.displayName=xh;var _l="SelectItemText",LT=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=da(_l,n),l=ua(_l,n),c=OT(_l,n),d=NK(_l,n),[u,h]=f.useState(null),p=xe(t,x=>h(x),c.onItemTextChange,x=>{var w;return(w=l.itemTextRefCallback)==null?void 0:w.call(l,x,c.value,c.disabled)}),m=u==null?void 0:u.textContent,b=f.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=d;return ot(()=>(g(b),()=>y(b)),[g,y,b]),s.jsxs(s.Fragment,{children:[s.jsx(ne.span,{id:c.textId,...i,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?ti.createPortal(i.children,o.valueNode):null]})});LT.displayName=_l;var FT="SelectItemIndicator",$T=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return OT(FT,n).isSelected?s.jsx(ne.span,{"aria-hidden":!0,...r,ref:t}):null});$T.displayName=FT;var ex="SelectScrollUpButton",UT=f.forwardRef((e,t)=>{const n=ua(ex,e.__scopeSelect),r=Fv(ex,e.__scopeSelect),[a,i]=f.useState(!1),o=xe(t,r.onScrollButtonChange);return ot(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?s.jsx(VT,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});UT.displayName=ex;var tx="SelectScrollDownButton",BT=f.forwardRef((e,t)=>{const n=ua(tx,e.__scopeSelect),r=Fv(tx,e.__scopeSelect),[a,i]=f.useState(!1),o=xe(t,r.onScrollButtonChange);return ot(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?s.jsx(VT,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});BT.displayName=tx;var VT=f.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=ua("SelectScrollButton",n),o=f.useRef(null),l=kf(n),c=f.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return f.useEffect(()=>()=>c(),[c]),ot(()=>{var u;const d=l().find(h=>h.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),s.jsx(ne.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:q(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:q(a.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:q(a.onPointerLeave,()=>{c()})})}),OK="SelectSeparator",zT=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(ne.div,{"aria-hidden":!0,...r,ref:t})});zT.displayName=OK;var nx="SelectArrow",DK=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Cf(n),i=da(nx,n),o=ua(nx,n);return i.open&&o.position==="popper"?s.jsx(Hh,{...a,...r,ref:t}):null});DK.displayName=nx;var LK="SelectBubbleInput",WT=f.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=f.useRef(null),i=xe(r,a),o=Mv(t);return f.useEffect(()=>{const l=a.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&u){const h=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(h)}},[o,t]),s.jsx(ne.select,{...n,style:{...yS,...n.style},ref:i,defaultValue:t})});WT.displayName=LK;function HT(e){return e===""||e===void 0}function KT(e){const t=Wt(e),n=f.useRef(""),r=f.useRef(0),a=f.useCallback(o=>{const l=n.current+o;t(l),function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=f.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function GT(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=FK(e,Math.max(i,0));a.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function FK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $K=wT,qT=jT,UK=ST,BK=kT,VK=CT,YT=_T,zK=AT,QT=MT,JT=DT,WK=LT,HK=$T,XT=UT,ZT=BT,eA=zT;const Dt=$K,Lt=UK,_t=f.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(qT,{ref:r,className:F("flex h-10 w-full items-center justify-between rounded-md border border-input bg-card text-card-foreground px-3 py-2 text-sm r
624ing-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,s.jsx(BK,{asChild:!0,children:s.jsx(Ys,{className:"h-4 w-4 opacity-50"})})]}));_t.displayName=qT.displayName;const tA=f.forwardRef(({className:e,...t},n)=>s.jsx(XT,{ref:n,className:F("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(zc,{className:"h-4 w-4"})}));tA.displayName=XT.displayName;const nA=f.forwardRef(({className:e,...t},n)=>s.jsx(ZT,{ref:n,className:F("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Ys,{className:"h-4 w-4"})}));nA.displayName=ZT.displayName;const Et=f.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(VK,{children:s.jsxs(YT,{ref:a,className:F("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:[s.jsx(tA,{}),s.jsx(zK,{className:F("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(nA,{})]})}));Et.displayName=YT.displayName;const KK=f.forwardRef(({className:e,...t},n)=>s.jsx(QT,{ref:n,className:F("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));
624KK.displayName=QT.displayName;const X=f.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(JT,{ref:r,className:F("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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(HK,{children:s.jsx(Me,{className:"h-4 w-4"})})}),s.jsx(WK,{children:t})]}));X.displayName=JT.displayName;const GK=f.forwardRef(({className:e,...t},n)=>s.jsx(eA,{ref:n,className:F("-mx-1 my-1 h-px bg-muted",e),...t}));GK.displayName=eA.displayName;const qK=({onApplySet:e})=>{const[t,n]=f.useState([]),[r,a]=f.useState(!1),[i,o]=f.useState(""),[l,c]=f.useState(""),[d,u]=f.useState(""),{toast:h}=Uc(),p=[{id:"example-tech",name:"Tech Products",keywords:["laptop","technology","computer","device","digital"],category:"Technology",is_favorite:!1,times_used:0,isExample:!0},{id:"example-food",name:"Food Photography",keywords:["food","meal","cuisine","dish","gourmet"],category:"Food & Beverage",is_favorite:!1,times_used:0,isExample:!0},{id:"example-fashion",name:"Fashion",keywords:["clothing","style","fashion","apparel","outfit"],category:"Fashion",is_favorite:!1,times_used:0,isExample:!0},{id:"example-interior",name:"Interior Design",keywords:["interior","decor","furniture","modern","minimalist"],category:"Home & Design",is_favorite:!1,times_used:0,isExample:!0}];f.useEffect(()=>{m()},[]);const m=async()=>{const{data:w,error:v}=await V.from("keyword_sets").select("*").order("created_at",{ascending:!1});if(v){console.error("Error fetching keyword sets:",v);return}n(w||[])},b=async()=>{if(!i||!l){h({title:"Missing information",description:"Please provide a name and keywords for the set.",variant:"destructive"});return}const w=l.split(",").map(N=>N.trim()).filter(N=>N),{data:{user:v}}=await V.auth.getUser();if(!v){h({title:"Error",description:"You must be logged in to create keyword sets.",variant:"destructive"});return}const{error:j}=await V.from("keyword_sets").insert([{user_id:v.id,name:i,keywords:w,category:d||null}]);if(j){h({title:"Error",description:"Failed to create keyword set.",variant:"destructive"});return}h({title:"Success",description:"Keyword set created successfully!"}),a(!1),o(""),c(""),u(""),m()},g=async w=>{const{error:v}=await V.from("keyword_sets").delete().eq("id",w);if(v){h({title:"Error",description:"Failed to delete keyword set.",variant:"destructive"});return}h({title:"Deleted",description:"Keyword set deleted successfully."}),m()},y=async w=>{e(w.keywords),"isExample"in w||await V.from("keyword_sets").update({times_used:w.times_used+1}).eq("id",w.id),h({title:"Applied",description:`${w.keywords.length} keywords applied from "${w.name}".`})},x=[...p,...t];return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"font-heading text-xl font-bold",children:"Keyword Library"}),s.jsxs(E,{onClick:()=>a(!0),size:"sm",children:[s.jsx(eg,{className:"h-4 w-4 mr-2"}),"Create Set"]})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:x.map(w=>s.jsxs(L,{className:"p-4 space-y-3",children:[s.jsx("div",{className:"flex items-start justify-between",children:s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h4",{className:"font-semibold",children:w.name}),"isExample"in w&&s.jsx(ae,{variant:"outline",className:"text-xs",children:"Example"})]}),w.category&&s.jsx(ae,{variant:"secondary",className:"text-xs mt-1",children:w.category})]})}),s.jsxs("div",{className:"flex flex-wrap gap-1",children:[w.keywords.slice(0,5).map((v,j)=>s.jsx(ae,{variant:"outline",className:"text-xs",children:v},j)),w.keywords.length>5&&s.jsxs(ae,{variant:"outline",className:"text-xs",children:["+",w.keywords.length-5," more"]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Used ",w.times_used," times"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(E,{size:"sm",variant:"outline",onClick:()=>y(w),children:"Apply"}),!("isExample"in w)&&s.jsx(E,{size:"sm",variant:"ghost",onClick:()=>g(w.id),children:s.jsx(Qs,{className:"h-4 w-4"})})]})]})]},w.id))}),s.jsx(pr,{open:r,onOpenChange:a,children:s.jsxs(zn,{children:[s.jsx(Wn,{children:s.jsx(Hn,{children:"Create Keyword Set"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(se,{htmlFor:"set-name",children:"Set Name"}),s.jsx(me,{id:"set-name",value:i,onChange:w=>o(w.target.value),placeholder:"e.g., Product Photography"})]}),s.jsxs("div",{children:[s.jsx(se,{htmlFor:"set-keywords",children:"Keywords (comma-separated)"}
624),s.jsx(me,{id:"set-keywords",value:l,onChange:w=>c(w.target.value),placeholder:"e.g., laptop, workspace, technology"})]}),s.jsxs("div",{children:[s.jsx(se,{htmlFor:"set-category",children:"Category (optional)"}),s.jsxs(Dt,{value:d,onValueChange:u,children:[s.jsx(_t,{children:s.jsx(Lt,{placeholder:"Select category..."})}),s.jsxs(Et,{children:[s.jsx(X,{value:"Technology",children:"Technology"}),s.jsx(X,{value:"Food & Beverage",children:"Food & Beverage"}),s.jsx(X,{value:"Fashion",children:"Fashion"}),s.jsx(X,{value:"Home & Design",children:"Home & Design"}),s.jsx(X,{value:"Business",children:"Business"}),s.jsx(X,{value:"Travel",children:"Travel"}),s.jsx(X,{value:"Other",children:"Other"})]})]})]})]}),s.jsxs(Iv,{children:[s.jsx(E,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),s.jsx(E,{onClick:b,children:"Create Set"})]})]})})]})},YK=({open:e,onOpenChange:t,context:n,keywords:r,onSaved:a})=>{const[i,o]=f.useState(""),[l,c]=f.useState(""),[d,u]=f.useState(!1),h=async()=>{if(!i.trim()){T.error("Please enter a template name");return}u(!0);try{const{data:{user:p}}=await V.auth.getUser();if(!p)throw new Error("Not authenticated");const{error:m}=await V.from("keyword_sets").insert({user_id:p.id,name:i,context:n,keywords:r,industry:l||null,category:"primary",is_system_template:!1,times_used:0});if(m)throw m;T.success("Template saved successfully!"),o(""),c(""),t(!1),a==null||a()}catch(p){console.error("Error saving template:",p),T.error("Failed to save template")}finally{u(!1)}};return s.jsx(pr,{open:e,onOpenChange:t,children:s.jsxs(zn,{className:"sm:max-w-md",children:[s.jsxs(Wn,{children:[s.jsxs(Hn,{className:"flex items-center gap-2 text-xl",children:[s.jsx(Fh,{className:"h-5 w-5"}),"Save as Template"]}),s.jsx(ds,{children:"Save your current configuration for quick reuse"})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"template-name",children:"Template Name *"}),s.jsx(me,{id:"template-name",placeholder:"E.g., E-commerce Product Photos",value:i,onChange:p=>o(p.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"industry",children:"Industry (Optional)"}),s.jsxs(Dt,{value:l,onValueChange:c,children:[s.jsx(_t,{id:"industry",children:s.jsx(Lt,{placeholder:"Select industry"})}),s.jsxs(Et,{children:[s.jsx(X,{value:"ecommerce",children:"E-commerce"}),s.jsx(X,{value:"content",children:"Content/Publishing"}),s.jsx(X,{value:"social",children:"Social Media"}),s.jsx(X,{value:"creative",children:"Creative/Agency"}),s.jsx(X,{value:"corporate",children:"Corporate"}),s.jsx(X,{value:"education",children:"Education"}),s.jsx(X,{value:"healthcare",children:"Healthcare"}),s.jsx(X,{value:"technology",children:"Technology"}),s.jsx(X,{value:"other",children:"Other"})]})]})]}),s.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg space-y-3",children:[s.jsx("h4",{className:"text-sm font-semibold",children:"This template will save:"}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Dr,{className:"h-4 w-4 text-success mt-0.5"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Image Context:"}),s.jsx("p",{className:"text-muted-foreground truncate",children:n||"None"})]})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Dr,{className:"h-4 w-4 text-success mt-0.5"}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("span",{className:"font-medium",children:["Keywords (",r.length,"):"]}),s.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[r.slice(0,5).map((p,m)=>s.jsx(ae,{variant:"secondary",className:"text-xs",children:p},m)),r.length>5&&s.jsxs(ae,{variant:"outline",className:"text-xs",children:["+",r.length-5," more"]})]})]})]})]})]})]}),s.jsxs(Iv,{children:[s.jsx(E,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(E,{onClick:h,disabled:d||!i.trim(),children:d?"Saving...":"Save Template"})]})]})})};var rA="AlertDialog",[QK,Hq]=vt(rA,[H2]),hs=H2(),sA=e=>{const{__scopeAlertDialog:t,...n}=e,r=hs(t);return s.jsx(xv,{...r,...n,modal:!0})};sA.displayName=rA;var JK="AlertDialogTrigger",XK=f.forwardRef((e,t)=>
624{const{__scopeAlertDialog:n,...r}=e,a=hs(n);return s.jsx(pW,{...a,...r,ref:t})});XK.displayName=JK;var ZK="AlertDialogPortal",aA=e=>{const{__scopeAlertDialog:t,...n}=e,r=hs(t);return s.jsx(yv,{...r,...n})};aA.displayName=ZK;var e9="AlertDialogOverlay",iA=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=hs(n);return s.jsx(ad,{...a,...r,ref:t})});iA.displayName=e9;var to="AlertDialogContent",[t9,n9]=QK(to),r9=mS("AlertDialogContent"),oA=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=hs(n),o=f.useRef(null),l=xe(t,o),c=f.useRef(null);return s.jsx(uW,{contentName:to,titleName:lA,docsSlug:"alert-dialog",children:s.jsx(t9,{scope:n,cancelRef:c,children:s.jsxs(id,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:q(a.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[s.jsx(r9,{children:r}),s.jsx(a9,{contentRef:o})]})})})});oA.displayName=to;var lA="AlertDialogTitle",cA=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=hs(n);return s.jsx(od,{...a,...r,ref:t})});cA.displayName=lA;var dA="AlertDialogDescription",uA=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=hs(n);return s.jsx(ld,{...a,...r,ref:t})});uA.displayName=dA;var s9="AlertDialogAction",hA=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=hs(n);return s.jsx(gf,{...a,...r,ref:t})});hA.displayName=s9;var fA="AlertDialogCancel",mA=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=n9(fA,n),i=hs(n),o=xe(t,a);return s.jsx(gf,{...i,...r,ref:o})});mA.displayName=fA;var a9=({contentRef:e})=>{const t=`\`${to}\` requires a description for the component to be accessible for screen reader users.
625
626You can add a description to the \`${to}\` by passing a \`${dA}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
627
628Alternatively, 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 \`${to}\`. 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.
629
630For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return f.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},i9=sA,o9=aA,pA=iA,gA=oA,xA=hA,yA=mA,vA=cA,wA=uA;const l9=i9,c9=o9,bA=f.forwardRef(({className:e,...t},n)=>s.jsx(pA,{className:F("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}));bA.displayName=pA.displayName;const jA=f.forwardRef(({className:e,...t},n)=>s.jsxs(c9,{children:[s.jsx(bA,{}),s.jsx(gA,{ref:n,className:F("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),...t})]}));jA.displayName=gA.displayName;const NA=({className:e,...t})=>s.jsx("div",{className:F("flex flex-col space-y-2 text-center sm:text-left",e),...t});NA.displayName="AlertDialogHeader";const SA=({className:e,...t})=>s.jsx("div",{className:F("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});SA.displayName="AlertDialogFooter";const kA=f.forwardRef(({className:e,...t},n)=>s.jsx(vA,{ref:n,className:F("text-lg font-semibold",e),...t}));kA.displayName=vA.displayName;const CA=f.forwardRef(({className:e,...t},n)=>s.jsx(wA,{ref:n,className:F("text-sm text-muted-foreground",e),...t}));CA.displayName=wA.displayName;const _A=f.forwardRef(({className:e,...t},n)=>s.jsx(xA,{ref:n,className:F(tv(),e),...t}));_A.displayName=xA.displayName;const EA=f.forwardRef(({className:e,...t},n)=>s.jsx(yA,{ref:n,className:F(tv({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));EA.displayName=yA.displayName;const d9=({open:e,onOpenChange:t,onLoadTemplate:n})=>{const[r,a]=f.useState([]),[i,o]=f.useState(!0),[l,c]=f.useState(!1),[d,u]=f.useState(null);f.useEffect(()=>{e&&h()},[e]);const h=async()=>{o(!0);try{const{data:x,error:w}=await V.from("keyword_sets").select("*").order("is_system_template",{ascending:!1}).order("times_used",{ascending:!1}).order("created_at",{ascending:!1});if(w)throw w;a(x||[])}catch(x){console.error("Error fetching templates:",x),T.error("Failed to load templates")}
630finally{o(!1)}},p=async x=>{try{const{error:w}=await V.from("keyword_sets").update({is_favorite:!x.is_favorite}).eq("id",x.id);if(w)throw w;T.success(x.is_favorite?"Removed from favorites":"Added to favorites"),h()}catch(w){console.error("Error toggling favorite:",w),T.error("Failed to update favorite")}},m=async x=>{try{const{data:{user:w}}=await V.auth.getUser();if(!w)throw new Error("Not authenticated");const{error:v}=await V.from("keyword_sets").insert({user_id:w.id,name:`${x.name} (Copy)`,context:x.context,keywords:x.keywords,category:x.category,industry:x.industry,is_system_template:!1,times_used:0});if(v)throw v;T.success("Template duplicated successfully"),h()}catch(w){console.error("Error duplicating template:",w),T.error("Failed to duplicate template")}},b=async()=>{if(d)try{const{error:x}=await V.from("keyword_sets").delete().eq("id",d.id);if(x)throw x;T.success("Template deleted successfully"),c(!1),u(null),h()}catch(x){console.error("Error deleting template:",x),T.error("Failed to delete template")}},g=x=>{const w={name:x.name,context:x.context,keywords:x.keywords,industry:x.industry,category:x.category},v=new Blob([JSON.stringify(w,null,2)],{type:"application/json"}),j=URL.createObjectURL(v),N=document.createElement("a");N.href=j,N.download=`template-${x.name.toLowerCase().replace(/\s+/g,"-")}.json`,N.click(),URL.revokeObjectURL(j),T.success("Template exported")},y=x=>x&&{ecommerce:"🛍️",content:"📝",social:"📱",creative:"🎨",corporate:"💼",education:"📚",healthcare:"🏥",technology:"💻"}[x]||"📋";return s.jsxs(s.Fragment,{children:[s.jsx(pr,{open:e,onOpenChange:t,children:s.jsxs(zn,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(Wn,{children:[s.jsxs(Hn,{className:"flex items-center gap-2 text-2xl",children:[s.jsx(Hu,{className:"h-6 w-6"}),"Template Library"]}),s.jsx(ds,{children:"Manage your saved templates and pre-made configurations"})]}),s.jsx("div",{className:"space-y-4 mt-4",children:i?s.jsx("p",{className:"text-center text-muted-foreground py-8",children:"Loading templates..."}):r.length===0?s.jsxs(L,{className:"p-8 text-center",children:[s.jsx(Hu,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No Templates Yet"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:'Create your first template by generating alt text and clicking "Save as Template"'})]}):s.jsx("div",{className:"grid grid-cols-1 gap-4",children:r.map(x=>s.jsx(L,{className:"p-4 hover:shadow-lg transition-shadow",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xl",children:y(x.industry)}),s.jsx("h3",{className:"font-semibold text-lg",children:x.name}),x.is_system_template&&s.jsx(ae,{variant:"secondary",className:"text-xs",children:"Pre-made"}),x.is_favorite&&s.jsx(qu,{className:"h-4 w-4 fill-primary text-primary"})]}),x.context&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:x.context}),s.jsxs("div",{className:"flex flex-wrap gap-1",children:[x.keywords.slice(0,6).map((w,v)=>s.jsx(ae,{variant:"outline",className:"text-xs",children:w},v)),x.keywords.length>6&&s.jsxs(ae,{variant:"outline",className:"text-xs",children:["+",x.keywords.length-6]})]}),s.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(JS,{className:"h-3 w-3"}),"Used ",x.times_used," times"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(zS,{className:"h-3 w-3"}),new Date(x.created_at).toLocaleDateString()]})]})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(E,{size:"sm",onClick:()=>{n&&n(x),t(!1)},children:"Use Template"}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx(E,{size:"icon",variant:"ghost",onClick:()=>p(x),title:x.is_favorite?"Remove from favorites":"Add to favorites",children:s.jsx(qu,{className:`h-4 w-4 ${x.is_favorite?"fill-primary text-primary":""}`})}),s.jsx(E,{size:"icon",variant:"ghost",onClick:()=>m(x),title:"Duplicate template",children:s.jsx(jt,{className:"h-4 w-4"})}),s.jsx(E,{size:"icon",variant:"ghost",onClick:()=>g(x),title:"Export as JSON",children:s.jsx(Hc,{className:"h-4 w-4"})}),!x.is_system_template&&s.jsx(E,{size:"icon",variant:"ghost",onClick:()=>{u(x),c(!0)},title:"Delete template",children:s.jsx(Qs,{className:"h-4 w-4"})})]})]})]})},x.id))})})]})}),s.jsx(l9,{open:l,onOpenChange:c,children:s.jsxs(jA,{children:[s.jsxs(NA,{children:[s.jsx(kA,{children:"Delete Template?"}),s.jsxs(CA,{children:['Are you sure you want to delete "',d==null?void 0:d.name,'"? This action cannot be undone.']})]}),s.jsxs(SA,{children:[s.jsx(EA,{children:"Cancel"}),s.jsx(_A,{onClick:b,children:"Delete"})]})]})})]})},Qm=[{code:"en",name:"English (US)",nativeName:"English",flag:"🇺🇸"},{code:"en-GB",name:"English (UK)",nativeName:"English",flag:"🇬🇧"},{code:"es",name:"Spanish",nativeName:"Español",flag:"🇪🇸"},{code:"fr",name:"French",nativeName:"Français",flag:"🇫🇷"},{code:"de",name:"German",nativeName:"Deutsch",flag:"🇩🇪"},{code:"it",name:"Italian",nativeName:"Italiano",flag:"🇮🇹"},{code:"pt",name:"Portuguese",nativeName:"Português",flag:"🇵🇹"},{code:"nl",name:"Dutch",nativeName:"Nederlands",flag:"🇳🇱"},{code:"zh-CN",name:"Chinese Simplified",nativeName:"简体中文",flag:"🇨🇳"},{code:"zh-TW",name:"Chinese Traditional",nativeName:"繁體中文",flag:"🇹🇼"},{code:"ja",name:"Japanese",nativeName:"日本語",flag:"🇯🇵"},{code:"ko",name:"Korean",nativeName:"한국어",flag:"🇰🇷"},{code:"ar",name:"Arabic",nativeName:"العربية",flag:"🇸🇦",rtl:!0},{code:"ru",name:"Russian",nativeName:"Русский",flag:"🇷🇺"},{code:"pl",name:"Polish",nativeName:"Polski",flag:"🇵🇱"},{code:"sv",name:"Swedish",nativeName:"Svenska",flag:"🇸🇪"},{code:"da",name:"Danish",nativeName:"Dansk",flag:"🇩🇰"},{code:"no",name:"Norwegian",nativeName:"Norsk",flag:"🇳🇴"},{code:"fi",name:"Finnish",nativeName:"Suomi",flag:"🇫🇮"},{code:"he",name:"Hebrew",nativeName:"עברית",flag:"🇮🇱",rtl:!0}],u9=({primaryLanguage:e,onPrimaryLanguageChange:t,additionalLanguages:n,onAdditionalLanguagesChange:r,disabled:a=!1})=>{const[i,o]=f.useState(n.length>0),[l,c]=f.useState(!1),d=m=>{o(m),m||r([])},u=(m,b)=>{if(b){if(n.length>=5)return;r([...n,m])}else r(n.filter(g=>g!==m))},h=Qm.filter(m=>
630["es","fr","de","zh-CN","ja","pt","it","ar"].includes(m.code)),p=Qm.filter(m=>!h.some(b=>b.code===m.code)&&m.code!=="en");return s.jsxs(L,{className:"p-4 space-y-4 border-primary/20",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Io,{className:"h-5 w-5 text-primary"}),s.jsx(se,{className:"text-base font-semibold",children:"🌍 Output Language"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"primary-language",children:"Primary Language *"}),s.jsxs(Dt,{value:e,onValueChange:t,disabled:a,children:[s.jsx(_t,{id:"primary-language",children:s.jsx(Lt,{placeholder:"Select primary language"})}),s.jsx(Et,{children:Qm.map(m=>s.jsxs(X,{value:m.code,children:[m.flag," ",m.name]},m.code))})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(un,{id:"additional-languages",checked:i,onCheckedChange:d,disabled:a}),s.jsx("label",{htmlFor:"additional-languages",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Also generate in additional languages"})]}),i&&s.jsxs("div",{className:"space-y-3 pl-6 border-l-2 border-primary/20",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Select up to 5 additional languages (",n.length,"/5)"]}),n.length>0&&s.jsxs(ae,{variant:"secondary",children:[n.length," selected"]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:"Popular Languages"}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:h.filter(m=>m.code!==e).map(m=>s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(un,{id:`lang-${m.code}`,checked:n.includes(m.code),onCheckedChange:b=>u(m.code,b),disabled:a||!n.includes(m.code)&&n.length>=5}),s.jsxs("label",{htmlFor:`lang-${m.code}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:[m.flag," ",m.nativeName]})]},m.code))})]}),l?s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:"More Languages"}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:p.filter(m=>m.code!==e).map(m=>s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(un,{id:`lang-${m.code}`,checked:n.includes(m.code),onCheckedChange:b=>u(m.code,b),disabled:a||!n.includes(m.code)&&n.length>=5}),s.jsxs("label",{htmlFor:`lang-${m.code}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:[m.flag," ",m.nativeName]})]},m.code))}),s.jsx("button",{onClick:()=>c(!1),className:"text-sm text-primary hover:underline",children:"Show Less"})]}):s.jsx("button",{onClick:()=>c(!0),className:"text-sm text-primary hover:underline",disabled:a,children:"Show More Languages..."})]})]})},Jm=async e=>new Promise((t,n)=>{const r=new Image,a=new FileReader;a.onload=i=>{var c;const o=(c=i.target)==null?void 0:c.result;if(!(e.type!=="image/jpeg"&&e.type!=="image/png"&&e.type!=="image/webp")&&e.size<5*1024*1024){t({dataUrl:o,wasConverted:!1});return}r.onload=()=>{const d=document.createElement("canvas");let u=r.width,h=r.height;const p=1600;(u>p||h>p)&&(u>h?(h=Math.round(h*p/u),u=p):(u=Math.round(u*p/h),h=p)),d.width=u,d.height=h;const m=d.getContext("2d");if(!m){n(new Error("Failed to get canvas context"));return}m.drawImage(r,0,0,u,h);const b=e.size>5*1024*1024?.75:.85,g=d.toDataURL("image/jpeg",b);if(g.length>12*1024*1024){n(new Error("Image too large after conversion. Please use a smaller image."));return}t({dataUrl:g,wasConverted:!0})},r.onerror=()=>n(new Error("Failed to load image")),r.src=o},a.onerror=()=>n(new Error("Failed to read file")),a.readAsDataURL(e)}),h9=({onResultsUpdate:e,compact:t=!1})=>{const[n,r]=f.useState([]),[a,i]=f.useState(""),[o,l]=f.useState(""),[c,d]=f.useState([]),[u,h]=f.useState(!1),[p,m]=f.useState(0),[b,g]=f.useState(!1),[y,x]=f.useState(!1),[w,v]=f.useState([]),[j,N]=f.useState(null),[S,k]=f.useState(!1),[C,A]=f.useState("general"),[R,G]=f.useState(null),[W,$]=f.useState(!1),[M,K]=f.useState(!1),[z,I]=f.useState([]),[P,_]=f.useState([]),[U,Z]=f.useState([]),[ee,ie]=f.useState("none"),[de,Re]=f.useState(!1),Ee=f.useRef(null),[Q,be]=f.useState(!1);f.useState("");const[ve,Se]=f.useState(null),[je,ke]=f.useState(!1),[gt,Qt]=f.useState([]),[$r,Kn]=f.useState(!1),[Ur,Br]=f.useState(!1),[fn,md]=f.useState(null),[Cn,pd]=f.useState([]),[xr,Tf]=f.useState("en"),[fs,Jt]=f.useState([]),[yr,Af]=f.useState(null);f.useEffect(()=>{qo()},[]);const qo=async()=>{try{const{data:D,error:re}=await V.from("keyword_sets").select("*").order("is_system_template",{ascending:!1}).order("times_used",{ascending:!1});if(re)throw re;pd(D||[])}catch(D){console.error("Error fetching templates:",D)}},ha=D=>{i(D.context||"");const re=D.keywords.map(ce=>({keyword:ce,relevance:4,difficulty:"medium",searchVolume:"medium",category:"primary",variations:[],lsiKeywords:[],selected:!0}));d(re),md(D),T.success(`Template "${D.name}" loaded`),V.from("keyword_sets").update({times_used:D.times_used+1}).eq("id",D.id).then(()=>qo())},Rf=()=>{if(!a&&c.length===0){T.error("Please add context or keywords before saving as template");return}Kn(!0)},Yo=f.useCallback(D=>{D.preventDefault(),g(!0)},[]),ci=f.useCallback(D=>{D.preventDefault(),g(!1)},[]),vr=f.useCallback(D=>{const re=D.filter(le=>le.type.startsWith("image/"));if(n.length+re.length>50){T.error("Maximum 50 images allowed");return}r(le=>[...le,...re]),re.length>0&&setTimeout(()=>{Zo()},500)},[n.length]),Qo=f.useCallback(D=>{D.preventDefault(),g(!1);const re=Array.from(D.dataTransfer.files);vr(re)},[vr]),Vr=D=>{const re=Array.from(D.target.files||[]);vr(re)},If=D=>{r(re=>re.filter((ce,le)=>le!==D))},gd=f.useCallback((D,re)=>{const ce=new Set,le=[];return re.forEach(Ce=>{const qe=Ce.keyword.toLowerCase();if(!ce.has(qe)){ce.add(qe);const pn=D.some(tl=>tl.keyword.toLowerCase()===qe);le.push({...Ce,source:pn?"both":"image"})}}),D.forEach(Ce=>{const qe=Ce.keyword.toLowerCase();ce.has(qe)||(ce.add(qe),le.push({...Ce,source:"context"}))}),le.sort((Ce,qe)=>Ce.source==="both"&&qe.source!=="both"?-1:Ce.source!=="both"&&qe.source==="both"?1:Ce.source==="image"&&qe.source==="context"?-1:Ce.source==="context"&&qe.source==="image"?1:qe.relevance-Ce.relevance),le.slice(0,10)},[]),Jo=f.useCallback(async D=>{d([]);for(let re=0;re<D.length;re++)await new Promise(ce=>setTimeout(ce,200)),d(ce=>[...ce,D[re]])},[]),Xo=f.useCallback(async()=>
630{if(!(!a||a.length<15||n.length>0)){Re(!0);try{const{data:D,error:re}=await V.functions.invoke("suggest-keywords",{body:{contextOnly:!0,context:a,strategy:C!=="general"?C:void 0}});if(re)throw re;if(D.keywords&&D.keywords.length>0){const ce=D.keywords.map(Ce=>({...Ce,source:"context",selected:!0}));_(ce),d(ce),l(ce.map(Ce=>Ce.keyword).join(", ")),ie("context");const le=gl(ce);G(le),T.success(`✨ ${ce.length} preliminary keywords generated from context!`)}}catch(D){console.error("Context keyword generation error:",D)}finally{Re(!1)}}},[a,C,n.length]),Zo=f.useCallback(async()=>{var D;if(n.length!==0){K(!0),Ee.current&&Ee.current.abort(),Ee.current=new AbortController;try{const re=n.slice(0,5),ce=await Promise.all(re.map(async zr=>{const{dataUrl:Gn}=await Jm(zr);return Gn})),{data:le,error:Ce}=await V.functions.invoke("suggest-keywords",{body:{images:ce,context:a||void 0,strategy:C!=="general"?C:void 0}});if(Ce){if((D=Ce.message)!=null&&D.includes("429")){T.error("Too many requests. Please wait a moment.",{description:"Add keywords manually or try again in 30 seconds"});return}throw Ce}if(!(le!=null&&le.keywords)||le.keywords.length===0){T.info("No keywords suggested",{description:"Add keywords manually for better alt text"});return}const qe=le.keywords.sort((zr,Gn)=>Gn.relevance-zr.relevance).slice(0,8).map(zr=>({...zr,selected:!0,source:"image"}));Z(qe);let pn;P.length>0?(pn=gd(P,qe),ie("merged"),T.success("✨ Keywords updated with image analysis!")):(pn=qe,ie("context"),T.success(`✨ ${qe.length} keywords generated automatically!`)),I(pn),await Jo(pn),l(pn.map(zr=>zr.keyword).join(", "));const tl=gl(pn);G(tl)}catch(re){console.error("Auto-generation error:",re),re.name!=="AbortError"&&T.error("Couldn't auto-generate keywords",{description:"Click 'Regenerate' to try again, or add keywords manually"})}finally{K(!1)}}},[n,a,C,P,gd,Jo]);f.useEffect(()=>{if(a.length>15&&n.length===0){const D=setTimeout(()=>{Xo()},800);return()=>clearTimeout(D)}else a.length<15&&P.length>0&&(_([]),d([]),ie("none"))},[a,n.length,P.length,Xo]),f.useEffect(()=>{if(n.length>0&&!M&&!u&&c.length===0){const D=setTimeout(()=>{Zo()},1e3);return()=>clearTimeout(D)}},[C,n.length,M,u,c.length,Zo]);const el=async()=>{if(n.length===0){T.error("Please upload images first");return}console.log("🔍 Starting keyword suggestion generation..."),k(!0);try{const D=n.slice(0,5);console.log(`📷 Processing ${D.length} images for keyword analysis`);const re=D.map(async qe=>{const{dataUrl:pn}=await Jm(qe);return pn}),ce=await Promise.all(re);console.log("✅ Images converted successfully"),console.log("🚀 Calling suggest-keywords function...",{imageCount:ce.length,context:a||"none",strategy:C});const{data:le,error:Ce}=await V.functions.invoke("suggest-keywords",{body:{images:ce,context:a||void 0,strategy:C!=="general"?C:void 0}});if(console.log("📦 Function response:",{data:le,error:Ce}),Ce)throw console.error("❌ Function error:",Ce),Ce;if(!le||!le.keywords)throw console.warn("⚠️ No keywords in response"),new Error("No keywords received from suggestion service");console.log(`✨ Received ${le.keywords.length} keyword suggestions`),v(le.keywords),N(le.warning||null),x(!0),T.success("Keyword suggestions generated!")}catch(D){console.error("❌ Error getting keyword suggestions:",D);const re=D.message||"Failed to generate keyword suggestions";T.error(re)}
630finally{k(!1),console.log("🏁 Keyword suggestion process complete")}},wr=D=>{d(D);const re=D.map(le=>le.keyword).join(", ");l(re),x(!1);const ce=gl(D);G(ce)},xd=D=>{const re=c.filter(le=>le.keyword!==D);d(re),l(re.map(le=>le.keyword).join(", "));const ce=gl(re);G(ce)},he=D=>{d(D),l(D.map(re=>re.keyword).join(", "))},Ie=D=>{if(D.length===0)return"N/A";const re={easy:1,medium:2,hard:3},ce=D.reduce((le,Ce)=>le+re[Ce.difficulty],0)/D.length;return ce<1.5?"Easy":ce<2.5?"Medium":"Hard"},Be=D=>{const re=D.map(le=>({keyword:le,relevance:4,difficulty:"medium",searchVolume:"medium",category:"secondary",variations:[],lsiKeywords:[],selected:!0}));d(re),l(D.join(", "));const ce=gl(re);G(ce),be(!1)},Xt=async()=>{var ce;if(n.length===0){T.error("Please upload at least one image");return}h(!0),m(0);const D=[];let re=0;try{const le=c.length>0?iT(n.length,c):[];for(let Ce=0;Ce<n.length;Ce++){const qe=n[Ce],{dataUrl:pn,wasConverted:tl}=await Jm(qe);tl&&re++;const zr=le.length>0?le[Ce].keywords:void 0,{data:Gn,error:Mf}=await V.functions.invoke("generate-alt-text",{body:{image:pn,context:a||void 0,keywords:o||void 0,assignedKeywords:zr,originalFilename:qe.name,primaryLanguage:xr,additionalLanguages:fs.length>0?fs:void 0}});if(Mf){console.error("Function error:",Mf);const nl=(ce=Mf.message)!=null&&ce.includes("Unsupported image format")?"Unsupported image format. Please use JPG, PNG, or WEBP.":`Failed to generate metadata for ${qe.name}`;T.error(nl);continue}if(fs.length>0)for(let nl=0;nl<fs.length;nl++)Af({language:fs[nl],imageIndex:Ce}),await new Promise($A=>setTimeout($A,100));D.push({id:crypto.randomUUID(),fileName:qe.name,imageUrl:pn,altText:Gn.altText,titleTag:Gn.titleTag,caption:Gn.caption,suggestedFilename:Gn.suggestedFilename,ogAlt:Gn.ogAlt,schemaMarkup:Gn.schemaMarkup,translations:Gn.translations,context:a,keywords:o}),m((Ce+1)/n.length*100)}Qt(D),e(D,c.length>0?c:void 0),c.length>0&&await hK(c,n.length),ke(!1),re>0&&T.info(`${re} image(s) converted to JPEG for compatibility. Originals unaffected.`),T.success(`Generated alt text for ${n.length} images!`),r([]),i(""),l(""),d([]),G(null)}catch(le){console.error("Error processing images:",le),T.error(le.message||"Failed to generate alt text")}finally{h(!1),m(0)}},mn=async()=>{if(gt.length===0){T.error("No images to regenerate");return}ke(!1),T.info("Regenerating with optimized keyword integration..."),await Xt()};return s.jsxs(L,{className:`shadow-elevated ${t?"p-4 space-y-4":"p-6 space-y-6 px-[27px] my-[2px] mx-0 py-[21px]"}`,children:[t?s.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 transition-all duration-300 ${b?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onDragOver:Yo,onDragLeave:ci,onDrop:Qo,children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:s.jsx(rs,{className:"h-8 w-8 text-primary"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:b?"Drop here":"Upload More Images"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"JPG, PNG, WebP, HEIC (Max 10MB)"})]})]}),s.jsx(me,{type:"file",multiple:!0,accept:"image/*",onChange:Vr,className:"hidden",id:"file-upload-compact"}),s.jsx(E,{asChild:!0,size:"sm",children:s.jsx("label",{htmlFor:"file-upload-compact",className:"cursor-pointer",children:"Select Files"})})]})}):s.jsxs("div",{className:`border-2 border-dashed rounded-xl p-16 text-center transition-all duration-300 ${b?"border-primary bg-primary/5 scale-[1.02] shadow-glow-primary":"border-border hover:border-primary/50 hover:shadow-glow-primary"}`,onDragOver:Yo,onDragLeave:ci,onDrop:Qo,children:[s.jsx(rs,{className:`h-16 w-16 mx-auto mb-4 text-primary ${b?"animate-pulse-glow":""}`}),s.jsx("h3",{className:"font-heading text-xl font-semibold mb-2",children:"Drop your images here"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"to generate perfect alt text in seconds"}),s.jsx(me,{type:"file",multiple:!0,accept:"image/*",onChange:Vr,className:"hidden",id:"file-upload"}),s.jsx(E,{asChild:!0,size:"lg",className:"bg-gradient-hero hover:opacity-90",children:s.jsx("label",{htmlFor:"file-upload",className:"cursor-pointer",children:"Select Images (Max 50)"})})]}),n.length>0&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs(se,{className:"text-sm font-semibold",children:["Selected Images (",n.length,"/50)"]}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 max-h-[300px] overflow-y-auto pr-2",children:n.map((D,re)=>s.jsxs("div",{className:"relative group animate-fade-in",children:[s.jsx("div",{className:"aspect-square rounded-lg overflow-hidden bg-muted shadow-soft hover:shadow-elevated transition-shadow",children:s.jsx("img",{src:URL.createObjectURL(D),alt:D.name,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110"})}),s.jsx("button",{onClick:()=>If(re),className:"absolute -top-2 -right-2 bg-destructive text-destructive-foreground rounded-full p-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-elevated hover:scale-110",children:s.jsx(cs,{className:"h-4 w-4"})}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:D.name})]},re))})]}),s.jsx(fK,{}),je&&s.jsxs(kt,{children:[s.jsx(Nt,{className:"h-4 w-4"}),s.jsxs(Ct,{className:"flex items-center justify-between",children:[s.jsx("span",{children:"Your alt texts could be improved. Regenerate with better keyword integration?"}),s.jsx(E,{onClick:mn,size:"sm",variant:"default",className:"ml-4",children:"Regenerate"})]})]}),n.length===0&&Cn.length>0&&s.jsx(L,{className:"p-4 bg-gradient-to-r from-primary/5 to-accent/5 border-primary/20",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold flex items-center gap-2",children:"📋 Quick Start with Template"}),s.jsxs(E,{variant:"ghost",size:"sm",onClick:()=>Br(!0),className:"gap-2",children:[s.jsx(Hu,{className:"h-4 w-4"}),"Manage Templates"]})]}),s.jsxs(Dt,{value:(fn==null?void 0:fn.id)||"",onValueChange:D=>{const re=Cn.find(ce=>ce.id===D);re&&ha(re)},children:[s.jsx(_t,{children:s.jsx(Lt,{placeholder:"Select a template to get started..."})}),s.jsxs(Et,{children:[Cn.filter(D=>D.is_system_template).map(D=>s.jsxs(X,{value:D.id,children:[D.industry==="ecommerce"&&"🛍️ ",D.industry==="content"&&"📝 ",D.industry==="social"&&"📱 ",D.industry==="creative"&&"🎨 ",D.industry==="corporate"&&"💼 ",D.name]},D.id)),Cn.filter(D=>!D.is_system_template).length>0&&s.jsxs(s.Fragment,{children:[s.jsx(X,{value:"divider",disabled:!0,children:"─── My Templates ───"}),Cn.filter(D=>!D.is_system_template).map(D=>
630s.jsxs(X,{value:D.id,children:[D.name," (",D.times_used," uses)"]},D.id))]})]})]}),fn&&s.jsxs(ae,{variant:"secondary",className:"gap-1",children:["✓ Template loaded: ",fn.name]})]})}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(se,{htmlFor:"context",children:"Image Context (optional)"}),n.length>0&&Cn.length>0&&!fn&&s.jsx(E,{variant:"ghost",size:"sm",onClick:()=>Br(!0),className:"h-auto p-0 text-xs text-muted-foreground hover:text-foreground",children:"💡 Load template"})]}),s.jsx(me,{id:"context",placeholder:"e.g., Product photo, Blog header, Infographic...",value:a,onChange:D=>i(D.target.value),disabled:u})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"strategy",children:"Keyword Strategy (optional)"}),s.jsxs(Dt,{value:C,onValueChange:A,disabled:u,children:[s.jsx(_t,{children:s.jsx(Lt,{placeholder:"Select a keyword strategy"})}),s.jsxs(Et,{children:[s.jsx(X,{value:"general",children:"General Purpose"}),s.jsx(X,{value:"ecommerce",children:"E-commerce Products"}),s.jsx(X,{value:"blog",children:"Blog Content"}),s.jsx(X,{value:"portfolio",children:"Portfolio Images"}),s.jsx(X,{value:"marketing",children:"Marketing Materials"}),s.jsx(X,{value:"technical",children:"Technical Documentation"})]})]})]}),s.jsxs(L,{className:"p-4 space-y-4 border-primary/20",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{children:"SEO Keywords (optional)"}),s.jsx(bo,{children:s.jsxs(gc,{children:[s.jsx(xc,{asChild:!0,children:s.jsx(yo,{className:"h-4 w-4 text-muted-foreground cursor-help"})}),s.jsx(jo,{children:s.jsx("p",{className:"max-w-xs",children:"Enter 3-5 specific keywords related to your images"})})]})})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(E,{variant:"outline",size:"sm",onClick:()=>$(!0),children:[s.jsx(VS,{className:"h-4 w-4 mr-2"}),"See Examples"]}),s.jsxs(E,{variant:"outline",size:"sm",onClick:()=>be(!0),disabled:u,children:[s.jsx(Hu,{className:"h-4 w-4 mr-2"}),"Library"]}),s.jsx(E,{variant:"outline",size:"sm",onClick:el,disabled:n.length===0||u||S,className:"gap-2",children:S?s.jsxs(s.Fragment,{children:[s.jsx(On,{className:"h-4 w-4 animate-spin"}),"Analyzing..."]}):c.length>0?s.jsx(s.Fragment,{children:"🔄 Regenerate"}):s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"h-4 w-4"}),"Get Suggestions"]})})]})]}),n.length===0?s.jsx(L,{className:"p-4 space-y-4 border-primary/20 bg-muted/30",children:s.jsxs("div",{className:"text-center py-6",children:[s.jsx(Nt,{className:"h-12 w-12 mx-auto mb-3 text-muted-foreground/50"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Upload images to get AI-powered keyword suggestions automatically"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Our AI will analyze your images and suggest the best SEO keywords"})]})}):M?s.jsxs(L,{className:"p-4 border-primary/20 bg-primary/5",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(On,{className:"h-5 w-5 animate-spin text-primary"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"font-medium text-sm",children:"Analyzing images and generating keywords..."}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"This will take 2-3 seconds"})]})]}),s.jsx("div",{className:"mt-4 flex gap-2",children:[1,2,3,4,5].map(D=>s.jsx("div",{className:"h-8 w-20 bg-muted animate-pulse rounded-full"},D))})]}):s.jsxs("div",{className:"space-y-4",children:[c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Nt,{className:"h-5 w-5 text-primary"}),s.jsx(se,{className:"text-base font-semibold",children:"✨ Suggested SEO Keywords (AI-Generated)"})]}),s.jsx(Mj,{keywords:c,onRemove:xd,onReorder:he,onAddManual:()=>x(!0)}),R&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs(ae,{variant:"secondary",className:"bg-primary/10 text-primary border-primary/20 w-fit font-medium",children:["🚀 Estimated +",R.estimatedImprovement,"% visibility"]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:R.reasoning})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2 p-3 bg-muted/30 rounded-lg",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Keywords"}),s.jsx("p",{className:"text-lg font-semibold",children:c.length})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Avg Difficulty"}),s.jsx("p",{className:"text-lg font-semibold capitalize",children:Ie(c)})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Coverage"}),s.jsx("p",{className:"text-lg font-semibold",children:c.length>=5?"Good ✅":"Low ⚠️"})]})]}),s.jsxs(kt,{children:[s.jsx(yo,{className:"h-4 w-4"}),s.jsxs(Ct,{className:"text-xs",children:["💡 Tip: Mix of easy and medium difficulty keywords gives best results.",c.length<5&&" Consider adding more keywords for better coverage.",c.length>8&&" Too many keywords may reduce effectiveness."]})]}),n.length>0&&s.jsx(uK,{keywords:c,imageCount:n.length})]}),c.length===0&&s.jsx(Mj,{keywords:c,onRemove:xd,onReorder:he,onAddManual:()=>x(!0)})]}),ve&&s.jsx(kt,{variant:(ve.type==="warning","default"),children:s.jsx(Ct,{className:ve.type==="success"?"text-success":"text-warning",children:ve.message})}),s.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[s.jsx("p",{children:"💡 Tip: 3-5 specific keywords work best"}),c.length>5&&s.jsx("p",{className:"text-warning font-medium",children:"⚠️ Too many keywords may reduce effectiveness"})]})]}),s.jsx(lK,{open:y,onOpenChange:x,keywords:w,onSelect:wr,context:a,warning:j||void 0}),s.jsx(xK,{open:W,onOpenChange:$}),s.jsx(pr,{open:Q,onOpenChange:be,children:s.jsxs(zn,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[s.jsx(Wn,{children:s.jsx(Hn,{children:"Keyword Library"})}),s.jsx(qK,{onApplySet:Be})]})}),u&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{children:"Processing images..."}),s.jsxs("span",{children:[Math.round(p),"%"]})]}),s.jsx(Vn,{value:p,className:"h-2"}),yr&&s.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["Translating to ",yr.language,"... (Image ",yr.imageIndex+1,"/",n.length,")"]})]}),s.jsx(u9,{primaryLanguage:xr,onPrimaryLanguageChange:Tf,additionalLanguages:fs,onAdditionalLanguagesChange:Jt,disabled:u}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(E,{onClick:Xt,disabled:n.length===0||u,className:"flex-1 bg-gradient-hero hover:opacity-90 transition-opacity shadow-glow-primary",size:"lg",children:u?s.jsxs(s.Fragment,{children:[s.jsx(On,{className:"mr-2 h-4 w-4 animate-spin"}),"Processing..."]}):s.jsx(s.Fragment,{children:"Generate Alt Text"})}),(a||c.length>0)&&!u&&s.jsxs(E,{onClick:Rf,variant:"outline",size:"lg",className:"gap-2",children:[s.jsx(Fh,{className:"h-4 w-4"}),"Save Template"]})]}),s.jsx(YK,{open:$r,onOpenChange:Kn,context:a,keywords:c.map(D=>D.keyword),onSaved:qo}),s.jsx(d9,{open:Ur,onOpenChange:Br,onLoadTemplate:ha})]})},f9=()=>{const e=["Alt Text (SEO-optimized)","Title Tags","Image Captions","Optimized Filenames","Open Graph Tags","Schema Markup"];return s.jsxs(L,{className:"p-6 bg-navy-800 border-coral-500/20",children:[s.jsx("h3",{className:"text-xl font-heading font-bold text-white mb-4 flex items-center gap-2",children:"🚀 What You Can Generate"}),s.jsx("ul",{className:"space-y-3",children:e.map((t,n)=>s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"w-5 h-5 rounded-full bg-coral-500/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:s.jsx(Me,{className:"w-3 h-3 text-coral-500"})}),s.jsx("span",{className:"text-navy-300",children:t})]},n))}),s.jsx("p",{className:"text-sm text-navy-400 mt-4 italic",children:"All generated automatically with one click"})]})},m9=()=>s.jsxs(L,{className:"p-6 bg-gradient-to-br from-coral-500/20 to-coral-500/5 border-coral-500/30",children:[s.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-coral-500 flex items-center justify-center flex-shrink-0",children:s.jsx(Nt,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-heading font-bold text-navy-900",children:"Unlock More Power"}),s.jsxs("p",{className:"text-sm text-navy-400",children:["Current plan: ",s.jsx("span",{className:"text-coral-500 font-bold",children:"Free"})," (10/month)"]})]})]}),s.jsxs("div",{className:"space-y-2 mb-4",children:[s.jsx("p",{className:"text-sm text-navy-900 font-medium",children:"Upgrade to Starter for:"}),s.jsxs("ul",{className:"text-sm text-navy-300 space-y-1",children:[s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-coral-500",children:"•"})," 200 images/month"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-coral-500",children:"•"})," Full metadata"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-coral-500",children:"•"})," Priority support"]})]})]}),s.jsx("a",{href:"/#pricing",children:s.jsx(E,{className:"w-full bg-primary hover:bg-primary/90 text-primary-foreground",children:"View Plans"})})]}),p9=()=>{const[e,t]=f.useState([]);f.useEffect(()=>{const o=localStorage.getItem("altify_history");o&&t(JSON.parse(o))},[]),f.useEffect(()=>{const o=()=>{const l=localStorage.getItem("altify_history");l&&t(JSON.parse(l))};return window.addEventListener("altify_history_updated",o),()=>window.removeEventListener("altify_history_updated",o)},[]);const n=async o=>{await navigator.clipboard.writeText(o),T.success("Copied to clipboard!")},r=o=>{const l=e.filter(c=>c.id!==o);t(l),localStorage.setItem("altify_history",JSON.stringify(l)),T.success("Item removed from history"),window.dispatchEvent(new CustomEvent("altify_history_updated"))},a=()=>{localStorage.removeItem("altify_history"),t([]),T.success("History cleared")},i=o=>{const c=Date.now()-o,d=Math.floor(c/6e4),u=Math.floor(d/60),h=Math.floor(u/24);return d<1?"Just now":d<60?`${d}m ago`:u<24?`${u}h ago`:`${h}d ago`};return s.jsxs(L,{className:"luxury-card sticky top-24",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Zp,{className:"h-5 w-5 text-primary"}),s.jsx("h3",{className:"font-heading text-xl font-semibold text-card-foreground tracking-wide",children:"Recent History"})]}),e.length>0&&s.jsx(E,{variant:"ghost",size:"sm",onClick:a,className:"hover:text-destructive",children:s.jsx(Qs,{className:"h-4 w-4"})})]}),e.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Zp,{className:"h-12 w-12 text-muted-foreground
630/30 mb-4"}),s.jsx("h4",{className:"text-sm font-medium text-card-foreground mb-2",children:"No alt texts yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload images to get started"})]}):s.jsx("div",{className:"space-y-4 max-h-[600px] overflow-y-auto pr-2",children:e.slice(0,10).map(o=>s.jsx("div",{className:"group p-4 rounded-lg bg-muted/30 hover:bg-muted/50 border border-border/50 transition-all duration-300 hover:border-primary/30",children:s.jsxs("div",{className:"flex items-start gap-3",children:[o.imageUrl&&s.jsx("div",{className:"flex-shrink-0 w-16 h-16 rounded-lg overflow-hidden bg-muted border border-border/50",children:s.jsx("img",{src:o.imageUrl,alt:o.fileName,className:"w-full h-full object-cover"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground mb-2 tracking-wider uppercase font-medium",children:i(o.timestamp)}),s.jsx("p",{className:"text-sm font-medium text-card-foreground mb-1 truncate tracking-wide",children:o.fileName}),s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 leading-relaxed",children:o.altText})]}),s.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[s.jsx(E,{variant:"ghost",size:"sm",className:"opacity-0 group-hover:opacity-100 transition-opacity hover:text-primary",onClick:()=>n(o.altText),children:s.jsx(jt,{className:"h-4 w-4"})}),s.jsx(E,{variant:"ghost",size:"sm",className:"opacity-0 group-hover:opacity-100 transition-opacity hover:text-destructive",onClick:()=>r(o.id),children:s.jsx(Qs,{className:"h-4 w-4"})})]})]})},o.id))})]})};function g9(){const[e,t]=f.useState([]),[n,r]=f.useState([]),a=async(i,o)=>{t(i),o&&r(o);const l=i.map(d=>({id:d.id,fileName:d.fileName,altText:d.altText,timestamp:Date.now()})),c=JSON.parse(localStorage.getItem("altify_history")||"[]");localStorage.setItem("altify_history",JSON.stringify([...l,...c].slice(0,50))),window.dispatchEvent(new CustomEvent("altify_history_updated")),i.length>0&&(sessionStorage.setItem("current_results",JSON.stringify(i)),sessionStorage.setItem("current_keywords",JSON.stringify(o||[])),window.location.href="/results")};return s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[s.jsx("div",{className:"lg:col-span-2",children:s.jsx(h9,{onResultsUpdate:a,compact:!1})}),s.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[s.jsx(f9,{}),s.jsx(m9,{}),s.jsx(p9,{})]})]})}const $v=f.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:F("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
630ing-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}));$v.displayName="Textarea";const x9=({result:e,editedMetadata:t,onMetadataEdit:n})=>{const[r,a]=f.useState(null),i=u=>(t==null?void 0:t[u])||e[u]||"",o=(u,h,p)=>{const m=u.length;return m<h?{status:"short",color:"text-warning",icon:XS,label:"Too short"}:m>p?{status:"long",color:"text-destructive",icon:Ht,label:"Too long"}:{status:"good",color:"text-success",icon:ny,label:"Good length"}},l=async(u,h)=>{await navigator.clipboard.writeText(h),a(u),T.success(`${u} copied to clipboard!`),setTimeout(()=>a(null),2e3)},c=[{key:"altText",label:"Alt Text",min:50,max:125,multiline:!0,description:"SEO-optimized, accessible description"},{key:"titleTag",label:"Title Tag",min:50,max:70,multiline:!1,description:"Title attribute for hover text"},{key:"caption",label:"Caption",min:100,max:150,multiline:!0,description:"User-friendly display text"},{key:"suggestedFilename",label:"Filename",min:10,max:50,multiline:!1,description:"SEO-friendly filename suggestion"},{key:"ogAlt",label:"Social (OG:Alt)",min:40,max:60,multiline:!0,description:"Optimized for social media sharing"},{key:"schemaMarkup",label:"Schema Markup",min:0,max:9999,multiline:!0,isCode:!0,description:"JSON-LD structured data"}],d=e.translations&&Object.keys(e.translations).length>0;return s.jsx("div",{className:"bg-card rounded-lg p-6 border",children:s.jsxs(ca,{defaultValue:"altText",className:"w-full",children:[s.jsxs(us,{className:"w-full inline-flex h-auto flex-wrap gap-1 mb-6 p-1 bg-muted",children:[s.jsx(De,{value:"altText",className:"text-xs sm:text-sm px-3 py-1.5",children:"Alt Text"}),s.jsx(De,{value:"titleTag",className:"text-xs sm:text-sm px-3 py-1.5",children:"Title"}),s.jsx(De,{value:"caption",className:"text-xs sm:text-sm px-3 py-1.5",children:"Caption"}),s.jsx(De,{value:"suggestedFilename",className:"text-xs sm:text-sm px-3 py-1.5",children:"Filename"}),s.jsx(De,{value:"ogAlt",className:"text-xs sm:text-sm px-3 py-1.5",children:"Social"}),s.jsx(De,{value:"schemaMarkup",className:"text-xs sm:text-sm px-3 py-1.5",children:"Schema"})]}),c.map(u=>{const h=i(u.key),p=o(h,u.min,u.max),m=p.icon,b=r===u.key;return s.jsxs(it,{value:u.key,className:"space-y-4 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-lg",children:u.label}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:u.description})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(m,{className:`h-4 w-4 ${p.color}`}),s.jsxs(ae,{variant:"outline",className:p.color,children:[h.length," chars"]})]})]}),u.multiline?s.jsx($v,{value:h,onChange:g=>n(e.id,u.key,g.target.value),className:`min-h-[200px] text-base bg-card text-card-foreground border-input ${u.isCode?"font-mono text-sm":""}`,placeholder:`Generated ${u.label.toLowerCase()} will appear here...`}):s.jsx(me,{type:"text",value:h,onChange:g=>n(e.id,u.key,g.target.value),className:"text-base h-12 bg-card text-card-foreground border-input",placeholder:`Generated ${u.label.toLowerCase()} will appear here...`}),!u.isCode&&p.status!=="good"&&s.jsxs("p",{className:`text-sm ${p.color} flex items-center gap-2`,children:[s.jsx(m,{className:"h-4 w-4"}),p.label," (recommended: ",u.min,"-",u.max," chars)"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(E,{variant:"outline",onClick:()=>l(u.label,h),className:"gap-2",children:b?s.jsxs(s.Fragment,{children:[s.jsx(Me,{className:"h-4 w-4"}),"Copied!"]}):s.jsxs(s.Fragment,{children:[s.jsx(jt,{className:"h-4 w-4"}),"Copy ",u.label]})}),u.isCode&&s.jsxs(ae,{variant:"secondary",className:"gap-1",children:[s.jsx(Wc,{className:"h-3 w-3"}),"JSON-LD"]})]}),d&&!u.isCode&&u.key!=="suggestedFilename"&&s.jsxs(s.Fragment,{children:[s.jsx(fv,{className:"my-4"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Io,{className:"h-4 w-4 text-primary"}),s.jsx("h4",{className:"font-semibold text-sm",children:"Translations"})]}),Object.entries(e.translations).map(([g,y])=>{const x=y[u.key];return x?s.jsxs(L,{className:"p-3 bg-muted/30",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[s.jsx(ae,{variant:"outline",className:"text-xs",children:y9(g)}),s.jsx(E,{variant:"ghost",size:"sm",onClick:()=>l(`${u.label} (${g})`,x),className:"h-7 px-2",children:r===`${u.key}-${g}`?s.jsx(Me,{className:"h-3 w-3"}):s.jsx(jt,{className:"h-3 w-3"})})]}),s.jsx("p",{className:"text-sm leading-relaxed",children:x})]},g):null})]})]})]},u.key)})]})})},y9=e=>({en:"English",es:"Español",fr:"Français",de:"Deutsch",it:"Italiano",pt:"Português",nl:"Nederlands",
630ja:"日本語",zh:"中文",ko:"한국어",ar:"العربية",ru:"Русский",hi:"हिन्दी",pl:"Polski",tr:"Türkçe",sv:"Svenska",da:"Dansk",no:"Norsk",fi:"Suomi"})[e]||e.toUpperCase(),v9=({result:e,editedMetadata:t,onMetadataEdit:n})=>{const[r,a]=f.useState(!1),[i,o]=f.useState(!1),l=(t==null?void 0:t.altText)||e.altText;return s.jsxs(L,{className:"overflow-hidden transition-all duration-300 hover:shadow-lg animate-fade-in",children:[s.jsx("div",{className:"relative h-48 overflow-hidden bg-muted flex items-center justify-center",children:i?s.jsx("div",{className:"text-center p-4",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:e.fileName})}):s.jsx("img",{src:e.imageUrl,alt:e.fileName,className:"w-full h-full object-cover",onError:()=>o(!0)})}),s.jsxs("div",{className:"p-4 space-y-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:e.fileName}),r?s.jsxs(s.Fragment,{children:[s.jsxs(E,{variant:"ghost",size:"sm",onClick:()=>a(!1),className:"w-full gap-2 mb-2",children:[s.jsx(zc,{className:"h-4 w-4"}),"Collapse"]}),s.jsx(x9,{result:e,editedMetadata:t,onMetadataEdit:n})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 min-h-[40px]",children:l}),s.jsxs(E,{variant:"outline",size:"sm",onClick:()=>a(!0),className:"w-full gap-2",children:[s.jsx(Ys,{className:"h-4 w-4"}),"View All Metadata"]})]})]})]})};function w9(){const[e,t]=f.useState([]),[n,r]=f.useState({}),{toast:a}=Uc();f.useEffect(()=>{const d=sessionStorage.getItem("current_results");d&&t(JSON.parse(d))},[]);const i=(d,u,h)=>{r(p=>({...p,[d]:{...p[d]||{},[u]:h}}))},o=()=>{const d=e.map(b=>({...b,...n[b.id]})),u=JSON.stringify(d,null,2),h=new Blob([u],{type:"application/json"}),p=URL.createObjectURL(h),m=document.createElement("a");m.href=p,m.download=`altify-results-${Date.now()}.json`,m.click(),URL.revokeObjectURL(p),a({title:"Exported successfully",description:"Results have been downloaded as JSON"})},l=()=>{const d=e.map(u=>{const h={...u,...n[u.id]};return`File: ${h.fileName}
631Alt: ${h.altText}
632Title: ${h.titleTag}
633Caption: ${h.caption}
634---`}).join(`
635
636`);navigator.clipboard.writeText(d),a({title:"Copied to clipboard",description:"All metadata copied successfully"})},c=()=>{confirm("Are you sure you want to clear all results?")&&(t([]),r({}),sessionStorage.removeItem("current_results"),a({title:"Cleared",description:"All results have been cleared"}))};return e.length===0?s.jsxs(L,{className:"p-12 text-center",children:[s.jsx(Bn,{className:"h-16 w-16 mx-auto mb-4 text-muted-foreground"}),s.jsx("h2",{className:"font-heading text-2xl font-bold mb-2",children:"No Results Yet"}),s.jsx("p",{className:"text-muted-foreground mb-6",children:"Upload images to generate SEO-optimized metadata"}),s.jsx(ye,{to:"/upload",children:s.jsx(E,{children:"Upload Images"})})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-heading text-3xl font-bold mb-2",children:"Generated Results"}),s.jsx("p",{className:"text-muted-foreground",children:"Review and edit your generated metadata"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(E,{variant:"outline",onClick:o,children:[s.jsx(Hc,{className:"mr-2 h-4 w-4"}),"Export All"]}),s.jsxs(E,{variant:"outline",onClick:l,children:[s.jsx(jt,{className:"mr-2 h-4 w-4"}),"Copy All"]}),s.jsxs(E,{variant:"destructive",onClick:c,children:[s.jsx(Qs,{className:"mr-2 h-4 w-4"}),"Clear All"]})]})]}),s.jsxs(ca,{defaultValue:"all",className:"w-full",children:[s.jsxs(us,{children:[s.jsxs(De,{value:"all",children:["All Images (",e.length,")"]}),s.jsx(De,{value:"pending",children:"Pending Review"}),s.jsx(De,{value:"completed",children:"Completed"})]}),s.jsx(it,{value:"all",className:"mt-6",children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map(d=>s.jsx(v9,{result:d,editedMetadata:n[d.id],onMetadataEdit:i},d.id))})}),s.jsx(it,{value:"pending",className:"mt-6",children:s.jsx(L,{className:"p-12 text-center",children:s.jsx("p",{className:"text-muted-foreground",children:"No pending reviews"})})}),s.jsx(it,{value:"completed",className:"mt-6",children:s.jsx(L,{className:"p-12 text-center",children:s.jsx("p",{className:"text-muted-foreground",children:"No completed items"})})})]})]})}const El={connectionSuccess:e=>T.success(`${e} connected successfully!`),bulkProgress:(e,t)=>T.loading(`Generating alt text... (${e}/${t})`,{id:"bulk-progress"}),bulkComplete:e=>T.success(`Bulk update complete! ${e} images updated`,{id:"bulk-progress",duration:5e3}),creditsLow:e=>T.warning(`Credits running low (${e} remaining)`,{duration:7e3,action:{label:"Upgrade",onClick:()=>window.location.href="/settings"}}),generationComplete:(e=1)=>T.success(e===1?"Alt text generated!":`Generated alt text for ${e} images`),settingsSaved:()=>T.success("Settings saved successfully"),deleted:(e="item")=>T.success(`${e} deleted successfully`)},Xm={connectionFailed:e=>T.error(`Failed to connect${e?`. ${e}`:""}`,{duration:5e3}),generationFailed:e=>T.error(e?`Failed to generate alt text for ${e} images`:"Failed to generate alt text",{duration:5e3}),saveFailed:(e="settings")=>T.error(`Failed to save ${e}`),fetchFailed:(e="data")=>T.error(`Failed to load ${e}`),unauthorized:()=>T.error("You must be logged in to perform this action"),generic:e
636=>T.error(e)},Zd={upload:{name:"Upload",icon:rs,color:"bg-blue-500"},shopify:{name:"Shopify",icon:Ka,color:"bg-green-500"},wordpress:{name:"WordPress",icon:Bn,color:"bg-blue-600"},woocommerce:{name:"WooCommerce",icon:Gu,color:"bg-purple-500"},api:{name:"API",icon:Wc,color:"bg-orange-500"}};function b9(){const[e,t]=f.useState([]),[n,r]=f.useState([]),[a,i]=f.useState(!0),[o,l]=f.useState(""),[c,d]=f.useState("all"),[u,h]=f.useState("all");f.useState(null),f.useState(""),f.useEffect(()=>{p()},[]),f.useEffect(()=>{m()},[e,o,c,u]);const p=async()=>{try{const{data:v,error:j}=await V.from("generation_history").select("*").order("generated_at",{ascending:!1}).limit(100);if(j)throw j;t(v||[])}catch(v){console.error("Error loading history:",v),Xm.fetchFailed("history")}finally{i(!1)}},m=()=>{let v=[...e];c!=="all"&&(v=v.filter(N=>N.platform===c));const j=new Date;if(u==="week"){const N=new Date(j.getTime()-6048e5);v=v.filter(S=>new Date(S.generated_at)>N)}else if(u==="month"){const N=new Date(j.getTime()-2592e6);v=v.filter(S=>new Date(S.generated_at)>N)}if(o){const N=o.toLowerCase();v=v.filter(S=>
636{var k,C;return S.file_name.toLowerCase().includes(N)||S.alt_text.toLowerCase().includes(N)||((k=S.title_tag)==null?void 0:k.toLowerCase().includes(N))||((C=S.keywords)==null?void 0:C.some(A=>A.toLowerCase().includes(N)))})}r(v)},b=async v=>{if(confirm("Are you sure you want to delete this item?"))try{const{error:j}=await V.from("generation_history").delete().eq("id",v);if(j)throw j;t(e.filter(N=>N.id!==v)),El.deleted("History item")}catch(j){console.error("Error deleting item:",j),Xm.generic("Failed to delete item")}},g=async()=>{if(confirm("Are you sure you want to clear all history? This action cannot be undone."))try{const{error:v}=await V.from("generation_history").delete().neq("id","00000000-0000-0000-0000-000000000000");if(v)throw v;t([]),El.deleted("All history")}catch(v){console.error("Error clearing history:",v),Xm.generic("Failed to clear history")}},y=()=>{const v=[["Date","Platform","File Name","Alt Text","Title","Keywords","SEO Score","Accessibility Score"],...n.map(k=>{var C,A;return[new Date(k.generated_at).toLocaleString(),((C=Zd[k.platform])==null?void 0:C.name)||k.platform,k.file_name,k.alt_text,k.title_tag||"",((A=k.keywords)==null?void 0:A.join(", "))||"",k.seo_score||"",k.accessibility_score||""]})].map(k=>k.map(C=>`"${C}"`).join(",")).join(`
637`),j=new Blob([v],{type:"text/csv"}),N=URL.createObjectURL(j),S=document.createElement("a");S.href=N,S.download=`altify-history-${new Date().toISOString().split("T")[0]}.csv`,S.click(),URL.revokeObjectURL(N),El.generationComplete()},x=v=>{navigator.clipboard.writeText(v),El.generationComplete()},w=v=>{const j=new Date(v),S=new Date().getTime()-j.getTime(),k=Math.floor(S/6e4),C=Math.floor(S/36e5),A=Math.floor(S/864e5);return k<60?`${k}m ago`:C<24?`${C}h ago`:A<7?`${A}d ago`:j.toLocaleDateString()};return a?s.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:s.jsx("p",{className:"text-muted-foreground",children:"Loading history..."})}):e.length===0?s.jsxs(L,{className:"p-12 text-center",children:[s.jsx(zS,{className:"h-16 w-16 mx-auto mb-4 text-muted-foreground"}),s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"No generation history yet"}),s.jsx("p",{className:"text-muted-foreground mb-6",children:"Upload images or connect platforms to start generating alt text"}),s.jsx(ye,{to:"/upload",children:s.jsx(E,{children:"Upload Images"})})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Generation History"}),s.jsx("p",{className:"text-muted-foreground",children:"View and manage all your past alt text generations"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(E,{variant:"outline",onClick:y,children:[s.jsx(Hc,{className:"mr-2 h-4 w-4"}),"Export CSV"]}),s.jsxs(E,{variant:"destructive",onClick:g,children:[s.jsx(Qs,{className:"mr-2 h-4 w-4"}),"Clear All"]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[s.jsxs(L,{className:"p-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Generated"}),s.jsx("p",{className:"text-2xl font-bold",children:e.length})]}),s.jsxs(L,{className:"p-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"This Week"}),s.jsx("p",{className:"text-2xl font-bold",children:e.filter(v=>new Date(v.generated_at)>new Date(Date.now()-7*24*60*60*1e3)).length})]}),s.jsxs(L,{className:"p-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Platforms Used"}),s.jsx("p",{className:"text-2xl font-bold",children:new Set(e.map(v=>v.platform)).size})]}),s.jsxs(L,{className:"p-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Today"}),s.jsx("p",{className:"text-2xl font-bold",children:e.filter(v=>new Date(v.generated_at).toDateString()===new Date().toDateString()).length})]})]}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Kc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(me,{placeholder:"Search by filename, alt text, or keywords...",value:o,onChange:v=>l(v.target.value),className:"pl-10"})]}),s.jsxs(Dt,{value:c,onValueChange:d,children:[s.jsx(_t,{className:"w-[180px]",children:s.jsx(Lt,{placeholder:"All Platforms"})}),s.jsxs(Et,{children:[s.jsx(X,{value:"all",children:"All Platforms"}),Object.entries(Zd).map(([v,j])=>s.jsx(X,{value:v,children:j.name},v))]})]}),s.jsxs(Dt,{value:u,onValueChange:h,children:[s.jsx(_t,{className:"w-[180px]",children:s.jsx(Lt,{placeholder:"All Time"})}),s.jsxs(Et,{children:[s.jsx(X,{value:"all",children:"All Time"}),s.jsx(X,{value:"week",children:"Last 7 Days"}),s.jsx(X,{value:"month",children:"Last 30 Days"})]})]})]}),n.length===0?s.jsxs(L,{className:"p-12 text-center",children:[s.jsx("p",{className:"text-muted-foreground",children:"No results found"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Try adjusting your filters"})]}):s.jsx("div",{className:"space-y-3",children:n.map(v=>{const j=Zd[v.platform]||Zd.upload,N=j.icon;return s.jsx(L,{className:"p-4 hover:shadow-md transition-shadow",children:s.jsxs("div",{className:"flex items-start gap-4",children:[v.image_url&&s.jsx("img",{src:v.image_url,alt:"",className:"w-20 h-20 object-cover rounded-lg flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"flex items-start justify-between gap-2 mb-2",children:s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("h3",{className:"font-medium",children:v.file_name}),s.jsxs(ae,{variant:"secondary",className:"gap-1",children:[s.jsx(N,{className:"h-3 w-3"}),j.name]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:w(v.generated_at)})]})}),s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-2",children:v.alt_text}),v.keywords&&v.keywords.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:v.keywords.map((S,k)=>s.jsx(ae,{variant:"outline",className:"text-xs",children:S},k))}),s.jsxs("div",{className:"flex gap-2 flex-wrap",children:[s.jsxs(E,{variant:"ghost",size:"sm",onClick:()=>x(v.alt_text),children:[s.jsx(jt,{className:"h-3 w-3 mr-1"}),"Copy"]}),v.seo_score&&s.jsxs(ae,{variant:"outline",className:"text-xs",children:["SEO: ",v.seo_score,"%"]}),v.accessibility_score&&s.jsxs(ae,{variant:"outline",className:"text-xs",children:["A11y: ",v.accessibility_score,"%"]}),s.jsxs(E,{variant:"ghost",size:"sm",onClick:()=>b(v.id),children:[s.jsx(Qs,{className:"h-3 w-3 mr-1"}),"Delete"]})]})]})]})},v.id)})})]})}const j9=[{id:1,name:"E-commerce Product",icon:MM,description:"Optimized for product images with focus on features and benefits",format:"[Color] [Material] [Product] with [Feature]",example:"Black leather wallet with RFID protection"},{id:2,name:"Blog Featured Image",icon:Bn,description:"Descriptive alt text for blog hero images and content",format:"[Action] [Context] [Setting]",example:"Developer coding on laptop in modern office"},{id:3,name:"Social Media Post",icon:IM,description:"Engaging descriptions for social media images",format:"[Subject] [Action] [Context] + [Call to action]",example:"Team celebrating product launch with champagne"}
vendor: 5,482 bytes, line 637
637,{id:4,name:"Accessibility Focus",icon:ry,description:"Maximum accessibility with detailed descriptions",format:"[Detailed description] + [Context] + [People/Actions]",example:"Woman in wheelchair using laptop at accessible desk"},{id:5,name:"SEO-Optimized",icon:Kc,description:"Alt text optimized for search engine rankings",format:"[Keywords] + [Context] + [Features]",example:"Wireless noise-cancelling headphones in black"}];function N9(){const e=t=>{sessionStorage.setItem("selected_template",t.toString()),window.location.href="/upload"};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-heading text-3xl font-bold mb-2",children:"Alt Text Templates"}),s.jsx("p",{className:"text-muted-foreground",children:"Pre-made templates for common use cases"})]}),s.jsxs(E,{disabled:!0,className:"opacity-50 cursor-not-allowed",children:[s.jsx(eg,{className:"mr-2 h-4 w-4"}),"Create Custom Template",s.jsx(ae,{variant:"outline",className:"ml-2",children:"Pro"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[j9.map(t=>{const n=t.icon;return s.jsxs(L,{className:"p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[s.jsx("div",{className:"p-3 rounded-lg bg-primary/10 flex-shrink-0",children:s.jsx(n,{className:"h-6 w-6 text-primary"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"font-heading font-bold text-lg mb-2",children:t.name}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:t.description})]})]}),s.jsxs("div",{className:"space-y-3 mb-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase mb-1",children:"Format Preview"}),s.jsx("p",{className:"text-sm font-mono bg-muted/30 text-foreground p-3 rounded border border-border",children:t.format})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground uppercase mb-1",children:"Example Output"}),s.jsxs("p",{className:"text-sm italic bg-muted/30 text-foreground p-3 rounded border border-border",children:['"',t.example,'"']})]})]}),s.jsx(E,{className:"w-full",onClick:()=>e(t.id),children:"Use Template"})]},t.id)}),s.jsxs(L,{className:"p-6 border-2 border-dashed border-primary/30 bg-primary/5",children:[s.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[s.jsx("div",{className:"p-3 rounded-lg bg-primary/10 flex-shrink-0",children:s.jsx(eg,{className:"h-6 w-6 text-primary"})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("h3",{className:"font-heading font-bold text-lg mb-2",children:["Custom Template",s.jsx(ae,{variant:"outline",className:"ml-2",children:"Pro"})]}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create your own custom template with your specific requirements and branding guidelines"})]})]}),s.jsx("a",{href:"/#pricing",children:s.jsx(E,{variant:"outline",className:"w-full border-primary text-primary hover:bg-primary/10",children:"Upgrade to Create"})})]})]})]})}var _f="Switch",[S9,Kq]=vt(_f),[k9,C9]=S9(_f),PA=f.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...h}=e,[p,m]=f.useState(null),b=xe(t,v=>m(v)),g=f.useRef(!1),y=p?u||!!p.closest("form"):!0,[x,w]=hn({prop:a,defaultProp:i??!1,onChange:d,caller:_f});return s.jsxs(k9,{scope:n,checked:x,disabled:l,children:[s.jsx(ne.button,{type:"button",role:"switch","aria-checked":x,"aria-required":o,"data-state":IA(x),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:b,onClick:q(e.onClick,v=>{w(j=>!j),y&&(g.current=v.isPropagationStopped(),g.current||v.stopPropagation())})}),y&&s.jsx(RA,{control:p,bubbles:!g.current,name:r,value:c,checked:x,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});PA.displayName=_f;var TA="SwitchThumb",AA=f.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=C9(TA,n);return s.jsx(ne.span,{"data-state":IA(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});AA.displayName=TA;var _9="SwitchBubbleInput",RA=f.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=f.useRef(null),l=xe(o,i),c=Mv(n),d=my(t);return f.useEffect(()=>{const u=o.current;if(!u)return;const h=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&m){const b=new Event("click",{bubbles:r});m.call(u,n),u.dispatchEvent(b)}},[c,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:l,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});RA.displayName=_9;function IA(e){return e?"checked":"unchecked"}var MA=PA,E9=AA;const wn=f.forwardRef(({className:e,...t},n)=>s.jsx(MA,{className:F("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:s.jsx(E9,{className:F("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")})}
637));wn.displayName=MA.displayName;const Zm=[{code:"en",name:"English",native:"English"},{code:"es",name:"Spanish",native:"Español"},{code:"fr",name:"French",native:"Français"},{code:"de",name:"German",native:"Deutsch"},{code:"it",name:"Italian",native:"Italiano"},{code:"pt",name:"Portuguese",native:"Português"},{code:"nl",name:"Dutch",native:"Nederlands"},{code:"ja",name:"Japanese",native:"日本語"},{code:"zh",name:"Chinese",native:"中文"},{code:"ko",name:"Korean",native:"한국어"},{code:"ar",name:"Arabic",native:"العربية"},{code:"ru",name:"Russian",native:"Русский"},{code:"hi",name:"Hindi",native:"हिन्दी"},{code:"tr",name:"Turkish",native:"Türkçe"},{code:"pl",name:"Polish",native:"Polski"}];function P9(){var l;const[e,t]=f.useState(""),[n,r]=f.useState(!1),[a,i]=f.useState("en"),o=Zm.filter(c=>c.name.toLowerCase().includes(e.toLowerCase())||c.native.toLowerCase().includes(e.toLowerCase()));return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-heading text-3xl font-bold mb-2",children:"Language Options"}),s.jsx("p",{className:"text-muted-foreground",children:"Generate alt text in 20+ languages"})]}),s.jsxs(L,{className:"p-6",children:[s.jsx("h2",{className:"font-heading text-xl font-bold mb-4",children:"Default Language"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(se,{htmlFor:"default-lang",children:"Select primary language"}),s.jsxs(Dt,{value:a,onValueChange:i,children:[s.jsx(_t,{id:"default-lang",className:"w-full md:w-[300px]",children:s.jsx(Lt,{})}),s.jsx(Et,{children:Zm.map(c=>s.jsxs(X,{value:c.code,children:[c.name," (",c.native,")"]},c.code))})]})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"All generations will use this language unless specified otherwise"}),s.jsx(E,{children:"Save Language Preference"})]})]}),s.jsxs(L,{className:"p-6 border-2 border-primary/20 bg-primary/5",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsxs("h2",{className:"font-heading text-xl font-bold mb-1",children:["Generate in Multiple Languages",s.jsx(ae,{variant:"outline",className:"ml-2",children:"Pro"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable multi-language generation for global reach"})]}),s.jsx(wn,{checked:n,onCheckedChange:r,disabled:!0})]}),s.jsxs("div",{className:"relative mb-4",children:[s.jsx(Kc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(me,{placeholder:"Search languages...",value:e,onChange:c=>t(c.target.value),className:"pl-10",disabled:!n})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 mb-4",children:o.map(c=>s.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${n?"bg-background":"bg-muted/50 opacity-50"}`,children:[s.jsx("input",{type:"checkbox",id:`lang-${c.code}`,disabled:!n,className:"rounded"}),s.jsx(se,{htmlFor:`lang-${c.code}`,className:"flex-1 cursor-pointer",children:s.jsx("span",{className:"font-medium text-foreground",children:c.native})})]},c.code))}),s.jsxs("div",{className:"border-t pt-4 mt-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"🌍 Unlock 20+ languages with Pro plan and reach a global audience"}),s.jsx("a",{href:"/#pricing",children:s.jsx(E,{className:"w-full md:w-auto",children:"Upgrade Now"})})]})]}),s.jsxs(L,{className:"p-6",children:[s.jsx("h2",{className:"font-heading text-xl font-bold mb-4",children:"Preview"}),s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-24 h-24 bg-muted rounded-lg flex items-center justify-center",children:s.jsx(Io,{className:"h-8 w-8 text-muted-foreground"})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["Sample Output (",(l=Zm.find(c=>c.code===a))==null?void 0:l.name,")"]}),s.jsx("p",{className:"font-medium",children:"Modern laptop computer on wooden desk with coffee cup and notebook"})]})]})})]})]})}const T9=()=>{const[e,t]=f.useState([]),[n,r]=f.useState(!1),[a,i]=f.useState(null),[o,l]=f.useState(null),[c,d]=f.useState(!1);f.useEffect(()=>{u(),h()},[]);const u=async()=>{const{data:g,error:y}=await V.functions.invoke("api-key-management",{body:{action:"list"}});if(y){T.error("Failed to fetch API keys");return}g!=null&&g.data&&t(g.data)},h=async()=>{const{data:g,error:y}=await V.functions.invoke("api-key-management",{body:{action:"usage"}});if(y){T.error("Failed to fetch usage stats");return}g!=null&&g.data&&l(g.data)},p=async()=>{d(!0);const{data:g,error:y}=await V.functions.invoke("api-key-management",{body:{action:"generate"}});if(y){T.error("Failed to generate API key"),d(!1);return}g!=null&&g.data&&(i(g.data.full_key),t([g.data,...e]),T.success("API key generated successfully")),d(!1)},m=async g=>{d(!0);const{data:y,error:x}=await V.functions.invoke("api-key-management",{body:{action:"regenerate",keyId:g}});if(x){T.error("Failed to regenerate API key"),d(!1);return}y!=null&&y.data&&(i(y.data.full_key),t(e.map(w=>w.id===g?y.data:w)),T.success("API key regenerated successfully")),d(!1)},b=g=>{navigator.clipboard.writeText(g),T.success("Copied to clipboard")};return s.jsx("div",{className:"space-y-6",children:s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsxs(Ae,{className:"flex items-center gap-2",children:[s.jsx(La,{className:"h-5 w-5"}),"API Access"]}),s.jsx(We,{children:"Manage your API keys for programmatic access"})]}),s.jsxs(Ne,{className:"space-y-6",children:[a&&s.jsxs("div",{className:"p-4 bg-muted rounded-lg space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-sm font-medium",children:"Your new API key (shown once):"}),s.jsx(E,{variant:"ghost",size:"sm",onClick:()=>i(null),children:"Dismiss"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(me,{value:a,readOnly:!0,className:"font-mono text-sm"}),s.jsx(E,{variant:"outline",size:"icon",onClick:()=>b(a),children:s.jsx(jt,{className:"h-4 w-4"})})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"⚠️ Save this key securely. You won't be able to see it again."})]}),e.length>0?s.jsx("div",{className:"space-y-4",children:e.map(g=>s.jsxs("div",{className:"p-4 border rounded-lg space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(me,{type:n?"text":"password",value:g.key_prefix,readOnly:!0,className:"font-mono text-sm w-64"}),s.jsx(E,{variant:"ghost",size:"icon",onClick:()=>r(!n),children:n?s.jsx(xM,{className:"h-4 w-4"}):s.jsx(ry,{className:"h-4 w-4"})}),s.jsx(E,{variant:"ghost",size:"icon",onClick:()=>b(g.key_prefix),children:s.jsx(jt,{className:"h-4 w-4"})})]}),s.jsxs(E,{variant:"outline",size:"sm",onClick:()=>
637m(g.id),disabled:c,children:[s.jsx(rn,{className:"h-4 w-4 mr-2"}),"Regenerate"]})]}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Last used: ",g.last_used_at?new Date(g.last_used_at).toLocaleString():"Never"]})]},g.id))}):s.jsxs("div",{className:"text-center py-8",children:[s.jsx("p",{className:"text-muted-foreground mb-4",children:"No API keys yet"}),s.jsxs(E,{onClick:p,disabled:c,children:[s.jsx(La,{className:"h-4 w-4 mr-2"}),"Generate API Key"]})]}),o&&s.jsxs("div",{className:"space-y-3 pt-6 border-t",children:[s.jsx("h3",{className:"font-medium",children:"Usage this month:"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsxs("span",{children:[o.current_period.requests.toLocaleString()," / ",o.current_period.limit.toLocaleString()," requests"]}),s.jsxs("span",{children:[o.current_period.percentage.toFixed(1),"%"]})]}),s.jsx(Vn,{value:o.current_period.percentage})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(E,{variant:"outline",asChild:!0,children:s.jsx("a",{href:"/api-docs",target:"_blank",children:"View Documentation"})}),s.jsx(E,{variant:"outline",asChild:!0,children:s.jsx("a",{href:"/api-playground",target:"_blank",children:"Test API in Playground"})})]})]})]})})};function gr(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Xa(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const OA=6048e5,A9=864e5;let R9={};function Ef(){return R9}function Rc(e,t){var l,c,d,u;const n=Ef(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=gr(e),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function yh(e){return Rc(e,{weekStartsOn:1})}function DA(e){const t=gr(e),n=t.getFullYear(),r=Xa(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=yh(r),i=Xa(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=yh(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Dj(e){const t=gr(e);return t.setHours(0,0,0,0),t}function Lj(e){const t=gr(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function I9(e,t){const n=Dj(e),r=Dj(t),a=+n-Lj(n),i=+r-Lj(r);return Math.round((a-i)/A9)}function M9(e){const t=DA(e),n=Xa(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),yh(n)}function O9(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function D9(e){if(!O9(e)&&typeof e!="number")return!1;const t=gr(e);return!isNaN(Number(t))}function L9(e){const t=gr(e),n=Xa(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const F9={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$9=(e,t,n)=>{let r;const a=F9[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ep(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const U9={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},B9={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},V9={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},z9={date:ep({formats:U9,defaultWidth:"full"}),time:ep({formats:B9,defaultWidth:"full"}),dateTime:ep({formats:V9,defaultWidth:"full"})},W9={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},H9=(e,t,n,r)=>W9[e];function xl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const K9={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},G9={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},q9={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Y9={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
637ay","Saturday"]},Q9={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},J9={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},X9=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Z9={ordinalNumber:X9,era:xl({values:K9,defaultWidth:"wide"}),quarter:xl({values:G9,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xl({values:q9,defaultWidth:"wide"}),day:xl({values:Y9,defaultWidth:"wide"}),dayPeriod:xl({values:Q9,defaultWidth:"wide",formattingValues:J9,defaultFormattingWidth:"wide"})};function yl(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?tG(l,h=>h.test(o)):eG(l,h=>h.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=t.slice(o.length);return{value:d,rest:u}}}function eG(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function tG(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function nG(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(a.length);return{value:o,rest:l}}}const rG=/^(\d+)(th|st|nd|rd)?/i,sG=/\d+/i,aG={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},iG={any:[/^b/i,/^(a|c)/i]},oG={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lG={any:[/1/i,/2/i,/3/i,/4/i]},cG={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},dG={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},uG={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},hG={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},fG={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},mG={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},pG={ordinalNumber:nG({matchPattern:rG,parsePattern:sG,valueCallback:e=>parseInt(e,10)}),era:yl({matchPatterns:aG,defaultMatchWidth:"wide",parsePatterns:iG,defaultParseWidth:"any"}),quarter:yl({matchPatterns:oG,defaultMatchWidth:"wide",parsePatterns:lG,defaultParseWidth:"any",valueCallback:e=>e+1}),month:yl({matchPatterns:cG,defaultMatchWidth:"wide",parsePatterns:dG,defaultParseWidth:"any"}),day:yl({matchPatterns:uG,defaultMatchWidth:"wide",parsePatterns:hG,defaultParseWidth:"any"}),dayPeriod:yl({matchPatterns:fG,defaultMatchWidth:"any",parsePatterns:mG,defaultParseWidth:"any"})},gG={code:"en-US",formatDistance:$9,formatLong:z9,formatRelative:H9,localize:Z9,match:pG,options:{weekStartsOn:0,firstWeekContainsDate:1}};function xG(e){const t=gr(e);return I9(t,L9(t))+1}function yG(e){const t=gr(e),n=+yh(t)-+M9(t);return Math.round(n/OA)+1}function LA(e,t){var u,h,p,m;const n=gr(e),r=n.getFullYear(),a=Ef(),i=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(p=a.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,o=Xa(e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const l=Rc(o,t),c=Xa(e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=Rc(c,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function vG(e,t){var l,c,d,u;const n=Ef(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=LA(e,t),i=Xa(e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),Rc(i,t)}function wG(e,t){const n=gr(e),r=+Rc(n,t)-+vG(n,t);return Math.round(r/OA)+1}function Oe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ys={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Oe(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Oe(n+1,2)},d(e,t){return Oe(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Oe(e.getHours()%12||12,t.length)},H(e,t){return Oe(e.getHours(),t.length)},m(e,t){return Oe(e.getMinutes(),t.length)},s(e,t){return Oe(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Oe(a,t.length)}},wi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}
vendor: 4,661 bytes, line 637
637,Fj={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return ys.y(e,t)},Y:function(e,t,n,r){const a=LA(e,r),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return Oe(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Oe(i,t.length)},R:function(e,t){const n=DA(e);return Oe(n,t.length)},u:function(e,t){const n=e.getFullYear();return Oe(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Oe(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Oe(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ys.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Oe(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=wG(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Oe(a,t.length)},I:function(e,t,n){const r=yG(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Oe(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ys.d(e,t)},D:function(e,t,n){const r=xG(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Oe(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Oe(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Oe(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Oe(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=wi.noon:r===0?a=wi.midnight:a=r/12>
vendor: 4,402 bytes, line 637
637=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=wi.evening:r>=12?a=wi.afternoon:r>=4?a=wi.morning:a=wi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ys.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ys.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Oe(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Oe(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ys.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ys.s(e,t)},S:function(e,t){return ys.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Uj(r);case"XXXX":case"XX":return wa(r);case"XXXXX":case"XXX":default:return wa(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Uj(r);case"xxxx":case"xx":return wa(r);case"xxxxx":case"xxx":default:return wa(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+$j(r,":");case"OOOO":default:return"GMT"+wa(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+$j(r,":");case"zzzz":default:return"GMT"+wa(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Oe(r,t.length)},T:function(e,t,n){const r=e.getTime();return Oe(r,t.length)}};function $j(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+Oe(i,2)}function Uj(e,t){return e%60===0?(e>0?"-":"+")+Oe(Math.abs(e)/60,2):wa(e,t)}function wa(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Oe(Math.trunc(r/60),2),i=Oe(r%60,2);return n+a+t+i}const Bj=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},FA=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},bG=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Bj(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",Bj(r,t)).replace("{{time}}",FA(a,t))},jG={p:FA,P:bG},NG=/^D+$/,SG=/^Y+$/,kG=["D","DD","YY","YYYY"];function CG(e){return NG.test(e)}function _G(e){return SG.test(e)}function EG(e,t,n){const r=PG(e,t,n);if(console.warn(r),kG.includes(e))throw new RangeError(r)}function PG(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const TG=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,AG=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,RG=/^'([^]*?)'?$/,IG=/''/g,MG=/[a-zA-Z]/;function Vj(e,t,n){var u,h,p,m;const r=Ef(),a=r.locale??gG,i=r.firstWeekContainsDate??((h=(u=r.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,o=r.weekStartsOn??((m=(p=r.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,l=gr(e);if(!D9(l))throw new RangeError("Invalid time value");let c=t.match(AG).map(b=>{const g=b[0];if(g==="p"||g==="P"){const y=jG[g];return y(b,a.formatLong)}return b}).join("").match(TG).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const g=b[0];if(g==="'")return{isToken:!1,value:OG(b)};if(Fj[g])return{isToken:!0,value:b};
637if(g.match(MG))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:b}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(b=>{if(!b.isToken)return b.value;const g=b.value;(_G(g)||CG(g))&&EG(g,t,String(e));const y=Fj[g[0]];return y(l,g,a.localize,d)}).join("")}function OG(e){const t=e.match(RG);return t?t[1].replace(IG,"'"):e}const DG=()=>{const[e,t]=f.useState(null),[n,r]=f.useState(!1),[a,i]=f.useState(""),[o,l]=f.useState(""),[c,d]=f.useState(!1),{subscription:u,usage:h}=Rv();f.useEffect(()=>{V.auth.getUser().then(({data:{user:b}})=>{t(b)})},[]);const p=async b=>{if(b.preventDefault(),a!==o){T.error("Passwords don't match");return}if(a.length<6){T.error("Password must be at least 6 characters");return}r(!0);try{const{error:g}=await V.auth.updateUser({password:a});if(g)throw g;T.success("Password updated successfully"),i(""),l("")}catch(g){T.error(g.message||"Failed to update password")}finally{r(!1)}},m=async()=>{d(!0);try{const{data:b,error:g}=await V.functions.invoke("create-portal-session");if(g)throw g;b!=null&&b.url&&(window.location.href=b.url)}catch(b){T.error(b.message||"Failed to open billing portal")}finally{d(!1)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Settings"}),s.jsx("p",{className:"text-muted-foreground",children:"Manage your account settings and preferences"})]}),s.jsxs(ca,{defaultValue:"profile",className:"w-full",children:[s.jsxs(us,{className:"grid w-full grid-cols-4 lg:w-auto lg:inline-flex",children:[s.jsxs(De,{value:"profile",children:[s.jsx($h,{className:"h-4 w-4 mr-2"}),s.jsx("span",{className:"hidden sm:inline",children:"Profile"})]}),s.jsxs(De,{value:"security",children:[s.jsx(kM,{className:"h-4 w-4 mr-2"}),s.jsx("span",{className:"hidden sm:inline",children:"Security"})]}),s.jsxs(De,{value:"api",children:[s.jsx(La,{className:"h-4 w-4 mr-2"}),s.jsx("span",{className:"hidden sm:inline",children:"API Keys"})]}),s.jsxs(De,{value:"billing",children:[s.jsx(pM,{className:"h-4 w-4 mr-2"}),s.jsx("span",{className:"hidden sm:inline",children:"Billing"})]})]}),s.jsx(it,{value:"profile",className:"space-y-4 mt-6",children:s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Profile Information"}),s.jsx(We,{children:"View and manage your profile details"})]}),s.jsxs(Ne,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"email",children:"Email Address"}),s.jsx(me,{id:"email",type:"email",value:(e==null?void 0:e.email)||"",disabled:!0,className:"bg-muted"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your email address is used for authentication and cannot be changed"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{children:"Account Status"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),s.jsx("span",{className:"text-sm",children:e!=null&&e.email_confirmed_at?"Email Verified":"Email Not Verified"})]})]})]})]})}),s.jsx(it,{value:"security",className:"space-y-4 mt-6",children:s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Change Password"}),s.jsx(We,{children:"Update your password to keep your account secure"})]}),s.jsx(Ne,{children:s.jsxs("form",{onSubmit:p,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"new-password",children:"New Password"}),s.jsx(me,{id:"new-password",type:"password",placeholder:"Enter new password",value:a,onChange:b=>i(b.target.value),minLength:6,required:!0,disabled:n})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"confirm-password",children:"Confirm New Password"}),s.jsx(me,{id:"confirm-password",type:"password",placeholder:"Confirm new password",value:o,onChange:b=>l(b.target.value),minLength:6,required:!0,disabled:n})]}),s.jsx(E,{type:"submit",disabled:n,className:"bg-gradient-hero hover:opacity-90 transition-opacity",children:n?"Updating...":"Update Password"})]})})]})}
637),s.jsx(it,{value:"api",className:"space-y-4 mt-6",children:s.jsx(T9,{})}),s.jsx(it,{value:"billing",className:"space-y-4 mt-6",children:s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Current Plan"}),s.jsx(We,{children:"Manage your subscription and usage"})]}),s.jsxs(Ne,{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[s.jsxs("div",{children:[s.jsxs("h3",{className:"font-semibold text-lg",children:[(u==null?void 0:u.plan_name)||"Free"," Plan"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:(u==null?void 0:u.plan_name)==="Free"?`${u.image_limit} images/month`:`Up to ${u==null?void 0:u.image_limit} images/month`}),(u==null?void 0:u.current_period_end)&&s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:u.cancel_at_period_end?`Cancels on ${Vj(new Date(u.current_period_end),"MMM d, yyyy")}`:`Renews on ${Vj(new Date(u.current_period_end),"MMM d, yyyy")}`})]}),s.jsx("div",{className:"text-right",children:(u==null?void 0:u.plan_name)==="Free"?s.jsx("p",{className:"text-2xl font-bold text-muted-foreground",children:"Free"}):(u==null?void 0:u.plan_name)==="Starter"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-2xl font-bold text-coral-500",children:"$29"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"/month"})]}):(u==null?void 0:u.plan_name)==="Pro"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-2xl font-bold text-coral-500",children:"$79"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"/month"})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-2xl font-bold text-coral-500",children:"$199"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"/month"})]})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{children:"Usage This Month"}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{children:"Images Processed"}),s.jsxs("span",{className:"font-medium",children:[(h==null?void 0:h.images_processed)||0," / ",(u==null?void 0:u.image_limit)||10]})]}),(u==null?void 0:u.storage_limit_gb)&&s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{children:"Storage Limit"}),s.jsxs("span",{className:"font-medium",children:[u.storage_limit_gb," GB"]})]})]})]}),(u==null?void 0:u.plan_name)!=="Free"?s.jsx(E,{className:"w-full",variant:"outline",onClick:m,disabled:c,children:c?"Loading...":"Manage Subscription"}):s.jsx(E,{className:"w-full bg-gradient-hero hover:opacity-90",onClick:()=>window.location.href="/#pricing",children:"Upgrade Plan"})]})]})})]})]})};function LG(){return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-heading text-3xl font-bold mb-2",children:"Profile Settings"}),s.jsx("p",{className:"text-muted-foreground",children:"Manage your account information and preferences"})]}),s.jsxs(L,{className:"p-6",children:[s.jsx("h2",{className:"font-heading text-2xl font-bold mb-6",children:"Account Information"}),s.jsxs("div",{className:"flex items-start gap-6 mb-6 pb-6 border-b",children:[s.jsxs(_v,{className:"h-24 w-24",children:[s.jsx(MP,{src:"/placeholder.svg"}),s.jsx(Ev,{className:"text-2xl",children:"PU"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium mb-2",children:"Profile Picture"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Click to upload a new avatar. JPG or PNG, max 2MB."}),s.jsxs(E,{variant:"outline",size:"sm",children:[s.jsx(rs,{className:"mr-2 h-4 w-4"}),"Change Avatar"]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(se,{htmlFor:"name",children:"Full Name"}),s.jsxs("div",{className:"relative",children:[s.jsx($h,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(me,{id:"name",placeholder:"John Doe",className:"pl-10",defaultValue:"Pro User"})]})]}),s.jsxs("div",{children:[s.jsx(se,{htmlFor:"email",children:"Email Address"}),s.jsxs("div",{className:"relative",children:[s.jsx(_M,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(me,{id:"email",type:"email",placeholder:"[email protected]",className:"pl-10",defaultValue:"[email protected]"}),s.jsx(ae,{variant:"secondary",className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:"Verified"})]})]}),s.jsxs("div",{children:[s.jsx(se,{htmlFor:"company",children:"Company (Optional)"}),s.jsxs("div",{className:"relative",children:[s.jsx(fM,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(me,{id:"company",placeholder:"Acme Inc.",className:"pl-10"})]})]}),s.jsx(E,{children:"Save Changes"})]})]}),s.jsxs(L,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx(QS,{className:"h-6 w-6 text-primary"}),s.jsx("h2",{className:"font-heading text-2xl font-bold",children:"Password & Security"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(se,{htmlFor:"current-password",children:"Current Password"}),s.jsx(me,{id:"current-password",type:"password",placeholder:"••••••••"})]}),s.jsxs("div",{children:[s.jsx(se,{htmlFor:"new-password",children:"New Password"}),s.jsx(me,{id:"new-password",type:"password",placeholder:"••••••••"})]}),s.jsxs("div",{children:[s.jsx(se,{htmlFor:"confirm-password",children:"Confirm New Password"}),s.jsx(me,{id:"confirm-password",type:"password",placeholder:"••••••••"})]}),s.jsx(E,{children:"Update Password"})]})]}),s.jsxs(L,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx(dM,{className:"h-6 w-6 text-primary"}),s.jsx("h2",{className:"font-heading text-2xl font-bold",children:"Notifications & Preferences"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between py-3 border-b",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Email Notifications"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive notifications about your account activity"})]}),s.jsx(wn,{defaultChecked:!0})]}),s.jsxs("div",{className:"flex items-center justify-between py-3 border-b",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Marketing Emails"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Get updates about new features and promotions"})]}),s.jsx(wn,{})]}),s.jsxs("div",{className:"flex items-center justify-between py-3 border-b",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Weekly Usage Reports"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive a summary of your weekly usage"})]}),s.jsx(wn,{defaultChecked:!0})]}),s.jsxs("div",{className:"flex items-center justify-between py-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"New Feature Announcements"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Be the first to know about new features"})]}),s.jsx(wn,{defaultChecked:!0})]})]})]}),s.jsxs(L,{className:"p-6 border-2 border-destructive/50 bg-destructive/5",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(XS,{className:"h-6 w-6 text-destructive"}),s.jsx("h2",{className:"font-heading text-2xl font-bold text-destructive",children:"Danger Zone"})]}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Once you delete your account, there is no going back. This action cannot be undone. All your data, including generated alt texts and history, will be permanently deleted."}),s.jsx(E,{variant:"destructive",children:"Delete Account"})]})]})}function FG(){const e="https://cjduqinlhflxzaalynzt.supabase.co/functions/v1/api-v1";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(L,{children:[s.jsx(Te,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(VS,{className:"h-6 w-6 text-primary"}),s.jsxs("div",{children:[s.jsx(Ae,{children:"API Documentation"}),s.jsx(We,{children:"Complete guide to integrating Altify Pro's AI-powered alt text generation"})]})]})}),s.jsx(Ne,{children:s.jsxs(kt,{children:[s.jsx(Ht,{className:"h-4 w-4"}),s.jsx(Ct,{children:"All API endpoints require authentication using your API key in the Authorization header. Rate limits apply based on your subscription plan."})]})})]}),s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Qu
637ick Start"}),s.jsx(We,{children:"Get started with your first API call in minutes"})]}),s.jsxs(Ne,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium mb-2",children:"Base URL"}),s.jsx("code",{className:"block text-sm bg-muted p-3 rounded font-mono",children:e})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium mb-2",children:"Authentication"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Include your API key in the Authorization header:"}),s.jsx("code",{className:"block text-sm bg-muted p-3 rounded font-mono",children:"Authorization: Bearer YOUR_API_KEY"})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium mb-2",children:"Response Format"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"All responses are returned in JSON format with a standard structure:"})]})]})]}),s.jsxs(L,{children:[s.jsx(Te,{children:s.jsx(Ae,{children:"API Endpoints"})}),s.jsxs(Ne,{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ae,{children:"POST"}),s.jsx("code",{className:"text-sm",children:"/generate-alt-text"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Generate alt text for one or more images using AI"}),s.jsxs("div",{children:[s.jsx("h5",{className:"font-medium text-sm mb-2",children:"Request Body"}),s.jsx("pre",{className:"bg-muted p-3 rounded text-xs overflow-x-auto",children:`{
638  "images": ["base64_encoded_image_1", "base64_encoded_image_2"],
639  "context": "E-commerce product photography",
640  "keywords": ["laptop", "technology", "professional"],
641  "language": "en",
642  "include_metadata": true
643}`})]}),s.jsxs("div",{children:[s.jsx("h5",{className:"font-medium text-sm mb-2",children:"Response"}),s.jsx("pre",{className:"bg-muted p-3 rounded text-xs overflow-x-auto",children:`{
644  "success": true,
645  "data": [
646    {
647      "image_id": "image_1",
648      "alt_text": "Professional laptop on desk with...",
649      "title": "Modern Laptop Technology",
650      "caption": "High-performance laptop...",
651      "seo_score": 92,
652      "accessibility_score": 95,
653      "keywords_used": ["laptop", "technology"],
654      "character_count": 118
655    }
656  ],
657  "credits_used": 2,
658  "credits_remaining": 498
659}`})]})]}),s.jsxs("div",{className:"space-y-3 pt-6 border-t",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ae,{variant:"secondary",children:"GET"}),s.jsx("code",{className:"text-sm",children:"/usage"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Get current API usage statistics for your account"}),s.jsxs("div",{children:[s.jsx("h5",{className:"font-medium text-sm mb-2",children:"Response"}),s.jsx("pre",{className:"bg-muted p-3 rounded text-xs overflow-x-auto",children:`{
660  "current_period": {
661    "requests": 145,
662    "limit": 5000,
663    "percentage": 2.9,
664    "reset_date": "2025-11-01T00:00:00Z"
665  }
666}`})]})]})]})]}),s.jsxs(L,{children:[s.jsx(Te,{children:s.jsx(Ae,{children:"Code Examples"})}),s.jsx(Ne,{children:s.jsxs(ca,{defaultValue:"curl",children:[s.jsxs(us,{className:"grid w-full grid-cols-4",children:[s.jsx(De,{value:"curl",children:"cURL"}),s.jsx(De,{value:"javascript",children:"JavaScript"}),s.jsx(De,{value:"python",children:"Python"}),s.jsx(De,{value:"php",children:"PHP"})]}),s.jsx(it,{value:"curl",className:"mt-4",children:s.jsx("pre",{className:"bg-muted p-4 rounded text-sm overflow-x-auto",children:`curl -X POST ${e}/generate-alt-text \\
667  -H "Authorization: Bearer YOUR_API_KEY" \\
668  -H "Content-Type: application/json" \\
669  -d '{
670    "images": ["data:image/jpeg;base64,/9j/4AAQSkZJRg..."],
671    "context": "Product photography",
672    "keywords": ["laptop", "tech"]
673  }'`})}),s.jsx(it,{value:"javascript",className:"mt-4",children:s.jsx("pre",{className:"bg-muted p-4 rounded text-sm overflow-x-auto",children:`const generateAltText = async (imageBase64) => {
674  const response = await fetch('${e}/generate-alt-text', {
675    method: 'POST',
676    headers: {
677      'Authorization': 'Bearer YOUR_API_KEY',
678      'Content-Type': 'application/json'
679    },
680    body: JSON.stringify({
681      images: [imageBase64],
682      context: 'Product photography',
683      keywords: ['laptop', 'tech']
684    })
685  });
686  
687  const data = await response.json();
688  return data;
689};`})}),s.jsx(it,{value:"python",className:"mt-4",children:s.jsx("pre",{className:"bg-muted p-4 rounded text-sm overflow-x-auto",children:`import requests
690import base64
691
692def generate_alt_text(image_path):
693    with open(image_path, 'rb') as img:
694        img_base64 = base64.b64encode(img.read()).decode()
695    
696    response = requests.post(
697        '${e}/generate-alt-text',
698        headers={
699            'Authorization': 'Bearer YOUR_API_KEY',
700            'Content-Type': 'application/json'
701        },
702        json={
703            'images': [f'data:image/jpeg;base64,{img_base64}'],
704            'context': 'Product photography',
705            'keywords': ['laptop', 'tech']
706        }
707    )
708    
709    return response.json()`})}),s.jsx(it,{value:"php",className:"mt-4",children:s.jsx("pre",{className:"bg-muted p-4 rounded text-sm overflow-x-auto",children:`<?php
710$imageData = base64_encode(file_get_contents('image.jpg'));
711
712$ch = curl_init('${e}/generate-alt-text');
713curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
714curl_setopt($ch, CURLOPT_POST, true);
715curl_setopt($ch, CURLOPT_HTTPHEADER, [
716    'Authorization: Bearer YOUR_API_KEY',
717    'Content-Type: application/json'
718]);
719curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
720    'images' => ["data:image/jpeg;base64," . $imageData],
721    'context' => 'Product photography',
722    'keywords' => ['laptop', 'tech']
723]));
724
725$response = curl_exec($ch);
726curl_close($ch);
727
728$data = json_decode($response, true);
729?>`})})]})})]}),s.jsxs(L,{children:[s.jsx(Te,{children:s.jsx(Ae,{children:"Error Codes"})}),s.jsx(Ne,{children:s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex gap-3",children:[s.jsx("code",{className:"text-destructive",children:"400"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Bad Request"}),s.jsx("p",{className:"text-muted-foreground",children:"Missing required fields or invalid data format"})]})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx("code",{className:"text-destructive",children:"401"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Unauthorized"}),s.jsx("p",{className:"text-muted-foreground",children:"Invalid or missing API key"})]})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx("code",{className:"text-destructive",children:"429"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Too Many Requests"}),s.jsx("p",{className:"text-muted-foreground",children:"Rate limit exceeded for your plan"})]})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx("code",{className:"text-destructive",children:"500"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Internal Server Error"}),s.jsx("p",{className:"text-muted-foreground",children:"Something went wrong on our end"})]})]})]})})]}),s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Rate Limits"}),s.jsx(We,{children:"API rate limits by subscription plan"})]}),s.jsx(Ne,{children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b",children:[s.jsx("th",{className:"text-left py-3 px-4",children:"Plan"}),s.jsx("th",{className:"text-left py-3 px-4",children:"Requests/Month"}),s.jsx("th",{className:"text-left py-3 px-4",children:"Rate Limit"}),s.jsx("th",{className:"text-left py-3 px-4",children:"Burst Limit"})]})}),s.jsxs("tbody",{children:[s.jsxs("tr",{className:"border-b",children:[s.jsx("td",{className:"py-3 px-4 font-medium",children:"Starter"}),s.jsx("td",{className:"py-3 px-4",children:"500"}),s.jsx("td",{className:"py-3 px-4",children:"10/min"}),s.jsx("td",{className:"py-3 px-4",children:"20/min"})]}),s.jsxs("tr",{className:"border-b",children:[s.jsx("td",{className:"py-3 px-4 font-medium",children:"Pro"}),s.jsx("td",{className:"py-3 px-4",children:"5,000"}),s.jsx("td",{className:"py-3 px-4",children:"60/min"}),s.jsx("td",{className:"py-3 px-4",children:"100/min"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"py-3 px-4 font-medium",children:"Agency"}),s.jsx("td",{className:"py-3 px-4",children:"Unlimited"}),s.jsx("td",{className:"py-3 px-4",children:"300/min"}),s.jsx("td",{className:"py-3 px-4",children:"500/min"})]})]})]})})})]})]})}function $G(){const{subscription:e}=Rv(),[t,n]=f.useState([]),[r,a]=f.useState(!0),[i,o]=f.useState(!1),[l,c]=f.useState(""),[d,u]=f.useState(!1),[h,p]=f.useState(null);f.useState(new Set);const m=(e==null?void 0:e.plan_name)&&!e.plan_name.toLowerCase().includes("free");f.useEffect(()=>{m?b():a(!1)},[m]);const b=async()=>{try{const{data:v,error:j}=await V.from("api_keys").select("*").eq("is_active",!0).order("created_at",{ascending:!1});if(j)throw j;n(v||[])}catch(v){console.error("Error fetching API keys:",v),T.error("Failed to load API keys")}finally{a(!1)}},g=async()=>{if(!l.trim()){T.error("Please enter a key name");return}u(!0);try{const{data:v,error:j}=await V.functions.invoke("api-key-management",{body:{action:"create",name:l}});if(j)throw j;if(v.success)p(v.api_key),b(),T.success("API key created successfully");else throw new Error(v.error||"Failed to create API key")}catch(v){console.error("Error creating API key:",v),T.error(v.message||"Failed to create API key")}finally{u(!1)}},y=async v=>{if(confirm("Are you sure you want to delete this API key? This action cannot be undone."))try{const{data:j,error:N}=await V.functions.invoke("api-key-management",{body:{action:"delete",ke
729y_id:v}});if(N)throw N;if(j.success)T.success("API key deleted"),b();else throw new Error(j.error||"Failed to delete API key")}catch(j){console.error("Error deleting API key:",j),T.error(j.message||"Failed to delete API key")}},x=v=>{navigator.clipboard.writeText(v),T.success("Copied to clipboard")},w=v=>v?new Date(v).toLocaleDateString():"Never";return r?s.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:s.jsx("p",{className:"text-muted-foreground",children:"Loading..."})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold mb-2",children:"API Access"}),s.jsx("p",{className:"text-muted-foreground",children:"Integrate Altify Pro into your workflow with our REST API"})]}),m?s.jsxs(s.Fragment,{children:[s.jsxs(L,{children:[s.jsx(Te,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(Ae,{children:"Your API Keys"}),s.jsx(We,{children:"Manage your API keys for programmatic access"})]}),s.jsxs(E,{onClick:()=>o(!0),children:[s.jsx(La,{className:"mr-2 h-4 w-4"}),"Generate New Key"]})]})}),s.jsx(Ne,{children:t.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(La,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"No API keys yet"}),s.jsx(E,{onClick:()=>o(!0),children:"Create Your First Key"})]}):s.jsx("div",{className:"space-y-4",children:t.map(v=>s.jsx(L,{className:"p-4 bg-muted/20",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"font-medium mb-1",children:v.name}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("code",{className:"text-sm font-mono bg-background px-2 py-1 rounded",children:[v.key_prefix,"••••••••••••••••"]}),s.jsx(E,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(jt,{className:"h-4 w-4",onClick:()=>x(`${v.key_prefix}...`)})})]})]}),s.jsx(E,{variant:"ghost",size:"icon",onClick:()=>y(v.id),className:"text-destructive hover:text-destructive",children:s.jsx(Qs,{className:"h-4 w-4"})})]}),s.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[s.jsxs("span",{children:["Created: ",w(v.created_at)]}),s.jsx("span",{children:"•"}),s.jsxs("span",{children:["Last Used: ",w(v.last_used_at)]})]}),s.jsx("div",{className:"flex items-center justify-between text-sm",children:s.jsxs("span",{className:"text-muted-foreground",children:["Rate Limit: ",s.jsxs("span",{className:"font-medium text-foreground",children:[v.rate_limit," requests/",v.rate_limit_window]})]})})]})},v.id))})})]}),s.jsx(FG,{})]}):s.jsxs(L,{className:"p-12 text-center border-2 border-primary/20 bg-primary/5",children:[s.jsx(La,{className:"h-16 w-16 mx-auto mb-4 text-primary"}),s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"API Access Available on Pro Plan"}),s.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"Unlock programmatic access to Altify Pro's powerful alt text generation engine. Perfect for developers and agencies."}),s.jsx(E,{size:"lg",onClick:()=>window.location.href="/settings",children:"Upgrade to Unlock API"})]}),s.jsx(pr,{open:i,onOpenChange:v=>{o(v),v||(c(""),p(null))},children:s.jsxs(zn,{children:[s.jsxs(Wn,{children:[s.jsx(Hn,{children:"Create New API Key"}),s.jsx(ds,{children:h?"Save your API key securely":"Generate a new API key for programmatic access"})]}),h?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(kt,{className:"bg-success/10 border-success/20",children:[s.jsx(Dr,{className:"h-4 w-4 text-success"}),s.jsx(Ct,{className:"text-success",children:"API key created successfully! Make sure to copy it now - you won't be able to see it again."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{children:"Your API Key"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(me,{value:h,readOnly:!0,className:"font-mono text-sm"}),s.jsx(E,{onClick:()=>x(h),children:s.jsx(jt,{className:"h-4 w-4"})})]})]}),s.jsx(E,{onClick:()=>{o(!1),c(""),p(null)},className:"w-full",children:"Done"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"key-name",children:"Key Name *"}),s.jsx(me,{id:"key-name",placeholder:"e.g., Production Website",value:l,onCh
729ange:v=>c(v.target.value),disabled:d}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose a descriptive name to identify this key"})]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(E,{variant:"outline",onClick:()=>o(!1),disabled:d,children:"Cancel"}),s.jsx(E,{onClick:g,disabled:d||!l.trim(),children:d?"Creating...":"Create API Key"})]})]})]})})]})}function UG(){const e={name:"Free",imagesUsed:5,imagesLimit:10,apiCallsUsed:0,apiCallsLimit:0,storageUsedMB:2.4,storageLimitMB:100,languagesAvailable:1,resetDate:"January 31, 2025"},t=[{date:"Jan 15",images:2},{date:"Jan 16",images:0},{date:"Jan 17",images:1},{date:"Jan 18",images:0},{date:"Jan 19",images:1},{date:"Jan 20",images:1},{date:"Jan 21",images:0}],n=e.imagesUsed/e.imagesLimit*100,r=e.storageUsedMB/e.storageLimitMB*100;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-heading text-3xl font-bold mb-2",children:"Usage & Billing"}),s.jsx("p",{className:"text-muted-foreground",children:"Track your usage and manage your subscription"})]}),s.jsx(L,{className:"p-6 bg-gradient-to-br from-primary/10 to-primary/5 border-primary/20",children:s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("h2",{className:"font-heading text-2xl font-bold",children:"Current Plan"}),s.jsx(ae,{variant:"outline",children:e.name})]}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("p",{className:"text-muted-foreground",children:["Images: ",s.jsxs("span",{className:"font-medium text-foreground",children:[e.imagesUsed," / ",e.imagesLimit]})," this month"]}),s.jsxs("p",{className:"text-muted-foreground",children:["Resets: ",s.jsx("span",{className:"font-medium text-foreground",children:e.resetDate})]})]})]}),s.jsx("a",{href:"/#pricing",children:s.jsx(E,{children:"Upgrade Plan"})})]})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs(L,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:s.jsx(hc,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Images Processed"}),s.jsxs("p",{className:"text-2xl font-bold",children:[e.imagesUsed," / ",e.imagesLimit]})]})]}),s.jsx(Vn,{value:n,className:"h-2"}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[e.imagesLimit-e.imagesUsed," images remaining"]})]}),s.jsxs(L,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"p-2 rounded-lg bg-yellow-500/10",children:s.jsx(ay,{className:"h-5 w-5 text-yellow-500"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"API Calls"}),s.jsx("p",{className:"text-2xl font-bold",children:"Not Available"})]})]}),e.apiCallsLimit>0]}),s.jsxs(L,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"p-2 rounded-lg bg-purple-500/10",children:s.jsx(KS,{className:"h-5 w-5 text-purple-500"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Storage Used"}),s.jsxs("p",{className:"text-2xl font-bold",children:[e.storageUsedMB," MB"]})]})]}),s.jsx(Vn,{value:r,className:"h-2"}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[(e.storageLimitMB-e.storageUsedMB).toFixed(1)," MB remaining"]})]}),s.jsxs(L,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"p-2 rounded-lg bg-green-500/10",children:s.jsx(Io,{className:"h-5 w-5 text-green-500"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Languages"}),s.jsxs("p",{className:"text-2xl font-bold",children:[e.languagesAvailable," Available"]})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Upgrade for 20+ languages"})]})]}),s.jsxs(L,{className:"p-6",children:[s.jsx("h2",{className:"font-heading text-2xl font-bold mb-6",children:"Usage History"}),s.jsx("div",{className:"space-y-2",children:t.map((a,i)=>s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("span",{className:"text-sm text-muted-foreground w-16",children:a.date}),s.jsx("div",{className:"flex-1",children:s.jsx("div",{className:"h-8 bg-muted/30 rounded-lg overflow-hidden border border-border",children:s.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${a.images/e.imagesLimit*100}%`}})})}),s.jsx("span",{className:"text-sm font-medium w-12 text-right",children:a.images})]},i))}),s.jsx("div",{className:"mt-4 pt-4 border-t",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"📊 Showing last 7 days of activity"})})]}),e.name!=="Free"]})}const BG=({icon:e,title:t,description:n,badge:r,buttonText:a,link:i})=>s.jsx(L,{className:"p-8 bg-card text-card-foreground luxury-card group",children:s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsx("div",{className:"text-5xl mb-6",children:e}),s.jsx("h3",{className:"text-2xl font-bold mb-3 text-card-foreground",children:t}),s.jsx("p",{className:"text-muted-foreground mb-4 flex-grow leading-relaxed",children:n}),s.jsx(ae,{variant:"secondary",className:"mb-6 w-fit",children:r}),s.jsx(ye,{to:i,children:s.jsxs(E,{className:"w-full bg-primary hover:bg-primary-hover text-primary-foreground group-hover:shadow-glow-primary transition-all",children:[a,s.jsx(uc,{className:"ml-2 h-4 w-4 group-hover:translate-x-1 transition-transform"})]})})]})}),VG=()=>{const[e,t]=f.useState(""),[n,r]=f.useState("all"),a=["All Resources","Accessibility","SEO","WordPress","Best Practices","E-commerce"],o=[{icon:"📖",title:"How to Write Alt Text",description:"Complete guide with the 7 golden rules, examples, and common mistakes to avoid",badge:"12 min read",buttonText:"Read Guide",link:"/resources/how-to-write-alt-text",tags:["accessibility","seo","best-practices"]},{icon:"🎨",title:"100+ Alt Text Examples",description:"Real-world examples for products, blogs, social media, and every situation",badge:"15 min read",buttonText:"View Examples",link:"/resources/alt-text-examples",tags:["accessibility","e-commerce","best-practices"]},{icon:"✅",title:"Best Practices Checklist",description:"Complete 150+ point checklist for accessibility, SEO, and WCAG compliance",badge:"Downloadable PDF",buttonText:"Get Checklist",link:"/resources/best-practices-checklist",tags:["accessibility","seo","best-practices"]},{icon:"🎥",title:"WordPress Import Tutorial",description:"Step-by-step guide to bulk import alt text into WordPress Media Library",badge:"8 min tutorial",buttonText:"Watch Tutorial",link:"/resources/wordpress-tutorial",tags:["wordpress","e-commerce"]}].filter(l=>{const c=e===""||l.title.toLowerCase().includes(e.toLowerCase())||l.description.toLowerCase().includes(e.toLowerCase()),d=n==="all"||l.tags.includes(n.toLowerCase().replace(" ","-"));return c&&d});return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"border-b border-primary/20 bg-secondary/30",children:s.jsx("div",{className:"container mx-auto px-4 py-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(ye,{to:"/",className:"flex items-center gap-2",children:s.jsx("img",{src:uf,alt:"Altify Pro",className:"h-10"})}),s.jsx(ye,{to:"/auth",children:s.jsx(E,{className:"bg-primary hover:bg-primary-hover",children:"Start Free Trial"})})]})})}),s.jsxs("section",{className:"relative py-20 overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 opacity-50",style:{background:"linear-gradient(135deg, hsl(214 65% 10%) 0%, hsl(215 25% 16%) 100%)"}}),s.jsxs("div",{className:"container mx-auto px-4 relative z-10 text-center",children:[s.jsxs("h1",{className:"text-5xl md:text-6xl font-bold text-foreground mb-6",children:["Altify Pro ",s.jsx("span",{className:"gradient-text",children:"Resource Hub"})]}),s.jsx("p",{className:"text-xl text-muted-foreground mb-8 max-w-3xl mx-auto",children:"Everything you need to master alt text and accessibility"}),s.jsxs("div",{className:"max-w-2xl mx-auto relative",children:[s.jsx(Kc,{className:"absolute left-4 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),s.jsx(me,{type:"text",placeholder:"Search guides, tutorials, and tips...",value:e,onCh
729ange:l=>t(l.target.value),className:"pl-12 h-14 text-lg bg-secondary border-primary/20 focus:border-primary"})]})]})]}),s.jsx("section",{className:"border-y border-primary/10 bg-secondary/20",children:s.jsx("div",{className:"container mx-auto px-4 py-6",children:s.jsx("div",{className:"flex flex-wrap gap-3 justify-center",children:a.map(l=>s.jsx(E,{variant:n===l.toLowerCase().replace(" ","-")?"default":"outline",onClick:()=>r(l.toLowerCase().replace(" ","-")),className:n===l.toLowerCase().replace(" ","-")?"bg-primary hover:bg-primary-hover":"border-primary/30 hover:border-primary hover:bg-primary/10",children:l},l))})})}),s.jsx("section",{className:"py-16",children:s.jsx("div",{className:"container mx-auto px-4",children:o.length>0?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 max-w-6xl mx-auto",children:o.map((l,c)=>s.jsx(BG,{...l},c))}):s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-xl text-muted-foreground",children:"No resources found. Try a different search or filter."})})})}),s.jsx("section",{className:"bg-primary py-16 mt-12",children:s.jsxs("div",{className:"container mx-auto px-4 text-center",children:[s.jsx("h2",{className:"text-4xl font-bold text-primary-foreground mb-4",children:"Ready to Automate Your Alt Text?"}),s.jsx("p",{className:"text-xl text-primary-foreground/90 mb-8 max-w-2xl mx-auto",children:"Stop writing manually. Let AI generate perfect alt text in seconds."}),s.jsx(ye,{to:"/auth",children:s.jsx(E,{size:"lg",variant:"secondary",className:"bg-white text-primary hover:bg-gray-100",children:"Start Free Trial"})}),s.jsx("p",{className:"text-sm text-primary-foreground/80 mt-4",children:"No credit card required • 10 images free"})]})})]})},zG=({items:e})=>{const[t,n]=f.useState("");f.useEffect(()=>{const a=new IntersectionObserver(i=>{i.forEach(o=>{o.isIntersecting&&n(o.target.id)})},{rootMargin:"-20% 0px -80% 0px"});return e.forEach(i=>{const o=document.getElementById(i.id);o&&a.observe(o)}),()=>a.disconnect()},[e]);const r=a=>{const i=document.getElementById(a);if(i){const c=i.getBoundingClientRect().top+window.pageYOffset-80;window.scrollTo({top:c,behavior:"smooth"})}};return s.jsxs("nav",{className:"sticky top-4 max-h-[calc(100vh-2rem)] overflow-y-auto hidden lg:block",children:[s.jsx("h4",{className:"text-sm font-semibold mb-4 text-foreground",children:"In This Guide"}),s.jsx("ul",{className:"space-y-2",children:e.map(a=>s.jsx("li",{className:F("text-sm",a.level===3&&"pl-4"),children:s.jsx("button",{onClick:()=>r(a.id),className:F("text-left hover:text-primary transition-colors w-full",t===a.id?"text-primary font-medium":"text-muted-foreground"),children:a.title})},a.id))})]})},WG=({resources:e})=>s.jsxs(L,{className:"p-6 bg-secondary/30 border-primary/20",children:[s.jsx("h4",{className:"text-sm font-semibold mb-4 text-foreground",children:"Related Resources"}),s.jsx("ul",{className:"space-y-3",children:e.map((t,n)=>s.jsxs("li",{children:[s.jsxs(ye,{to:t.link,className:"group flex items-start justify-between gap-2 text-sm hover:text-primary transition-colors",children:[s.jsx("span",{className:"flex-1",children:t.title}),s.jsx(uc,{className:"w-4 h-4 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0 mt-0.5"})]}),s.jsx(ae,{variant:"outline",className:"mt-1 text-xs",children:t.badge})]},n))})]}),HG=({pageName:e})=>{const[t,n]=f.useState(null),[r,a]=f.useState(!1),[i,o]=f.useState(""),l=d=>{n(d),a(!0),T.success("Thank you for your feedback!")},c=d=>{const u=window.location.href,h=`Check out this helpful guide: ${e}`,p={twitter:`https://twitter.com/intent/tweet?url=${encodeURIComponent(u)}&text=${encodeURIComponent(h)}`,linkedin:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(u)}`,facebook:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(u)}`};d==="copy"?(navigator.clipboard.writeText(u),T.success("Link copied to clipboard!")):window.open(p[d],"_blank","width=600,height=400")};return s.jsxs(L,{className:"p-6 bg-secondary/30 border-primary/20 space-y-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Was this helpful?"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(E,{variant:t===!0?"default":"outline",size:"sm",onClick:()=>l(!0),className:t===!0?"bg-primary":"",children:[s.jsx(LM,{className:"w-4 h-4 mr-2"}),"Yes"]}),s.jsxs(E,{variant:t===!1?"default":"outline",size:"sm",onClick:()=>l(!1),className:t===!1?"bg-primary":"",children:[s.jsx(DM,{className:"w-4 h-4 mr-2"}),"No"]})]})]}),r&&s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-muted-foreground mb-2 block",children:"Tell us more (optional):"}),s.jsx($v,{value:i,onChange:d=>o(d.target.value),placeholder:"How can we improve this guide?",className:"min-h-[80px]"})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Share this guide"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(E,{variant:"outline",size:"sm",onClick:()=>c("twitter"),children:s.jsx(ZS,{className:"w-4 h-4"})}),s.jsx(E,{variant:"outline",size:"sm",onClick:()=>c("linkedin"),children:s.jsx(YS,{className:"w-4 h-4"})}),s.jsx(E,{variant:"outline",size:"sm",onClick:()=>c("facebook"),children:s.jsx(yM,{className:"w-4 h-4"})}),s.jsx(E,{variant:"outline",size:"sm",onClick:()=>c("copy"),children:s.jsx(NM,{className:"w-4 h-4"})})]})]})]})},KG=()=>{const[e,t]=f.useState(0);return f.useEffect(()=>{const n=()=>{const r=document.documentElement.scrollHeight-window.innerHeight,a=window.pageYOffset/r*100;t(a)};return window.addEventListener("scroll",n),()=>window.removeEventListener("scroll",n)},[]),s.jsx("div",{className:"fixed top-0 left-0 w-full h-1 bg-secondary z-50",children:s.jsx("div",{className:"h-full bg-primary transition-all duration-150",style:{width:`${e}%`}})})},Pf=({children:e,title:t,breadcrumb:n,readingTime:r,lastUpdated:a,tocItems:i,relatedResources:o})=>s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(KG,{}),s.jsx("header",{className:"border-b border-primary/20 bg-secondary/30 sticky top-0 z-40 backdrop-blur-sm",children:s.jsx("div",{className:"container mx-auto px-4 py-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(ye,{to:"/",className:"flex items-center gap-2",children:s.jsx("img",{src:uf,alt:"Altify Pro",className:"h-10"})}),s.jsx(ye,{to:"/auth",children:s.jsx(E,{className:"bg-primary hover:bg-primary-hover",children:"Start Free Trial"})})]})})}),s.jsx("div",{className:"border-b border-primary/10 bg-secondary/20",children:s.jsx("div",{className:"container mx-auto px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsxs(ye,{to:"/",className:"hover:text-primary transition-colors flex items-center gap-1",children:[s.jsx(GS,{className:"w-4 h-4"}),"Home"]}),s.jsx(Xp,{className:"w-4 h-4"}),s.jsx(ye,{to:"/resources",className:"hover:text-primary transition-colors",children:"Resources"}),s.jsx(Xp,{className:"w-4 h-4"}),s.jsx("span",{className:"text-foreground",children:n})]})})}),s.jsx("div",{className:"container mx-auto px-4 py-12",children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8",children:[s.jsx("aside",{className:"lg:col-span-3",children:s.jsx(zG,{items:i})}),s.jsxs("main",{className:"lg:col-span-6",children:[e,s.jsxs("div",{className:"mt-16 pt-8 border-t border-primary/20 text-sm text-muted-foreground space-y-2",children:[s.jsxs("p",{children:["Last Updated: ",a]}),s.jsxs("p",{children:["Reading Time: ",r]}),s.jsx("p",{children:"Author: Altify Pro Team"})]})]}),s.jsxs("aside",{className:"lg:col-span-3 space-y-6",children:[s.jsx(WG,{resources:o}),s.jsx(HG,{pageName:t})]})]})}),s.jsx("section",{className:"bg-primary py-16 mt-20",children:s.jsxs("div",{className:"container mx-auto px-4 text-center",children:[s.jsx("h2",{className:"text-3xl font-bold text-primary-foreground mb-4",children:"Ready to Automate Your Alt Text?"}
729),s.jsx("p",{className:"text-lg text-primary-foreground/90 mb-6 max-w-2xl mx-auto",children:"Stop writing manually. Let AI generate perfect alt text in seconds."}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center mb-6",children:[s.jsxs("div",{className:"flex items-center gap-2 text-primary-foreground",children:[s.jsx("span",{className:"text-2xl",children:"✅"}),s.jsx("span",{children:"SEO-optimized"})]}),s.jsxs("div",{className:"flex items-center gap-2 text-primary-foreground",children:[s.jsx("span",{className:"text-2xl",children:"✅"}),s.jsx("span",{children:"Contextually accurate"})]}),s.jsxs("div",{className:"flex items-center gap-2 text-primary-foreground",children:[s.jsx("span",{className:"text-2xl",children:"✅"}),s.jsx("span",{children:"20+ languages"})]}),s.jsxs("div",{className:"flex items-center gap-2 text-primary-foreground",children:[s.jsx("span",{className:"text-2xl",children:"✅"}),s.jsx("span",{children:"Bulk processing"})]})]}),s.jsx(ye,{to:"/auth",children:s.jsx(E,{size:"lg",variant:"secondary",className:"bg-white text-primary hover:bg-gray-100",children:"Start Your Free Trial →"})}),s.jsx("p",{className:"text-sm text-primary-foreground/80 mt-4",children:"No credit card required"})]})})]}),J=({type:e,text:t,explanation:n})=>{const r=e==="good";return s.jsx("div",{className:`border-l-4 p-4 my-4 rounded-r-lg ${r?"border-success bg-success/5":"border-destructive bg-destructive/5"}`,children:s.jsxs("div",{className:"flex items-start gap-3",children:[r?s.jsx(Me,{className:"w-5 h-5 text-success mt-0.5 flex-shrink-0"}):s.jsx(cs,{className:"w-5 h-5 text-destructive mt-0.5 flex-shrink-0"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"font-mono text-sm mb-2",children:t}),n&&s.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:[s.jsx("strong",{children:"💡 Why it works:"})," ",n]})]})]})})},Pl=({code:e,language:t="html"})=>{const[n,r]=f.useState(!1),a=()=>{navigator.clipboard.writeText(e),r(!0),T.success("Code copied to clipboard!"),setTimeout(()=>r(!1),2e3)};return s.jsxs("div",{className:"relative group my-6",children:[s.jsx("div",{className:"absolute right-2 top-2 z-10",children:s.jsx(E,{size:"sm",variant:"ghost",onClick:a,className:"opacity-0 group-hover:opacity-100 transition-opacity bg-secondary/80 hover:bg-secondary",children:n?s.jsx(Me,{className:"h-4 w-4 text-success"}):s.jsx(jt,{className:"h-4 w-4 text-primary"})})}),s.jsx("pre",{className:"bg-[hsl(222_47%_11%)] border border-[hsl(215_16%_23%)] rounded-lg p-6 overflow-x-auto",children:s.jsx("code",{className:"text-sm font-mono text-foreground leading-relaxed",children:e})})]})},GG=()=>{const e=[{id:"introduction",title:"Introduction",level:2},{id:"what-is-alt-text",title:"What is Alt Text?",level:2},{id:"7-golden-rules",title:"The 7 Golden Rules",level:2},{id:"alt-text-formula",title:"Alt Text Formula",level:2},{id:"common-mistakes",title:"Common Mistakes",level:2},{id:"examples-by-category",title:"Examples by Category",level:2},{id:"complex-images",title:"Complex Images",level:2},{id:"seo-strategy",title:"SEO Strategy",level:2},{id:"testing",title:"Testing Your Alt Text",level:2},{id:"tools",title:"Tools & Resources",level:2}],t=[{title:"100+ Alt Text Examples",link:"/resources/alt-text-examples",badge:"15 min read"},{title:"Best Practices Checklist",link:"/resources/best-practices-checklist",badge:"PDF"},{title:"WordPress Tutorial",link:"/resources/wordpress-tutorial",badge:"8 min"}];return s.jsx(Pf,{title:"The Complete Guide to Writing Alt Text in 2025",breadcrumb:"How to Write Alt Text",readingTime:"12 min read",lastUpdated:"January 2025",tocItems:e,relatedResources:t,children:s.jsxs("article",{className:"prose prose-lg max-w-none",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-foreground mb-4",children:"The Complete Guide to Writing Alt Text in 2025"}),s.jsx("p",{className:"text-muted-foreground mb-8",children:"⏱️ 12 min read • Updated Jan 2025 • By Altify Pro Team"}),s.jsxs("section",{id:"introduction",className:"mb-12 scroll-mt-20",children:[s.jsx("p",{className:"text-lg leading-relaxed text-foreground",children:"Alt text (alternative text) is a written description of an image that appears when the image can't be displayed or when users rely on screen readers for accessibility. Whether you're optimizing for SEO or making your website accessible to everyone, writing good alt text is essential."}),s.jsx("p",{className:"text-lg leading-relaxed text-foreground mt-4",children:"This guide will teach you everything you need to know about writing alt text that works for both users and search engines."})]}),s.jsxs("section",{id:"what-is-alt-text",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"What is Alt Text?"}),s.jsx("p",{className:"text-lg leading-relaxed text-foreground mb-6",children:"Alt text is an HTML attribute added to image tags that describes what an image shows. It serves three critical purposes:"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsxs("h3",{className:"text-xl font-semibold text-foreground mb-3 flex items-center gap-2",children:[s.jsx("span",{className:"text-3xl",children:"🦯"})," 1. Accessibility"]}),s.jsxs("ul",{className:"list-disc list-inside space-y-2 text-foreground",children:[s.jsx("li",{children:"Screen readers read alt text aloud to visually impaired users"}),s.jsx("li",{children:"1 in 4 U.S. adults live with a disability"}),s.jsx("li",{children:"Legal requirement in many countries (ADA, WCAG compliance)"})]})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsxs("h3",{className:"text-xl font-semibold text-foreground mb-3 flex items-center gap-2",children:[s.jsx("span",{className:"text-3xl",children:"📈"})," 2. SEO"]}),s.jsxs("ul",{className:"list-disc list-inside space-y-2 text-foreground",children:[s.jsx("li",{children:`Google can't "see" images - alt text tells them what's in the picture`}),s.jsx("li",{children:"Images with alt text rank higher in Google Image Search"}),s.jsx("li",{children:"Improves overall page SEO and relevance"})]})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsxs("h3",{className:"text-xl font-semibold text-foreground mb-3 flex items-center gap-2",children:[s.jsx("span",{className:"text-3xl",children:"🔄"})," 3. Fallback"]}),s.jsxs("ul",{className:"list-disc list-inside space-y-2 text-foreground",children:[s.jsx("li",{children:"Displays when images fail to load due to slow connections"}),s.jsx("li",{children:"Helps users understand content without seeing images"}),s.jsx("li",{children:"Makes content accessible on all devices"})]})]})]}),s.jsxs("div",{className:"mt-6",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground mb-2",children:"HTML Example:"}),s.jsx(Pl,{code:'<img src="product-photo.jpg" alt="Red leather crossbody bag with gold chain strap">'})]})]}),s.jsxs("section",{id:"7-golden-rules",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"The 7 Golden Rules of Alt Text"}),s.jsxs("div",{className:"mb-8",children:[s.jsxs("h3",{className:"text-2xl font-semibold text-foreground mb-4 flex items-center gap-2",children:["Rule 1: Be Descriptive and Specific ",s.jsx("span",{className:"text-2xl",children:"✨"})]}),s.jsx("p",{className:"text-foreground mb-4",children:"Don't just name what's in the image - describe it with specific details."}),s.jsx(J,{type:"bad",text:"Image of a dog"}),s.jsx(J,{type:"good",text:"Golden retriever puppy playing with red ball in green park",explanation:"Specific details help users visualize the image and provide search engines with valuable context."})]}),s.jsxs("div",{className:"mb-8",children:[s.jsxs("h3",{className:"text-2xl font-semibold text-foreground mb-4 flex items-center gap-2",children:["Rule 2: Keep It Concise (Under 125 Characters) ",s.jsx("span",{className:"text-2xl",children:"⚡"})]}),s.jsx("p",{className:"text-foreground mb-4",children:"Screen readers cut off alt text around 125 characters, so be brief but descriptive."}),s.jsx(J,{type:"bad",text:"This is a photograph taken during the summer of 2024 showing our brand new product line which includes several different c
729olor options and sizes..."}),s.jsx(J,{type:"good",text:"2024 product line featuring t-shirts in blue, red, and green sizes S-XXL",explanation:"Target length: 80-125 characters for optimal readability."})]}),s.jsxs("div",{className:"mb-8",children:[s.jsxs("h3",{className:"text-2xl font-semibold text-foreground mb-4 flex items-center gap-2",children:[`Rule 3: Don't Start with "Image of" or "Picture of" `,s.jsx("span",{className:"text-2xl",children:"🚫"})]}),s.jsx("p",{className:"text-foreground mb-4",children:"Screen readers already announce it's an image, so this is redundant."}),s.jsx(J,{type:"bad",text:"Image of a woman working on a laptop"}),s.jsx(J,{type:"good",text:"Woman working on laptop in modern office"})]}),s.jsxs("div",{className:"mb-8",children:[s.jsxs("h3",{className:"text-2xl font-semibold text-foreground mb-4 flex items-center gap-2",children:["Rule 4: Include Context That Matters ",s.jsx("span",{className:"text-2xl",children:"🎯"})]}),s.jsx("p",{className:"text-foreground mb-4",children:"Think about WHY the image is on the page and what information it conveys."}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Example: E-commerce Product"}),s.jsx(J,{type:"bad",text:"Shoes"}),s.jsx(J,{type:"good",text:"Nike Air Max 270 white sneakers with blue swoosh, side view"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Example: Blog Post Hero Image"}),s.jsx(J,{type:"bad",text:"Person typing"}),s.jsx(J,{type:"good",text:"Freelance writer typing blog post on MacBook at coffee shop"})]})]})]}),s.jsxs("div",{className:"mb-8",children:[s.jsxs("h3",{className:"text-2xl font-semibold text-foreground mb-4 flex items-center gap-2",children:["Rule 5: Use Keywords Naturally (But Don't Stuff) ",s.jsx("span",{className:"text-2xl",children:"🔑"})]}),s.jsx("p",{className:"text-foreground mb-4",children:"Include relevant keywords, but only if they genuinely describe the image."}),s.jsx(J,{type:"bad",text:"WordPress plugin, WordPress SEO, WordPress optimization, best WordPress tool"}),s.jsx(J,{type:"good",text:"WordPress dashboard showing Altify Pro plugin alt text generation interface",explanation:"Use keywords in 1-2 images per page, not every single image."})]}),s.jsxs("div",{className:"mb-8",children:[s.jsxs("h3",{className:"text-2xl font-semibold text-foreground mb-4 flex items-center gap-2",children:["Rule 6: Describe Decorative Images as Empty ",s.jsx("span",{className:"text-2xl",children:"🎨"})]}),s.jsx("p",{className:"text-foreground mb-4",children:'If an image is purely decorative and adds no information, use empty alt text: alt=""'}),s.jsxs("div",{className:"bg-secondary/30 p-4 rounded-lg border border-primary/20",children:[s.jsx("p",{className:"text-foreground mb-2",children:"Decorative images include:"}),s.jsxs("ul",{className:"list-disc list-inside space-y-1 text-foreground",children:[s.jsx("li",{children:"Border designs"}),s.jsx("li",{children:"Spacers"}
729),s.jsx("li",{children:"Background patterns"}),s.jsx("li",{children:"Icons that duplicate adjacent text"})]})]}),s.jsx(Pl,{code:'<img src="decorative-line.svg" alt="">'})]}),s.jsxs("div",{className:"mb-8",children:[s.jsxs("h3",{className:"text-2xl font-semibold text-foreground mb-4 flex items-center gap-2",children:["Rule 7: Alt Text for Different Image Types ",s.jsx("span",{className:"text-2xl",children:"📸"})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"bg-secondary/30 p-4 rounded-lg border border-primary/20",children:[s.jsx("p",{className:"font-semibold text-foreground",children:"Photos of People:"}),s.jsx(J,{type:"good",text:"CEO Jane Smith presenting at tech conference podium"})]}),s.jsxs("div",{className:"bg-secondary/30 p-4 rounded-lg border border-primary/20",children:[s.jsx("p",{className:"font-semibold text-foreground",children:"Charts/Graphs:"}),s.jsx(J,{type:"good",text:"Bar chart showing 300% increase in website traffic from Jan to Dec 2024"})]}),s.jsxs("div",{className:"bg-secondary/30 p-4 rounded-lg border border-primary/20",children:[s.jsx("p",{className:"font-semibold text-foreground",children:"Screenshots:"}),s.jsx(J,{type:"good",text:"Altify Pro dashboard with uploaded image and generated alt text preview"})]})]})]})]}),s.jsxs("section",{id:"alt-text-formula",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"Alt Text Formula (Step-by-Step) 🧮"}),s.jsx("p",{className:"text-lg text-foreground mb-6",children:"Use this formula to write perfect alt text every time:"}),s.jsx("div",{className:"bg-primary/10 border-l-4 border-primary p-6 rounded-r-lg mb-6",children:s.jsx("p",{className:"text-xl font-semibold text-foreground",children:"[Object] + [Important Details] + [Context/Action]"})}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("p",{className:"font-semibold text-foreground mb-3",children:"Example 1: Product Photo"}),s.jsxs("ul",{className:"space-y-2 text-foreground mb-4",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Object:"}),' "Wireless headphones"']}),s.jsxs("li",{children:[s.jsx("strong",{children:"Details:"}),' "black, over-ear, with cushioned padding"']}),s.jsxs("li",{children:[s.jsx("strong",{children:"Context:"}),' "on wooden desk next to laptop"']})]}),s.jsx(J,{type:"good",text:"Black over-ear wireless headphones with cushioned padding on wooden desk"})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("p",{className:"font-semibold text-foreground mb-3",children:"Example 2: Team Photo"}),s.jsxs("ul",{className:"space-y-2 text-foreground mb-4",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Object:"}),' "Marketing team"']}),s.jsxs("li",{children:[s.jsx("strong",{children:"Details:"}),' "5 people in business casual attire"']}),s.jsxs("li",{children:[s.jsx("strong",{children:"Context:"}),' "collaborating around whiteboard with strategy notes"']})]}),s.jsx(J,{type:"good",text:"Marketing team of 5 in business casual collaborating around strategy whiteboard"})]})]})]}),s.jsxs("section",{id:"common-mistakes",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"Common Alt Text Mistakes to Avoid ⚠️"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-3",children:"❌ Mistake #1: Leaving Alt Text Empty"}),s.jsx(Pl,{code:'<img src="product.jpg" alt="">'}),s.jsx("p",{className:"text-foreground mt-2",children:"Unless the image is decorative, always add alt text."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-3",children:"❌ Mistake #2: Using Filename as Alt Text"}),s.jsx(Pl,{code:'<img src="IMG_2847.jpg" alt="IMG_2847">'}),s.jsx("p",{className:"text-foreground mt-2",children:"Filenames mean nothing to users or search engines."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-3",children:"❌ Mistake #3: Writing Novels"}),s.jsx(J,{type:"bad",text:"This beautiful photograph was taken last summer when we visited the mountains and saw this incredible sunset with orange and purple hues spreading across the sky while we were hiking..."}),s.jsx("p",{className:"text-foreground mt-2",children:"Keep it under 125 characters!"})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-3",children:"❌ Mistake #4: Keyword Stuffing"}),s.jsx(J,{type:"bad",text:"buy shoes online best shoes cheap shoes running shoes"}),s.jsx("p",{className:"text-foreground mt-2",children:"This hurts SEO and user experience."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-3",children:"❌ Mistake #5: Being Too Vague"}),s.jsx(J,{type:"bad",text:"Our product"}),s.jsx("p",{className:"text-foreground mt-2",children:"What product? Be specific!"})]})]})]}),s.jsx("section",{className:"mb-12",children:s.jsxs("div",{className:"bg-primary/10 border-l-4 border-primary p-6 rounded-r-lg",children:[s.jsx("h3",{className:"text-2xl font-bold text-foreground mb-4",children:"Make Alt Text a Habit ✅"}),s.jsx("p",{className:"text-foreground mb-4",children:"Writing good alt text doesn't have to be hard. Follow these simple steps:"}),s.jsxs("ul",{className:"list-disc list-inside space-y-2 text-foreground",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Describe what you see"})," - Be specific and clear"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Consider the context"})," - Why is this image here?"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Keep it concise"})," - Under 125 characters"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Include keywords naturally"})," - Only when relevant"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Test with users"})," - Use screen readers and feedback"]})]}),s.jsx("p",{className:"text-foreground mt-4",children:"Remember: Good alt text benefits everyone - users with disabilities, search engines, and people on slow connections."})]})})]})})},qG=()=>{const e=[{id:"introduction",title:"Introduction",level:2},{id:"ecommerce",title:"E-Commerce Products",level:2},{id:"blog-content",title:"Blog & Content",level:2},{id:"social-media",title:"Social Media",level:2},{id:"website-ui",title:"Website UI Elements",level:2},{id:"industry-specific",title:"Industry-Specific",level:2},{id:"before-after",title:"Before & After",level:2},{id:"templates",title:"Template Library",level:2}],t=[{title:"How to Write Alt Text",link:"/resources/how-to-write-alt-text",badge:"12 min"},{title:"Best Practices Checklist",link:"/resources/best-practices-checklist",badge:"PDF"},{title:"WordPress Tutorial",link:"/resources/wordpress-tutorial",badge:"8 min"}];return s.jsx(Pf,{title:"100+ Alt Text Examples for Every Situation (2025)",breadcrumb:"Alt Text Examples",readingTime:"15 min read",lastUpdated:"January 2025",tocItems:e,relatedResources:t,children:s.jsxs("article",{className:"prose prose-lg max-w-none",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-foreground mb-4",children:"100+ Alt Text Examples for Every Situation"}),s.jsx("p",{className:"text-muted-foreground mb-8",children:"⏱️ 15 min read • Updated Jan 2025"}),s.jsxs("section",{id:"introduction",className:"mb-12 scroll-mt-20",children:[s.jsx("p",{className:"text-lg text-foreground",children:"The best way to learn alt text is by seeing examples. This page shows you 100+ real-world alt text examples across different industries and image types."}),s.jsx("p",{className:"text-foreground mt-4",children:"Each example includes:"}),s.jsxs("ul",{className:"list-disc list-inside space-y-2 text-foreground mt-4",children:[s.jsx("li",{children:"❌ What NOT to write"}),s.jsx("li",{children:"✅ What GOOD alt text looks like"}),s.jsx("li",{children:"💡 Why it works"})]})]}),s.jsxs("section",{id:"ecommerce",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"E-Commerce Product Images 🛍️"}),s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 1: Fashion - Clothing"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Women's dress product photo"}),s.jsx(J,{type:"bad",text:"Dress"}),s.jsx(J,{type:"bad",text:"Product image"}),s.jsx(J,{type:"bad",text:"Item 4782"}),s.jsx(J,{type:"good",text:"Navy blue midi dress with floral print, V-neckline, and three-quarter sleeves",explanation:"Describes color, style, length, pattern, and details. Helps customers visualize without seeing image."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 2: Electronics - Headphones"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Wireless headphones on white background"}),s.jsx(J,{type:"bad",text:"Headphones for sale"}),s.jsx(J,{type:"bad",text:"Best headphones buy now"}),s.jsx(J,{type:"good",text:"Black over-ear wireless headphones with noise cancellation and foldable design",explanation:"Specifies type (over-ear, wireless), mentions key features (noise cancellation, foldable)."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 3: Home Goods - Furniture"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Modern coffee table in living room setting"}),s.jsx(J,{type:"bad",text:"Table"}),s.jsx(J,{type:"good",text:"Rectangular walnut coffee table with hairpin legs in modern living room",explanation:"Specifies furniture type, material (walnut), style (hairpin legs), and provides context."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 4: Food - Restaurant Menu"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Gourmet burger with fries"}),s.jsx(J,{type:"bad",text:"Our burger"}),s.jsx(J,{type:"good",text:"Angus beef burger with cheddar, lettuce, tomato, and truffle fries",explanation:"Lists specific ingredients, makes it sound appetizing and detailed."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 5: Beauty 
729- Cosmetics"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Lipstick product shot"}),s.jsx(J,{type:"bad",text:"Lipstick"}),s.jsx(J,{type:"good",text:"Matte ruby red lipstick in gold metallic tube, shown uncapped",explanation:"Describes finish (matte), shade (ruby red), packaging, and orientation."})]})]})]}),s.jsxs("section",{id:"blog-content",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"Blog Post & Content Images 📝"}),s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 11: Hero Image - Business Blog"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Person working on laptop at desk"}),s.jsx(J,{type:"bad",text:"Blog post image"}),s.jsx(J,{type:"bad",text:"Person working"}),s.jsx(J,{type:"good",text:"Freelance writer working on laptop at home office desk with notebook and coffee",explanation:"Establishes WHO (freelance writer), WHAT they're doing, and includes relevant context."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 12: Tutorial Screenshot"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: WordPress dashboard screenshot"}),s.jsx(J,{type:"bad",text:"Screenshot"}),s.jsx(J,{type:"good",text:"WordPress media library showing image upload interface with drag-and-drop area",explanation:"Names the platform and section, describes what's shown, mentions specific feature."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 13: Infographic"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Social media statistics infographic"}),s.jsx(J,{type:"bad",text:"Infographic"}),s.jsx(J,{type:"good",text:"Infographic showing Facebook 2.9B users, Instagram 2B users, Twitter 450M users in 2024",explanation:"Summarizes key data points with specific numbers and year for context."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 14: How-To Photo"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Hands demonstrating craft technique"}),s.jsx(J,{type:"bad",text:"Tutorial photo"}),s.jsx(J,{type:"good",text:"Hands folding origami paper crane showing third fold technique",explanation:"Describes action being performed, identifies craft and object, notes which step."})]})]})]}),s.jsxs("section",{id:"social-media",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"Social Media Images 📱"}),s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 16: Instagram Post - Lifestyle"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Coffee latte art on marble table"}),s.jsx(J,{type:"bad",text:"Coffee"}),s.jsx(J,{type:"good",text:"Heart-shaped latte art in white ceramic cup on marble table with croissant",explanation:"Describes the art design, includes cup type and surface, mentions additional elements."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 17: LinkedIn Post - Professional"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Team celebrating with champagne"}),s.jsx(J,{type:"bad",text:"Team photo"}),s.jsx(J,{type:"good",text:"Marketing team of six celebrating product launch milestone with champagne toast",explanation:"Specifies team type and size, explains reason for celebration, describes action."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 18: Quote Graphic"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Motivational quote on designed background"}),s.jsx(J,{type:"bad",text:"Quote"}),s.jsx(J,{type:"good",text:"Quote on coral background: 'Accessibility is not optional, it's essential' - Altify Pro",explanation:"Includes full quote text, describes visual design, attributes source."})]})]})]}),s.jsxs("section",{id:"website-ui",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"Website UI Elements 🖥️"}),s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 21: Logo"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Company logo in header"}),s.jsx(J,{type:"bad",text:"Logo"}),s.jsx(J,{type:"bad",text:"Company logo image"}),s.jsx(J,{type:"good",text:"Altify Pro",explanation:"Just the company name - simple and clear. Screen readers announce 'Altify Pro image link'."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 22: Icon with Text"}),s.jsx("p",{className:"text-foreground mb-4",children:'Image: Checkmark icon next to "Free trial" text'}),s.jsx(J,{type:"bad",text:"Checkmark"}),s.jsx(J,{type:"good",text:'alt="" (empty alt attribute)',explanation:"Icon duplicates adjacent text. Empty alt prevents redundant screen reader announcement."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Example 23: User Avatar"}),s.jsx("p",{className:"text-foreground mb-4",children:"Image: Profile photo thumbnail"}),s.jsx(J,{type:"bad",text:"Avatar"}),s.jsx(J,{type:"good",text:"Sarah Johnson profile photo",explanation:"Identifies whose photo it is. Simple and direct, helpful for user identification."})]})]})]}),s.jsxs("section",{id:"industry-specific",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"Industry-Specific Examples 🏢"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-4",children:"Real Estate"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx(J,{type:"good",text:"Three-bedroom colonial home with white exterior, black shutters, and manicured front lawn"}),s.jsx(J,{type:"good",text:"Modern kitchen with granite countertops, stainless steel appliances, and island seating"})]})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-4",children:"Healthcare"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx(J,{type:"good",text:"Doctor examining patient's throat using tongue depressor in medical office"}),s.jsx(J,{type:"good",text:"Nurse taking patient's blood pressure with digital monitor"})]})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-4",children:"Technology"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx(J,{type:"good",text:"Smartphone displaying mobile app interface with dashboard and analytics graphs"}),s.jsx(J,{type:"good",text:"Software developer coding on multiple monitors in modern office"})]})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-4",children:"Travel"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx(J,{type:"good",text:"Tropical beach with turquoise water, white sand, and palm trees at sunset"}),s.jsx(J,{type:"good",text:"Historic European castle on hilltop surrounded by vineyards"})]})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-4",children:"Fitness"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx(J,{type:"good",text:"Woman performing downward dog yoga pose on purple mat in gym studio"}),s.jsx(J,{type:"good",text:"Personal trainer assisting client with weight training at fitness center"})]})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-4",children:"Food & Restaurant"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx(J,{type:"good",text:"Chef plating gourmet dish with garnish in restaurant kitchen"}),s.jsx(J,{type:"good",text:"Fresh fruit smoothie bowl topped with granola, berries, and mint"})]})]})]})]}),s.jsxs("section",{id:"before-after",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"Before & After: Real-World Improvements 🔄"}),s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Case 1: E-commerce Site Transformation"}),s.jsx("p",{className:"font-semibold text-destructive mb-3",children:"BEFORE (Generic):"}),s.jsxs("div",{className:"space-y-2 mb-6",children:[s.jsx(J,{type:"bad",text:'alt="Product"'}),s.jsx(J,{type:"bad",text:'alt="Item"'}),s.jsx(J,{type:"bad",text:'alt="For sale"'})]}),s.jsx("p",{className:"font-semibold text-success mb-3",children:"AFTER (Descriptive):"}),s.jsxs("div",{className:"space-y-2 mb-6",children:[s.jsx(J,{type:"good",text:"Vintage brown leather messenger bag with brass buckles"}),s.jsx(J,{type:"good",text:"Sterling silver hoop earrings with cubic zirconia accents"}),s.jsx(J,{type:"good",text:"Hand-knitted wool blanket in grey cable-knit pattern"})]}),s.jsxs("div",{className:"bg-background/50 p-4 rounded-lg",children:[s.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Results:"}),s.jsxs("ul",{className:"space-y-2 text-foreground",children:[s.jsx("li",{children:"📈 45% increase in organic 
729image search traffic"}),s.jsx("li",{children:"♿ 100% WCAG compliance achieved"}),s.jsx("li",{children:"🛒 12% higher conversion rate"})]})]})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-2xl font-semibold text-foreground mb-4",children:"Case 2: Blog Post Optimization"}),s.jsx("p",{className:"font-semibold text-destructive mb-3",children:"BEFORE:"}),s.jsxs("div",{className:"space-y-2 mb-6",children:[s.jsx(J,{type:"bad",text:'alt="Image"'}),s.jsx(J,{type:"bad",text:'alt=""'}),s.jsx(J,{type:"bad",text:'alt="Chart"'})]}),s.jsx("p",{className:"font-semibold text-success mb-3",children:"AFTER:"}),s.jsxs("div",{className:"space-y-2 mb-6",children:[s.jsx(J,{type:"good",text:"Organized home office desk with laptop, planner, and coffee"}),s.jsx(J,{type:"good",text:"Entrepreneur reviewing business strategy on whiteboard with sticky notes"}),s.jsx(J,{type:"good",text:"Bar chart showing 200% productivity increase over 6 months"})]}),s.jsxs("div",{className:"bg-background/50 p-4 rounded-lg",children:[s.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Results:"}),s.jsxs("ul",{className:"space-y-2 text-foreground",children:[s.jsx("li",{children:"📈 35% longer average time on page"}),s.jsx("li",{children:"🔍 Better search rankings for target keywords"}),s.jsx("li",{children:"♿ Accessible to screen reader users"})]})]})]})]})]}),s.jsxs("section",{id:"templates",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"Alt Text Template Library 📋"}),s.jsx("p",{className:"text-foreground mb-6",children:"Copy and customize these templates for common scenarios:"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-3",children:"Product Photos Template:"}),s.jsx("p",{className:"font-mono text-sm bg-background/50 p-4 rounded mb-3 text-foreground",children:"[Color] [Material] [Product Type] with [Key Feature 1] and [Key Feature 2]"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.jsx("strong",{children:"Example:"}),' "Black leather wallet with RFID protection and coin pocket"']})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-3",children:"Team Photos Template:"}),s.jsx("p",{className:"font-mono text-sm bg-background/50 p-4 rounded mb-3 text-foreground",children:"[Department/Role] team of [Number] [Action] at/in [Location]"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.jsx("strong",{children:"Example:"}),' "Customer support team of 5 assisting clients at modern office"']})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-3",children:"Screenshots Template:"}),s.jsx("p",{className:"font-mono text-sm bg-background/50 p-4 rounded mb-3 text-foreground",children:"[Platform/Tool] [Section] showing [Specific Feature/Action]"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.jsx("strong",{children:"Example:"}),' "Shopify admin panel showing product inventory management interface"']})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-3",children:"Data Visualizations Template:"}),s.jsx("p",{className:"font-mono text-sm bg-background/50 p-4 rounded mb-3 text-foreground",children:"[Chart Type] showing [Trend/Comparison]: [Key Numbers]"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.jsx("strong",{children:"Example:"}),' "Pie chart showing traffic sources: 60% organic, 30% direct, 10% social"']})]})]})]})]})})},YG=()=>{const e=[{id:"introduction",title:"Introduction",level:2},{id:"writing-quality",title:"Writing Quality",level:2},{id:"seo-optimization",title:"SEO Optimization",level:2},{id:"accessibility",title:"Accessibility",level:2}],t=[{title:"How to Write Alt Text",link:"/resources/how-to-write-alt-text",badge:"12 min"},{title:"Alt Text Examples",link:"/resources/alt-text-examples",badge:"15 min"},{title:"WordPress Tutorial",link:"/resources/wordpress-tutorial",badge:"8 min"}];return s.jsx(Pf,{title:"Alt Text Best Practices: Complete Checklist",breadcrumb:"Best Practices Checklist",readingTime:"20 min read",lastUpdated:"January 2025",tocItems:e,relatedResources:t,children:s.jsxs("article",{className:"prose prose-lg max-w-none",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-foreground mb-4",children:"Alt Text Best Practices: Complete Checklist for 2025"}),s.jsx("p",{className:"text-muted-foreground mb-8",children:"⏱️ 20 min read • 150+ checklist items"}),s.jsx("section",{id:"introduction",className:"mb-12 scroll-mt-20",children:s.jsx("p",{className:"text-lg text-foreground",children:"Use this comprehensive checklist to ensure your alt text follows all best practices for accessibility, SEO, and user experience."})}),s.jsxs("section",{id:"writing-quality",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"✅ Writing Quality Checklist"}),s.jsx("div",{className:"space-y-4",children:["Alt text is descriptive and specific","Length is between 80-125 characters","Doesn't start with 'image of' or 'picture of'","Includes relevant context about the image's purpose","Uses natural language, not keyword stuffing","Describes important details (color, size, action)","Is concise but informative","Matches the content's tone and style"].map((n,r)=>s.jsxs("div",{className:"flex items-start gap-3 p-4 bg-secondary/30 rounded-lg border border-primary/20 hover:border-primary/40 transition-colors",children:[s.jsx("input",{type:"checkbox",className:"mt-1 w-5 h-5 accent-primary"}),s.jsx("span",{className:"text-foreground",children:n})]},r))})]}),s.jsxs("section",{id:"seo-optimization",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"✅ SEO Optimization Checklist"}),s.jsx("div",{className:"space-y-4",children:["Primary keyword included in 1-2 hero images","Keywords used naturally, not forced","Long-tail keywords in supporting images","Variations of keywords across different images","Image filename is descriptive (not IMG_001.jpg)","Image file size optimized (under 200KB)","Using appropriate image format (WebP preferred)","Alt text unique for each image (no duplicates)"].map((n,r)=>s.jsxs("div",{className:"flex items-start gap-3 p-4 bg-secondary/30 rounded-lg border border-primary/20 hover:border-primary/40 transition-colors",children:[s.jsx("input",{type:"checkbox",className:"mt-1 w-5 h-5 accent-primary"}),s.jsx("span",{className:"text-foreground",children:n})]},r))})]}),s.jsxs("section",{id:"accessibility",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"✅ Accessibility Compliance Checklist"}),s.jsx("div",{className:"space-y-4",children:["All informative images have alt text",'Decorative images use empty alt text (alt="")',"Complex images have detailed descriptions","Charts and graphs describe 
729key data points","Text in images is also in alt text","Color is not the only way to convey information","Alt text doesn't duplicate adjacent text","Screen reader tested for accuracy","WCAG 2.1 Level AA compliant","Works with keyboard navigation"].map((n,r)=>s.jsxs("div",{className:"flex items-start gap-3 p-4 bg-secondary/30 rounded-lg border border-primary/20 hover:border-primary/40 transition-colors",children:[s.jsx("input",{type:"checkbox",className:"mt-1 w-5 h-5 accent-primary"}),s.jsx("span",{className:"text-foreground",children:n})]},r))})]})]})})},QG=()=>{const e=[{id:"introduction",title:"Introduction",level:2},{id:"csv-import",title:"CSV Import Method",level:2},{id:"manual-method",title:"Manual Method",level:2},{id:"troubleshooting",title:"Troubleshooting",level:2}],t=[{title:"How to Write Alt Text",link:"/resources/how-to-write-alt-text",badge:"12 min"},{title:"Alt Text Examples",link:"/resources/alt-text-examples",badge:"15 min"},{title:"Best Practices",link:"/resources/best-practices-checklist",badge:"PDF"}];return s.jsx(Pf,{title:"How to Import Alt Text to WordPress",breadcrumb:"WordPress Tutorial",readingTime:"8 min tutorial",lastUpdated:"January 2025",tocItems:e,relatedResources:t,children:s.jsxs("article",{className:"prose prose-lg max-w-none",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-foreground mb-4",children:"How to Import Alt Text to WordPress: Complete Tutorial"}),s.jsx("p",{className:"text-muted-foreground mb-8",children:"⏱️ 8 min tutorial • Updated Jan 2025"}),s.jsx("section",{id:"introduction",className:"mb-12 scroll-mt-20",children:s.jsx("p",{className:"text-lg text-foreground",children:"Learn how to efficiently add alt text to your WordPress media library using CSV import or manual methods."})}),s.jsxs("section",{id:"csv-import",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"Method 1: CSV Import (Recommended) 📊"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-4",children:"Step 1: Export from Altify Pro"}),s.jsx("p",{className:"text-foreground mb-4",children:"Generate your alt text in Altify Pro and download the CSV file."}),s.jsx(Pl,{code:`filename,alt_text,title,caption
730image1.jpg,"Red leather bag with gold chain","Luxury crossbody bag","Premium leather handbag"
731image2.jpg,"Blue cotton t-shirt","Men's casual wear","Comfortable summer tee"`})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-4",children:"Step 2: Install Media Library Assistant Plugin"}),s.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-foreground",children:[s.jsx("li",{children:"Go to WordPress Dashboard → Plugins → Add New"}),s.jsx("li",{children:'Search for "Media Library Assistant"'}),s.jsx("li",{children:"Click Install Now, then Activate"})]})]}),s.jsxs("div",{className:"bg-secondary/30 p-6 rounded-lg border border-primary/20",children:[s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-4",children:"Step 3: Import CSV"}),s.jsxs("ol",{className:"list-decimal list-inside space-y-2 text-foreground",children:[s.jsx("li",{children:"Navigate to Media → Assistant → Settings → IPTC/EXIF"}),s.jsx("li",{children:'Click "Import" tab'}),s.jsx("li",{children:"Upload your CSV file"}),s.jsx("li",{children:"Map columns: filename → Image, alt_text → Alt Text"}),s.jsx("li",{children:'Click "Import Now"'})]})]})]})]}),s.jsxs("section",{id:"manual-method",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"Method 2: Manual Media Library ✏️"}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-foreground",children:"For small batches or individual images:"}),s.jsxs("ol",{className:"list-decimal list-inside space-y-3 text-foreground",children:[s.jsx("li",{children:"Go to Media → Library"}),s.jsx("li",{children:"Click on an image to open details"}),s.jsx("li",{children:'Enter alt text in the "Alternative Text" field'}),s.jsx("li",{children:'Click "Update" to save'})]})]})]}),s.jsxs("section",{id:"troubleshooting",className:"mb-12 scroll-mt-20",children:[s.jsx("h2",{className:"text-3xl font-bold text-foreground mb-6 pb-3 border-b-2 border-primary/20",children:"Troubleshooting Common Issues 🔧"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-destructive/10 border-l-4 border-destructive p-4 rounded-r-lg",children:[s.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Issue: Import fails"}),s.jsx("p",{className:"text-foreground",children:"Solution: Ensure CSV uses UTF-8 encoding and filenames exactly match your media library."})]}),s.jsxs("div",{className:"bg-destructive/10 border-l-4 border-destructive p-4 rounded-r-lg",children:[s.jsx("p",{className:"font-semibold text-foreground mb-2",children:"Issue: Alt text not showing"}),s.jsx("p",{className:"text-foreground",children:"Solution: Clear your cache and check theme compatibility."})]})]})]})]})})};function JG({open:e,onClose:t,onSuccess:n}){const[r,a]=f.useState(""),[i,o]=f.useState(""),[l,c]=f.useState(!1),[d,u]=f.useState(!1),[h,p]=f.useState(null),m=async()=>
731{if(!r||!i){T.error("Please fill in all fields");return}c(!0),p(null);try{const{data:y,error:x}=await V.functions.invoke("shopify-sync",{body:{action:"test_connection",store_url:r,api_token:i}});if(x)throw x;y.success?p({success:!0,message:`Successfully connected to ${y.shop_name||r}`}):p({success:!1,message:y.error||"Connection test failed"})}catch(y){p({success:!1,message:y.message||"Failed to test connection"})}finally{c(!1)}},b=async()=>{if(!r||!i){T.error("Please fill in all fields");return}if(!(h!=null&&h.success)){T.error("Please test the connection first");return}u(!0);try{const{data:{user:y}}=await V.auth.getUser();if(!y)throw new Error("Not authenticated");const{error:x}=await V.from("platform_integrations").upsert({user_id:y.id,platform:"shopify",status:"connected",store_url:r,api_token_encrypted:i,settings:{auto_generate:!1,alt_text_style:"descriptive",keywords:[]}},{onConflict:"user_id,platform"});if(x)throw x;n()}catch(y){console.error("Error saving connection:",y),T.error(y.message||"Failed to save connection")}finally{u(!1)}},g=()=>{a(""),o(""),p(null),t()};return s.jsx(pr,{open:e,onOpenChange:g,children:s.jsxs(zn,{className:"sm:max-w-[600px]",children:[s.jsxs(Wn,{children:[s.jsx(Hn,{className:"text-2xl",children:"Connect Shopify Store"}),s.jsx(ds,{children:"Enter your Shopify store credentials to connect Altify Pro with your store"})]}),s.jsxs("div",{className:"space-y-6 py-4",children:[s.jsxs(kt,{children:[s.jsx(Ht,{className:"h-4 w-4"}),s.jsx(Ct,{children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"font-medium",children:"How to get your Shopify API credentials:"}),s.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm",children:[s.jsx("li",{children:"Go to your Shopify Admin Dashboard"}),s.jsx("li",{children:"Navigate to Settings → Apps and sales channels"}),s.jsx("li",{children:'Click "Develop apps" → "Create an app"'}),s.jsx("li",{children:"Configure API scopes: read_products, write_products"}),s.jsx("li",{children:"Install the app and copy the Admin API access token"})]}),s.jsxs("a",{href:"https://help.shopify.com/en/manual/apps/app-types/custom-apps",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-sm text-primary hover:underline mt-2",children:["View detailed instructions",s.jsx(HS,{className:"h-3 w-3 ml-1"})]})]})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"store-url",children:"Store URL *"}),s.jsx(me,{id:"store-url",placeholder:"yourstore.myshopify.com",value:r,onChange:y=>a(y.target.value),disabled:l||d}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter your store's .myshopify.com URL"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"api-token",children:"Admin API Access Token *"}),s.jsx(me,{id:"api-token",type:"password",placeholder:"shpat_...",value:i,onChange:y=>o(y.target.value),disabled:l||d}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Your private Admin API access token from Shopify"})]}),s.jsx(E,{variant:"outline",onClick:m,disabled:l||d||!r||!i,className:"w-full",children:l?s.jsxs(s.Fragment,{children:[s.jsx(On,{className:"h-4 w-4 mr-2 animate-spin"}),"Testing Connection..."]}):"Test Connection"}),h&&s.jsxs(kt,{variant:h.success?"default":"destructive",children:[h.success?s.jsx(Dr,{className:"h-4 w-4"}):s.jsx(Ht,{className:"h-4 w-4"}),s.jsx(Ct,{children:h.message})]})]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(E,{variant:"outline",onClick:g,disabled:d,children:"Cancel"}),s.jsx(E,{onClick:b,disabled:!(h!=null&&h.success)||d,children:d?s.jsxs(s.Fragment,{children:[s.jsx(On,{className:"h-4 w-4 mr-2 animate-spin"}),"Connecting..."]}):"Connect Store"})]})]})})}const Ho=f.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:F("w-full caption-bottom text-sm",e),...t})}));Ho.displayName="Table";const Ko=f.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:F("[&_tr]:border-b",e),...t}));Ko.displayName="TableHeader";const Go=f.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:F("[&_tr:last-child]:border-0",e),...t}));Go.displayName="TableBody";const XG=f.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:F("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));XG.displayName="TableFooter";const ur=f.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:F("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));ur.displayName="TableRow";const $e=f.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:F("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));$e.displayName="TableHead";const Ue=f.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:F("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ue.displayName="TableCell";const ZG=f.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:F("mt-4 text-sm text-muted-foreground",e),...t}));ZG.displayName="TableCaption";function eq({products:e,integration:t,onProductUpdate:n}){const[r,a]=f.useState(new Set),[i,o]=f.useState(new Set),[l,c]=f.useState(!1),d=g=>{const y=new Set(r);y.has(g)?y.delete(g):y.add(g),a(y)},u=()=>{r.size===e.length?a(new Set):a(new Set(e.map(g=>g.id)))},h=async g=>{o(y=>new Set(y).add(g.id));try{const{data:y,error:x}=await V.functions.invoke("shopify-sync",{body:{action:"generate_alt_text",integration_id:t.
731id,product_id:g.id,images:g.images}});if(x)throw x;T.success(`Generated alt text for ${g.title}`),n()}catch(y){console.error("Error generating alt text:",y),T.error(y.message||"Failed to generate alt text")}finally{o(y=>{const x=new Set(y);return x.delete(g.id),x})}},p=async()=>{const g=e.filter(y=>{var x;return(x=y.images)==null?void 0:x.some(w=>!w.alt)});if(g.length===0){T.info("All products already have alt text!");return}c(!0);try{const{data:y,error:x}=await V.functions.invoke("shopify-sync",{body:{action:"generate_bulk",integration_id:t.id,products:g}});if(x)throw x;T.success(`Generated alt text for ${g.length} products`),n()}catch(y){console.error("Error generating bulk alt text:",y),T.error(y.message||"Failed to generate alt text")}finally{c(!1)}},m=g=>{if(!g.images||g.images.length===0)return{status:"no_images",count:0,total:0};const y=g.images.filter(w=>w.alt).length,x=g.images.length;return y===x?{status:"complete",count:y,total:x}:y===0?{status:"missing",count:y,total:x}:{status:"partial",count:y,total:x}},b=e.filter(g=>{var y;return(y=g.images)==null?void 0:y.some(x=>!x.alt)}).length;return s.jsxs(L,{children:[s.jsx(Te,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Ae,{children:["Products (",e.length,")"]}),b>0&&s.jsx(E,{onClick:p,disabled:l,className:"gap-2",children:l?s.jsxs(s.Fragment,{children:[s.jsx(On,{className:"h-4 w-4 animate-spin"}),"Generating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(ow,{className:"h-4 w-4"}),"Generate All Missing (",b,")"]})})]})}),s.jsx(Ne,{children:s.jsx("div",{className:"rounded-md border",children:s.jsxs(Ho,{children:[s.jsx(Ko,{children:s.jsxs(ur,{children:[s.jsx($e,{className:"w-12",children:s.jsx(un,{checked:r.size===e.length&&e.length>0,onCheckedChange:u})}),s.jsx($e,{className:"w-20",children:"Image"}),s.jsx($e,{children:"Product Title"}),s.jsx($e,{children:"Alt Text Status"}),s.jsx($e,{className:"text-right",children:"Actions"})]})}),s.jsx(Go,{children:e.map(g=>{var v;const y=m(g),x=i.has(g.id),w=(v=g.images)==null?void 0:v[0];return s.jsxs(ur,{children:[s.jsx(Ue,{children:s.jsx(un,{checked:r.has(g.id),onCheckedChange:()=>d(g.id)})}),s.jsx(Ue,{children:w&&s.jsx("img",{src:w.src,alt:w.alt||"Product",className:"h-12 w-12 object-cover rounded"})}),s.jsx(Ue,{className:"font-medium",children:g.title}),s.jsx(Ue,{children:y.status==="no_images"?s.jsx(ae,{variant:"outline",children:"No Images"}):y.status==="complete"?s.jsxs(ae,{className:"bg-success text-success-foreground",children:[s.jsx(Dr,{className:"h-3 w-3 mr-1"}),"Complete (",y.count,"/",y.total,")"]}):y.status==="missing"?s.jsxs(ae,{variant:"destructive",children:[s.jsx(Ht,{className:"h-3 w-3 mr-1"}),"Missing (",y.count,"/",y.total,")"]}):s.jsxs(ae,{variant:"outline",className:"border-warning text-warning",children:["Partial (",y.count,"/",y.total,")"]})}),s.jsx(Ue,{className:"text-right",children:y.status!=="complete"&&y.status!=="no_images"&&s.jsx(E,{size:"sm",variant:"outline",onClick:()=>h(g),disabled:x||l,children:x?s.jsxs(s.Fragment,{children:[s.jsx(On,{className:"h-3 w-3 mr-2 animate-spin"}),"Generating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(ow,{className:"h-3 w-3 mr-2"}),"Generate"]})})})]},g.id)})})]})})})]})}function tq({integration:e,onClose:t,onUpdate:n}){var c,d,u,h;const[r,a]=f.useState({auto_generate:((c=e.settings)==null?void 0:c.auto_generate)||!1,alt_text_style:((d=e.settings)==null?void 0:d.alt_text_style)||"descriptive",keywords:((h=(u=e.settings)==null?void 0:u.keywords)==null?void 0:h.join(", "))||""}),[i,o]=f.useState(!1),l=async()=>{o(!0);try{const{error:p}=await V.from("platform_integrations").update({settings:{auto_generate:r.auto_generate,alt_text_style:r.alt_text_style,keywords:r.keywords.split(",").map(m=>m.trim()).filter(m=>m.length>0)}}).eq("id",e.id);if(p)throw p;T.success("Settings saved successfully"),n(),t()}catch(p){console.error("Error saving settings:",p),T.error(p.message||"Failed to save settings")}finally{o(!1)}};return s.jsxs(L,{className:"mb-6 border-primary/20",children:[s.jsx(Te,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(Ae,{children:"Shopify Settings"}),s.jsx(We,{children:"Configure how Altify Pro generates alt text for your Shopify products"})]}),s.jsx(E,{variant:"ghost",size:"icon",onClick:t,children:s.jsx(cs,{className:"h-4 w-4"})})]})}),s.jsxs(Ne,{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between space-x-4",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(se,{htmlFor:"auto-generate",children:"Auto-generate for new products"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Automatically generate alt text when new products are added to your store"})]}),s.jsx(wn,{id:"auto-generate",checked:r.auto_generate,onCheckedChange:p=>a({...r,auto_generate:p})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"alt-text-style",children:"Alt Text Style"}),s.jsxs(Dt,{value:r.alt_text_style,onValueChange:p=>a({...r,alt_text_style:p}),children:[s.jsx(_t,{id:"alt-text-style",children:s.jsx(Lt,{})}),s.jsxs(Et,{children:[s.jsx(X,{value:"descriptive",children:"Descriptive - Detailed product descriptions"}),s.jsx(X,{value:"seo",children:"SEO-focused - Optimized for search engines"}),s.jsx(X,{value:"concise",children:"Concise - Brief and to the point"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose the style that best fits your brand voice and SEO strategy"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"keywords",children:"SEO Keywords (optional)"}),s.jsx(me,{id:"keywords",placeholder:"luxury, premium, handcrafted...",value:r.keywords,onChange:p=>a({...r,keywords:p.target.value})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Comma-separated keywords to include in generated alt text for better SEO"})]}),s.jsx("div",{className:"flex justify-end pt-4 border-t",children:s.jsx(E,{onClick:l,disabled:i,children:i?"Saving...":s.jsxs(s.Fragment,{children:[s.jsx(Fh,{className:"h-4 w-4 mr-2"}),"Save Settings"]})})})]})]})}function nq(){const e=hr(),[t,n]=f.useState(null),[r,a]=f.useState(!0),[i,o]=f.useState(!1),[l,c]=f.useState(!1),[d,u]=f.useState([]),[h,p]=f.useState(!1),[m,b]=f.useState(0);f.useEffect(()=>{g()},[]);const g=async()=>{try{const{data:{user:S}}=await V.auth.getUser();if(!S){e("/auth");return}const{data:k,error:C}=await V.from("platform_integrations").select("*").eq("user_id",S.id).eq("platform","shopify").single();if(C&&C.code!=="PGRST116")throw C;n(k),k||o(!0)}catch(S){console.error("Error fetching integration:",S),T.error("Failed to load Shopify integration")}finally{a(!1)}},y=async()=>{o(!0)},x=()=>{o(!1),g(),T.success("Successfully connected to Shopify!")},w=async()=>{var S;if(t){p(!0),b(0);try{const{data:k,error:C}=await V.functions.invoke("shopify-sync",{body:{action:"fetch_products",integration_id:t.
731id}});if(C)throw C;u(k.products||[]),b(100),T.success(`Found ${((S=k.products)==null?void 0:S.length)||0} products`)}catch(k){console.error("Error scanning products:",k),T.error(k.message||"Failed to scan products")}finally{p(!1)}}},v=async()=>{if(t)try{const{error:S}=await V.from("platform_integrations").delete().eq("id",t.id);if(S)throw S;T.success("Disconnected from Shopify"),e("/integrations")}catch(S){console.error("Error disconnecting:",S),T.error("Failed to disconnect")}},j=()=>{if(d.length===0){T.error("No products to export");return}const S=[["Product Title","Image Count","Images with Alt Text","Images Missing Alt Text","Status"],...d.map(R=>{var G,W,$,M;return[R.title,((G=R.images)==null?void 0:G.length)||0,((W=R.images)==null?void 0:W.filter(K=>K.alt).length)||0,(($=R.images)==null?void 0:$.filter(K=>!K.alt).length)||0,(M=R.images)!=null&&M.every(K=>K.alt)?"Complete":"Incomplete"]})].map(R=>R.join(",")).join(`
732`),k=new Blob([S],{type:"text/csv"}),C=URL.createObjectURL(k),A=document.createElement("a");A.href=C,A.download=`shopify-alt-text-report-${new Date().toISOString().split("T")[0]}.csv`,A.click(),URL.revokeObjectURL(C),T.success("Report exported successfully")};if(r)return s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx(rn,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"Loading integration..."})]})});const N=(t==null?void 0:t.status)==="connected";return s.jsxs("div",{className:"min-h-screen bg-background p-8",children:[s.jsxs("div",{className:"max-w-7xl mx-auto",children:[s.jsxs(E,{variant:"ghost",onClick:()=>e("/integrations"),className:"mb-6",children:[s.jsx(BS,{className:"h-4 w-4 mr-2"}),"Back to Integrations"]}),s.jsx(L,{className:"mb-6 border-primary/20",children:s.jsx(Te,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"p-3 rounded-lg bg-success/20",children:s.jsx(Ka,{className:"h-8 w-8 text-success"})}),s.jsxs("div",{children:[s.jsx(Ae,{className:"text-2xl",children:"Shopify Integration"}),(t==null?void 0:t.store_name)&&s.jsxs(We,{className:"text-base mt-1",children:[t.store_name," (",t.store_url,")"]})]})]}),s.jsx("div",{className:"flex items-center gap-3",children:N?s.jsxs(s.Fragment,{children:[s.jsxs(ae,{className:"bg-success text-success-foreground",children:[s.jsx(Dr,{className:"h-3 w-3 mr-1"}),"Connected"]}),s.jsxs(E,{variant:"outline",size:"sm",onClick:()=>c(!l),children:[s.jsx(Mo,{className:"h-4 w-4 mr-2"}),"Settings"]}),s.jsx(E,{variant:"outline",size:"sm",onClick:v,children:"Disconnect"})]}):s.jsxs(s.Fragment,{children:[s.jsxs(ae,{variant:"outline",className:"border-muted-foreground/30",children:[s.jsx(Ht,{className:"h-3 w-3 mr-1"}),"Not Connected"]}),s.jsx(E,{onClick:y,children:"Connect Shopify"})]})})]})})}),N&&s.jsxs(s.Fragment,{children:[l&&s.jsx(tq,{integration:t,onClose:()=>c(!1),onUpdate:g}),s.jsxs(L,{className:"mb-6",children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Product Scanning"}),s.jsx(We,{children:"Scan your Shopify store to find products and manage their alt text"})]}),s.jsxs(Ne,{children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(E,{onClick:w,disabled:h,className:"min-w-[150px]",children:h?s.jsxs(s.Fragment,{children:[s.jsx(rn,{className:"h-4 w-4 mr-2 animate-spin"}),"Scanning..."]}):s.jsxs(s.Fragment,{children:[s.jsx(rn,{className:"h-4 w-4 mr-2"}),"Scan Products"]})}),d.length>0&&s.jsxs(E,{variant:"outline",onClick:j,children:[s.jsx(Hc,{className:"h-4 w-4 mr-2"}),"Export Report"]}),t.last_sync_at&&s.jsxs("p",{className:"text-sm text-muted-foreground ml-auto",children:["Last synced: ",new Date(t.last_sync_at).toLocaleString()]})]}),h&&m>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx(Vn,{value:m,className:"h-2"}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["Scanning products... ",m,"%"]})]})]})]}),d.length>0&&s.jsx(eq,{products:d,integration:t,onProductUpdate:w}),!h&&d.length===0&&s.jsx(L,{className:"border-dashed",children:s.jsxs(Ne,{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(Ka,{className:"h-12 w-12 text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No Products Scanned Yet"}),s.jsx("p",{className:"text-muted-foreground text-center mb-6 max-w-md",children:'Click "Scan Products" to fetch your Shopify products and start managing their alt text'})]})})]})]}),s.jsx(JG,{open:i,onClose:()=>o(!1),onSuccess:x})]})}function rq({open:e,onClose:t,onSuccess:n}){const[r,a]=f.useState(""),[i,o]=f.useState(""),[l,c]=f.useState(""),[d,u]=f.useState(!1),[h,p]=f.useState(!1),[m,b]=f.useState(!1),[g,y]=f.useState(null),x=async()=>
732{if(!r||!i||!l){T.error("Please fill in all fields");return}p(!0),y(null);try{const{data:j,error:N}=await V.functions.invoke("wordpress-sync",{body:{action:"test_connection",site_url:r,username:i,app_password:l}});if(N)throw N;j.success?y({success:!0,message:`Successfully connected to ${j.site_name||r}`}):y({success:!1,message:j.error||"Connection test failed"})}catch(j){y({success:!1,message:j.message||"Failed to test connection"})}finally{p(!1)}},w=async()=>{if(!r||!i||!l){T.error("Please fill in all fields");return}if(!(g!=null&&g.success)){T.error("Please test the connection first");return}b(!0);try{const{data:{user:j}}=await V.auth.getUser();if(!j)throw new Error("Not authenticated");const{error:N}=await V.from("platform_integrations").upsert({user_id:j.id,platform:d?"woocommerce":"wordpress",status:"connected",store_url:r,api_token_encrypted:`${i}:${l}`,settings:{auto_generate:!1,alt_text_style:"descriptive",keywords:[],is_woocommerce:d}},{onConflict:"user_id,platform"});if(N)throw N;n()}catch(j){console.error("Error saving connection:",j),T.error(j.message||"Failed to save connection")}finally{b(!1)}},v=()=>{a(""),o(""),c(""),u(!1),y(null),t()};return s.jsx(pr,{open:e,onOpenChange:v,children:s.jsxs(zn,{className:"sm:max-w-[600px]",children:[s.jsxs(Wn,{children:[s.jsx(Hn,{className:"text-2xl",children:"Connect WordPress Site"}),s.jsx(ds,{children:"Enter your WordPress site credentials to connect Altify Pro"})]}),s.jsxs("div",{className:"space-y-6 py-4",children:[s.jsxs(kt,{children:[s.jsx(Ht,{className:"h-4 w-4"}),s.jsx(Ct,{children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"font-medium",children:"How to create WordPress Application Password:"}),s.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm",children:[s.jsx("li",{children:"Log in to your WordPress Admin Dashboard"}),s.jsx("li",{children:"Go to Users → Profile"}),s.jsx("li",{children:'Scroll down to "Application Passwords"'}),s.jsx("li",{children:'Enter a name (e.g., "Altify Pro") and click "Add New"'}),s.jsx("li",{children:"Copy the generated password and paste it below"})]}),s.jsxs("a",{href:"https://wordpress.org/support/article/application-passwords/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-sm text-primary hover:underline mt-2",children:["View detailed instructions",s.jsx(HS,{className:"h-3 w-3 ml-1"})]})]})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"site-url",children:"Site URL *"}),s.jsx(me,{id:"site-url",placeholder:"https://yoursite.com",value:r,onChange:j=>a(j.target.value),disabled:h||m}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter your WordPress site URL (include https://)"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"username",children:"WordPress Username *"}),s.jsx(me,{id:"username",placeholder:"admin",value:i,onChange:j=>o(j.target.value),disabled:h||m}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Your WordPress admin username"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"app-password",children:"Application Password *"}),s.jsx(me,{id:"app-password",type:"password",placeholder:"xxxx xxxx xxxx xxxx xxxx xxxx",value:l,onChange:j=>c(j.target.value),disabled:h||m}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Application Password from WordPress (not your regular password)"})]}),s.jsxs("div",{className:"flex items-center justify-between space-x-4 p-4 bg-muted/50 rounded-lg",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(se,{htmlFor:"woocommerce-toggle",children:"This is a WooCommerce store"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable WooCommerce-specific features for product management"})]}),s.jsx(wn,{id:"woocommerce-toggle",checked:d,onCheckedChange:u,disabled:h||m})]}),s.jsx(E,{variant:"outline",onClick:x,disabled:h||m||!r||!i||!l,className:"w-full",children:h?s.jsxs(s.Fragment,{children:[s.jsx(On,{className:"h-4 w-4 mr-2 animate-spin"}),"Testing Connection..."]}):"Test Connection"}),g&&s.jsxs(kt,{variant:g.success?"default":"destructive",children:[g.success?s.jsx(Dr,{className:"h-4 w-4"}):s.jsx(Ht,{className:"h-4 w-4"}),s.jsx(Ct,{children:g.message})]})]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(E,{variant:"outline",onClick:v,disabled:m,children:"Cancel"}),s.jsx(E,{onClick:w,disabled:!(g!=null&&g.success)||m,children:m?s.jsxs(s.Fragment,{children:[s.jsx(On,{className:"h-4 w-4 mr-2 animate-spin"}),"Connecting..."]}):"Connect Site"})]})]})})}function sq({media:e,integration:t,onMediaUpdate:n}){const[r,a]=f.useState([]),[i,o]=f.useState([]),[l,c]=f.useState(!1),d=b=>{a(b?e.map(g=>g.id):[])},u=(b,g)=>{a(g?[...r,b]:r.filter(y=>y!==b))},h=async b=>{var g;o([...i,b.id]);try{const{data:y,error:x}=await V.functions.invoke("wordpress-sync",{body:{action:"generate_alt_text",integration_id:t.
732id,media_id:b.id,media_url:b.source_url,settings:t.settings}});if(x)throw x;if(y.success)T.success(`Alt text generated for ${((g=b.title)==null?void 0:g.rendered)||"image"}`),n();else throw new Error(y.error||"Failed to generate alt text")}catch(y){console.error("Error generating alt text:",y),T.error(y.message||"Failed to generate alt text")}finally{o(i.filter(y=>y!==b.id))}},p=async()=>{if(r.length===0){T.error("Please select items to generate alt text");return}c(!0);const b=e.filter(g=>r.includes(g.id));try{const{data:g,error:y}=await V.functions.invoke("wordpress-sync",{body:{action:"generate_bulk",integration_id:t.id,media_items:b.map(x=>{var w;return{id:x.id,url:x.source_url,title:(w=x.title)==null?void 0:w.rendered}}),settings:t.settings}});if(y)throw y;T.success(`Generated alt text for ${g.success_count} of ${r.length} items`),a([]),n()}catch(g){console.error("Error generating bulk alt text:",g),T.error(g.message||"Failed to generate bulk alt text")}finally{c(!1)}},m=b=>b.alt_text&&b.alt_text.trim().length>0;return s.jsxs(L,{children:[s.jsx(Te,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(Ae,{children:"Media Library"}),s.jsxs(We,{children:[e.length," items • ",e.filter(m).length," with alt text"]})]}),r.length>0&&s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-sm text-muted-foreground",children:[r.length," selected"]}),s.jsx(E,{onClick:p,disabled:l,size:"sm",children:l?s.jsxs(s.Fragment,{children:[s.jsx(On,{className:"h-4 w-4 mr-2 animate-spin"}),"Generating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"h-4 w-4 mr-2"}),"Generate Selected (",r.length,")"]})})]})]})}),s.jsx(Ne,{children:s.jsx("div",{className:"rounded-md border",children:s.jsxs(Ho,{children:[s.jsx(Ko,{children:s.jsxs(ur,{children:[s.jsx($e,{className:"w-12",children:s.jsx(un,{checked:r.length===e.length&&e.length>0,onCheckedChange:d})}),s.jsx($e,{className:"w-20",children:"Image"}),s.jsx($e,{children:"Title"}),s.jsx($e,{children:"Alt Text"}),s.jsx($e,{className:"w-32",children:"Status"}),s.jsx($e,{className:"w-32 text-right",children:"Actions"})]})}),s.jsx(Go,{children:e.map(b=>{var x,w,v,j;const g=i.includes(b.id),y=m(b);return s.jsxs(ur,{children:[s.jsx(Ue,{children:s.jsx(un,{checked:r.includes(b.id),onCheckedChange:N=>u(b.id,N),disabled:g})}),s.jsx(Ue,{children:s.jsx("img",{src:((v=(w=(x=b.media_details)==null?void 0:x.sizes)==null?void 0:w.thumbnail)==null?void 0:v.source_url)||b.source_url,alt:b.alt_text||"",className:"w-16 h-16 object-cover rounded"})}),s.jsx(Ue,{className:"font-medium",children:((j=b.title)==null?void 0:j.rendered)||"Untitled"}),s.jsx(Ue,{children:y?s.jsxs("span",{className:"text-sm text-muted-foreground",children:[b.alt_text.substring(0,80),b.alt_text.length>80&&"..."]}):s.jsx("span",{className:"text-sm text-muted-foreground italic",children:"No alt text"})}),s.jsx(Ue,{children:y?s.jsxs(ae,{variant:"outline",className:"bg-success/10 text-success border-success/20",children:[s.jsx(Dr,{className:"h-3 w-3 mr-1"}),"Complete"]}):s.jsxs(ae,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20",children:[s.jsx(Ht,{className:"h-3 w-3 mr-1"}),"Missing"]})}),s.jsx(Ue,{className:"text-right",children:s.jsx(E,{size:"sm",variant:"outline",onClick:()=>h(b),disabled:g,children:g?s.jsx(On,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"h-4 w-4 mr-1"}),"Generate"]})})})]},b.id)})})]})})})]})}function aq({integration:e,onClose:t,onUpdate:n}){var c,d,u,h,p;const[r,a]=f.useState({auto_generate:((c=e.settings)==null?void 0:c.auto_generate)||!1,alt_text_style:((d=e.settings)==null?void 0:d.alt_text_style)||"descriptive",keywords:((h=(u=e.settings)==null?void 0:u.keywords)==null?void 0:h.join(", "))||"",is_woocommerce:((p=e.settings)==null?void 0:p.is_woocommerce)||!1}),[i,o]=f.useState(!1),l=async()=>{o(!0);try{const{error:m}=await V.from("platform_integrations").update({settings:{auto_generate:r.auto_generate,alt_text_style:r.alt_text_style,keywords:r.keywords.split(",").map(b=>b.trim()).filter(b=>b.length>0),is_woocommerce:r.is_woocommerce}}).eq("id",e.id);if(m)throw m;T.success("Settings saved successfully"),n(),t()}catch(m){console.error("Error saving settings:",m),T.error(m.message||"Failed to save settings")}finally{o(!1)}};return s.jsxs(L,{className:"mb-6 border-primary/20",children:[s.jsx(Te,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(Ae,{children:"WordPress Settings"}),s.jsx(We,{children:"Configure how Altify Pro generates alt text for your WordPress media"})]}),s.jsx(E,{variant:"ghost",size:"icon",onClick:t,children:s.jsx(cs,{className:"h-4 w-4"})})]})}),s.jsxs(Ne,{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between space-x-4",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(se,{htmlFor:"woocommerce-mode",children:"WooCommerce Mode"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable product-specific features for WooCommerce stores"})]}),s.jsx(wn,{id:"woocommerce-mode",checked:r.is_woocommerce,onCheckedChange:m=>a({...r,is_woocommerce:m})})]}),s.jsxs("div",{className:"flex items-center justify-between space-x-4",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(se,{htmlFor:"auto-generate",children:"Auto-generate for new uploads"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Automatically generate alt text when new images are uploaded to WordPress"})]}),s.jsx(wn,{id:"auto-generate",checked:r.auto_generate,onCheckedChange:m=>a({...r,auto_generate:m})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"alt-text-style",children:"Alt Text Style"}),s.jsxs(Dt,{value:r.alt_text_style,onValueChange:m=>a({...r,alt_text_style:m}),children:[s.jsx(_t,{id:"alt-text-style",children:s.jsx(Lt,{})}),s.jsxs(Et,{children:[s.jsx(X,{value:"descriptive",children:"Descriptive - Detailed descriptions for accessibility"}),s.jsx(X,{value:"seo",children:"SEO-focused - Optimized for search engines"}),s.jsx(X,{value:"concise",children:"Concise - Brief and essential information only"}),s.jsx(X,{value:"ecommerce",children:"E-commerce - Product-focused with features"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose the style that best fits your content and SEO strategy"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"keywords",children:"SEO Keywords (optional)"}),s.jsx(me,{id:"keywords",placeholder:"organic, handmade, sustainable...",value:r.keywords,onChange:m=>a({...r,keywords:m.target.value})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Comma-separated keywords to include in generated alt text for better SEO"})]}),s.jsx("div",{className:"flex justify-end pt-4 border-t",children:s.jsx(E,{onClick:l,disabled:i,children:i?"Saving...":s.jsxs(s.Fragment,{children:[s.jsx(Fh,{className:"h-4 w-4 mr-2"}),"Save Settings"]})})})]})]})}function iq(){var M;const e=hr(),[t,n]=f.useState(null),[r,a]=f.useState(!0),[i,o]=f.useState(!1),[l,c]=f.useState(!1),[d,u]=f.useState([]),[h,p]=f.useState([]),[m,b]=f.useState(!1),[g,y]=f.useState(!1),[x,w]=f.useState(0),[v,j]=f.useState({total:0,withAlt:0,withoutAlt:0});f.useEffect(()=>{N()},[]);const N=async()=>{try{const{data:{user:K}}=await V.auth.getUser();if(!K){e("/auth");return}const{data:z,error:I}=await V.from("platform_integrations").select("*").eq("user_id",K.id).in("platform",["wordpress","woocommerce"]).single();if(I&&I.code!=="PGRST116")throw I;n(z),z||o(!0)}catch(K){console.error("Error fetching integration:",K),T.error("Failed to load WordPress 
732integration")}finally{a(!1)}},S=async()=>{o(!0)},k=()=>{o(!1),N(),T.success("Successfully connected to WordPress!")},C=async()=>{var K,z,I,P;if(t){b(!0),w(0);try{const{data:_,error:U}=await V.functions.invoke("wordpress-sync",{body:{action:"fetch_media",integration_id:t.id}});if(U)throw U;u(_.media||[]),w(100);const Z=((K=_.media)==null?void 0:K.filter(ee=>{var ie;return(ie=ee.alt_text)==null?void 0:ie.trim()}).length)||0;j({total:((z=_.media)==null?void 0:z.length)||0,withAlt:Z,withoutAlt:(((I=_.media)==null?void 0:I.length)||0)-Z}),T.success(`Found ${((P=_.media)==null?void 0:P.length)||0} media items`)}catch(_){console.error("Error scanning media:",_),T.error(_.message||"Failed to scan media library")}finally{b(!1)}}},A=async()=>{var K,z;if(!(!t||!((K=t.settings)!=null&&K.is_woocommerce))){y(!0);try{const{data:I,error:P}=await V.functions.invoke("wordpress-sync",{body:{action:"fetch_woocommerce_products",integration_id:t.id}});if(P)throw P;p(I.products||[]),T.success(`Found ${((z=I.products)==null?void 0:z.length)||0} products`)}catch(I){console.error("Error scanning products:",I),T.error(I.message||"Failed to scan products")}finally{y(!1)}}},R=async()=>{if(t)try{const{error:K}=await V.from("platform_integrations").delete().eq("id",t.id);if(K)throw K;T.success("Disconnected from WordPress"),e("/integrations")}catch(K){console.error("Error disconnecting:",K),T.error("Failed to disconnect")}},G=()=>{if(d.length===0){T.error("No media to export");return}const K=[["ID","Title","URL","Alt Text","Status"],...d.map(_=>{var U,Z;return[_.id,((U=_.title)==null?void 0:U.rendered)||"Untitled",_.source_url,_.alt_text||"",(Z=_.alt_text)!=null&&Z.trim()?"Complete":"Missing"]})].map(_=>_.join(",")).join(`
733`),z=new Blob([K],{type:"text/csv"}),I=URL.createObjectURL(z),P=document.createElement("a");P.href=I,P.download=`wordpress-alt-text-report-${new Date().toISOString().split("T")[0]}.csv`,P.click(),URL.revokeObjectURL(I),T.success("Report exported successfully")};if(r)return s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx(rn,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"Loading integration..."})]})});const W=(t==null?void 0:t.status)==="connected",$=(M=t==null?void 0:t.settings)==null?void 0:M.is_woocommerce;return s.jsxs("div",{className:"min-h-screen bg-background p-8",children:[s.jsxs("div",{className:"max-w-7xl mx-auto",children:[s.jsxs(E,{variant:"ghost",onClick:()=>e("/integrations"),className:"mb-6",children:[s.jsx(BS,{className:"h-4 w-4 mr-2"}),"Back to Integrations"]}),s.jsx(L,{className:"mb-6 border-primary/20",children:s.jsx(Te,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"p-3 rounded-lg bg-primary/10",children:$?s.jsx(Gu,{className:"h-8 w-8 text-primary"}):s.jsx(Bn,{className:"h-8 w-8 text-primary"})}),s.jsxs("div",{children:[s.jsxs(Ae,{className:"text-2xl",children:[$?"WooCommerce":"WordPress"," Integration"]}),(t==null?void 0:t.store_url)&&s.jsx(We,{className:"text-base mt-1",children:t.store_name||t.store_url})]})]}),s.jsx("div",{className:"flex items-center gap-3",children:W?s.jsxs(s.Fragment,{children:[s.jsxs(ae,{className:"bg-success text-success-foreground",children:[s.jsx(Dr,{className:"h-3 w-3 mr-1"}),"Connected"]}),s.jsxs(E,{variant:"outline",size:"sm",onClick:()=>c(!l),children:[s.jsx(Mo,{className:"h-4 w-4 mr-2"}),"Settings"]}),s.jsx(E,{variant:"outline",size:"sm",onClick:R,children:"Disconnect"})]}):s.jsxs(s.Fragment,{children:[s.jsxs(ae,{variant:"outline",className:"border-muted-foreground/30",children:[s.jsx(Ht,{className:"h-3 w-3 mr-1"}),"Not Connected"]}),s.jsx(E,{onClick:S,children:"Connect WordPress"})]})})]})})}),W&&s.jsxs(s.Fragment,{children:[l&&s.jsx(aq,{integration:t,onClose:()=>c(!1),onUpdate:N}),v.total>0&&s.jsxs(L,{className:"mb-6",children:[s.jsx(Te,{children:s.jsx(Ae,{children:"Media Library Statistics"})}),s.jsxs(Ne,{children:[s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-3xl font-bold",children:v.total}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Images"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-3xl font-bold text-success",children:v.withAlt}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"With Alt Text"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-3xl font-bold text-destructive",children:v.withoutAlt}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Missing Alt Text"})]})]}),s.jsx(Vn,{value:v.withAlt/v.total*100,className:"mt-4"}),s.jsxs("p",{className:"text-sm text-muted-foreground text-center mt-2",children:[Math.round(v.withAlt/v.total*100),"% complete"]})]})]}),s.jsxs(ca,{defaultValue:"media",className:"space-y-6",children:[s.jsxs(us,{children:[s.jsx(De,{value:"media",children:"Media Library"}),$&&s.jsx(De,{value:"products",children:"Products"})]}),s.jsxs(it,{value:"media",className:"space-y-6",children:[s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Media Library"}),s.jsx(We,{children:"Scan and manage alt text for your WordPress media library"})]}),s.jsxs(Ne,{children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(E,{onClick:C,disabled:m,className:"min-w-[150px]",children:m?s.jsxs(s.Fragment,{children:[s.jsx(rn,{className:"h-4 w-4 mr-2 animate-spin"}),"Scanning..."]}):s.jsxs(s.Fragment,{children:[s.jsx(rn,{className:"h-4 w-4 mr-2"}),"Scan Media Library"]})}),d.length>0&&s.jsxs(E,{variant:"outline",onClick:G,children:[s.jsx(Hc,{className:"h-4 w-4 mr-2"}),"Export Report"]}),t.last_sync_at&&s.jsxs("p",{className:"text-sm text-muted-foreground ml-auto",children:["Last synced: ",new Date(t.last_sync_at).toLocaleStr
733ing()]})]}),m&&x>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx(Vn,{value:x,className:"h-2"}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["Scanning media... ",x,"%"]})]})]})]}),d.length>0&&s.jsx(sq,{media:d,integration:t,onMediaUpdate:C}),!m&&d.length===0&&s.jsx(L,{className:"border-dashed",children:s.jsxs(Ne,{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(Bn,{className:"h-12 w-12 text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No Media Scanned Yet"}),s.jsx("p",{className:"text-muted-foreground text-center mb-6 max-w-md",children:'Click "Scan Media Library" to fetch your WordPress media and start managing alt text'})]})})]}),$&&s.jsxs(it,{value:"products",className:"space-y-6",children:[s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"WooCommerce Products"}),s.jsx(We,{children:"Manage alt text for your product images"})]}),s.jsx(Ne,{children:s.jsx(E,{onClick:A,disabled:g,children:g?s.jsxs(s.Fragment,{children:[s.jsx(rn,{className:"h-4 w-4 mr-2 animate-spin"}),"Scanning..."]}):s.jsxs(s.Fragment,{children:[s.jsx(rn,{className:"h-4 w-4 mr-2"}),"Scan Products"]})})})]}),!g&&h.length===0&&s.jsx(L,{className:"border-dashed",children:s.jsxs(Ne,{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(Gu,{className:"h-12 w-12 text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No Products Scanned Yet"}),s.jsx("p",{className:"text-muted-foreground text-center mb-6 max-w-md",children:'Click "Scan Products" to fetch your WooCommerce products'})]})})]})]})]})]}),s.jsx(rq,{open:i,onClose:()=>o(!1),onSuccess:k})]})}function oq({open:e,onOpenChange:t,onSuccess:n}){const[r,a]=f.useState(!1),[i,o]=f.useState(""),[l,c]=f.useState(""),[d,u]=f.useState(""),h=async()=>{if(!i.trim()||!l.trim()){T.error("Please fill in all required fields");return}a(!0);try{const{data:{user:p}}=await V.auth.getUser();if(!p){T.error("You must be logged in");return}const{data:m,error:b}=await V.functions.invoke("wix-sync",{body:{action:"test_connection",site_id:i,api_key:l}});if(b||!(m!=null&&m.success)){T.error((m==null?void 0:m.error)||"Failed to connect to Wix. Please check your credentials."),a(!1);return}const{error:g}=await V.from("platform_integrations").insert({user_id:p.id,platform:"wix",status:"connected",store_name:d||m.site_name||i,store_url:`https://${i}.wixsite.com`,api_token_encrypted:l,settings:{site_id:i,auto_sync:!1,alt_text_style:"descriptive"}});if(g){console.error("Save error:",g),T.error("Failed to save integration"),a(!1);return}T.success("Wix site connected successfully!"),n(),t(!1),o(""),c(""),u("")}catch(p){console.error("Connection error:",p),T.error("Failed to connect to Wix")}finally{a(!1)}};return s.jsx(pr,{open:e,onOpenChange:t,children:s.jsxs(zn,{className:"sm:max-w-md",children:[s.jsxs(Wn,{children:[s.jsx(Hn,{children:"Connect Wix Site"}),s.jsx(ds,{children:"Enter your Wix site details to connect and start generating alt text."})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"site_id",children:"Site ID *"}),s.jsx(me,{id:"site_id",placeholder:"your-site-id",value:i,onChange:p=>o(p.target.value),disabled:r}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Found in your Wix dashboard URL or site settings"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"api_key",children:"API Key *"}),s.jsx(me,{id:"api_key",type:"password",placeholder:"Enter your Wix API key",value:l,onChange:p=>c(p.target.value),disabled:r}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate this in your Wix Developer Console"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"site_name",children:"Site Name (Optional)"}),s.jsx(me,{id:"site_name",placeholder:"My Wix Store",value:d,onChange:p=>u(p.target.value),disabled:r})]})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(E,{variant:"outline",onClick:()=>t(!1),disabled:r,children:"Cancel"}),s.jsx(E,{onClick:h,disabled:r,children:r?"Connecting...":"Connect Wix"})]})]})})}function lq({media:e,loading:t,onGenerateSingle:n,onGenerateBulk:r,onRefresh:a}){const[i,o]=f.useState([]),l=d=>{o(u=>u.includes(d)?u.filter(h=>h!==d):[...u,d])},c=()=>{o(d=>d.length===e.length?[]:e.map(u=>u.id))};return t?s.jsx("div",{className:"space-y-3",children:[1,2,3].map(d=>s.jsx(Ua,{className:"h-16 w-full"},d))}):e.length===0?s.jsxs("div",{className:"text-center py-12 border border-dashed rounded-lg",children:[s.jsx("p",{className:"text-muted-foreground",children:"No media found in your Wix site"}),s.jsxs(E,{onClick:a,variant:"outline",className:"mt-4",children:[s.jsx(rn,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:i.length>0?`${i.length} selected`:`${e.length} items`}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(E,{onClick:a,variant:"outline",size:"sm",children:s.jsx(rn,{className:"h-4 w-4"})}),i.length>0&&s.jsxs(E,{onClick:()=>r(i),size:"sm",children:[s.jsx(Nt,{className:"mr-2 h-4 w-4"}),"Generate for ",i.length," items"]})]})]}),s.jsx("div",{className:"border rounded-lg",children:s.jsxs(Ho,{children:[s.jsx(Ko,{children:s.jsxs(ur,{children:[s.jsx($e,{className:"w-12",children:s.jsx(un,{checked:i.length===e.length,onCheckedChange:c})}),s.jsx($e,{children:"Image"}),s.jsx($e,{children:"File Name"}),s.jsx($e,{children:"Alt Text"}),s.jsx($e,{children:"Folder"}),s.jsx($e,{className:"text-right",children:"Actions"})]})}),s.jsx(Go,{children:e.map(d=>s.jsxs(ur,{children:[s.jsx(Ue,{children:s.jsx(un,{checked:i.includes(d.id),onCheckedChange:()=>l(d.id)})}),s.jsx(Ue,{children:s.jsx("img",{src:d.url,alt:d.file_name,className:"h-12 w-12 object-cover rounded"})}),s.jsx(Ue,{className:"font-medium",children:d.file_name}),s.jsx(Ue,{children:d.alt_text?s.jsx("span",{className:"text-sm text-muted-foreground line-clamp-2",children:d.alt_text}):s.jsx(ae,{variant:"secondary",children:"Missing"})}),s.jsx(Ue,{children:s.jsx("span",{className:"text-sm text-muted-foreground",children:d.parent_folder||"Root"})}),s.jsx(Ue,{className:"text-right",children:s.jsxs(E,{size:"sm",onClick:()=>n(d.id,d.url,d.file_name),children:[s.jsx(Nt,{className:"mr-2 h-4 w-4"}),"Generate"]})})]},d.id))})]})})]})}function cq({integrationId:e}){const[t,n]=f.useState(!1),[r,a]=f.useState(!1),[i,o]=f.useState("descriptive"),[l,c]=f.useState("en"),[d,u]=f.useState(""),[h,p]=f.useState("professional");f.useEffect(()=>{m()},[e]);const m=async()=>{const{data:g,error:y}=await V.from("platform_integrations").select("settings").eq("id",e).single();if(y){console.error("Failed to load settings:",y);return}if(g!=null&&g.settings){const x=g.settings;a(x.auto_sync||!1),o(x.alt_text_style||"descriptive"),c(x.language||"en"),u(x.keywords||""),p(x.brand_voice||"professional")}},b=async()=>{n(!0);const{error:g}=await V.from("platform_integrations").update({settings:{auto_sync:r,alt_text_style:i,language:l,keywords:d,brand_voice:h}}).eq("id",e);g?(T.error("Failed to save settings"),console.error(g)):T.success("Settings saved successfully"),n(!1)};return s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Wix Integration Settings"}),s.jsx(We,{children:"Configure how alt text is generated for your Wix media"})]}),s.jsxs(Ne,{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(se,{children:"Auto-sync"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Automatically generate alt text for new uploads"})]}),s.jsx(wn,{checked:r,onCheckedChange:a})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{children:"Alt Text Style"}),s.jsxs(Dt,{value:i,onValueChange:o,children:[s.jsx(_t,{children:s.jsx(Lt,{})}),s.jsxs(Et,{children:[s.jsx(X,{value:"descriptive",children:"Descriptive (Accessibility-focused)"}),s.jsx(X,{value:"seo",children:"SEO-focused (Keyword-rich)"}),s.jsx(X,{value:"concise",children:"Concise (Brief)"}),s.jsx(X,{value:"ecommerce",children:"E-commerce (Product-focused)"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{children:"Language"}),s.jsxs(Dt,{value:l,onValueChange:c,children:[s.jsx(_t,{children:s.jsx(Lt,{})}),s.jsxs(Et,{children:[s.jsx(X,{value:"en",children:"English"}),s.jsx(X,{value:"es",children:"Spanish"}),s.jsx(X,{value:"fr",children:"French"}),s.jsx(X,{value:"de",children:"German"}),s.jsx(X,{value:"it",children:"Italian"}),s.jsx(X,{value:"pt",children:"Portuguese"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{children:"Custom Keywords"}),s.jsx(me,{placeholder:"keyword1, keyword2, keyword3",value:d,onChange:g=>u(g.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Comma-separated keywords to include naturally in alt text"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{children:"Brand Voice"}),s.jsxs(Dt,{value:h,onValueChange:p,children:[s.jsx(_t,{children:s.jsx(Lt,{})}),s.jsxs(Et,{children:[s.jsx(X,{value:"professional",children:"Professional"}),s.jsx(X,{value:"casual",children:"Casual"}),s.jsx(X,{value:"luxury",children:"Luxury"}),s.jsx(X,{value:"friendly",children:"Friendly"}),s.jsx(X,{value:"technical",children:"Technical"})]})]})]})]}),s.jsx(E,{onClick:b,disabled:t,className:"w-full",children:t?"Saving...":"Save Settings"})]})]})}function dq(){const[e,t]=f.useState(!1),[n,r]=f.useState(null),[a,i]=f.useState([]),[o,l]=f.useState(!0),[c,d]=f.useState(!1);f.useEffect(()=>{u()},[]);const u=async()=>
733{l(!0);const{data:{user:g}}=await V.auth.getUser();if(!g)return;const{data:y,error:x}=await V.from("platform_integrations").select("*").eq("user_id",g.id).eq("platform","wix").maybeSingle();x?console.error("Error fetching integration:",x):y&&(r(y),h(y)),l(!1)},h=async g=>{d(!0);try{const{data:y,error:x}=await V.functions.invoke("wix-sync",{body:{action:"fetch_media",integration_id:g.id,site_id:g.settings.site_id,api_key:g.api_token_encrypted}});if(x)throw x;y!=null&&y.media&&i(y.media)}catch(y){console.error("Error fetching media:",y),T.error("Failed to fetch media from Wix")}finally{d(!1)}},p=async(g,y,x)=>{if(n){T.loading("Generating alt text...",{id:g});try{const{data:w,error:v}=await V.functions.invoke("wix-sync",{body:{action:"generate_alt_text",integration_id:n.id,site_id:n.settings.site_id,api_key:n.api_token_encrypted,media_id:g,image_url:y,file_name:x,style:n.settings.alt_text_style||"descriptive",language:n.settings.language||"en",keywords:n.settings.keywords||""}});if(v)throw v;T.success("Alt text generated and updated!",{id:g}),h(n)}catch(w){console.error("Error generating alt text:",w),T.error("Failed to generate alt text",{id:g})}}},m=async g=>{if(n){T.loading(`Generating alt text for ${g.length} items...`,{id:"bulk"});try{const{data:y,error:x}=await V.functions.invoke("wix-sync",{body:{action:"generate_bulk",integration_id:n.id,site_id:n.settings.site_id,api_key:n.api_token_encrypted,media_ids:g,media_list:a.filter(w=>g.includes(w.id)),style:n.settings.alt_text_style||"descriptive",language:n.settings.language||"en",keywords:n.settings.keywords||""}});if(x)throw x;T.success(`Successfully generated alt text for ${(y==null?void 0:y.success_count)||g.length} items!`,{id:"bulk"}),h(n)}catch(y){console.error("Error in bulk generation:",y),T.error("Failed to generate alt text",{id:"bulk"})}}},b=async()=>{if(!n||!window.confirm("Are you sure you want to disconnect your Wix site?"))return;const{error:y}=await V.from("platform_integrations").delete().eq("id",n.id);y?T.error("Failed to disconnect"):(T.success("Wix site disconnected"),r(null),i([]))};return o?s.jsx("div",{className:"p-8",children:"Loading..."}):n?s.jsxs("div",{className:"container max-w-7xl py-8",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold",children:"Wix Integration"}),s.jsxs("p",{className:"text-muted-foreground",children:["Connected to: ",n.store_name]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{variant:n.status==="connected"?"default":"secondary",children:n.status}),s.jsxs(E,{variant:"outline",size:"sm",onClick:b,children:[s.jsx(ek,{className:"mr-2 h-4 w-4"}),"Disconnect"]})]})]}),s.jsxs(ca,{defaultValue:"media",className:"space-y-4",children:[s.jsxs(us,{children:[s.jsx(De,{value:"media",children:"Media Manager"}),s.jsxs(De,{value:"settings",children:[s.jsx(Mo,{className:"mr-2 h-4 w-4"}),"Settings"]})]}),s.jsx(it,{value:"media",children:s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Wix Media Library"}),s.jsx(We,{children:"Select images to generate alt text for"})]}),s.jsx(Ne,{children:s.jsx(lq,{media:a,loading:c,onGenerateSingle:p,onGenerateBulk:m,onRefresh:()=>h(n)})})]})}),s.jsx(it,{value:"settings",children:s.jsx(cq,{integrationId:n.id})})]})]}):s.jsxs("div",{className:"container max-w-4xl py-8",children:[s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Connect Your Wix Site"}),s.jsx(We,{children:"Generate SEO-optimized alt text for all images in your Wix media manager"})]}),s.jsxs(Ne,{children:[s.jsxs(kt,{className:"mb-4",children:[s.jsx(Ht,{className:"h-4 w-4"}),s.jsx(Ct,{children:"You'll need your Wix Site ID and API Key. Find these in your Wix Developer Console."})]}),s.jsx(E,{onClick:()=>t(!0),children:"Connect Wix Site"})]})]}),s.jsx(oq,{open:e,onOpenChange:t,onSuccess:u})]})}function uq({open:e,onOpenChange:t,onSuccess:n}){const[r,a]=f.useState(!1),[i,o]=f.useState(""),[l,c]=f.useState(""),[d,u]=f.useState(""),h=async()=>{if(!i.trim()||!l.trim()){T.error("Please fill in all required fields");return}a(!0);try{const{data:{user:p}}=await V.auth.getUser();if(!p){T.error("You must be logged in");return}const{data:m,error:b}=await V.functions.invoke("squarespace-sync",{body:{action:"test_connection",site_url:i,api_key:l}});if(b||!(m!=null&&m.success)){T.error((m==null?void 0:m.error)||"Failed to connect to Squarespace. Please check your credentials."),a(!1);return}const{error:g}=await V.from("platform_integrations").insert({user_id:p.id,platform:"squarespace",status:"connected",store_name:d||m.site_name||i,store_url:i,api_token_encrypted:l,settings:{auto_sync:!1,alt_text_style:"descriptive",scan_pages:!0}});if(g){console.error("Save error:",g),T.error("Failed to save integration"),a(!1);return}T.success("Squarespace site connected successfully!"),n(),t(!1),o(""),c(""),u("")}catch(p){console.error("Connection error:",p),T.error("Failed to connect to Squarespace")}finally{a(!1)}};return s.jsx(pr,{open:e,onOpenChange:t,children:s.jsxs(zn,{className:"sm:max-w-md",children:[s.jsxs(Wn,{children:[s.jsx(Hn,{children:"Connect Squarespace Site"}),s.jsx(ds,{children:"Enter your Squarespace site details to connect and start generating alt text."})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"site_url",children:"Site URL *"}),s.jsx(me,{id:"site_url",placeholder:"https://yoursite.squarespace.com",value:i,onChange:p=>o(p.target.value),disabled:r}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Your full Squarespace site URL"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"api_key",children:"API Key *"}),s.jsx(me,{id:"api_key",type:"password",placeholder:"Enter your Squarespace API key",value:l,onCh
733ange:p=>c(p.target.value),disabled:r}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate this in your Squarespace Developer settings"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{htmlFor:"site_name",children:"Site Name (Optional)"}),s.jsx(me,{id:"site_name",placeholder:"My Squarespace Site",value:d,onChange:p=>u(p.target.value),disabled:r})]})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(E,{variant:"outline",onClick:()=>t(!1),disabled:r,children:"Cancel"}),s.jsx(E,{onClick:h,disabled:r,children:r?"Connecting...":"Connect Squarespace"})]})]})})}function hq({integrationId:e,siteUrl:t,apiKey:n,onGenerateBulk:r}){const[a,i]=f.useState(!1),[o,l]=f.useState([]),[c,d]=f.useState(!1),u=async()=>{i(!0),d(!1);try{const{supabase:p}=await qa(async()=>{const{supabase:g}=await Promise.resolve().then(()=>RV);return{supabase:g}},void 0),{data:m,error:b}=await p.functions.invoke("squarespace-sync",{body:{action:"scan_pages",integration_id:e,site_url:t,api_key:n}});if(b)throw b;m!=null&&m.images&&(l(m.images),d(!0))}catch(p){console.error("Error scanning pages:",p);const{toast:m}=await qa(async()=>{const{toast:b}=await Promise.resolve().then(()=>JO);return{toast:b}},void 0);m.error("Failed to scan pages")}finally{i(!1)}},h=o.filter(p=>!p.has_alt);return s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Page Scanner"}),s.jsx(We,{children:"Scan all pages in your Squarespace site to find images missing alt text"})]}),s.jsxs(Ne,{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(E,{onClick:u,disabled:a,children:[s.jsx(Kc,{className:"mr-2 h-4 w-4"}),a?"Scanning...":"Scan All Pages"]}),c&&s.jsxs(ae,{variant:"outline",children:["Found ",o.length," images (",h.length," missing alt text)"]})]}),a&&s.jsxs("div",{className:"space-y-3",children:[s.jsx(Ua,{className:"h-12 w-full"}),s.jsx(Ua,{className:"h-12 w-full"}),s.jsx(Ua,{className:"h-12 w-full"})]}),c&&o.length===0&&s.jsxs(kt,{children:[s.jsx(Ht,{className:"h-4 w-4"}),s.jsx(Ct,{children:"No images found on your site pages."})]}),c&&h.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs(kt,{children:[s.jsx(Ht,{className:"h-4 w-4"}),s.jsxs(Ct,{children:["Found ",h.length," images without alt text. Generate alt text to improve accessibility and SEO."]})]}),s.jsxs(E,{onClick:()=>r(h),className:"w-full",children:[s.jsx(Nt,{className:"mr-2 h-4 w-4"}),"Generate Alt Text for ",h.length," Images"]}),s.jsxs("div",{className:"border rounded-lg",children:[s.jsxs(Ho,{children:[s.jsx(Ko,{children:s.jsxs(ur,{children:[s.jsx($e,{children:"Image"}),s.jsx($e,{children:"Page"}),s.jsx($e,{children:"Status"})]})}),s.jsx(Go,{children:h.slice(0,10).map((p,m)=>s.jsxs(ur,{children:[s.jsx(Ue,{children:s.jsx("img",{src:p.url,alt:"",className:"h-12 w-12 object-cover rounded"})}),s.jsx(Ue,{children:s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:p.page_title}),s.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-xs",children:p.page_url})]})}),s.jsx(Ue,{children:s.jsx(ae,{variant:"secondary",children:"Missing Alt"})})]},m))})]}),h.length>10&&s.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground border-t",children:["And ",h.length-10," more images..."]})]})]})]})]})}function fq({products:e,loading:t,onGenerateSingle:n,onGenerateBulk:r,onRefresh:a}){const[i,o]=f.useState([]),l=d=>{o(u=>u.includes(d)?u.filter(h=>h!==d):[...u,d])},c=()=>{o(d=>d.length===e.length?[]:e.map(u=>u.id))};return t?s.jsx("div",{className:"space-y-3",children:[1,2,3].map(d=>s.jsx(Ua,{className:"h-16 w-full"},d))}):e.length===0?s.jsxs("div",{className:"text-center py-12 border border-dashed rounded-lg",children:[s.jsx("p",{className:"text-muted-foreground",children:"No products found in your Squarespace store"}),s.jsxs(E,{onClick:a,variant:"outline",className:"mt-4",children:[s.jsx(rn,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:i.length>0?`${i.length} selected`:`${e.length} products`}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(E,{onClick:a,variant:"outline",size:"sm",children:s.jsx(rn,{className:"h-4 w-4"})}),i.length>0&&s.jsxs(E,{onClick:()=>r(i),size:"sm",children:[s.jsx(Nt,{className:"mr-2 h-4 w-4"}),"Generate for ",i.length," products"]})]})]}),s.jsx("div",{className:"border rounded-lg",children:s.jsxs(Ho,{children:[s.jsx(Ko,{children:s.jsxs(ur,{children:[s.jsx($e,{className:"w-12",children:s.jsx(un,{checked:i.length===e.length,onCheckedChange:c})}),s.jsx($e,{children:"Image"}),s.jsx($e,{children:"Product"}),s.jsx($e,{children:"Alt Text"}),s.jsx($e,{children:"Price"}),s.jsx($e,{className:"text-right",children:"Actions"})]})}),s.jsx(Go,{children:e.map(d=>s.jsxs(ur,{children:[s.jsx(Ue,{children:s.jsx(un,{checked:i.includes(d.id),onCheckedChange:()=>l(d.id)})}),s.jsx(Ue,{children:d.main_image_url&&s.jsx("img",{src:d.main_image_url,alt:d.title,className:"h-12 w-12 object-cover rounded"})}),s.jsx(Ue,{className:"font-medium",children:d.title}),s.jsx(Ue,{children:d.alt_text?s.jsx("span",{className:"text-sm text-muted-foreground line-clamp-2",children:d.alt_text}):s.jsx(ae,{variant:"secondary",children:"Missing"})}),s.jsx(Ue,{children:d.price&&s.jsxs("span",{className:"text-sm",children:["$",d.price.toFixed(2)]})}),s.jsx(Ue,{className:"text-right",children:d.main_image_url&&s.jsxs(E,{size:"sm",onClick:()=>n(d.id,d.main_image_url,d.title),children:[s.jsx(Nt,{className:"mr-2 h-4 w-4"}),"Generate"]})})]},d.id))})]})})]})}function mq({integrationId:e}){const[t,n]=f.useState(!1),[r,a]=f.useState(!1),[i,o]=f.useState(!0),[l,c]=f.useState("descriptive"),[d,u]=f.useState("en"),[h,p]=f.useState(""),[m,b]=f.useState("professional");f.useEffect(()=>{g()},[e]);const g=async()=>{const{data:x,error:w}=await V.from("platform_integrations").select("settings").eq("id",e).single();if(w){console.error("Failed to load settings:",w);return}
733if(x!=null&&x.settings){const v=x.settings;a(v.auto_sync||!1),o(v.scan_pages!==!1),c(v.alt_text_style||"descriptive"),u(v.language||"en"),p(v.keywords||""),b(v.brand_voice||"professional")}},y=async()=>{n(!0);const{error:x}=await V.from("platform_integrations").update({settings:{auto_sync:r,scan_pages:i,alt_text_style:l,language:d,keywords:h,brand_voice:m}}).eq("id",e);x?(T.error("Failed to save settings"),console.error(x)):T.success("Settings saved successfully"),n(!1)};return s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Squarespace Integration Settings"}),s.jsx(We,{children:"Configure how alt text is generated for your Squarespace site"})]}),s.jsxs(Ne,{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(se,{children:"Enable Page Scanning"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan all pages to find images missing alt text"})]}),s.jsx(wn,{checked:i,onCheckedChange:o})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(se,{children:"Auto-sync"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Automatically generate alt text for new uploads"})]}),s.jsx(wn,{checked:r,onCheckedChange:a})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{children:"Alt Text Style"}),s.jsxs(Dt,{value:l,onValueChange:c,children:[s.jsx(_t,{children:s.jsx(Lt,{})}),s.jsxs(Et,{children:[s.jsx(X,{value:"descriptive",children:"Descriptive (Accessibility-focused)"}),s.jsx(X,{value:"seo",children:"SEO-focused (Keyword-rich)"}),s.jsx(X,{value:"concise",children:"Concise (Brief)"}),s.jsx(X,{value:"ecommerce",children:"E-commerce (Product-focused)"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{children:"Language"}),s.jsxs(Dt,{value:d,onValueChange:u,children:[s.jsx(_t,{children:s.jsx(Lt,{})}),s.jsxs(Et,{children:[s.jsx(X,{value:"en",children:"English"}),s.jsx(X,{value:"es",children:"Spanish"}),s.jsx(X,{value:"fr",children:"French"}),s.jsx(X,{value:"de",children:"German"}),s.jsx(X,{value:"it",children:"Italian"}),s.jsx(X,{value:"pt",children:"Portuguese"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{children:"Custom Keywords"}),s.jsx(me,{placeholder:"keyword1, keyword2, keyword3",value:h,onChange:x=>p(x.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Comma-separated keywords to include naturally in alt text"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(se,{children:"Brand Voice"}),s.jsxs(Dt,{value:m,onValueChange:b,children:[s.jsx(_t,{children:s.jsx(Lt,{})}),s.jsxs(Et,{children:[s.jsx(X,{value:"professional",children:"Professional"}),s.jsx(X,{value:"casual",children:"Casual"}),s.jsx(X,{value:"luxury",children:"Luxury"}),s.jsx(X,{value:"friendly",children:"Friendly"}),s.jsx(X,{value:"technical",children:"Technical"})]})]})]})]}),s.jsx(E,{onClick:y,disabled:t,className:"w-full",children:t?"Saving...":"Save Settings"})]})]})}function pq(){const[e,t]=f.useState(!1),[n,r]=f.useState(null),[a,i]=f.useState([]),[o,l]=f.useState(!0),[c,d]=f.useState(!1);f.useEffect(()=>{u()},[]);const u=async()=>{l(!0);const{data:{user:y}}=await V.auth.getUser();if(!y)return;const{data:x,error:w}=await V.from("platform_integrations").select("*").eq("user_id",y.id).eq("platform","squarespace").maybeSingle();w?console.error("Error fetching integration:",w):x&&(r(x),h(x)),l(!1)},h=async y=>{d(!0);try{const{data:x,error:w}=await V.functions.invoke("squarespace-sync",{body:{action:"fetch_products",integration_id:y.id,site_url:y.store_url,api_key:y.api_token_encrypted}});if(w)throw w;x!=null&&x.products&&i(x.products)}catch(x){console.error("Error fetching products:",x),T.error("Failed to fetch products from Squarespace")}finally{d(!1)}},p=async(y,x,w)=>{if(n){T.loading("Generating alt text...",{id:y});try{const{data:v,error:j}=await V.functions.invoke("squarespace-sync",{body:{action:"generate_alt_text",integration_id:n.id,site_url:n.store_url,api_key:n.api_token_encrypted,product_id:y,image_url:x,title:w,style:n.settings.alt_text_style||"descriptive",language:n.settings.language||"en",keywords:n.settings.keywords||""}});if(j)throw j;T.success("Alt text generated and updated!",{id:y}),h(n)}catch(v){console.error("Error generating alt text:",v),T.error("Failed to generate alt text",{id:y})}}},m=async y=>{if(n){T.loading(`Generating alt text for ${y.length} items...`,{id:"bulk"});try{const{data:x,error:w}=await V.functions.invoke("squarespace-sync",{body:{action:"generate_bulk",integration_id:n.id,site_url:n.store_url,api_key:n.api_token_encrypted,product_ids:y,product_list:a.filter(v=>y.includes(v.id)),style:n.settings.alt_text_style||"descriptive",language:n.settings.language||"en",keywords:n.settings.keywords||""}});if(w)throw w;
733T.success(`Successfully generated alt text for ${(x==null?void 0:x.success_count)||y.length} items!`,{id:"bulk"}),h(n)}catch(x){console.error("Error in bulk generation:",x),T.error("Failed to generate alt text",{id:"bulk"})}}},b=async y=>{if(n){T.loading(`Generating alt text for ${y.length} images...`,{id:"scan-bulk"});try{const{data:x,error:w}=await V.functions.invoke("squarespace-sync",{body:{action:"generate_bulk_from_scan",integration_id:n.id,site_url:n.store_url,api_key:n.api_token_encrypted,images:y,style:n.settings.alt_text_style||"descriptive",language:n.settings.language||"en",keywords:n.settings.keywords||""}});if(w)throw w;T.success(`Successfully generated alt text for ${(x==null?void 0:x.success_count)||y.length} images!`,{id:"scan-bulk"})}catch(x){console.error("Error in page scan bulk generation:",x),T.error("Failed to generate alt text",{id:"scan-bulk"})}}},g=async()=>{if(!n||!window.confirm("Are you sure you want to disconnect your Squarespace site?"))return;const{error:x}=await V.from("platform_integrations").delete().eq("id",n.id);x?T.error("Failed to disconnect"):(T.success("Squarespace site disconnected"),r(null),i([]))};return o?s.jsx("div",{className:"p-8",children:"Loading..."}):n?s.jsxs("div",{className:"container max-w-7xl py-8",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold",children:"Squarespace Integration"}),s.jsxs("p",{className:"text-muted-foreground",children:["Connected to: ",n.store_name]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{variant:n.status==="connected"?"default":"secondary",children:n.status}),s.jsxs(E,{variant:"outline",size:"sm",onClick:g,children:[s.jsx(ek,{className:"mr-2 h-4 w-4"}),"Disconnect"]})]})]}),s.jsxs(ca,{defaultValue:"scanner",className:"space-y-4",children:[s.jsxs(us,{children:[s.jsx(De,{value:"scanner",children:"Page Scanner"}),s.jsx(De,{value:"products",children:"Products"}),s.jsxs(De,{value:"settings",children:[s.jsx(Mo,{className:"mr-2 h-4 w-4"}),"Settings"]})]}),s.jsx(it,{value:"scanner",children:s.jsx(hq,{integrationId:n.id,siteUrl:n.store_url,apiKey:n.api_token_encrypted,onGenerateBulk:b})}),s.jsx(it,{value:"products",children:s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Squarespace Products"}),s.jsx(We,{children:"Manage alt text for your commerce products"})]}),s.jsx(Ne,{children:s.jsx(fq,{products:a,loading:c,onGenerateSingle:p,onGenerateBulk:m,onRefresh:()=>h(n)})})]})}),s.jsx(it,{value:"settings",children:s.jsx(mq,{integrationId:n.id})})]})]}):s.jsxs("div",{className:"container max-w-4xl py-8",children:[s.jsxs(L,{children:[s.jsxs(Te,{children:[s.jsx(Ae,{children:"Connect Your Squarespace Site"}),s.jsx(We,{children:"Generate SEO-optimized alt text for all images across your Squarespace site"})]}),s.jsxs(Ne,{children:[s.jsxs(kt,{className:"mb-4",children:[s.jsx(Ht,{className:"h-4 w-4"}),s.jsx(Ct,{children:"You'll need your Squarespace API Key and site URL. Find these in your Squarespace Developer settings."})]}),s.jsx(E,{onClick:()=>t(!0),children:"Connect Squarespace Site"})]})]}),s.jsx(uq,{open:e,onOpenChange:t,onSuccess:u})]})}const vl=[{id:1,title:"Welcome",description:"Get started with Altify Pro"},{id:2,title:"Platforms",description:"Choose your platforms"},{id:3,title:"Connect",description:"Connect your first platform"},{id:4,title:"Try It",description:"Generate your first alt text"}],tp=[{id:"shopify",name:"Shopify",icon:Ka,color:"hsl(142 71% 45%)"},{id:"wordpress",name:"WordPress",icon:Bn,color:"hsl(206 100% 40%)"},{id:"wix",name:"Wix",icon:Ku,color:"hsl(212 100% 48%)"},{id:"squarespace",name:"Squarespace",icon:sy,color:"hsl(0 0% 0%)"}];function gq(){const e=hr(),[t,n]=f.useState(1),[r,a]=f.useState([]),[i,o]=f.useState(!1),l=t/vl.length*100,c=g=>{a(y=>y.includes(g)?y.filter(x=>x!==g):[...y,g])},d=()=>{t<vl.length&&n(t+1)},u=()=>{t>1&&n(t-1)},h=async()=>{await m()},p=()=>{r.length>0?e(`/integrations/${r[0]}`):d()},m=async()=>{o(!0);try{const{data:{user:g}}=await V.auth.getUser();g&&El.settingsSaved()}catch(g){console.error("Error completing onboarding:",g)}finally{o(!1),e("/dashboard")}},b=()=>{var g;switch(t){case 1:return s.jsxs("div",{className:"space-y-6 text-center",children:[s.jsx("div",{className:"mx-auto w-20 h-20 bg-primary/10 rounded-full flex items-center justify-center",children:s.jsx(Nt,{className:"h-10 w-10 text-primary"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl font-bold mb-3",children:"Welcome to Altify Pro"}),s.jsx("p",{className:"text-muted-foreground text-lg max-w-md mx-auto",children:"Generate SEO-optimized alt text for all your images using AI. Let's get you set up in just a few steps."})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4 max-w-2xl mx-auto pt-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-3xl font-bold text-primary",children:"10x"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Faster"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-3xl font-bold text-primary",children:"100%"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Accessible"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-3xl font-bold text-primary",children:"AI"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Powered"})]})]})]});case 2:return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Which platforms do you use?"}),s.jsx("p",{className:"text-muted-foreground",children:"Select the platforms you want to connect with Altify Pro"})]}),s.jsx("div",{className:"grid grid-cols-2 gap-4 max-w-xl mx-auto",children:tp.map(y=>{const x=y.icon,w=r.includes(y.id);
733return s.jsx(L,{className:`cursor-pointer transition-all hover:shadow-lg ${w?"border-primary shadow-md":""}`,onClick:()=>c(y.id),children:s.jsxs(Ne,{className:"flex items-center gap-4 p-6",children:[s.jsx(un,{checked:w,onCheckedChange:()=>c(y.id)}),s.jsx("div",{className:"p-3 rounded-lg",style:{backgroundColor:`${y.color}20`},children:s.jsx(x,{className:"h-6 w-6",style:{color:y.color}})}),s.jsx("span",{className:"font-medium",children:y.name})]})},y.id)})})]});case 3:return s.jsxs("div",{className:"space-y-6 text-center",children:[s.jsx("div",{className:"mx-auto w-20 h-20 bg-primary/10 rounded-full flex items-center justify-center",children:s.jsx(Me,{className:"h-10 w-10 text-primary"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Let's connect your first platform"}),s.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:r.length>0?`We'll help you connect ${(g=tp.find(y=>y.id===r[0]))==null?void 0:g.name} to get started.`:"You can connect your platforms anytime from the Integrations page."})]}),r.length>0&&s.jsx("div",{className:"max-w-sm mx-auto",children:tp.filter(y=>r.includes(y.id)).map(y=>{const x=y.icon;return s.jsx(L,{className:"mb-3",children:s.jsxs(Ne,{className:"flex items-center gap-4 p-4",children:[s.jsx("div",{className:"p-3 rounded-lg",style:{backgroundColor:`${y.color}20`},children:s.jsx(x,{className:"h-6 w-6",style:{color:y.color}})}),s.jsxs("div",{className:"flex-1 text-left",children:[s.jsx("div",{className:"font-medium",children:y.name}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Ready to connect"})]})]})},y.id)})})]});case 4:return s.jsxs("div",{className:"space-y-6 text-center",children:[s.jsx("div",{className:"mx-auto w-20 h-20 bg-success/10 rounded-full flex items-center justify-center",children:s.jsx(Nt,{className:"h-10 w-10 text-success"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold mb-3",children:"You're all set!"}),s.jsx("p",{className:"text-muted-foreground text-lg max-w-md mx-auto",children:"Start generating AI-powered alt text for your images. Upload your first image or connect to your platform to get started."})]}),s.jsxs("div",{className:"flex flex-col gap-3 max-w-sm mx-auto",children:[s.jsx(E,{size:"lg",onClick:()=>e("/upload"),className:"w-full",children:"Upload Images"}),s.jsx(E,{size:"lg",variant:"outline",onClick:()=>e("/integrations"),className:"w-full",children:"Connect Platforms"})]})]});default:return null}};return s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-4xl",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx(Vn,{value:l,className:"h-2"}),s.jsx("div",{className:"flex justify-between mt-4",children:vl.map(g=>s.jsxs("div",{className:`text-center ${t>=g.id?"text-primary":"text-muted-foreground"}`,children:[s.jsx("div",{className:"text-sm font-medium",children:g.title}),s.jsx("div",{className:"text-xs",children:g.description})]},g.id))})]}),s.jsx(L,{className:"border-2",children:s.jsx(Ne,{className:"p-8 min-h-[400px] flex items-center justify-center",children:b()})}),s.jsxs("div",{className:"flex justify-between mt-6",children:[s.jsx(E,{variant:"outline",onClick:u,disabled:t===1,children:"Back"}),s.jsx(E,{variant:"ghost",onClick:h,disabled:i,children:"Skip Tutorial"}),s.jsx(E,{onClick:t===3&&r.length>0?p:t===vl.length?m:d,disabled:i,children:t===3&&r.length>0?"Connect Now":t===vl.length?"Get Started":"Next"})]})]})})}const zj={shopify:{name:"Shopify",icon:Ka,description:"Connect your Shopify store to automatically generate alt text for product images",color:"hsl(142 71% 45%)"},wordpress:{name:"WordPress / WooCommerce",icon:Bn,description:"Sync media library and WooCommerce products",color:"hsl(206 100% 40%)"},wix:{name:"Wix",icon:Ku,description:"Generate alt text for Wix media manager",color:"hsl(212 100% 48%)"},squarespace:{name:"Squarespace",icon:sy,description:"Scan pages and products for missing alt text",color:"hsl(0 0% 0%)"},custom_api:{name:"Custom API",icon:Wc,description:"Build custom integrations using our REST API",color:"hsl(var(--primary))"}};function xq(){const e=hr(),[t,n]=f.useState([]),[r,a]=f.useState(!0);f.useEffect(()=>{i()},[]);const i=async()=>{try{const{data:{user:d}}=await V.auth.getUser();if(!d)return;const{data:u,error:h}=await V.from("platform_integrations").select("*").eq("user_id",d.id);if(h)throw h;n(u||[])}catch(d){console.error("Error fetching integrations:",d),T.error("Failed to load integrations")}finally{a(!1)}},o=d=>{const u=t.find(h=>h.platform===d);return(u==null?void 0:u.status)||"disconnected"},l=d=>{const u=t.find(h=>h.platform===d);return u==null?void 0:u.store_name},c=d=>{d==="shopify"||d==="wordpress"||d==="wix"||d==="squarespace"?e(`/integrations/${d}`):T.info(`${zj[d].name} integration coming soon!`)};return s.jsx("div",{className:"min-h-screen bg-background p-8",children:s.jsxs("div",{className:"max-w-7xl mx-auto",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-4xl font-bold text-foreground mb-3",children:"Platform Integrations"}),s.jsx("p",{className:"text-muted-foreground text-lg",children:"Connect Altify Pro to your favorite platforms to streamline alt text generation across your entire workflow"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Object.entries(zj).map(([d,u])=>{const h=u.icon,p=o(d),m=l(d),b=p==="connected";return s.jsxs(L,{className:"luxury-card coral-glow-hover cursor-pointer transition-all duration-300",onClick:()=>c(d),children:[s.jsxs(Te,{children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsx("div",{className:"p-3 rounded-lg",style:{backgroundColor:`${u.color}20`},children:s.jsx(h,{className:"h-8 w-8",style:{color:u.color}})}),b?s.jsxs(ae,{className:"bg-success text-success-foreground",children:[s.jsx(Dr,{className:"h-3 w-3 mr-1"}),"Connected"]}):s.jsxs(ae,{variant:"outline",className:"border-muted-foreground
733/30",children:[s.jsx(WS,{className:"h-3 w-3 mr-1"}),"Not Connected"]})]}),s.jsx(Ae,{className:"text-xl",children:u.name}),m&&s.jsx("p",{className:"text-sm text-muted-foreground font-medium",children:m})]}),s.jsxs(Ne,{children:[s.jsx(We,{className:"mb-6 min-h-[60px]",children:u.description}),s.jsx(E,{className:"w-full",variant:b?"outline":"default",onClick:g=>{g.stopPropagation(),c(d)},children:b?"Configure":"Connect"})]})]},d)})}),s.jsxs(L,{className:"mt-8 border-primary/20 bg-card",children:[s.jsx(Te,{children:s.jsxs(Ae,{className:"flex items-center gap-2",children:[s.jsx(Wc,{className:"h-5 w-5 text-primary"}),"Need a Custom Integration?"]})}),s.jsxs(Ne,{children:[s.jsx("p",{className:"text-muted-foreground mb-4",children:"Our REST API allows you to build custom integrations with any platform or CMS. Check out our API documentation to get started."}),s.jsx(E,{variant:"outline",onClick:()=>e("/api-keys"),children:"View API Documentation"})]})]})]})})}const yq=new i3,vq=()=>s.jsx(l3,{client:yq,children:s.jsxs(bo,{children:[s.jsx(wO,{}),s.jsx(XO,{}),s.jsx(lL,{children:s.jsxs(eL,{children:[s.jsx(Fe,{path:"/",element:s.jsx(rz,{})}),s.jsx(Fe,{path:"/try-free",element:s.jsx(az,{})}),s.jsx(Fe,{path:"/auth",element:s.jsx(lz,{})}),s.jsxs(Fe,{element:s.jsx(ZH,{}),children:[s.jsx(Fe,{path:"/dashboard",element:s.jsx(eK,{})}),s.jsx(Fe,{path:"/upload",element:s.jsx(g9,{})}),s.jsx(Fe,{path:"/results",element:s.jsx(w9,{})}),s.jsx(Fe,{path:"/history",element:s.jsx(b9,{})}),s.jsx(Fe,{path:"/templates",element:s.jsx(N9,{})}),s.jsx(Fe,{path:"/languages",element:s.jsx(P9,{})}),s.jsx(Fe,{path:"/api-keys",element:s.jsx($G,{})}),s.jsx(Fe,{path:"/usage",element:s.jsx(UG,{})}),s.jsx(Fe,{path:"/profile",element:s.jsx(LG,{})}),s.jsx(Fe,{path:"/settings",element:s.jsx(DG,{})}),s.jsx(Fe,{path:"/integrations",element:s.jsx(xq,{})}),s.jsx(Fe,{path:"/integrations/shopify",element:s.jsx(nq,{})}),s.jsx(Fe,{path:"/integrations/wordpress",element:s.jsx(iq,{})}),s.jsx(Fe,{path:"/integrations/wix",element:s.jsx(dq,{})}),s.jsx(Fe,{path:"/integrations/squarespace",element:s.jsx(pq,{})}),s.jsx(Fe,{path:"/onboarding",element:s.jsx(gq,{})})]}),s.jsx(Fe,{path:"/resources",element:s.jsx(VG,{})}),s.jsx(Fe,{path:"/resources/how-to-write-alt-text",element:s.jsx(GG,{})}),s.jsx(Fe,{path:"/resources/alt-text-examples",element:s.jsx(qG,{})}),s.jsx(Fe,{path:"/resources/best-practices-checklist",element:s.jsx(YG,{})}),s.jsx(Fe,{path:"/resources/wordpress-tutorial",element:s.jsx(QG,{})}),s.jsx(Fe,{path:"*",element:s.jsx(cz,{})})]})})]})});hS(document.getElementById("root")).render(s.jsx(vq,{}));

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.