vendor: 6,721 bytes, lines 1-9
1var tR=Object.defineProperty;var qy=e=>{throw TypeError(e)};var rR=(e,t,r)=>t in e?tR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var On=(e,t,r)=>rR(e,typeof t!="symbol"?t+"":t,r),vf=(e,t,r)=>t.has(e)||qy("Cannot "+r);var E=(e,t,r)=>(vf(e,t,"read from private field"),r?r.call(e):t.get(e)),pe=(e,t,r)=>t.has(e)?qy("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ie=(e,t,r,n)=>(vf(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Se=(e,t,r)=>(vf(e,t,"access private method"),r);var tu=(e,t,r,n)=>({set _(s){ie(e,t,s,r)},get _(){return E(e,t,n)}});function k1(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=r(s);fetch(s.href,a)}})();function Rc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function nR(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var C1={exports:{}},mh={},E1={exports:{}},Ne={};/** 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 Ic=Symbol.for("react.element"),sR=Symbol.for("react.portal"),iR=Symbol.for("react.fragment"),aR=Symbol.for("react.strict_mode"),oR=Symbol.for("react.profiler"),lR=Symbol.for("react.provider"),cR=Symbol.for("react.context"),uR=Symbol.for("react.forward_ref"),dR=Symbol.for("react.suspense"),hR=Symbol.for("react.memo"),fR=Symbol.for("react.lazy"),Hy=Symbol.iterator;function mR(e){return e===null||typeof e!="object"?null:(e=Hy&&e[Hy]||e["@@iterator"],typeof e=="function"?e:null)}var P1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T1=Object.assign,A1={};function Po(e,t,r){this.props=e,this.context=t,this.refs=A1,this.updater=r||P1}Po.prototype.isReactComponent={};Po.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")};Po.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function R1(){}R1.prototype=Po.prototype;function sx(e,t,r){this.props=e,this.context=t,this.refs=A1,this.updater=r||P1}var ix=sx.prototype=new R1;ix.constructor=sx;T1(ix,Po.prototype);ix.isPureReactComponent=!0;var Ky=Array.isArray,I1=Object.prototype.hasOwnProperty,ax={current:null},O1={key:!0,ref:!0,__self:!0,__source:!0};function M1(e,t,r){var n,s={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)I1.call(t,n)&&!O1.hasOwnProperty(n)&&(s[n]=t[n]);var l=arguments.length-2;if(l===1)s.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)s[n]===void 0&&(s[n]=l[n]);return{$$typeof:Ic,type:e,key:a,ref:o,props:s,_owner:ax.current}}function pR(e,t){return{$$typeof:Ic,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ox(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ic}function gR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Yy=/\/+/g;function yf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?gR(""+e.key):t.toString(36)}function zu(e,t,r,n,s){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ic:case sR:o=!0}}if(o)return o=e,s=s(o),e=n===""?"."+yf(o,0):n,Ky(s)?(r="",e!=null&&(r=e.replace(Yy,"$&/")+"/"),zu(s,t,r,"",function(u){return u})):s!=null&&(ox(s)&&(s=pR(s,r+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Yy,"$&/")+"/")+e)),t.push(s)),1;if(o=0,n=n===""?".":n+":",Ky(e))for(var l=0;l<e.length;l++){a=e[l];var c=n+yf(a,l);o+=zu(a,t,r,c,s)}else if(c=mR(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=n+yf(a,l++),o+=zu(a,t,r,c,s);else if(a==="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 ru(e,t,r){if(e==null)return e;var n=[],s=0;return zu(e,n,"","",function(a){return t.call(r,a,s++)}),n}function xR(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qt={current:null},Gu={transition:null},vR={ReactCurrentDispatcher:qt,ReactCurrentBatchConfig:Gu,ReactCurrentOwner:ax};function D1(){throw Error("act(...) is not supported in production builds of React.")}Ne.Children={map:ru,forEach:function(e,t,r){ru(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return ru(e,function(){t++}),t},toArray:function(e){return ru(e,function(t){return t})||[]},only:function(e){if(!ox(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ne.Component=Po;Ne.Fragment=iR;Ne.Profiler=oR;Ne.PureComponent=sx;Ne.StrictMode=aR;
vendor: 5,548 bytes, lines 9-25
9Ne.Suspense=dR;Ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vR;Ne.act=D1;Ne.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=T1({},e.props),s=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=ax.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)I1.call(t,c)&&!O1.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:Ic,type:e.type,key:s,ref:a,props:n,_owner:o}};Ne.createContext=function(e){return e={$$typeof:cR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:lR,_context:e},e.Consumer=e};Ne.createElement=M1;Ne.createFactory=function(e){var t=M1.bind(null,e);return t.type=e,t};Ne.createRef=function(){return{current:null}};Ne.forwardRef=function(e){return{$$typeof:uR,render:e}};Ne.isValidElement=ox;Ne.lazy=function(e){return{$$typeof:fR,_payload:{_status:-1,_result:e},_init:xR}};Ne.memo=function(e,t){return{$$typeof:hR,type:e,compare:t===void 0?null:t}};Ne.startTransition=function(e){var t=Gu.transition;Gu.transition={};try{e()}finally{Gu.transition=t}};Ne.unstable_act=D1;Ne.useCallback=function(e,t){return qt.current.useCallback(e,t)};Ne.useContext=function(e){return qt.current.useContext(e)};Ne.useDebugValue=function(){};Ne.useDeferredValue=function(e){return qt.current.useDeferredValue(e)};Ne.useEffect=function(e,t){return qt.current.useEffect(e,t)};Ne.useId=function(){return qt.current.useId()};Ne.useImperativeHandle=function(e,t,r){return qt.current.useImperativeHandle(e,t,r)};Ne.useInsertionEffect=function(e,t){return qt.current.useInsertionEffect(e,t)};Ne.useLayoutEffect=function(e,t){return qt.current.useLayoutEffect(e,t)};Ne.useMemo=function(e,t){return qt.current.useMemo(e,t)};Ne.useReducer=function(e,t,r){return qt.current.useReducer(e,t,r)};Ne.useRef=function(e){return qt.current.useRef(e)};Ne.useState=function(e){return qt.current.useState(e)};Ne.useSyncExternalStore=function(e,t,r){return qt.current.useSyncExternalStore(e,t,r)};Ne.useTransition=function(){return qt.current.useTransition()};Ne.version="18.3.1";E1.exports=Ne;var p=E1.exports;const W=Rc(p),lx=k1({__proto__:null,default:W},[p]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var yR=p,bR=Symbol.for("react.element"),wR=Symbol.for("react.fragment"),jR=Object.prototype.hasOwnProperty,NR=yR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,SR={key:!0,ref:!0,__self:!0,__source:!0};function L1(e,t,r){var n,s={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)jR.call(t,n)&&!SR.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:bR,type:e,key:a,ref:o,props:s,_owner:NR.current}}mh.Fragment=wR;mh.jsx=L1;mh.jsxs=L1;C1.exports=mh;var i=C1.exports,$1={exports:{}},yr={},F1={exports:{}},U1={};/** 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(T,O){var H=T.length;T.push(O);e:for(;0<H;){var re=H-1>>>1,Q=T[re];if(0<s(Q,O))T[re]=O,T[H]=Q,H=re;else break e}}function r(T){return T.length===0?null:T[0]}function n(T){if(T.length===0)return null;var O=T[0],H=T.pop();if(H!==O){T[0]=H;e:for(var re=0,Q=T.length,q=Q>>>1;re<q;){var M=2*(re+1)-1,Z=T[M],z=M+1,A=T[z];if(0>s(Z,H))z<Q&&0>s(A,Z)?(T[re]=A,T[z]=H,re=z):(T[re]=Z,T[M]=H,re=M);else if(z<Q&&0>s(A,H))T[re]=A,T[z]=H,re=z;else break e}}return O}function s(T,O){var H=T.sortIndex-O.sortIndex;return H!==0?H:T.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,h=null,f=3,m=!1,w=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(T){for(var O=r(u);O!==null;){if(O.callback===null)n(u);else if(O.startTime<=T)n(u),O.sortIndex=O.expirationTime,t(c,O);else break;O=r(u)}}function j(T){if(g=!1,x(T),!w)if(r(c)!==null)w=!0,$(N);else{var O=r(u);O!==null&&F(j,O.startTime-T)}}function N(T,O){w=!1,g&&(g=!1,b(k),k=-1),m=!0;var H=f;try{for(x(O),h=r(c);h!==null&&(!(h.expirationTime>O)||T&&!D());){var re=h.callback;if(typeof re=="function"){h.callback=null,f=h.priorityLevel;var Q=re(h.expirationTime<=O);O=e.unstable_now(),typeof Q=="function"?h.callback=Q:h===r(c)&&n(c),x(O)}else n(c);h=r(c)}if(h!==null)var q=!0;else{var M=r(u);M!==null&&F(j,M.startTime-O),q=!1}return q}finally{h=null,f=H,m=!1}}var S=!1,_=null,k=-1,P=5,C=-1;function D(){return!(e.unstable_now()-C<P)}function I(){if(_!==null){var T=e.unstable_now();C=T;var O=!0;try{O=_(!0,T)}finally{O?V():(S=!1,_=null)}}else S=!1}var V;
vendor: 8,681 bytes, lines 25-34
25if(typeof v=="function")V=function(){v(I)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,R=U.port2;U.port1.onmessage=I,V=function(){R.postMessage(null)}}else V=function(){y(I,0)};function $(T){_=T,S||(S=!0,V())}function F(T,O){k=y(function(){T(e.unstable_now())},O)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){w||m||(w=!0,$(N))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(T){switch(f){case 1:case 2:case 3:var O=3;break;default:O=f}var H=f;f=O;try{return T()}finally{f=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,O){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var H=f;f=T;try{return O()}finally{f=H}},e.unstable_scheduleCallback=function(T,O,H){var re=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?re+H:re):H=re,T){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=H+Q,T={id:d++,callback:O,priorityLevel:T,startTime:H,expirationTime:Q,sortIndex:-1},H>re?(T.sortIndex=H,t(u,T),r(c)===null&&T===r(u)&&(g?(b(k),k=-1):g=!0,F(j,H-re))):(T.sortIndex=Q,t(c,T),w||m||(w=!0,$(N))),T},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(T){var O=f;return function(){var H=f;f=O;try{return T.apply(this,arguments)}finally{f=H}}}})(U1);F1.exports=U1;var _R=F1.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 kR=p,pr=_R;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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 V1=new Set,Ul={};function ta(e,t){fo(e,t),fo(e+"Capture",t)}function fo(e,t){for(Ul[e]=t,e=0;e<t.length;e++)V1.add(t[e])}var Kn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bm=Object.prototype.hasOwnProperty,CR=/^[: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]*$/,Qy={},Jy={};function ER(e){return Bm.call(Jy,e)?!0:Bm.call(Qy,e)?!1:CR.test(e)?Jy[e]=!0:(Qy[e]=!0,!1)}function PR(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function TR(e,t,r,n){if(t===null||typeof t>"u"||PR(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 Ht(e,t,r,n,s,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Et={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Et[e]=new Ht(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Et[t]=new Ht(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Et[e]=new Ht(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Et[e]=new Ht(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){Et[e]=new Ht(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Et[e]=new Ht(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Et[e]=new Ht(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Et[e]=new Ht(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Et[e]=new Ht(e,5,!1,e.toLowerCase(),null,!1,!1)});var cx=/[\-:]([a-z])/g;function ux(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(cx,ux);Et[t]=new Ht(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(cx,ux);Et[t]=new Ht(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(cx,ux);Et[t]=new Ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Et[e]=new Ht(e,1,!1,e.toLowerCase(),null,!1,!1)});Et.xlinkHref=new Ht("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Et[e]=new Ht(e,1,!1,e.toLowerCase(),null,!0,!0)});function dx(e,t,r,n){var s=Et.hasOwnProperty(t)?Et[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(TR(t,r,s,n)&&(r=null),n||s===null?ER(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var ns=kR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nu=Symbol.for("react.element"),Sa=Symbol.for("react.portal"),_a=Symbol.for("react.fragment"),hx=Symbol.for("react.strict_mode"),zm=Symbol.for("react.profiler"),B1=Symbol.for("react.provider"),z1=Symbol.for("react.context"),fx=Symbol.for("react.forward_ref"),Gm=Symbol.for("react.suspense"),Wm=Symbol.for("react.suspense_list"),mx=Symbol.for("react.memo"),xs=Symbol.for("react.lazy"),G1=Symbol.for("react.offscreen"),Xy=Symbol.iterator;function Ko(e){return e===null||typeof e!="object"?null:(e=Xy&&e[Xy]||e["@@iterator"],typeof e=="function"?e:null)}var Je=Object.assign,bf;function dl(e){if(bf===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);bf=t&&t[1]||""}return` 34`+bf+e}var wf=!1;function jf(e,t){if(!e||wf)return"";wf=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}
vendor: 14,090 bytes, lines 34-37
34catch(u){if(u&&n&&typeof u.stack=="string"){for(var s=u.stack.split(` 35`),a=n.stack.split(` 36`),o=s.length-1,l=a.length-1;1<=o&&0<=l&&s[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==a[l]){var c=` 37`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{wf=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?dl(e):""}function AR(e){switch(e.tag){case 5:return dl(e.type);case 16:return dl("Lazy");case 13:return dl("Suspense");case 19:return dl("SuspenseList");case 0:case 2:case 15:return e=jf(e.type,!1),e;case 11:return e=jf(e.type.render,!1),e;case 1:return e=jf(e.type,!0),e;default:return""}}function qm(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 _a:return"Fragment";case Sa:return"Portal";case zm:return"Profiler";case hx:return"StrictMode";case Gm:return"Suspense";case Wm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case z1:return(e.displayName||"Context")+".Consumer";case B1:return(e._context.displayName||"Context")+".Provider";case fx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mx:return t=e.displayName||null,t!==null?t:qm(e.type)||"Memo";case xs:t=e._payload,e=e._init;try{return qm(e(t))}catch{}}return null}function RR(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 qm(t);case 8:return t===hx?"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 Gs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function W1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function IR(e){var t=W1(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function su(e){e._valueTracker||(e._valueTracker=IR(e))}function q1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=W1(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function md(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 Hm(e,t){var r=t.checked;return Je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Zy(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Gs(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function H1(e,t){t=t.checked,t!=null&&dx(e,"checked",t,!1)}function Km(e,t){H1(e,t);var r=Gs(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ym(e,t.type,r):t.hasOwnProperty("defaultValue")&&Ym(e,t.type,Gs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function e0(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Ym(e,t,r){(t!=="number"||md(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var hl=Array.isArray;function Va(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Gs(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Qm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return Je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function t0(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(K(92));if(hl(r)){if(1<r.length)throw Error(K(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Gs(r)}}function K1(e,t){var r=Gs(t.value),n=Gs(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function r0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Y1(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 Jm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Y1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var iu,Q1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(iu=iu||document.createElement("div"),iu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=iu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var yl={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},OR=["Webkit","ms","Moz","O"];Object.keys(yl).forEach(function(e){OR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),yl[t]=yl[e]})});function J1(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||yl.hasOwnProperty(e)&&yl[e]?(""+t).trim():t+"px"}function X1(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=J1(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var MR=Je({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 Xm(e,t){if(t){if(MR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function Zm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ep=null;function px(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tp=null,Ba=null,za=null;function n0(e){if(e=Dc(e)){if(typeof tp!="function")throw Error(K(280));var t=e.stateNode;t&&(t=yh(t),tp(e.stateNode,e.type,t))}}function Z1(e){Ba?za?za.push(e):za=[e]:Ba=e}function eN(){if(Ba){var e=Ba,t=za;if(za=Ba=null,n0(e),t)for(e=0;e<t.length;e++)n0(t[e])}}function tN(e,t){return e(t)}function rN(){}var Nf=!1;function nN(e,t,r){if(Nf)return e(t,r);Nf=!0;try{return tN(e,t,r)}finally{Nf=!1,(Ba!==null||za!==null)&&(rN(),eN())}}function Bl(e,t){var r=e.stateNode;if(r===null)return null;var n=yh(r);if(n===null)return null;r=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(K(231,t,typeof r));return r}var rp=!1;if(Kn)try{var Yo={};Object.defineProperty(Yo,"passive",{get:function(){rp=!0}}),window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch{rp=!1}function DR(e,t,r,n,s,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var bl=!1,pd=null,gd=!1,np=null,LR={onError:function(e){bl=!0,pd=e}};function $R(e,t,r,n,s,a,o,l,c){bl=!1,pd=null,DR.apply(LR,arguments)}function FR(e,t,r,n,s,a,o,l,c){if($R.apply(this,arguments),bl){if(bl){var u=pd;bl=!1,pd=null}else throw Error(K(198));gd||(gd=!0,np=u)}}function ra(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function sN(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 s0(e){if(ra(e)!==e)throw Error(K(188))}function UR(e){var t=e.alternate;if(!t){if(t=ra(e),t===null)throw Error(K(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var a=s.alternate;if(a===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===a.child){for(a=s.child;a;){if(a===r)return s0(s),e;if(a===n)return s0(s),t;a=a.sibling}throw Error(K(188))}if(r.return!==n.return)r=s,n=a;else{for(var o=!1,l=s.child;l;){if(l===r){o=!0,r=s,n=a;break}if(l===n){o=!0,n=s,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,n=s;break}if(l===n){o=!0,n=a,r=s;break}l=l.sibling}if(!o)throw Error(K(189))}}if(r.alternate!==n)throw Error(K(190))}if(r.tag!==3)throw Error(K(188));return r.stateNode.current===r?e:t}function iN(e){return e=UR(e),e!==null?aN(e):null}function aN(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=aN(e);if(t!==null)return t;e=e.sibling}return null}var oN=pr.unstable_scheduleCallback,i0=pr.unstable_cancelCallback,VR=pr.unstable_shouldYield,BR=pr.unstable_requestPaint,at=pr.unstable_now,zR=pr.unstable_getCurrentPriorityLevel,gx=pr.unstable_ImmediatePriority,lN=pr.unstable_UserBlockingPriority,xd=pr.unstable_NormalPriority,GR=pr.unstable_LowPriority,cN=pr.unstable_IdlePriority,ph=null,Nn=null;function WR(e){if(Nn&&typeof Nn.onCommitFiberRoot=="function")try{Nn.onCommitFiberRoot(ph,e,void 0,(e.current.flags&128)===128)}catch{}}var en=Math.clz32?Math.clz32:KR,qR=Math.log,HR=Math.LN2;function KR(e){return e>>>=0,e===0?32:31-(qR(e)/HR|0)|0}var au=64,ou=4194304;function fl(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 vd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~s;l!==0?n=fl(l):(a&=o,a!==0&&(n=fl(a)))}else o=r&~s,o!==0?n=fl(o):a!==0&&(n=fl(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-en(t),s=1<<r,n|=e[r],t&=~s;return n}function YR(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 QR(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-en(a),l=1<<o,c=s[o];c===-1?(!(l&r)||l&n)&&(s[o]=YR(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function sp(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function uN(){var e=au;return au<<=1,!(au&4194240)&&(au=64),e}function Sf(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 4,087 bytes, line 37
37function Oc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-en(t),e[t]=r}function JR(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-en(r),a=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~a}}function xx(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-en(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var Ae=0;function dN(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var hN,vx,fN,mN,pN,ip=!1,lu=[],Is=null,Os=null,Ms=null,zl=new Map,Gl=new Map,ys=[],XR="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 a0(e,t){switch(e){case"focusin":case"focusout":Is=null;break;case"dragenter":case"dragleave":Os=null;break;case"mouseover":case"mouseout":Ms=null;break;case"pointerover":case"pointerout":zl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gl.delete(t.pointerId)}}function Qo(e,t,r,n,s,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[s]},t!==null&&(t=Dc(t),t!==null&&vx(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function ZR(e,t,r,n,s){switch(t){case"focusin":return Is=Qo(Is,e,t,r,n,s),!0;case"dragenter":return Os=Qo(Os,e,t,r,n,s),!0;case"mouseover":return Ms=Qo(Ms,e,t,r,n,s),!0;case"pointerover":var a=s.pointerId;return zl.set(a,Qo(zl.get(a)||null,e,t,r,n,s)),!0;case"gotpointercapture":return a=s.pointerId,Gl.set(a,Qo(Gl.get(a)||null,e,t,r,n,s)),!0}return!1}function gN(e){var t=Ni(e.target);if(t!==null){var r=ra(t);if(r!==null){if(t=r.tag,t===13){if(t=sN(r),t!==null){e.blockedOn=t,pN(e.priority,function(){fN(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ap(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);ep=n,r.target.dispatchEvent(n),ep=null}else return t=Dc(r),t!==null&&vx(t),e.blockedOn=r,!1;t.shift()}return!0}function o0(e,t,r){Wu(e)&&r.delete(t)}function eI(){ip=!1,Is!==null&&Wu(Is)&&(Is=null),Os!==null&&Wu(Os)&&(Os=null),Ms!==null&&Wu(Ms)&&(Ms=null),zl.forEach(o0),Gl.forEach(o0)}function Jo(e,t){e.blockedOn===t&&(e.blockedOn=null,ip||(ip=!0,pr.unstable_scheduleCallback(pr.unstable_NormalPriority,eI)))}function Wl(e){function t(s){return Jo(s,e)}if(0<lu.length){Jo(lu[0],e);for(var r=1;r<lu.length;r++){var n=lu[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Is!==null&&Jo(Is,e),Os!==null&&Jo(Os,e),Ms!==null&&Jo(Ms,e),zl.forEach(t),Gl.forEach(t),r=0;r<ys.length;r++)n=ys[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<ys.length&&(r=ys[0],r.blockedOn===null);)gN(r),r.blockedOn===null&&ys.shift()}var Ga=ns.ReactCurrentBatchConfig,yd=!0;function tI(e,t,r,n){var s=Ae,a=Ga.transition;Ga.transition=null;try{Ae=1,yx(e,t,r,n)}finally{Ae=s,Ga.transition=a}}function rI(e,t,r,n){var s=Ae,a=Ga.transition;Ga.transition=null;try{Ae=4,yx(e,t,r,n)}finally{Ae=s,Ga.transition=a}}function yx(e,t,r,n){if(yd){var s=ap(e,t,r,n);if(s===null)Of(e,t,n,bd,r),a0(e,n);else if(ZR(s,e,t,r,n))n.stopPropagation();else if(a0(e,n),t&4&&-1<XR.indexOf(e)){for(;s!==null;){var a=Dc(s);if(a!==null&&hN(a),a=ap(e,t,r,n),a===null&&Of(e,t,n,bd,r),a===s)break;s=a}s!==null&&n.stopPropagation()}else Of(e,t,n,null,r)}}var bd=null;function ap(e,t,r,n){if(bd=null,e=px(n),e=Ni(e),e!==null)if(t=ra(e),t===null)e=null;else if(r=t.tag,r===13){if(e=sN(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return bd=e,null}
vendor: 10,401 bytes, line 37
37function xN(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(zR()){case gx:return 1;case lN:return 4;case xd:case GR:return 16;case cN:return 536870912;default:return 16}default:return 16}}var Ts=null,bx=null,qu=null;function vN(){if(qu)return qu;var e,t=bx,r=t.length,n,s="value"in Ts?Ts.value:Ts.textContent,a=s.length;for(e=0;e<r&&t[e]===s[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===s[a-n];n++);return qu=s.slice(e,1<n?1-n:void 0)}function Hu(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 cu(){return!0}function l0(){return!1}function br(e){function t(r,n,s,a,o){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?cu:l0,this.isPropagationStopped=l0,this}return Je(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=cu)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=cu)},persist:function(){},isPersistent:cu}),t}var To={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wx=br(To),Mc=Je({},To,{view:0,detail:0}),nI=br(Mc),_f,kf,Xo,gh=Je({},Mc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jx,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!==Xo&&(Xo&&e.type==="mousemove"?(_f=e.screenX-Xo.screenX,kf=e.screenY-Xo.screenY):kf=_f=0,Xo=e),_f)},movementY:function(e){return"movementY"in e?e.movementY:kf}}),c0=br(gh),sI=Je({},gh,{dataTransfer:0}),iI=br(sI),aI=Je({},Mc,{relatedTarget:0}),Cf=br(aI),oI=Je({},To,{animationName:0,elapsedTime:0,pseudoElement:0}),lI=br(oI),cI=Je({},To,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),uI=br(cI),dI=Je({},To,{data:0}),u0=br(dI),hI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fI={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mI[e])?!!t[e]:!1}function jx(){return pI}var gI=Je({},Mc,{key:function(e){if(e.key){var t=hI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jx,charCode:function(e){return e.type==="keypress"?Hu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),xI=br(gI),vI=Je({},gh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),d0=br(vI),yI=Je({},Mc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jx}),bI=br(yI),wI=Je({},To,{propertyName:0,elapsedTime:0,pseudoElement:0}),jI=br(wI),NI=Je({},gh,{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}),SI=br(NI),_I=[9,13,27,32],Nx=Kn&&"CompositionEvent"in window,wl=null;Kn&&"documentMode"in document&&(wl=document.documentMode);var kI=Kn&&"TextEvent"in window&&!wl,yN=Kn&&(!Nx||wl&&8<wl&&11>=wl),h0=" ",f0=!1;function bN(e,t){switch(e){case"keyup":return _I.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wN(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ka=!1;function CI(e,t){switch(e){case"compositionend":return wN(t);case"keypress":return t.which!==32?null:(f0=!0,h0);case"textInput":return e=t.data,e===h0&&f0?null:e;default:return null}}function EI(e,t){if(ka)return e==="compositionend"||!Nx&&bN(e,t)?(e=vN(),qu=bx=Ts=null,ka=!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 yN&&t.locale!=="ko"?null:t.data;default:return null}}var PI={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 m0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!PI[e.type]:t==="textarea"}function jN(e,t,r,n){Z1(n),t=wd(t,"onChange"),0<t.length&&(r=new wx("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var jl=null,ql=null;function TI(e){IN(e,0)}function xh(e){var t=Pa(e);if(q1(t))return e}function AI(e,t){if(e==="change")return t}var NN=!1;if(Kn){var Ef;if(Kn){var Pf="oninput"in document;if(!Pf){var p0=document.createElement("div");p0.setAttribute("oninput","return;"),Pf=typeof p0.oninput=="function"}Ef=Pf}else Ef=!1;NN=Ef&&(!document.documentMode||9<document.documentMode)}function g0(){jl&&(jl.detachEvent("onpropertychange",SN),ql=jl=null)}function SN(e){if(e.propertyName==="value"&&xh(ql)){var t=[];jN(t,ql,e,px(e)),nN(TI,t)}}function RI(e,t,r){e==="focusin"?(g0(),jl=t,ql=r,jl.attachEvent("onpropertychange",SN)):e==="focusout"&&g0()}function II(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xh(ql)}function OI(e,t){if(e==="click")return xh(t)}function MI(e,t){if(e==="input"||e==="change")return xh(t)}function DI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nn=typeof Object.is=="function"?Object.is:DI;function Hl(e,t){if(nn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!Bm.call(t,s)||!nn(e[s],t[s]))return!1}return!0}function x0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function v0(e,t){var r=x0(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=x0(r)}}function _N(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_N(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kN(){for(var e=window,t=md();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=md(e.document)}return t}function Sx(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 LI(e){var t=kN(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&_N(r.ownerDocument.documentElement,r)){if(n!==null&&Sx(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,a=Math.min(n.start,s);n=n.end===void 0?a:Math.min(n.end,s),!e.extend&&a>n&&(s=n,n=a,a=s),s=v0(r,a);var o=v0(r,n);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var $I=Kn&&"documentMode"in document&&11>=document.documentMode,Ca=null,op=null,Nl=null,lp=!1;function y0(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;lp||Ca==null||Ca!==md(n)||(n=Ca,"selectionStart"in n&&Sx(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,501 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),Nl&&Hl(Nl,n)||(Nl=n,n=wd(op,"onSelect"),0<n.length&&(t=new wx("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ca)))}function uu(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ea={animationend:uu("Animation","AnimationEnd"),animationiteration:uu("Animation","AnimationIteration"),animationstart:uu("Animation","AnimationStart"),transitionend:uu("Transition","TransitionEnd")},Tf={},CN={};Kn&&(CN=document.createElement("div").style,"AnimationEvent"in window||(delete Ea.animationend.animation,delete Ea.animationiteration.animation,delete Ea.animationstart.animation),"TransitionEvent"in window||delete Ea.transitionend.transition);function vh(e){if(Tf[e])return Tf[e];if(!Ea[e])return e;var t=Ea[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in CN)return Tf[e]=t[r];return e}var EN=vh("animationend"),PN=vh("animationiteration"),TN=vh("animationstart"),AN=vh("transitionend"),RN=new Map,b0="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 Zs(e,t){RN.set(e,t),ta(t,[e])}for(var Af=0;Af<b0.length;Af++){var Rf=b0[Af],FI=Rf.toLowerCase(),UI=Rf[0].toUpperCase()+Rf.slice(1);Zs(FI,"on"+UI)}Zs(EN,"onAnimationEnd");Zs(PN,"onAnimationIteration");Zs(TN,"onAnimationStart");Zs("dblclick","onDoubleClick");Zs("focusin","onFocus");Zs("focusout","onBlur");Zs(AN,"onTransitionEnd");fo("onMouseEnter",["mouseout","mouseover"]);fo("onMouseLeave",["mouseout","mouseover"]);fo("onPointerEnter",["pointerout","pointerover"]);fo("onPointerLeave",["pointerout","pointerover"]);ta("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ta("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ta("onBeforeInput",["compositionend","keypress","textInput","paste"]);ta("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ta("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ta("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ml="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(" "),VI=new Set("cancel close invalid load scroll toggle".split(" ").concat(ml));function w0(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,FR(n,t,void 0,e),e.currentTarget=null}function IN(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&s.isPropagationStopped())break e;w0(s,l,u),a=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&s.isPropagationStopped())break e;w0(s,l,u),a=c}}}if(gd)throw e=np,gd=!1,np=null,e}function Fe(e,t){var r=t[fp];r===void 0&&(r=t[fp]=new Set);var n=e+"__bubble";r.has(n)||(ON(t,e,2,!1),r.add(n))}function If(e,t,r){var n=0;t&&(n|=4),ON(r,e,n,t)}var du="_reactListening"+Math.random().toString(36).slice(2);function Kl(e){if(!e[du]){e[du]=!0,V1.forEach(function(r){r!=="selectionchange"&&(VI.has(r)||If(r,!1,e),If(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[du]||(t[du]=!0,If("selectionchange",!1,t))}}function ON(e,t,r,n){switch(xN(t)){case 1:var s=tI;break;case 4:s=rI;break;default:s=yx}r=s.bind(null,t,r,e),s=void 0,!rp||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Of(e,t,r,n,s){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;
vendor: 2,527 bytes, line 37
37if(l===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;l!==null;){if(o=Ni(l),o===null)return;if(c=o.tag,c===5||c===6){n=a=o;continue e}l=l.parentNode}}n=n.return}nN(function(){var u=a,d=px(r),h=[];e:{var f=RN.get(e);if(f!==void 0){var m=wx,w=e;switch(e){case"keypress":if(Hu(r)===0)break e;case"keydown":case"keyup":m=xI;break;case"focusin":w="focus",m=Cf;break;case"focusout":w="blur",m=Cf;break;case"beforeblur":case"afterblur":m=Cf;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=c0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=iI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=bI;break;case EN:case PN:case TN:m=lI;break;case AN:m=jI;break;case"scroll":m=nI;break;case"wheel":m=SI;break;case"copy":case"cut":case"paste":m=uI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=d0}var g=(t&4)!==0,y=!g&&e==="scroll",b=g?f!==null?f+"Capture":null:f;g=[];for(var v=u,x;v!==null;){x=v;var j=x.stateNode;if(x.tag===5&&j!==null&&(x=j,b!==null&&(j=Bl(v,b),j!=null&&g.push(Yl(v,j,x)))),y)break;v=v.return}0<g.length&&(f=new m(f,w,null,r,d),h.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&r!==ep&&(w=r.relatedTarget||r.fromElement)&&(Ni(w)||w[Yn]))break e;if((m||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,m?(w=r.relatedTarget||r.toElement,m=u,w=w?Ni(w):null,w!==null&&(y=ra(w),w!==y||w.tag!==5&&w.tag!==6)&&(w=null)):(m=null,w=u),m!==w)){if(g=c0,j="onMouseLeave",b="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=d0,j="onPointerLeave",b="onPointerEnter",v="pointer"),y=m==null?f:Pa(m),x=w==null?f:Pa(w),f=new g(j,v+"leave",m,r,d),f.target=y,f.relatedTarget=x,j=null,Ni(d)===u&&(g=new g(b,v+"enter",w,r,d),g.target=x,g.relatedTarget=y,j=g),y=j,m&&w)t:{for(g=m,b=w,v=0,x=g;x;x=la(x))v++;for(x=0,j=b;j;j=la(j))x++;for(;0<v-x;)g=la(g),v--;for(;0<x-v;)b=la(b),x--;for(;v--;){if(g===b||b!==null&&g===b.alternate)break t;g=la(g),b=la(b)}g=null}else g=null;m!==null&&j0(h,f,m,g,!1),w!==null&&y!==null&&j0(h,y,w,g,!0)}}
vendor: 5,341 bytes, lines 37-38
37e:{if(f=u?Pa(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var N=AI;else if(m0(f))if(NN)N=MI;else{N=II;var S=RI}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(N=OI);if(N&&(N=N(e,u))){jN(h,N,r,d);break e}S&&S(e,f,u),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&Ym(f,"number",f.value)}switch(S=u?Pa(u):window,e){case"focusin":(m0(S)||S.contentEditable==="true")&&(Ca=S,op=u,Nl=null);break;case"focusout":Nl=op=Ca=null;break;case"mousedown":lp=!0;break;case"contextmenu":case"mouseup":case"dragend":lp=!1,y0(h,r,d);break;case"selectionchange":if($I)break;case"keydown":case"keyup":y0(h,r,d)}var _;if(Nx)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else ka?bN(e,r)&&(k="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(k="onCompositionStart");k&&(yN&&r.locale!=="ko"&&(ka||k!=="onCompositionStart"?k==="onCompositionEnd"&&ka&&(_=vN()):(Ts=d,bx="value"in Ts?Ts.value:Ts.textContent,ka=!0)),S=wd(u,k),0<S.length&&(k=new u0(k,e,null,r,d),h.push({event:k,listeners:S}),_?k.data=_:(_=wN(r),_!==null&&(k.data=_)))),(_=kI?CI(e,r):EI(e,r))&&(u=wd(u,"onBeforeInput"),0<u.length&&(d=new u0("onBeforeInput","beforeinput",null,r,d),h.push({event:d,listeners:u}),d.data=_))}IN(h,t)})}function Yl(e,t,r){return{instance:e,listener:t,currentTarget:r}}function wd(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,a=s.stateNode;s.tag===5&&a!==null&&(s=a,a=Bl(e,r),a!=null&&n.unshift(Yl(e,a,s)),a=Bl(e,t),a!=null&&n.push(Yl(e,a,s))),e=e.return}return n}function la(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function j0(e,t,r,n,s){for(var a=t._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,s?(c=Bl(r,a),c!=null&&o.unshift(Yl(r,c,l))):s||(c=Bl(r,a),c!=null&&o.push(Yl(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var BI=/\r\n?/g,zI=/\u0000|\uFFFD/g;function N0(e){return(typeof e=="string"?e:""+e).replace(BI,` 38`).replace(zI,"")}function hu(e,t,r){if(t=N0(t),N0(e)!==t&&r)throw Error(K(425))}function jd(){}var cp=null,up=null;function dp(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 hp=typeof setTimeout=="function"?setTimeout:void 0,GI=typeof clearTimeout=="function"?clearTimeout:void 0,S0=typeof Promise=="function"?Promise:void 0,WI=typeof queueMicrotask=="function"?queueMicrotask:typeof S0<"u"?function(e){return S0.resolve(null).then(e).catch(qI)}:hp;function qI(e){setTimeout(function(){throw e})}function Mf(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),Wl(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Wl(t)}function Ds(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 _0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Ao=Math.random().toString(36).slice(2),wn="__reactFiber$"+Ao,Ql="__reactProps$"+Ao,Yn="__reactContainer$"+Ao,fp="__reactEvents$"+Ao,HI="__reactListeners$"+Ao,KI="__reactHandles$"+Ao;function Ni(e){var t=e[wn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Yn]||r[wn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=_0(e);e!==null;){if(r=e[wn])return r;e=_0(e)}return t}e=r,r=e.parentNode}return null}function Dc(e){return e=e[wn]||e[Yn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Pa(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function yh(e){return e[Ql]||null}var mp=[],Ta=-1;function ei(e){return{current:e}}function Ve(e){0>Ta||(e.current=mp[Ta],mp[Ta]=null,Ta--)}function De(e,t){Ta++,mp[Ta]=e.current,e.current=t}var Ws={},Ft=ei(Ws),tr=ei(!1),zi=Ws;function mo(e,t){var r=e.type.contextTypes;if(!r)return Ws;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in r)s[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function rr(e){return e=e.childContextTypes,e!=null}function Nd(){Ve(tr),Ve(Ft)}function k0(e,t,r){if(Ft.current!==Ws)throw Error(K(168));De(Ft,t),De(tr,r)}function MN(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(K(108,RR(e)||"Unknown",s));return Je({},r,n)}function Sd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ws,zi=Ft.current,De(Ft,e),De(tr,tr.current),!0}function C0(e,t,r){var n=e.stateNode;if(!n)throw Error(K(169));r?(e=MN(e,t,zi),n.__reactInternalMemoizedMergedChildContext=e,Ve(tr),Ve(Ft),De(Ft,e)):Ve(tr),De(tr,r)}var Vn=null,bh=!1,Df=!1;function DN(e){Vn===null?Vn=[e]:Vn.push(e)}function YI(e){bh=!0,DN(e)}
vendor: 13,845 bytes, line 38
38function ti(){if(!Df&&Vn!==null){Df=!0;var e=0,t=Ae;try{var r=Vn;for(Ae=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Vn=null,bh=!1}catch(s){throw Vn!==null&&(Vn=Vn.slice(e+1)),oN(gx,ti),s}finally{Ae=t,Df=!1}}return null}var Aa=[],Ra=0,_d=null,kd=0,Er=[],Pr=0,Gi=null,zn=1,Gn="";function pi(e,t){Aa[Ra++]=kd,Aa[Ra++]=_d,_d=e,kd=t}function LN(e,t,r){Er[Pr++]=zn,Er[Pr++]=Gn,Er[Pr++]=Gi,Gi=e;var n=zn;e=Gn;var s=32-en(n)-1;n&=~(1<<s),r+=1;var a=32-en(t)+s;if(30<a){var o=s-s%5;a=(n&(1<<o)-1).toString(32),n>>=o,s-=o,zn=1<<32-en(t)+s|r<<s|n,Gn=a+e}else zn=1<<a|r<<s|n,Gn=e}function _x(e){e.return!==null&&(pi(e,1),LN(e,1,0))}function kx(e){for(;e===_d;)_d=Aa[--Ra],Aa[Ra]=null,kd=Aa[--Ra],Aa[Ra]=null;for(;e===Gi;)Gi=Er[--Pr],Er[Pr]=null,Gn=Er[--Pr],Er[Pr]=null,zn=Er[--Pr],Er[Pr]=null}var fr=null,hr=null,ze=!1,Xr=null;function $N(e,t){var r=Ar(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function E0(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,fr=e,hr=Ds(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,fr=e,hr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Gi!==null?{id:zn,overflow:Gn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Ar(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,fr=e,hr=null,!0):!1;default:return!1}}function pp(e){return(e.mode&1)!==0&&(e.flags&128)===0}function gp(e){if(ze){var t=hr;if(t){var r=t;if(!E0(e,t)){if(pp(e))throw Error(K(418));t=Ds(r.nextSibling);var n=fr;t&&E0(e,t)?$N(n,r):(e.flags=e.flags&-4097|2,ze=!1,fr=e)}}else{if(pp(e))throw Error(K(418));e.flags=e.flags&-4097|2,ze=!1,fr=e}}}function P0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;fr=e}function fu(e){if(e!==fr)return!1;if(!ze)return P0(e),ze=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!dp(e.type,e.memoizedProps)),t&&(t=hr)){if(pp(e))throw FN(),Error(K(418));for(;t;)$N(e,t),t=Ds(t.nextSibling)}if(P0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){hr=Ds(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}hr=null}}else hr=fr?Ds(e.stateNode.nextSibling):null;return!0}function FN(){for(var e=hr;e;)e=Ds(e.nextSibling)}function po(){hr=fr=null,ze=!1}function Cx(e){Xr===null?Xr=[e]:Xr.push(e)}var QI=ns.ReactCurrentBatchConfig;function Zo(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(K(309));var n=r.stateNode}if(!n)throw Error(K(147,e));var s=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=s.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(K(284));if(!r._owner)throw Error(K(290,e))}return e}function mu(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function T0(e){var t=e._init;return t(e._payload)}function UN(e){function t(b,v){if(e){var x=b.deletions;x===null?(b.deletions=[v],b.flags|=16):x.push(v)}}function r(b,v){if(!e)return null;for(;v!==null;)t(b,v),v=v.sibling;return null}function n(b,v){for(b=new Map;v!==null;)v.key!==null?b.set(v.key,v):b.set(v.index,v),v=v.sibling;return b}function s(b,v){return b=Us(b,v),b.index=0,b.sibling=null,b}function a(b,v,x){return b.index=x,e?(x=b.alternate,x!==null?(x=x.index,x<v?(b.flags|=2,v):x):(b.flags|=2,v)):(b.flags|=1048576,v)}function o(b){return e&&b.alternate===null&&(b.flags|=2),b}function l(b,v,x,j){return v===null||v.tag!==6?(v=zf(x,b.mode,j),v.return=b,v):(v=s(v,x),v.return=b,v)}function c(b,v,x,j){var N=x.type;return N===_a?d(b,v,x.props.children,j,x.key):v!==null&&(v.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===xs&&T0(N)===v.type)?(j=s(v,x.props),j.ref=Zo(b,v,x),j.return=b,j):(j=ed(x.type,x.key,x.props,null,b.mode,j),j.ref=Zo(b,v,x),j.return=b,j)}function u(b,v,x,j){return v===null||v.tag!==4||v.stateNode.containerInfo!==x.containerInfo||v.stateNode.implementation!==x.implementation?(v=Gf(x,b.mode,j),v.return=b,v):(v=s(v,x.children||[]),v.return=b,v)}function d(b,v,x,j,N){return v===null||v.tag!==7?(v=Ui(x,b.mode,j,N),v.return=b,v):(v=s(v,x),v.return=b,v)}function h(b,v,x){if(typeof v=="string"&&v!==""||typeof v=="number")return v=zf(""+v,b.mode,x),v.return=b,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case nu:return x=ed(v.type,v.key,v.props,null,b.mode,x),x.ref=Zo(b,null,v),x.return=b,x;case Sa:return v=Gf(v,b.mode,x),v.return=b,v;case xs:var j=v._init;return h(b,j(v._payload),x)}if(hl(v)||Ko(v))return v=Ui(v,b.mode,x,null),v.return=b,v;mu(b,v)}return null}function f(b,v,x,j){var N=v!==null?v.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return N!==null?null:l(b,v,""+x,j);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case nu:return x.key===N?c(b,v,x,j):null;case Sa:return x.key===N?u(b,v,x,j):null;case xs:return N=x._init,f(b,v,N(x._payload),j)}if(hl(x)||Ko(x))return N!==null?null:d(b,v,x,j,null);mu(b,x)}return null}function m(b,v,x,j,N){if(typeof j=="string"&&j!==""||typeof j=="number")return b=b.get(x)||null,l(v,b,""+j,N);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case nu:return b=b.get(j.key===null?x:j.key)||null,c(v,b,j,N);case Sa:return b=b.get(j.key===null?x:j.key)||null,u(v,b,j,N);case xs:var S=j._init;return m(b,v,x,S(j._payload),N)}if(hl(j)||Ko(j))return b=b.get(x)||null,d(v,b,j,N,null);mu(v,j)}return null}function w(b,v,x,j){for(var N=null,S=null,_=v,k=v=0,P=null;_!==null&&k<x.length;k++){_.index>k?(P=_,_=null):P=_.sibling;var C=f(b,_,x[k],j);if(C===null){_===null&&(_=P);break}e&&_&&C.alternate===null&&t(b,_),v=a(C,v,k),S===null?N=C:S.sibling=C,S=C,_=P}if(k===x.length)return r(b,_),ze&&pi(b,k),N;if(_===null){for(;k<x.length;k++)_=h(b,x[k],j),_!==null&&(v=a(_,v,k),S===null?N=_:S.sibling=_,S=_);return ze&&pi(b,k),N}for(_=n(b,_);k<x.length;k++)P=m(_,b,k,x[k],j),P!==null&&(e&&P.alternate!==null&&_.delete(P.key===null?k:P.key),v=a(P,v,k),S===null?N=P:S.sibling=P,S=P);return e&&_.forEach(function(D){return t(b,D)}),ze&&pi(b,k),N}function g(b,v,x,j){var N=Ko(x);if(typeof N!="function")throw Error(K(150));if(x=N.call(x),x==null)throw Error(K(151));for(var S=N=null,_=v,k=v=0,P=null,C=x.next();_!==null&&!C.done;k++,C=x.next()){_.index>k?(P=_,_=null):P=_.sibling;var D=f(b,_,C.value,j);if(D===null){_===null&&(_=P);break}e&&_&&D.alternate===null&&t(b,_),v=a(D,v,k),S===null?N=D:S.sibling=D,S=D,_=P}if(C.done)return r(b,_),ze&&pi(b,k),N;if(_===null){for(;!C.done;k++,C=x.next())C=h(b,C.value,j),C!==null&&(v=a(C,v,k),S===null?N=C:S.sibling=C,S=C);return ze&&pi(b,k),N}for(_=n(b,_);!C.done;k++,C=x.next())C=m(_,b,k,C.value,j),C!==null&&(e&&C.alternate!==null&&_.delete(C.key===null?k:C.key),v=a(C,v,k),S===null?N=C:S.sibling=C,S=C);return e&&_.forEach(function(I){return t(b,I)}),ze&&pi(b,k),N}function y(b,v,x,j){if(typeof x=="object"&&x!==null&&x.type===_a&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case nu:e:{for(var N=x.key,S=v;S!==null;){if(S.key===N){if(N=x.type,N===_a){if(S.tag===7){r(b,S.sibling),v=s(S,x.props.children),v.return=b,b=v;break e}}else if(S.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===xs&&T0(N)===S.type){r(b,S.sibling),v=s(S,x.props),v.ref=Zo(b,S,x),v.return=b,b=v;break e}r(b,S);break}else t(b,S);S=S.sibling}x.type===_a?(v=Ui(x.props.children,b.mode,j,x.key),v.return=b,b=v):(j=ed(x.type,x.key,x.props,null,b.mode,j),j.ref=Zo(b,v,x),j.return=b,b=j)}return o(b);case Sa:e:{for(S=x.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){r(b,v.sibling),v=s(v,x.children||[]),v.return=b,b=v;break e}else{r(b,v);break}else t(b,v);v=v.sibling}v=Gf(x,b.mode,j),v.return=b,b=v}return o(b);case xs:return S=x._init,y(b,v,S(x._payload),j)}if(hl(x))return w(b,v,x,j);if(Ko(x))return g(b,v,x,j);mu(b,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(r(b,v.sibling),v=s(v,x),v.return=b,b=v):(r(b,v),v=zf(x,b.mode,j),v.return=b,b=v),o(b)):r(b,v)}return y}var go=UN(!0),VN=UN(!1),Cd=ei(null),Ed=null,Ia=null,Ex=null;function Px(){Ex=Ia=Ed=null}function Tx(e){var t=Cd.current;Ve(Cd),e._currentValue=t}function xp(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Wa(e,t){Ed=e,Ex=Ia=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Zt=!0),e.firstContext=null)}function Mr(e){var t=e._currentValue;if(Ex!==e)if(e={context:e,memoizedValue:t,next:null},Ia===null){if(Ed===null)throw Error(K(308));Ia=e,Ed.dependencies={lanes:0,firstContext:e}}else Ia=Ia.next=e;return t}var Si=null;function Ax(e){Si===null?Si=[e]:Si.push(e)}function BN(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Ax(t)):(r.next=s.next,s.next=r),t.interleaved=r,Qn(e,n)}function Qn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var vs=!1;function Rx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zN(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 Wn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ls(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ke&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Qn(e,r)}return s=n.interleaved,s===null?(t.next=t,Ax(n)):(t.next=s.next,s.next=t),n.interleaved=t,Qn(e,r)}function Ku(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,xx(e,r)}}function A0(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?s=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?s=a=t:a=a.next=t}else s=a=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Pd(e,t,r,n){var s=e.updateQueue;vs=!1;var a=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var h=s.baseState;o=0,d=u=c=null,l=a;do{var f=l.lane,m=l.eventTime;if((n&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,g=l;switch(f=t,m=r,g.tag){case 1:if(w=g.payload,typeof w=="function"){h=w.call(m,h,f);break e}h=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=g.payload,f=typeof w=="function"?w.call(m,h,f):w,f==null)break e;h=Je({},h,f);break e;case 2:vs=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[l]:f.push(l))}else m={eventTime:m,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=h):d=d.next=m,o|=f;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;f=l,l=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(d===null&&(c=h),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);qi|=o,e.lanes=o,e.memoizedState=h}}function R0(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(K(191,s));s.call(n)}}}var Lc={},Sn=ei(Lc),Jl=ei(Lc),Xl=ei(Lc);function _i(e){if(e===Lc)throw Error(K(174));return e}function Ix(e,t){switch(De(Xl,t),De(Jl,e),De(Sn,Lc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Jm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Jm(t,e)}Ve(Sn),De(Sn,t)}function xo(){Ve(Sn),Ve(Jl),Ve(Xl)}function GN(e){_i(Xl.current);var t=_i(Sn.current),r=Jm(t,e.type);t!==r&&(De(Jl,e),De(Sn,r))}function Ox(e){Jl.current===e&&(Ve(Sn),Ve(Jl))}var qe=ei(0);function Td(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.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 Lf=[];function Mx(){for(var e=0;e<Lf.length;e++)Lf[e]._workInProgressVersionPrimary=null;Lf.length=0}var Yu=ns.ReactCurrentDispatcher,$f=ns.ReactCurrentBatchConfig,Wi=0,Ke=null,mt=null,xt=null,Ad=!1,Sl=!1,Zl=0,JI=0;function At(){throw Error(K(321))}function Dx(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!nn(e[r],t[r]))return!1;return!0}function Lx(e,t,r,n,s,a){if(Wi=a,Ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Yu.current=e===null||e.memoizedState===null?tO:rO,e=r(n,s),Sl){a=0;
vendor: 6,592 bytes, line 38
38do{if(Sl=!1,Zl=0,25<=a)throw Error(K(301));a+=1,xt=mt=null,t.updateQueue=null,Yu.current=nO,e=r(n,s)}while(Sl)}if(Yu.current=Rd,t=mt!==null&&mt.next!==null,Wi=0,xt=mt=Ke=null,Ad=!1,t)throw Error(K(300));return e}function $x(){var e=Zl!==0;return Zl=0,e}function xn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?Ke.memoizedState=xt=e:xt=xt.next=e,xt}function Dr(){if(mt===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var t=xt===null?Ke.memoizedState:xt.next;if(t!==null)xt=t,mt=e;else{if(e===null)throw Error(K(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},xt===null?Ke.memoizedState=xt=e:xt=xt.next=e}return xt}function ec(e,t){return typeof t=="function"?t(e):t}function Ff(e){var t=Dr(),r=t.queue;if(r===null)throw Error(K(311));r.lastRenderedReducer=e;var n=mt,s=n.baseQueue,a=r.pending;if(a!==null){if(s!==null){var o=s.next;s.next=a.next,a.next=o}n.baseQueue=s=a,r.pending=null}if(s!==null){a=s.next,n=n.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((Wi&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=h,o=n):c=c.next=h,Ke.lanes|=d,qi|=d}u=u.next}while(u!==null&&u!==a);c===null?o=n:c.next=l,nn(n,t.memoizedState)||(Zt=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do a=s.lane,Ke.lanes|=a,qi|=a,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Uf(e){var t=Dr(),r=t.queue;if(r===null)throw Error(K(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,a=t.memoizedState;if(s!==null){r.pending=null;var o=s=s.next;do a=e(a,o.action),o=o.next;while(o!==s);nn(a,t.memoizedState)||(Zt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function WN(){}function qN(e,t){var r=Ke,n=Dr(),s=t(),a=!nn(n.memoizedState,s);if(a&&(n.memoizedState=s,Zt=!0),n=n.queue,Fx(YN.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||xt!==null&&xt.memoizedState.tag&1){if(r.flags|=2048,tc(9,KN.bind(null,r,n,s,t),void 0,null),bt===null)throw Error(K(349));Wi&30||HN(r,t,s)}return s}function HN(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ke.updateQueue,t===null?(t={lastEffect:null,stores:null},Ke.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function KN(e,t,r,n){t.value=r,t.getSnapshot=n,QN(t)&&JN(e)}function YN(e,t,r){return r(function(){QN(t)&&JN(e)})}function QN(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!nn(e,r)}catch{return!0}}function JN(e){var t=Qn(e,1);t!==null&&tn(t,e,1,-1)}function I0(e){var t=xn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ec,lastRenderedState:e},t.queue=e,e=e.dispatch=eO.bind(null,Ke,e),[t.memoizedState,e]}function tc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Ke.updateQueue,t===null?(t={lastEffect:null,stores:null},Ke.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function XN(){return Dr().memoizedState}function Qu(e,t,r,n){var s=xn();Ke.flags|=e,s.memoizedState=tc(1|t,r,void 0,n===void 0?null:n)}function wh(e,t,r,n){var s=Dr();n=n===void 0?null:n;var a=void 0;if(mt!==null){var o=mt.memoizedState;if(a=o.destroy,n!==null&&Dx(n,o.deps)){s.memoizedState=tc(t,r,a,n);return}}Ke.flags|=e,s.memoizedState=tc(1|t,r,a,n)}function O0(e,t){return Qu(8390656,8,e,t)}function Fx(e,t){return wh(2048,8,e,t)}function ZN(e,t){return wh(4,2,e,t)}function eS(e,t){return wh(4,4,e,t)}function tS(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 rS(e,t,r){return r=r!=null?r.concat([e]):null,wh(4,4,tS.bind(null,t,e),r)}function Ux(){}function nS(e,t){var r=Dr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Dx(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function sS(e,t){var r=Dr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Dx(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function iS(e,t,r){return Wi&21?(nn(r,t)||(r=uN(),Ke.lanes|=r,qi|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Zt=!0),e.memoizedState=r)}function XI(e,t){var r=Ae;Ae=r!==0&&4>r?r:4,e(!0);var n=$f.transition;$f.transition={};try{e(!1),t()}finally{Ae=r,$f.transition=n}}function aS(){return Dr().memoizedState}function ZI(e,t,r){var n=Fs(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},oS(e))lS(t,r);else if(r=BN(e,t,r,n),r!==null){var s=Wt();tn(r,e,n,s),cS(r,t,n)}}function eO(e,t,r){var n=Fs(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(oS(e))lS(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,r);if(s.hasEagerState=!0,s.eagerState=l,nn(l,o)){var c=t.interleaved;c===null?(s.next=s,Ax(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=BN(e,t,s,n),r!==null&&(s=Wt(),tn(r,e,n,s),cS(r,t,n))}}function oS(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function lS(e,t){Sl=Ad=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function cS(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,xx(e,r)}}var Rd={readContext:Mr,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},tO={readContext:Mr,useCallback:function(e,t){return xn().memoizedState=[e,t===void 0?null:t],e},useContext:Mr,useEffect:O0,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Qu(4194308,4,tS.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Qu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qu(4,2,e,t)},useMemo:function(e,t){var r=xn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=xn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=ZI.bind(null,Ke,e),[n.memoizedState,e]}
vendor: 5,922 bytes, lines 38-40
38,useRef:function(e){var t=xn();return e={current:e},t.memoizedState=e},useState:I0,useDebugValue:Ux,useDeferredValue:function(e){return xn().memoizedState=e},useTransition:function(){var e=I0(!1),t=e[0];return e=XI.bind(null,e[1]),xn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ke,s=xn();if(ze){if(r===void 0)throw Error(K(407));r=r()}else{if(r=t(),bt===null)throw Error(K(349));Wi&30||HN(n,t,r)}s.memoizedState=r;var a={value:r,getSnapshot:t};return s.queue=a,O0(YN.bind(null,n,a,e),[e]),n.flags|=2048,tc(9,KN.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=xn(),t=bt.identifierPrefix;if(ze){var r=Gn,n=zn;r=(n&~(1<<32-en(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Zl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=JI++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rO={readContext:Mr,useCallback:nS,useContext:Mr,useEffect:Fx,useImperativeHandle:rS,useInsertionEffect:ZN,useLayoutEffect:eS,useMemo:sS,useReducer:Ff,useRef:XN,useState:function(){return Ff(ec)},useDebugValue:Ux,useDeferredValue:function(e){var t=Dr();return iS(t,mt.memoizedState,e)},useTransition:function(){var e=Ff(ec)[0],t=Dr().memoizedState;return[e,t]},useMutableSource:WN,useSyncExternalStore:qN,useId:aS,unstable_isNewReconciler:!1},nO={readContext:Mr,useCallback:nS,useContext:Mr,useEffect:Fx,useImperativeHandle:rS,useInsertionEffect:ZN,useLayoutEffect:eS,useMemo:sS,useReducer:Uf,useRef:XN,useState:function(){return Uf(ec)},useDebugValue:Ux,useDeferredValue:function(e){var t=Dr();return mt===null?t.memoizedState=e:iS(t,mt.memoizedState,e)},useTransition:function(){var e=Uf(ec)[0],t=Dr().memoizedState;return[e,t]},useMutableSource:WN,useSyncExternalStore:qN,useId:aS,unstable_isNewReconciler:!1};function Hr(e,t){if(e&&e.defaultProps){t=Je({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function vp(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Je({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var jh={isMounted:function(e){return(e=e._reactInternals)?ra(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Wt(),s=Fs(e),a=Wn(n,s);a.payload=t,r!=null&&(a.callback=r),t=Ls(e,a,s),t!==null&&(tn(t,e,s,n),Ku(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Wt(),s=Fs(e),a=Wn(n,s);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Ls(e,a,s),t!==null&&(tn(t,e,s,n),Ku(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Wt(),n=Fs(e),s=Wn(r,n);s.tag=2,t!=null&&(s.callback=t),t=Ls(e,s,n),t!==null&&(tn(t,e,n,r),Ku(t,e,n))}};function M0(e,t,r,n,s,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,o):t.prototype&&t.prototype.isPureReactComponent?!Hl(r,n)||!Hl(s,a):!0}function uS(e,t,r){var n=!1,s=Ws,a=t.contextType;return typeof a=="object"&&a!==null?a=Mr(a):(s=rr(t)?zi:Ft.current,n=t.contextTypes,a=(n=n!=null)?mo(e,s):Ws),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=jh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=a),t}function D0(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&jh.enqueueReplaceState(t,t.state,null)}function yp(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Rx(e);var a=t.contextType;typeof a=="object"&&a!==null?s.context=Mr(a):(a=rr(t)?zi:Ft.current,s.context=mo(e,a)),s.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(vp(e,t,a,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&jh.enqueueReplaceState(s,s.state,null),Pd(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function vo(e,t){try{var r="",n=t;do r+=AR(n),n=n.return;while(n);var s=r}catch(a){s=` 39Error generating stack: `+a.message+` 40`+a.stack}return{value:e,source:t,stack:s,digest:null}}function Vf(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function bp(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var sO=typeof WeakMap=="function"?WeakMap:Map;function dS(e,t,r){r=Wn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Od||(Od=!0,Tp=n),bp(e,t)},r}function hS(e,t,r){r=Wn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){bp(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){bp(e,t),typeof n!="function"&&($s===null?$s=new Set([this]):$s.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function L0(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new sO;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=vO.bind(null,e,t,r),t.then(e,e))}function $0(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 F0(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Wn(-1,1),t.tag=2,Ls(r,t,1))),r.lanes|=1),e)}var iO=ns.ReactCurrentOwner,Zt=!1;function Bt(e,t,r,n){t.child=e===null?VN(t,null,r,n):go(t,e.child,r,n)}function U0(e,t,r,n,s){r=r.render;var a=t.ref;
vendor: 6,220 bytes, line 40
40return Wa(t,s),n=Lx(e,t,r,n,a,s),r=$x(),e!==null&&!Zt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Jn(e,t,s)):(ze&&r&&_x(t),t.flags|=1,Bt(e,t,n,s),t.child)}function V0(e,t,r,n,s){if(e===null){var a=r.type;return typeof a=="function"&&!Kx(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,fS(e,t,a,n,s)):(e=ed(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&s)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:Hl,r(o,n)&&e.ref===t.ref)return Jn(e,t,s)}return t.flags|=1,e=Us(a,n),e.ref=t.ref,e.return=t,t.child=e}function fS(e,t,r,n,s){if(e!==null){var a=e.memoizedProps;if(Hl(a,n)&&e.ref===t.ref)if(Zt=!1,t.pendingProps=n=a,(e.lanes&s)!==0)e.flags&131072&&(Zt=!0);else return t.lanes=e.lanes,Jn(e,t,s)}return wp(e,t,r,n,s)}function mS(e,t,r){var n=t.pendingProps,s=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},De(Ma,ar),ar|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,De(Ma,ar),ar|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,De(Ma,ar),ar|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,De(Ma,ar),ar|=n;return Bt(e,t,s,r),t.child}function pS(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function wp(e,t,r,n,s){var a=rr(r)?zi:Ft.current;return a=mo(t,a),Wa(t,s),r=Lx(e,t,r,n,a,s),n=$x(),e!==null&&!Zt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Jn(e,t,s)):(ze&&n&&_x(t),t.flags|=1,Bt(e,t,r,s),t.child)}function B0(e,t,r,n,s){if(rr(r)){var a=!0;Sd(t)}else a=!1;if(Wa(t,s),t.stateNode===null)Ju(e,t),uS(t,r,n),yp(t,r,n,s),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Mr(u):(u=rr(r)?zi:Ft.current,u=mo(t,u));var d=r.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==u)&&D0(t,o,n,u),vs=!1;var f=t.memoizedState;o.state=f,Pd(t,n,o,s),c=t.memoizedState,l!==n||f!==c||tr.current||vs?(typeof d=="function"&&(vp(t,r,d,n),c=t.memoizedState),(l=vs||M0(t,r,l,n,f,c,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),o.props=n,o.state=c,o.context=u,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,zN(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Hr(t.type,l),o.props=u,h=t.pendingProps,f=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Mr(c):(c=rr(r)?zi:Ft.current,c=mo(t,c));var m=r.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||f!==c)&&D0(t,o,n,c),vs=!1,f=t.memoizedState,o.state=f,Pd(t,n,o,s);var w=t.memoizedState;l!==h||f!==w||tr.current||vs?(typeof m=="function"&&(vp(t,r,m,n),w=t.memoizedState),(u=vs||M0(t,r,u,n,f,w,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,w,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,w,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=w),o.props=n,o.state=w,o.context=c,n=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return jp(e,t,r,n,a,s)}function jp(e,t,r,n,s,a){pS(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return s&&C0(t,r,!1),Jn(e,t,a);n=t.stateNode,iO.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=go(t,e.child,null,a),t.child=go(t,null,l,a)):Bt(e,t,l,a),t.memoizedState=n.state,s&&C0(t,r,!0),t.child}function gS(e){var t=e.stateNode;t.pendingContext?k0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&k0(e,t.context,!1),Ix(e,t.containerInfo)}function z0(e,t,r,n,s){return po(),Cx(s),t.flags|=256,Bt(e,t,r,n),t.child}var Np={dehydrated:null,treeContext:null,retryLane:0};function Sp(e){return{baseLanes:e,cachePool:null,transitions:null}}function xS(e,t,r){var n=t.pendingProps,s=qe.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),De(qe,s&1),e===null)return gp(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=n.children,e=n.fallback,a?(n=t.mode,a=t.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=_h(o,n,0,null),e=Ui(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Sp(r),t.memoizedState=Np,e):Vx(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return aO(e,t,o,n,l,s,r);if(a){a=n.fallback,o=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Us(s,c),n.subtreeFlags=s.subtreeFlags&14680064),l!==null?a=Us(l,a):(a=Ui(a,o,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,o=e.child.memoizedState,o=o===null?Sp(r):{base
vendor: 8,918 bytes, line 40
40Lanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=Np,n}return a=e.child,e=a.sibling,n=Us(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Vx(e,t){return t=_h({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function pu(e,t,r,n){return n!==null&&Cx(n),go(t,e.child,null,r),e=Vx(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function aO(e,t,r,n,s,a,o){if(r)return t.flags&256?(t.flags&=-257,n=Vf(Error(K(422))),pu(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,s=t.mode,n=_h({mode:"visible",children:n.children},s,0,null),a=Ui(a,s,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&go(t,e.child,null,o),t.child.memoizedState=Sp(o),t.memoizedState=Np,a);if(!(t.mode&1))return pu(e,t,o,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(K(419)),n=Vf(a,n,void 0),pu(e,t,o,n)}if(l=(o&e.childLanes)!==0,Zt||l){if(n=bt,n!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|o)?0:s,s!==0&&s!==a.retryLane&&(a.retryLane=s,Qn(e,s),tn(n,e,s,-1))}return Hx(),n=Vf(Error(K(421))),pu(e,t,o,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=yO.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,hr=Ds(s.nextSibling),fr=t,ze=!0,Xr=null,e!==null&&(Er[Pr++]=zn,Er[Pr++]=Gn,Er[Pr++]=Gi,zn=e.id,Gn=e.overflow,Gi=t),t=Vx(t,n.children),t.flags|=4096,t)}function G0(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),xp(e.return,t,r)}function Bf(e,t,r,n,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=s)}function vS(e,t,r){var n=t.pendingProps,s=n.revealOrder,a=n.tail;if(Bt(e,t,n.children,r),n=qe.current,n&2)n=n&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&&G0(e,r,t);else if(e.tag===19)G0(e,r,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}n&=1}if(De(qe,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&Td(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Bf(t,!1,s,r,a);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Td(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Bf(t,!0,r,null,a);break;case"together":Bf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ju(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Jn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),qi|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,r=Us(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Us(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function oO(e,t,r){switch(t.tag){case 3:gS(t),po();break;case 5:GN(t);break;case 1:rr(t.type)&&Sd(t);break;case 4:Ix(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;De(Cd,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(De(qe,qe.current&1),t.flags|=128,null):r&t.child.childLanes?xS(e,t,r):(De(qe,qe.current&1),e=Jn(e,t,r),e!==null?e.sibling:null);De(qe,qe.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return vS(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),De(qe,qe.current),n)break;return null;case 22:case 23:return t.lanes=0,mS(e,t,r)}return Jn(e,t,r)}var yS,_p,bS,wS;yS=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};_p=function(){};bS=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,_i(Sn.current);var a=null;switch(r){case"input":s=Hm(e,s),n=Hm(e,n),a=[];break;case"select":s=Je({},s,{value:void 0}),n=Je({},n,{value:void 0}),a=[];break;case"textarea":s=Qm(e,s),n=Qm(e,n),a=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=jd)}Xm(r,n);var o;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ul.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in n){var c=n[u];if(l=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(a||(a=[]),a.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ul.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Fe("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}r&&(a=a||[]).push("style",r);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};wS=function(e,t,r,n){r!==n&&(t.flags|=4)};function el(e,t){if(!ze)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Rt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function lO(e,t,r){var n=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 rr(t.type)&&Nd(),Rt(t),null;case 3:return n=t.stateNode,xo(),Ve(tr),Ve(Ft),Mx(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Xr!==null&&(Ip(Xr),Xr=null))),_p(e,t),Rt(t),null;case 5:Ox(t);var s=_i(Xl.current);if(r=t.type,e!==null&&t.stateNode!=null)bS(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(K(166));return Rt(t),null}if(e=_i(Sn.current),fu(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[wn]=t,n[Ql]=a,e=(t.mode&1)!==0,r){case"dialog":Fe("cancel",n),Fe("close",n);break;case"iframe":case"object":case"embed":Fe("load",n);break;case"video":case"audio":for(s=0;s<ml.length;s++)Fe(ml[s],n);break;case"source":Fe("error",n);break;case"img":case"image":case"link":Fe("error",n),Fe("load",n);break;case"details":Fe("toggle",n);break;case"input":Zy(n,a),Fe("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Fe("invalid",n);break;case"textarea":t0(n,a),Fe("invalid",n)}Xm(r,a),s=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?n.textContent!==l&&(a.suppressHydrationWarning!==!0&&hu(n.textContent,l,e),s=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&hu(n.textContent,l,e),s=["children",""+l]):Ul.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Fe("scroll",n)}switch(r){case"input":su(n),e0(n,a,!0);break;case"textarea":su(n),r0(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=jd)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Y1(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[wn]=t,e[Ql]=n,yS(e,t,!1,!1),t.stateNode=e;e:{switch(o=Zm(r,n),r){case"dialog":Fe("cancel",e),Fe("close",e),s=n;break;case"iframe":case"object":case"embed":Fe("load",e),s=n;break;case"video":case"audio":for(s=0;s<ml.length;s++)Fe(ml[s],e);s=n;break;case"source":Fe("error",e),s=n;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),s=n;break;case"details":Fe("toggle",e),s=n;break;case"input":Zy(e,n),s=Hm(e,n),Fe("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=Je({},n,{value:void 0}),Fe("invalid",e);break;case"textarea":t0(e,n),s=Qm(e,n),Fe("invalid",e);break;default:s=n}Xm(r,s),l=s;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?X1(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Q1(e,c)):a==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Vl(e,c):typeof c=="number"&&Vl(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Ul.hasOwnProperty(a)?c!=null&&a==="onScroll"&&Fe("scroll",e):c!=null&&dx(e,a,c,o))}switch(r){case"input":su(e),e0(e,n,!1);break;case"textarea":su(e),r0(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Gs(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?Va(e,!!n.multiple,a,!1):n.defaultValue!=null&&Va(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=jd)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Rt(t),null;case 6:if(e&&t.stateNode!=null)wS(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(K(166));if(r=_i(Xl.current),_i(Sn.current),fu(t)){if(n=t.stateNode,r=t.memoizedProps,n[wn]=t,(a=n.nodeValue!==r)&&(e=fr,e!==null))switch(e.tag){case 3:hu(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&hu(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[wn]=t,t.stateNode=n}return Rt(t),null;case 13:if(Ve(qe),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ze&&hr!==null&&t.mode&1&&!(t.flags&128))FN(),po(),t.flags|=98560,a=!1;else if(a=fu(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(K(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(K(317));a[wn]=t}else po(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rt(t),a=!1}else Xr!==null&&(Ip(Xr),Xr=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||qe.current&1?pt===0&&(pt=3):Hx())),t.updateQueue!==null&&(t.flags|=4),Rt(t),null);case 4:return xo(),_p(e,t),e===null&&Kl(t.stateNode.containerInfo),Rt(t),null;case 10:return Tx(t.type._context),Rt(t),null;case 17:return rr(t.type)&&Nd(),Rt(t),null;case 19:if(Ve(qe),a=t.memoizedState,a===null)return Rt(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)el(a,!1);else{if(pt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Td(e),o!==null){for(t.flags|=128,el(a,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return De(qe,qe.current&1|2),t.child}e=e.sibling}a.tail!==null&&at()>yo&&(t.flags|=128,n=!0,el(a,!1),t.lanes=4194304)}else{if(!n)if(e=Td(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),el(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!ze)return Rt(t),null}else 2*at()-a.renderingStartTime>yo&&r!==1073741824&&(t.flags|=128,n=!0,el(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=at(),t.sibling=null,r=qe.current,De(qe,n?r&1|2:r&1),t):(Rt(t),null);case 22:case 23:return qx(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?ar&1073741824&&(Rt(t),t.subtreeFlags&6&&(t.flags|=8192)):Rt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function cO(e,t){switch(kx(t),t.tag){case 1:return rr(t.type)&&Nd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 25,774 bytes, line 40
40case 3:return xo(),Ve(tr),Ve(Ft),Mx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ox(t),null;case 13:if(Ve(qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));po()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ve(qe),null;case 4:return xo(),null;case 10:return Tx(t.type._context),null;case 22:case 23:return qx(),null;case 24:return null;default:return null}}var gu=!1,Mt=!1,uO=typeof WeakSet=="function"?WeakSet:Set,ne=null;function Oa(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){et(e,t,n)}else r.current=null}function kp(e,t,r){try{r()}catch(n){et(e,t,n)}}var W0=!1;function dO(e,t){if(cp=yd,e=kN(),Sx(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,d=0,h=e,f=null;t:for(;;){for(var m;h!==r||s!==0&&h.nodeType!==3||(l=o+s),h!==a||n!==0&&h.nodeType!==3||(c=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(m=h.firstChild)!==null;)f=h,h=m;for(;;){if(h===e)break t;if(f===r&&++u===s&&(l=o),f===a&&++d===n&&(c=o),(m=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(up={focusedElem:e,selectionRange:r},yd=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var g=w.memoizedProps,y=w.memoizedState,b=t.stateNode,v=b.getSnapshotBeforeUpdate(t.elementType===t.type?g:Hr(t.type,g),y);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(j){et(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return w=W0,W0=!1,w}function _l(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&kp(t,r,a)}s=s.next}while(s!==n)}}function Nh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Cp(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function jS(e){var t=e.alternate;t!==null&&(e.alternate=null,jS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wn],delete t[Ql],delete t[fp],delete t[HI],delete t[KI])),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 NS(e){return e.tag===5||e.tag===3||e.tag===4}function q0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||NS(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 Ep(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=jd));else if(n!==4&&(e=e.child,e!==null))for(Ep(e,t,r),e=e.sibling;e!==null;)Ep(e,t,r),e=e.sibling}function Pp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Pp(e,t,r),e=e.sibling;e!==null;)Pp(e,t,r),e=e.sibling}var jt=null,Jr=!1;function cs(e,t,r){for(r=r.child;r!==null;)SS(e,t,r),r=r.sibling}function SS(e,t,r){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(ph,r)}catch{}switch(r.tag){case 5:Mt||Oa(r,t);case 6:var n=jt,s=Jr;jt=null,cs(e,t,r),jt=n,Jr=s,jt!==null&&(Jr?(e=jt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):jt.removeChild(r.stateNode));break;case 18:jt!==null&&(Jr?(e=jt,r=r.stateNode,e.nodeType===8?Mf(e.parentNode,r):e.nodeType===1&&Mf(e,r),Wl(e)):Mf(jt,r.stateNode));break;case 4:n=jt,s=Jr,jt=r.stateNode.containerInfo,Jr=!0,cs(e,t,r),jt=n,Jr=s;break;case 0:case 11:case 14:case 15:if(!Mt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var a=s,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&kp(r,t,o),s=s.next}while(s!==n)}cs(e,t,r);break;case 1:if(!Mt&&(Oa(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){et(r,t,l)}cs(e,t,r);break;case 21:cs(e,t,r);break;case 22:r.mode&1?(Mt=(n=Mt)||r.memoizedState!==null,cs(e,t,r),Mt=n):cs(e,t,r);break;default:cs(e,t,r)}}function H0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new uO),t.forEach(function(n){var s=bO.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function Br(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:jt=l.stateNode,Jr=!1;break e;case 3:jt=l.stateNode.containerInfo,Jr=!0;break e;case 4:jt=l.stateNode.containerInfo,Jr=!0;break e}l=l.return}if(jt===null)throw Error(K(160));SS(a,o,s),jt=null,Jr=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){et(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)_S(t,e),t=t.sibling}function _S(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Br(t,e),gn(e),n&4){try{_l(3,e,e.return),Nh(3,e)}catch(g){et(e,e.return,g)}try{_l(5,e,e.return)}catch(g){et(e,e.return,g)}}break;case 1:Br(t,e),gn(e),n&512&&r!==null&&Oa(r,r.return);break;case 5:if(Br(t,e),gn(e),n&512&&r!==null&&Oa(r,r.return),e.flags&32){var s=e.stateNode;try{Vl(s,"")}catch(g){et(e,e.return,g)}}if(n&4&&(s=e.stateNode,s!=null)){var a=e.memoizedProps,o=r!==null?r.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&H1(s,a),Zm(l,o);var u=Zm(l,a);for(o=0;o<c.length;o+=2){var d=c[o],h=c[o+1];d==="style"?X1(s,h):d==="dangerouslySetInnerHTML"?Q1(s,h):d==="children"?Vl(s,h):dx(s,d,h,u)}switch(l){case"input":Km(s,a);break;case"textarea":K1(s,a);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?Va(s,!!a.multiple,m,!1):f!==!!a.multiple&&(a.defaultValue!=null?Va(s,!!a.multiple,a.defaultValue,!0):Va(s,!!a.multiple,a.multiple?[]:"",!1))}s[Ql]=a}catch(g){et(e,e.return,g)}}break;case 6:if(Br(t,e),gn(e),n&4){if(e.stateNode===null)throw Error(K(162));s=e.stateNode,a=e.memoizedProps;try{s.nodeValue=a}catch(g){et(e,e.return,g)}}break;case 3:if(Br(t,e),gn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Wl(t.containerInfo)}catch(g){et(e,e.return,g)}break;case 4:Br(t,e),gn(e);break;case 13:Br(t,e),gn(e),s=e.child,s.flags&8192&&(a=s.memoizedState!==null,s.stateNode.isHidden=a,!a||s.alternate!==null&&s.alternate.memoizedState!==null||(Gx=at())),n&4&&H0(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(Mt=(u=Mt)||d,Br(t,e),Mt=u):Br(t,e),gn(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ne=e,d=e.child;d!==null;){for(h=ne=d;ne!==null;){switch(f=ne,m=f.child,f.tag){case 0:case 11:case 14:case 15:_l(4,f,f.return);break;case 1:Oa(f,f.return);var w=f.stateNode;if(typeof w.componentWillUnmount=="function"){n=f,r=f.return;try{t=n,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(g){et(n,r,g)}}break;case 5:Oa(f,f.return);break;case 22:if(f.memoizedState!==null){Y0(h);continue}}m!==null?(m.return=f,ne=m):Y0(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{s=h.stateNode,u?(a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=J1("display",o))}catch(g){et(e,e.return,g)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(g){et(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;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Br(t,e),gn(e),n&4&&H0(e);break;case 21:break;default:Br(t,e),gn(e)}}function gn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(NS(r)){var n=r;break e}r=r.return}throw Error(K(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Vl(s,""),n.flags&=-33);var a=q0(e);Pp(e,a,s);break;case 3:case 4:var o=n.stateNode.containerInfo,l=q0(e);Ep(e,l,o);break;default:throw Error(K(161))}}catch(c){et(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hO(e,t,r){ne=e,kS(e)}function kS(e,t,r){for(var n=(e.mode&1)!==0;ne!==null;){var s=ne,a=s.child;if(s.tag===22&&n){var o=s.memoizedState!==null||gu;if(!o){var l=s.alternate,c=l!==null&&l.memoizedState!==null||Mt;l=gu;var u=Mt;if(gu=o,(Mt=c)&&!u)for(ne=s;ne!==null;)o=ne,c=o.child,o.tag===22&&o.memoizedState!==null?Q0(s):c!==null?(c.return=o,ne=c):Q0(s);for(;a!==null;)ne=a,kS(a),a=a.sibling;ne=s,gu=l,Mt=u}K0(e)}else s.subtreeFlags&8772&&a!==null?(a.return=s,ne=a):K0(e)}}function K0(e){for(;ne!==null;){var t=ne;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Mt||Nh(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Mt)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:Hr(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&R0(t,a,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}R0(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&Wl(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}Mt||t.flags&512&&Cp(t)}catch(f){et(t,t.return,f)}}if(t===e){ne=null;break}if(r=t.sibling,r!==null){r.return=t.return,ne=r;break}ne=t.return}}function Y0(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ne=r;break}ne=t.return}}function Q0(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Nh(4,t)}catch(c){et(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(c){et(t,s,c)}}var a=t.return;try{Cp(t)}catch(c){et(t,a,c)}break;case 5:var o=t.return;try{Cp(t)}catch(c){et(t,o,c)}}}catch(c){et(t,t.return,c)}if(t===e){ne=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ne=l;break}ne=t.return}}var fO=Math.ceil,Id=ns.ReactCurrentDispatcher,Bx=ns.ReactCurrentOwner,Ir=ns.ReactCurrentBatchConfig,ke=0,bt=null,dt=null,Ct=0,ar=0,Ma=ei(0),pt=0,rc=null,qi=0,Sh=0,zx=0,kl=null,Xt=null,Gx=0,yo=1/0,Fn=null,Od=!1,Tp=null,$s=null,xu=!1,As=null,Md=0,Cl=0,Ap=null,Xu=-1,Zu=0;function Wt(){return ke&6?at():Xu!==-1?Xu:Xu=at()}function Fs(e){return e.mode&1?ke&2&&Ct!==0?Ct&-Ct:QI.transition!==null?(Zu===0&&(Zu=uN()),Zu):(e=Ae,e!==0||(e=window.event,e=e===void 0?16:xN(e.type)),e):1}function tn(e,t,r,n){if(50<Cl)throw Cl=0,Ap=null,Error(K(185));Oc(e,r,n),(!(ke&2)||e!==bt)&&(e===bt&&(!(ke&2)&&(Sh|=r),pt===4&&bs(e,Ct)),nr(e,n),r===1&&ke===0&&!(t.mode&1)&&(yo=at()+500,bh&&ti()))}function nr(e,t){var r=e.callbackNode;QR(e,t);var n=vd(e,e===bt?Ct:0);if(n===0)r!==null&&i0(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&i0(r),t===1)e.tag===0?YI(J0.bind(null,e)):DN(J0.bind(null,e)),WI(function(){!(ke&6)&&ti()}),r=null;else{switch(dN(n)){case 1:r=gx;break;case 4:r=lN;break;case 16:r=xd;break;case 536870912:r=cN;break;default:r=xd}r=OS(r,CS.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function CS(e,t){if(Xu=-1,Zu=0,ke&6)throw Error(K(327));var r=e.callbackNode;if(qa()&&e.callbackNode!==r)return null;var n=vd(e,e===bt?Ct:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Dd(e,n);else{t=n;var s=ke;ke|=2;var a=PS();(bt!==e||Ct!==t)&&(Fn=null,yo=at()+500,Fi(e,t));do try{gO();break}catch(l){ES(e,l)}while(!0);Px(),Id.current=a,ke=s,dt!==null?t=0:(bt=null,Ct=0,t=pt)}if(t!==0){if(t===2&&(s=sp(e),s!==0&&(n=s,t=Rp(e,s))),t===1)throw r=rc,Fi(e,0),bs(e,n),nr(e,at()),r;if(t===6)bs(e,n);else{if(s=e.current.alternate,!(n&30)&&!mO(s)&&(t=Dd(e,n),t===2&&(a=sp(e),a!==0&&(n=a,t=Rp(e,a))),t===1))throw r=rc,Fi(e,0),bs(e,n),nr(e,at()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(K(345));case 2:gi(e,Xt,Fn);break;case 3:if(bs(e,n),(n&130023424)===n&&(t=Gx+500-at(),10<t)){if(vd(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){Wt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=hp(gi.bind(null,e,Xt,Fn),t);break}gi(e,Xt,Fn);break;case 4:if(bs(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var o=31-en(n);a=1<<o,o=t[o],o>s&&(s=o),n&=~a}if(n=s,n=at()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*fO(n/1960))-n,10<n){e.timeoutHandle=hp(gi.bind(null,e,Xt,Fn),n);break}gi(e,Xt,Fn);break;case 5:gi(e,Xt,Fn);break;default:throw Error(K(329))}}}return nr(e,at()),e.callbackNode===r?CS.bind(null,e):null}function Rp(e,t){var r=kl;return e.current.memoizedState.isDehydrated&&(Fi(e,t).flags|=256),e=Dd(e,t),e!==2&&(t=Xt,Xt=r,t!==null&&Ip(t)),e}function Ip(e){Xt===null?Xt=e:Xt.push.apply(Xt,e)}function mO(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],a=s.getSnapshot;s=s.value;try{if(!nn(a(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 bs(e,t){for(t&=~zx,t&=~Sh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-en(t),n=1<<r;e[r]=-1,t&=~n}}function J0(e){if(ke&6)throw Error(K(327));qa();var t=vd(e,0);if(!(t&1))return nr(e,at()),null;var r=Dd(e,t);if(e.tag!==0&&r===2){var n=sp(e);n!==0&&(t=n,r=Rp(e,n))}if(r===1)throw r=rc,Fi(e,0),bs(e,t),nr(e,at()),r;if(r===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,gi(e,Xt,Fn),nr(e,at()),null}function Wx(e,t){var r=ke;ke|=1;try{return e(t)}finally{ke=r,ke===0&&(yo=at()+500,bh&&ti())}}function Hi(e){As!==null&&As.tag===0&&!(ke&6)&&qa();var t=ke;ke|=1;var r=Ir.transition,n=Ae;try{if(Ir.transition=null,Ae=1,e)return e()}finally{Ae=n,Ir.transition=r,ke=t,!(ke&6)&&ti()}}function qx(){ar=Ma.current,Ve(Ma)}function Fi(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,GI(r)),dt!==null)for(r=dt.return;r!==null;){var n=r;switch(kx(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Nd();break;case 3:xo(),Ve(tr),Ve(Ft),Mx();break;case 5:Ox(n);break;case 4:xo();break;case 13:Ve(qe);break;case 19:Ve(qe);break;case 10:Tx(n.type._context);break;case 22:case 23:qx()}r=r.return}if(bt=e,dt=e=Us(e.current,null),Ct=ar=t,pt=0,rc=null,zx=Sh=qi=0,Xt=kl=null,Si!==null){for(t=0;t<Si.length;t++)if(r=Si[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,a=r.pending;if(a!==null){var o=a.next;a.next=s,n.next=o}r.pending=n}Si=null}return e}function ES(e,t){do{var r=dt;try{if(Px(),Yu.current=Rd,Ad){for(var n=Ke.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Ad=!1}if(Wi=0,xt=mt=Ke=null,Sl=!1,Zl=0,Bx.current=null,r===null||r.return===null){pt=1,rc=t,dt=null;break}e:{var a=e,o=r.return,l=r,c=t;if(t=Ct,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=$0(o);if(m!==null){m.flags&=-257,F0(m,o,l,a,t),m.mode&1&&L0(a,u,t),t=m,c=u;var w=t.updateQueue;if(w===null){var g=new Set;g.add(c),t.updateQueue=g}else w.add(c);break e}else{if(!(t&1)){L0(a,u,t),Hx();break e}c=Error(K(426))}}else if(ze&&l.mode&1){var y=$0(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),F0(y,o,l,a,t),Cx(vo(c,l));break e}}a=c=vo(c,l),pt!==4&&(pt=2),kl===null?kl=[a]:kl.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var b=dS(a,c,t);A0(a,b);break e;case 1:l=c;var v=a.type,x=a.stateNode;if(!(a.flags&128)&&(typeof v.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&($s===null||!$s.has(x)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=hS(a,l,t);A0(a,j);break e}}a=a.return}while(a!==null)}AS(r)}catch(N){t=N,dt===r&&r!==null&&(dt=r=r.return);continue}break}while(!0)}function PS(){var e=Id.current;return Id.current=Rd,e===null?Rd:e}function Hx(){(pt===0||pt===3||pt===2)&&(pt=4),bt===null||!(qi&268435455)&&!(Sh&268435455)||bs(bt,Ct)}function Dd(e,t){var r=ke;ke|=2;var n=PS();(bt!==e||Ct!==t)&&(Fn=null,Fi(e,t));do try{pO();break}catch(s){ES(e,s)}while(!0);if(Px(),ke=r,Id.current=n,dt!==null)throw Error(K(261));return bt=null,Ct=0,pt}function pO(){for(;dt!==null;)TS(dt)}function gO(){for(;dt!==null&&!VR();)TS(dt)}function TS(e){var t=IS(e.alternate,e,ar);e.memoizedProps=e.pendingProps,t===null?AS(e):dt=t,Bx.current=null}function AS(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=cO(r,t),r!==null){r.flags&=32767,dt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{pt=6,dt=null;return}}else if(r=lO(r,t,ar),r!==null){dt=r;return}if(t=t.sibling,t!==null){dt=t;return}dt=t=e}while(t!==null);pt===0&&(pt=5)}function gi(e,t,r){var n=Ae,s=Ir.transition;try{Ir.transition=null,Ae=1,xO(e,t,r,n)}finally{Ir.transition=s,Ae=n}return null}function xO(e,t,r,n){do qa();while(As!==null);if(ke&6)throw Error(K(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(JR(e,a),e===bt&&(dt=bt=null,Ct=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||xu||(xu=!0,OS(xd,function(){return qa(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=Ir.transition,Ir.transition=null;var o=Ae;Ae=1;var l=ke;ke|=4,Bx.current=null,dO(e,r),_S(r,e),LI(up),yd=!!cp,up=cp=null,e.current=r,hO(r),BR(),ke=l,Ae=o,Ir.transition=a}else e.current=r;if(xu&&(xu=!1,As=e,Md=s),a=e.pendingLanes,a===0&&($s=null),WR(r.stateNode),nr(e,at()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(Od)throw Od=!1,e=Tp,Tp=null,e;return Md&1&&e.tag!==0&&qa(),a=e.pendingLanes,a&1?e===Ap?Cl++:(Cl=0,Ap=e):Cl=0,ti(),null}function qa(){if(As!==null){var e=dN(Md),t=Ir.transition,r=Ae;try{if(Ir.transition=null,Ae=16>e?16:e,As===null)var n=!1;else{if(e=As,As=null,Md=0,ke&6)throw Error(K(331));var s=ke;for(ke|=4,ne=e.current;ne!==null;){var a=ne,o=a.child;if(ne.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ne=u;ne!==null;){var d=ne;switch(d.tag){case 0:case 11:case 15:_l(8,d,a)}var h=d.child;if(h!==null)h.return=d,ne=h;else for(;ne!==null;){d=ne;var f=d.sibling,m=d.return;if(jS(d),d===u){ne=null;break}if(f!==null){f.return=m,ne=f;break}ne=m}}}var w=a.alternate;if(w!==null){var g=w.child;if(g!==null){w.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==null)}}ne=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,ne=o;else e:for(;ne!==null;){if(a=ne,a.flags&2048)switch(a.tag){case 0:case 11:case 15:_l(9,a,a.return)}var b=a.sibling;if(b!==null){b.return=a.return,ne=b;break e}ne=a.return}}var v=e.current;for(ne=v;ne!==null;){o=ne;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,ne=x;else e:for(o=v;ne!==null;){if(l=ne,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Nh(9,l)}}catch(N){et(l,l.return,N)}if(l===o){ne=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,ne=j;break e}ne=l.return}}if(ke=s,ti(),Nn&&typeof Nn.onPostCommitFiberRoot=="function")try{Nn.onPostCommitFiberRoot(ph,e)}catch{}n=!0}return n}finally{Ae=r,Ir.transition=t}}return!1}function X0(e,t,r){t=vo(r,t),t=dS(e,t,1),e=Ls(e,t,1),t=Wt(),e!==null&&(Oc(e,1,t),nr(e,t))}function et(e,t,r){if(e.tag===3)X0(e,e,r);else for(;t!==null;){if(t.tag===3){X0(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&($s===null||!$s.has(n))){e=vo(r,e),e=hS(t,e,1),t=Ls(t,e,1),e=Wt(),t!==null&&(Oc(t,1,e),nr(t,e));break}}t=t.return}}function vO(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Wt(),e.pingedLanes|=e.suspendedLanes&r,bt===e&&(Ct&r)===r&&(pt===4||pt===3&&(Ct&130023424)===Ct&&500>at()-Gx?Fi(e,0):zx|=r),nr(e,t)}function RS(e,t){t===0&&(e.mode&1?(t=ou,ou<<=1,!(ou&130023424)&&(ou=4194304)):t=1);var r=Wt();e=Qn(e,t),e!==null&&(Oc(e,t,r),nr(e,r))}function yO(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),RS(e,r)}function bO(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(K(314))}n!==null&&n.delete(t),RS(e,r)}var IS;IS=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||tr.current)Zt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Zt=!1,oO(e,t,r);Zt=!!(e.flags&131072)}else Zt=!1,ze&&t.flags&1048576&&LN(t,kd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Ju(e,t),e=t.pendingProps;var s=mo(t,Ft.current);Wa(t,r),s=Lx(null,t,n,e,s,r);var a=$x();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rr(n)?(a=!0,Sd(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Rx(t),s.updater=jh,t.stateNode=s,s._reactInternals=t,yp(t,n,e,r),t=jp(null,t,n,!0,a,r)):(t.tag=0,ze&&a&&_x(t),Bt(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Ju(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=jO(n),e=Hr(n,e),s){case 0:t=wp(null,t,n,e,r);break e;case 1:t=B0(null,t,n,e,r);break e;case 11:t=U0(null,t,n,e,r);break e;case 14:t=V0(null,t,n,Hr(n.type,e),r);break e}throw Error(K(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Hr(n,s),wp(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Hr(n,s),B0(e,t,n,s,r);case 3:e:{if(gS(t),e===null)throw Error(K(387));n=t.pendingProps,a=t.memoizedState,s=a.element,zN(e,t),Pd(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=vo(Error(K(423)),t),t=z0(e,t,n,r,s);break e}else if(n!==s){s=vo(Error(K(424)),t),t=z0(e,t,n,r,s);break e}else for(hr=Ds(t.stateNode.containerInfo.firstChild),fr=t,ze=!0,Xr=null,r=VN(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(po(),n===s){t=Jn(e,t,r);break e}Bt(e,t,n,r)}t=t.child}return t;case 5:return GN(t),e===null&&gp(t),n=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,o=s.children,dp(n,s)?o=null:a!==null&&dp(n,a)&&(t.flags|=32),pS(e,t),Bt(e,t,o,r),t.child;case 6:return e===null&&gp(t),null;case 13:return xS(e,t,r);case 4:return Ix(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=go(t,null,n,r):Bt(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Hr(n,s),U0(e,t,n,s,r);case 7:return Bt(e,t,t.pendingProps,r),t.child;case 8:return Bt(e,t,t.pendingProps.children,r),t.child;case 12:return Bt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,a=t.memoizedProps,o=s.value,De(Cd,n._currentValue),n._currentValue=o,a!==null)if(nn(a.value,o)){if(a.children===s.children&&!tr.current){t=Jn(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(a.tag===1){c=Wn(-1,r&-r),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=r,c=a.alternate,c!==null&&(c.lanes|=r),xp(a.return,r,t),l.lanes|=r;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(K(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),xp(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Bt(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Wa(t,r),s=Mr(s),n=n(s),t.flags|=1,Bt(e,t,n,r),t.child;case 14:return n=t.type,s=Hr(n,t.pendingProps),s=Hr(n.type,s),V0(e,t,n,s,r);case 15:return fS(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Hr(n,s),Ju(e,t),t.tag=1,rr(n)?(e=!0,Sd(t)):e=!1,Wa(t,r),uS(t,n,s),yp(t,
vendor: 6,010 bytes, line 40
40n,s,r),jp(null,t,n,!0,e,r);case 19:return vS(e,t,r);case 22:return mS(e,t,r)}throw Error(K(156,t.tag))};function OS(e,t){return oN(e,t)}function wO(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ar(e,t,r,n){return new wO(e,t,r,n)}function Kx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jO(e){if(typeof e=="function")return Kx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fx)return 11;if(e===mx)return 14}return 2}function Us(e,t){var r=e.alternate;return r===null?(r=Ar(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function ed(e,t,r,n,s,a){var o=2;if(n=e,typeof e=="function")Kx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case _a:return Ui(r.children,s,a,t);case hx:o=8,s|=8;break;case zm:return e=Ar(12,r,t,s|2),e.elementType=zm,e.lanes=a,e;case Gm:return e=Ar(13,r,t,s),e.elementType=Gm,e.lanes=a,e;case Wm:return e=Ar(19,r,t,s),e.elementType=Wm,e.lanes=a,e;case G1:return _h(r,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case B1:o=10;break e;case z1:o=9;break e;case fx:o=11;break e;case mx:o=14;break e;case xs:o=16,n=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=Ar(o,r,t,s),t.elementType=e,t.type=n,t.lanes=a,t}function Ui(e,t,r,n){return e=Ar(7,e,n,t),e.lanes=r,e}function _h(e,t,r,n){return e=Ar(22,e,n,t),e.elementType=G1,e.lanes=r,e.stateNode={isHidden:!1},e}function zf(e,t,r){return e=Ar(6,e,null,t),e.lanes=r,e}function Gf(e,t,r){return t=Ar(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function NO(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sf(0),this.expirationTimes=Sf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sf(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Yx(e,t,r,n,s,a,o,l,c){return e=new NO(e,t,r,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ar(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rx(a),e}function SO(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Sa,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function MS(e){if(!e)return Ws;e=e._reactInternals;e:{if(ra(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(rr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var r=e.type;if(rr(r))return MN(e,r,t)}return t}function DS(e,t,r,n,s,a,o,l,c){return e=Yx(r,n,!0,e,s,a,o,l,c),e.context=MS(null),r=e.current,n=Wt(),s=Fs(r),a=Wn(n,s),a.callback=t??null,Ls(r,a,s),e.current.lanes=s,Oc(e,s,n),nr(e,n),e}function kh(e,t,r,n){var s=t.current,a=Wt(),o=Fs(s);return r=MS(r),t.context===null?t.context=r:t.pendingContext=r,t=Wn(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Ls(s,t,o),e!==null&&(tn(e,s,o,a),Ku(e,s,o)),o}function Ld(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 Z0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Qx(e,t){Z0(e,t),(e=e.alternate)&&Z0(e,t)}function _O(){return null}var LS=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jx(e){this._internalRoot=e}Ch.prototype.render=Jx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));kh(e,t,null,null)};Ch.prototype.unmount=Jx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hi(function(){kh(null,e,null,null)}),t[Yn]=null}};function Ch(e){this._internalRoot=e}Ch.prototype.unstable_scheduleHydration=function(e){if(e){var t=mN();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ys.length&&t!==0&&t<ys[r].priority;r++);ys.splice(r,0,e),r===0&&gN(e)}};function Xx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Eh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function eb(){}function kO(e,t,r,n,s){if(s){if(typeof n=="function"){var a=n;n=function(){var u=Ld(o);a.call(u)}}var o=DS(t,n,e,0,null,!1,!1,"",eb);return e._reactRootContainer=o,e[Yn]=o.current,Kl(e.nodeType===8?e.parentNode:e),Hi(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var l=n;n=function(){var u=Ld(c);l.call(u)}}var c=Yx(e,0,!1,null,null,!1,!1,"",eb);return e._reactRootContainer=c,e[Yn]=c.current,Kl(e.nodeType===8?e.parentNode:e),Hi(function(){kh(t,c,r,n)}),c}function Ph(e,t,r,n,s){var a=r._reactRootContainer;if(a){var o=a;if(typeof s=="function"){var l=s;s=function(){var c=Ld(o);l.call(c)}}kh(t,o,e,s)}else o=kO(r,t,e,s,n);return Ld(o)}hN=function(e){switch(e.tag){case 3:var t=e.stateNode;
vendor: 4,372 bytes, line 40
40if(t.current.memoizedState.isDehydrated){var r=fl(t.pendingLanes);r!==0&&(xx(t,r|1),nr(t,at()),!(ke&6)&&(yo=at()+500,ti()))}break;case 13:Hi(function(){var n=Qn(e,1);if(n!==null){var s=Wt();tn(n,e,1,s)}}),Qx(e,1)}};vx=function(e){if(e.tag===13){var t=Qn(e,134217728);if(t!==null){var r=Wt();tn(t,e,134217728,r)}Qx(e,134217728)}};fN=function(e){if(e.tag===13){var t=Fs(e),r=Qn(e,t);if(r!==null){var n=Wt();tn(r,e,t,n)}Qx(e,t)}};mN=function(){return Ae};pN=function(e,t){var r=Ae;try{return Ae=e,t()}finally{Ae=r}};tp=function(e,t,r){switch(t){case"input":if(Km(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=yh(n);if(!s)throw Error(K(90));q1(n),Km(n,s)}}}break;case"textarea":K1(e,r);break;case"select":t=r.value,t!=null&&Va(e,!!r.multiple,t,!1)}};tN=Wx;rN=Hi;var CO={usingClientEntryPoint:!1,Events:[Dc,Pa,yh,Z1,eN,Wx]},tl={findFiberByHostInstance:Ni,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},EO={bundleType:tl.bundleType,version:tl.version,rendererPackageName:tl.rendererPackageName,rendererConfig:tl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ns.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=iN(e),e===null?null:e.stateNode},findFiberByHostInstance:tl.findFiberByHostInstance||_O,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 vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vu.isDisabled&&vu.supportsFiber)try{ph=vu.inject(EO),Nn=vu}catch{}}yr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=CO;yr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xx(t))throw Error(K(200));return SO(e,t,null,r)};yr.createRoot=function(e,t){if(!Xx(e))throw Error(K(299));var r=!1,n="",s=LS;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Yx(e,1,!1,null,null,r,!1,n,s),e[Yn]=t.current,Kl(e.nodeType===8?e.parentNode:e),new Jx(t)};yr.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(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=iN(t),e=e===null?null:e.stateNode,e};yr.flushSync=function(e){return Hi(e)};yr.hydrate=function(e,t,r){if(!Eh(t))throw Error(K(200));return Ph(null,e,t,!0,r)};yr.hydrateRoot=function(e,t,r){if(!Xx(e))throw Error(K(405));var n=r!=null&&r.hydratedSources||null,s=!1,a="",o=LS;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=DS(t,null,e,1,r??null,s,!1,a,o),e[Yn]=t.current,Kl(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new Ch(t)};yr.render=function(e,t,r){if(!Eh(t))throw Error(K(200));return Ph(null,e,t,!1,r)};yr.unmountComponentAtNode=function(e){if(!Eh(e))throw Error(K(40));return e._reactRootContainer?(Hi(function(){Ph(null,null,e,!1,function(){e._reactRootContainer=null,e[Yn]=null})}),!0):!1};yr.unstable_batchedUpdates=Wx;yr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Eh(r))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return Ph(e,t,r,!1,n)};yr.version="18.3.1-next-f1338f8080-20240426";function $S(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($S)}catch(e){console.error(e)}}$S(),$1.exports=yr;var na=$1.exports;const FS=Rc(na);var US,tb=na;US=tb.createRoot,tb.hydrateRoot;var PO=typeof Element<"u",TO=typeof Map=="function",AO=typeof Set=="function",RO=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function td(e,t){if(e===t)return!0;
40if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!td(e[n],t[n]))return!1;return!0}var a;if(TO&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!td(n.value[1],t.get(n.value[0])))return!1;return!0}if(AO&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(RO&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(PO&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!td(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var IO=function(t,r){try{return td(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const OO=Rc(IO);var MO=function(e,t,r,n,s,a,o,l){if(!e){var c;if(t===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,s,a,o,l],d=0;c=new Error(t.replace(/%s/g,function(){return u[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},DO=MO;const rb=Rc(DO);var LO=function(t,r,n,s){var a=n?n.call(s,t,r):void 0;if(a!==void 0)return!!a;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var o=Object.keys(t),l=Object.keys(r);if(o.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),u=0;u<o.length;u++){var d=o[u];if(!c(d))return!1;var h=t[d],f=r[d];if(a=n?n.call(s,h,f,d):void 0,a===!1||a===void 0&&h!==f)return!1}return!0};const $O=Rc(LO);var VS=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(VS||{}),Wf={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},nb=Object.values(VS),Th={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},BS=Object.entries(Th).reduce((e,[t,r])=>(e[r]=t,e),{}),Zr="data-rh",Ha={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Ka=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},FO=e=>{let t=Ka(e,"title");const r=Ka(e,Ha.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=Ka(e,Ha.DEFAULT_TITLE);return t||n||void 0},UO=e=>Ka(e,Ha.ON_CHANGE_CLIENT_STATE)||(()=>{}),qf=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),VO=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a].toLowerCase();if(e.indexOf(l)!==-1&&n[l])return r.concat(n)}}return r},[]),BO=e=>console&&typeof console.warn=="function"&&console.warn(e),rl=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&BO(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const o={};a.filter(c=>{let u;const d=Object.keys(c);for(let f=0;f<d.length;f+=1){const m=d[f],w=m.toLowerCase();t.indexOf(w)!==-1&&!(u==="rel"&&c[u].toLowerCase()==="canonical")&&!(w==="rel"&&c[w].toLowerCase()==="stylesheet")&&(u=w),t.indexOf(m)!==-1&&(m==="innerHTML"||m==="cssText"||m==="itemprop")&&(u=m)}if(!u||!c[u])return!1;const h=c[u].toLowerCase();return n[u]||(n[u]={}),o[u]||(o[u]={}),n[u][h]?!1:(o[u][h]=!0,!0)}
40).reverse().forEach(c=>s.push(c));const l=Object.keys(o);for(let c=0;c<l.length;c+=1){const u=l[c],d={...n[u],...o[u]};n[u]=d}return s},[]).reverse()},zO=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},GO=e=>({baseTag:VO(["href"],e),bodyAttributes:qf("bodyAttributes",e),defer:Ka(e,Ha.DEFER),encode:Ka(e,Ha.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:qf("htmlAttributes",e),linkTags:rl("link",["rel","href"],e),metaTags:rl("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:rl("noscript",["innerHTML"],e),onChangeClientState:UO(e),scriptTags:rl("script",["src","innerHTML"],e),styleTags:rl("style",["cssText"],e),title:FO(e),titleAttributes:qf("titleAttributes",e),prioritizeSeoTags:zO(e,Ha.PRIORITIZE_SEO_TAGS)}),zS=e=>Array.isArray(e)?e.join(""):e,WO=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},Hf=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>(WO(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},sb=(e,t)=>({...e,[t]:void 0}),qO=["noscript","script","style"],Op=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),GS=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),HO=(e,t,r,n)=>{const s=GS(r),a=zS(t);return s?`<${e} ${Zr}="true" ${s}>${Op(a,n)}</${e}>`:`<${e} ${Zr}="true">${Op(a,n)}</${e}>`},KO=(e,t,r=!0)=>t.reduce((n,s)=>{const a=s,o=Object.keys(a).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const h=typeof a[d]>"u"?d:`${d}="${Op(a[d],r)}"`;return u?`${u} ${h}`:h},""),l=a.innerHTML||a.cssText||"",c=qO.indexOf(e)===-1;return`${n}<${e} ${Zr}="true" ${o}${c?"/>":`>${l}</${e}>`}`},""),WS=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=Th[n];return r[s||n]=e[n],r},t),YO=(e,t,r)=>{const n={key:t,[Zr]:!0},s=WS(r,n);return[W.createElement("title",s,t)]},rd=(e,t)=>t.map((r,n)=>{const s={key:n,[Zr]:!0};return Object.keys(r).forEach(a=>{const l=Th[a]||a;if(l==="innerHTML"||l==="cssText"){const c=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:c}}else s[l]=r[a]}),W.createElement(e,s)}),Sr=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>YO(e,t.title,t.titleAttributes),toString:()=>HO(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>WS(t),toString:()=>GS(t)};default:return{toComponent:()=>rd(e,t),toString:()=>KO(e,t,r)}}},QO=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=Hf(e,Wf.meta),a=Hf(t,Wf.link),o=Hf(r,Wf.script);return{priorityMethods:{toComponent:()=>[...rd("meta",s.priority),...rd("link",a.priority),...rd("script",o.priority)],toString:()=>`${Sr("meta",s.priority,n)} ${Sr("link",a.priority,n)} ${Sr("script",o.priority,n)}`},metaTags:s.default,linkTags:a.default,scriptTags:o.default}},JO=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:a,styleTags:o,title:l="",titleAttributes:c,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:h,scriptTags:f}=e,m={toComponent:()=>[],toString:()=>""};return u&&({priorityMethods:m,linkTags:d,metaTags:h,scriptTags:f}=QO(e)),{priority:m,base:Sr("base",t,n),bodyAttributes:Sr("bodyAttributes",r,n),htmlAttributes:Sr("htmlAttributes",s,n),link:Sr("link",d,n),meta:Sr("meta",h,n),noscript:Sr("noscript",a,n),script:Sr("script",f,n),style:Sr("style",o,n),title:Sr("title",{title:l,titleAttributes:c},n)}},Mp=JO,yu=[],Zx=!!(typeof window<"u"&&window.document&&window.document.createElement),Dp=class{constructor(e,t){On(this,"instances",[]);On(this,"canUseDOM",Zx);On(this,"context");On(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?yu:this.instances,add:e=>{(this.canUseDOM?yu:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?yu:this.instances).indexOf(e);(this.canUseDOM?yu:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=Mp({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},XO=parseInt(W.version.split(".")[0],10),Lp=XO>=19,ZO={},qS=W.createContext(ZO),Pi,HS=(Pi=class extends p.Component{constructor(r){super(r);On(this,"helmetData");Lp?this.helmetData=null:this.helmetData=new Dp(this.props.context||{},Pi.canUseDOM)}render(){return Lp?W.createElement(W.Fragment,null,this.props.children):W.createElement(qS.Provider,{value:this.helmetData.value},this.props.children)}},On(Pi,"canUseDOM",Zx),Pi),ca=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${Zr}]`),s=[].slice.call(n),a=[];let o;return t&&t.length&&t.forEach(l=>{const c=document.createElement(e);for(const u in l)if(Object.prototype.hasOwnProperty.call(l,u))if(u==="innerHTML")c.innerHTML=l.innerHTML;else if(u==="cssText"){const d=l.cssText;
40c.appendChild(document.createTextNode(d))}else{const d=u,h=typeof l[d]>"u"?"":l[d];c.setAttribute(u,h)}c.setAttribute(Zr,"true"),s.some((u,d)=>(o=d,c.isEqualNode(u)))?s.splice(o,1):a.push(c)}),s.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)}),a.forEach(l=>r.appendChild(l)),{oldTags:s,newTags:a}},$p=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(Zr),s=n?n.split(","):[],a=[...s],o=Object.keys(t);for(const l of o){const c=t[l]||"";r.getAttribute(l)!==c&&r.setAttribute(l,c),s.indexOf(l)===-1&&s.push(l);const u=a.indexOf(l);u!==-1&&a.splice(u,1)}for(let l=a.length-1;l>=0;l-=1)r.removeAttribute(a[l]);s.length===a.length?r.removeAttribute(Zr):r.getAttribute(Zr)!==o.join(",")&&r.setAttribute(Zr,o.join(","))},eM=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=zS(e)),$p("title",t)},ib=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:a,metaTags:o,noscriptTags:l,onChangeClientState:c,scriptTags:u,styleTags:d,title:h,titleAttributes:f}=e;$p("body",n),$p("html",s),eM(h,f);const m={baseTag:ca("base",r),linkTags:ca("link",a),metaTags:ca("meta",o),noscriptTags:ca("noscript",l),scriptTags:ca("script",u),styleTags:ca("style",d)},w={},g={};Object.keys(m).forEach(y=>{const{newTags:b,oldTags:v}=m[y];b.length&&(w[y]=b),v.length&&(g[y]=m[y].oldTags)}),t&&t(),c(e,w,g)},nl=null,tM=e=>{nl&&cancelAnimationFrame(nl),e.defer?nl=requestAnimationFrame(()=>{ib(e,()=>{nl=null})}):(ib(e),nl=null)},rM=tM,ab=class extends p.Component{constructor(){super(...arguments);On(this,"rendered",!1)}shouldComponentUpdate(t){return!$O(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=GO(t.get().map(a=>{const{context:o,...l}=a.props;return l}));HS.canUseDOM?rM(s):Mp&&(n=Mp(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},nd=[],ob=e=>{const t={};for(const r of Object.keys(e))t[BS[r]||r]=e[r];return t},ui=e=>{const t={};for(const r of Object.keys(e)){const n=Th[r];t[n||r]=e[r]}return t},lb=(e,t)=>{if(!Zx)return;const r=document.getElementsByTagName(e)[0];if(!r)return;const n="data-rh-managed",s=r.getAttribute(n),a=s?s.split(","):[],o=Object.keys(t);for(const l of a)o.includes(l)||r.removeAttribute(l);for(const l of o){const c=t[l];c==null||c===!1?r.removeAttribute(l):c===!0?r.setAttribute(l,""):r.setAttribute(l,String(c))}o.length>0?r.setAttribute(n,o.join(",")):r.removeAttribute(n)},Kf=()=>{const e={},t={};for(const r of nd){const{htmlAttributes:n,bodyAttributes:s}=r.props;n&&Object.assign(e,ob(n)),s&&Object.assign(t,ob(s))}lb("html",e),lb("body",t)},nM=class extends p.Component{componentDidMount(){nd.push(this),Kf()}componentDidUpdate(){Kf()}componentWillUnmount(){const e=nd.indexOf(this);e!==-1&&nd.splice(e,1),Kf()}resolveTitle(){const{title:e,titleTemplate:t,defaultTitle:r}=this.props;return e&&t?t.replace(/%s/g,()=>Array.isArray(e)?e.join(""):e):e||r||void 0}renderTitle(){const e=this.resolveTitle();if(e===void 0)return null;const t=this.props.titleAttributes||{};return W.createElement("title",ui(t),e)}renderBase(){const{base:e}=this.props;return e?W.createElement("base",ui(e)):null}renderMeta(){const{meta:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,r)=>W.createElement("meta",{key:r,...ui(t)}))}renderLink(){const{link:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,r)=>W.createElement("link",{key:r,...ui(t)}))}renderScript(){const{script:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,r)=>{const{innerHTML:n,...s}=t,a=ui(s);return n&&(a.dangerouslySetInnerHTML={__html:n}),W.createElement("script",{key:r,...a})})}renderStyle(){const{style:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,r)=>{const{cssText:n,...s}=t,a=ui(s);return n&&(a.dangerouslySetInnerHTML={__html:n}),W.createElement("style",{key:r,...a})})}renderNoscript(){const{noscript:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,r)=>{const{innerHTML:n,...s}=t,a=ui(s);return n&&(a.dangerouslySetInnerHTML={__html:n}),W.createElement("noscript",{key:r,...a})})}render(){return W.createElement(W.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},Vm,ev=(Vm=class extends p.Component{shouldComponentUpdate(e){return!OO(sb(this.props,"helmetData"),sb(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}
40warnOnInvalidChildren(e,t){return rb(nb.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${nb.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),rb(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return W.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...a}=n.props,o=Object.keys(a).reduce((c,u)=>(c[BS[u]||u]=a[u],c),{});let{type:l}=n;switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(n,s),l){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,o,s);break;default:t=this.mapObjectTypeChildren(n,t,o,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof Dp)){const s=n;n=new Dp(s.context,!0),delete r.helmetData}return Lp?W.createElement(nM,{...r}):n?W.createElement(ab,{...r,context:n.value}):W.createElement(qS.Consumer,null,s=>W.createElement(ab,{...r,context:s}))}},On(Vm,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Vm);const sM=1,iM=1e6;let Yf=0;function aM(){return Yf=(Yf+1)%Number.MAX_SAFE_INTEGER,Yf.toString()}const Qf=new Map,cb=e=>{if(Qf.has(e))return;const t=setTimeout(()=>{Qf.delete(e),El({type:"REMOVE_TOAST",toastId:e})},iM);Qf.set(e,t)},oM=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,sM)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?cb(r):e.toasts.forEach(n=>{cb(n.id)}),{...e,toasts:e.toasts.map(n=>
vendor: 13,905 bytes, line 40
40n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},sd=[];let id={toasts:[]};function El(e){id=oM(id,e),sd.forEach(t=>{t(id)})}function Ue({...e}){const t=aM(),r=s=>El({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>El({type:"DISMISS_TOAST",toastId:t});return El({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function un(){const[e,t]=p.useState(id);return p.useEffect(()=>(sd.push(t),()=>{const r=sd.indexOf(t);r>-1&&sd.splice(r,1)}),[e]),{...e,toast:Ue,dismiss:r=>El({type:"DISMISS_TOAST",toastId:r})}}function oe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function ub(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function KS(...e){return t=>{let r=!1;const n=e.map(s=>{const a=ub(s,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let s=0;s<n.length;s++){const a=n[s];typeof a=="function"?a():ub(e[s],null)}}}}function je(...e){return p.useCallback(KS(...e),e)}function lM(e,t){const r=p.createContext(t),n=a=>{const{children:o,...l}=a,c=p.useMemo(()=>l,Object.values(l));return i.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function s(a){const o=p.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,s]}function Kt(e,t=[]){let r=[];function n(a,o){const l=p.createContext(o),c=r.length;r=[...r,o];const u=h=>{var b;const{scope:f,children:m,...w}=h,g=((b=f==null?void 0:f[e])==null?void 0:b[c])||l,y=p.useMemo(()=>w,Object.values(w));return i.jsx(g.Provider,{value:y,children:m})};u.displayName=a+"Provider";function d(h,f){var g;const m=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,w=p.useContext(m);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[u,d]}const s=()=>{const a=r.map(o=>p.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,cM(s,...t)]}function cM(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const h=c(a)[`__scope${u}`];return{...l,...h}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function bo(e){const t=uM(e),r=p.forwardRef((n,s)=>{const{children:a,...o}=n,l=p.Children.toArray(a),c=l.find(hM);if(c){const u=c.props.children,d=l.map(h=>h===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:h);return i.jsx(t,{...o,ref:s,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return i.jsx(t,{...o,ref:s,children:a})});return r.displayName=`${e}.Slot`,r}var Ro=bo("Slot");function uM(e){const t=p.forwardRef((r,n)=>{const{children:s,...a}=r;if(p.isValidElement(s)){const o=mM(s),l=fM(a,s.props);return s.type!==p.Fragment&&(l.ref=n?KS(n,o):o),p.cloneElement(s,l)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YS=Symbol("radix.slottable");function dM(e){const t=({children:r})=>i.jsx(i.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=YS,t}function hM(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YS}function fM(e,t){const r={...t};for(const n in t){const s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...l)=>{const c=a(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...a}:n==="className"&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}function mM(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Ah(e){const t=e+"CollectionProvider",[r,n]=Kt(t),[s,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:y,children:b}=g,v=W.useRef(null),x=W.useRef(new Map).current;return i.jsx(s,{scope:y,itemMap:x,collectionRef:v,children:b})};o.displayName=t;const l=e+"CollectionSlot",c=bo(l),u=W.forwardRef((g,y)=>{const{scope:b,children:v}=g,x=a(l,b),j=je(y,x.collectionRef);return i.jsx(c,{ref:j,children:v})});u.displayName=l;const d=e+"CollectionItemSlot",h="data-radix-collection-item",f=bo(d),m=W.forwardRef((g,y)=>{const{scope:b,children:v,...x}=g,j=W.useRef(null),N=je(y,j),S=a(d,b);return W.useEffect(()=>(S.itemMap.set(j,{ref:j,...x}),()=>void S.itemMap.delete(j))),i.jsx(f,{[h]:"",ref:N,children:v})});m.displayName=d;function w(g){const y=a(e+"CollectionConsumer",g);return W.useCallback(()=>{const v=y.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((S,_)=>x.indexOf(S.ref.current)-x.indexOf(_.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},w,n]}var pM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ue=pM.reduce((e,t)=>{const r=bo(`Primitive.${t}`),n=p.forwardRef((s,a)=>{const{asChild:o,...l}=s,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function QS(e,t){e&&na.flushSync(()=>e.dispatchEvent(t))}function gr(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function gM(e,t=globalThis==null?void 0:globalThis.document){const r=gr(e);p.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var xM="DismissableLayer",Fp="dismissableLayer.update",vM="dismissableLayer.pointerDownOutside",yM="dismissableLayer.focusOutside",db,JS=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$c=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=p.useContext(JS),[d,h]=p.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=p.useState({}),w=je(t,_=>h(_)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(y),v=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,j=v>=b,N=wM(_=>{const k=_.target,P=[...u.branches].some(C=>C.contains(k));!j||P||(s==null||s(_),o==null||o(_),_.defaultPrevented||l==null||l())},f),S=jM(_=>{const k=_.target;[...u.branches].some(C=>C.contains(k))||(a==null||a(_),o==null||o(_),_.defaultPrevented||l==null||l())},f);return gM(_=>{v===u.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&l&&(_.preventDefault(),l()))},f),p.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(db=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),hb(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=db)}},[d,f,r,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),hb())},[d,u]),p.useEffect(()=>{const _=()=>m({});return document.addEventListener(Fp,_),()=>document.removeEventListener(Fp,_)},[]),i.jsx(ue.div,{...c,ref:w,style:{pointerEvents:x?j?"auto":"none":void 0,...e.style},onFocusCapture:oe(e.onFocusCapture,S.onFocusCapture),onBlurCapture:oe(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:oe(e.onPointerDownCapture,N.onPointerDownCapture)})});$c.displayName=xM;var bM="DismissableLayerBranch",XS=p.forwardRef((e,t)=>{const r=p.useContext(JS),n=p.useRef(null),s=je(t,n);return p.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),i.jsx(ue.div,{...e,ref:s})});XS.displayName=bM;function wM(e,t=globalThis==null?void 0:globalThis.document){const r=gr(e),n=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const a=l=>{if(l.target&&!n.current){let c=function(){ZS(vM,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function jM(e,t=globalThis==null?void 0:globalThis.document){const r=gr(e),n=p.useRef(!1);return p.useEffect(()=>{const s=a=>{a.target&&!n.current&&ZS(yM,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function hb(){const e=new CustomEvent(Fp);document.dispatchEvent(e)}function ZS(e,t,r,{discrete:n}){const s=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?QS(s,a):s.dispatchEvent(a)}var NM=$c,SM=XS,ht=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},_M="Portal",Rh=p.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[s,a]=p.useState(!1);ht(()=>a(!0),[]);const o=r||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?FS.createPortal(i.jsx(ue.div,{...n,ref:t}),o):null});Rh.displayName=_M;function kM(e,t){return p.useReducer((r,n)=>t[r][n]??r,e)}var ss=e=>{const{present:t,children:r}=e,n=CM(t),s=typeof r=="function"?r({present:n.isPresent}):p.Children.only(r),a=je(n.ref,EM(s));return typeof r=="function"||n.isPresent?p.cloneElement(s,{ref:a}):null};ss.displayName="Presence";function CM(e){const[t,r]=p.useState(),n=p.useRef(null),s=p.useRef(e),a=p.useRef("none"),o=e?"mounted":"unmounted",[l,c]=kM(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=bu(n.current);a.current=l==="mounted"?u:"none"},[l]),ht(()=>{const u=n.current,d=s.current;if(d!==e){const f=a.current,m=bu(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),ht(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=m=>{const g=bu(n.current).includes(m.animationName);if(m.target===t&&g&&(c("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=m=>{m.target===t&&(a.current=bu(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:p.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function bu(e){return(e==null?void 0:e.animationName)||"none"}function EM(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var PM=lx[" useInsertionEffect ".trim().toString()]||ht;function sn({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,a,o]=TM({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:s;{const d=p.useRef(e!==void 0);p.useEffect(()=>{const h=d.current;h!==l&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,n])}const u=p.useCallback(d=>{var h;if(l){const f=AM(d)?d(e):d;f!==e&&((h=o.current)==null||h.call(o,f))}else a(d)},[l,e,a,o]);return[c,u]}function TM({defaultProp:e,onChange:t}){const[r,n]=p.useState(e),s=p.useRef(r),a=p.useRef(t);return PM(()=>{a.current=t},[t]),p.useEffect(()=>{var o;s.current!==r&&((o=a.current)==null||o.call(a,r),s.current=r)},[r,s]),[r,n,a]}function AM(e){return typeof e=="function"}var e_=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"}),RM="VisuallyHidden",Ih=p.forwardRef((e,t)=>i.jsx(ue.span,{...e,ref:t,style:{...e_,...e.style}}));Ih.displayName=RM;var IM=Ih,tv="ToastProvider",[rv,OM,MM]=Ah("Toast"),[t_,tK]=Kt("Toast",[MM]),[DM,Oh]=t_(tv),r_=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:o}=e,[l,c]=p.useState(null),[u,d]=p.useState(0),h=p.useRef(!1),f=p.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${tv}\`. Expected non-empty \`string\`.`),i.jsx(rv.Provider,{scope:t,children:i.jsx(DM,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:a,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:p.useCallback(()=>d(m=>m+1),[]),onToastRemove:p.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:o})})};r_.displayName=tv;var n_="ToastViewport",LM=["F8"],Up="toast.viewportPause",Vp="toast.viewportResume",s_=p.forwardRef((e,t)=>
40{const{__scopeToast:r,hotkey:n=LM,label:s="Notifications ({hotkey})",...a}=e,o=Oh(n_,r),l=OM(r),c=p.useRef(null),u=p.useRef(null),d=p.useRef(null),h=p.useRef(null),f=je(t,h,o.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=o.toastCount>0;p.useEffect(()=>{const y=b=>{var x;n.length!==0&&n.every(j=>b[j]||b.code===j)&&((x=h.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]),p.useEffect(()=>{const y=c.current,b=h.current;if(w&&y&&b){const v=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(Up);b.dispatchEvent(S),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(Vp);b.dispatchEvent(S),o.isClosePausedRef.current=!1}},j=S=>{!y.contains(S.relatedTarget)&&x()},N=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",v),y.addEventListener("focusout",j),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",N),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",j),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",N),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[w,o.isClosePausedRef]);const g=p.useCallback(({tabbingDirection:y})=>{const v=l().map(x=>{const j=x.ref.current,N=[j,...QM(j)];return y==="forwards"?N:N.reverse()});return(y==="forwards"?v.reverse():v).flat()},[l]);return p.useEffect(()=>{const y=h.current;if(y){const b=v=>{var N,S,_;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const k=document.activeElement,P=v.shiftKey;if(v.target===y&&P){(N=u.current)==null||N.focus();return}const I=g({tabbingDirection:P?"backwards":"forwards"}),V=I.findIndex(U=>U===k);Jf(I.slice(V+1))?v.preventDefault():P?(S=u.current)==null||S.focus():(_=d.current)==null||_.focus()}};return y.addEventListener("keydown",b),()=>y.removeEventListener("keydown",b)}},[l,g]),i.jsxs(SM,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:w?void 0:"none"},children:[w&&i.jsx(Bp,{ref:u,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"forwards"});Jf(y)}}),i.jsx(rv.Slot,{scope:r,children:i.jsx(ue.ol,{tabIndex:-1,...a,ref:f})}),w&&i.jsx(Bp,{ref:d,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"backwards"});Jf(y)}})]})});s_.displayName=n_;var i_="ToastFocusProxy",Bp=p.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,a=Oh(i_,r);return i.jsx(Ih,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&n()}})});Bp.displayName=i_;var Fc="Toast",$M="toast.swipeStart",FM="toast.swipeMove",UM="toast.swipeCancel",VM="toast.swipeEnd",a_=p.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:a,...o}=e,[l,c]=sn({prop:n,defaultProp:s??!0,onChange:a,caller:Fc});return i.jsx(ss,{present:r||l,children:i.jsx(GM,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:gr(e.onPause),onResume:gr(e.onResume),onSwipeStart:oe(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:oe(e.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:oe(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:oe(e.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});a_.displayName=Fc;var[BM,zM]=t_(Fc,{onClose(){}}),GM=p.forwardRef((e,t)=>
40{const{__scopeToast:r,type:n="foreground",duration:s,open:a,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:m,...w}=e,g=Oh(Fc,r),[y,b]=p.useState(null),v=je(t,U=>b(U)),x=p.useRef(null),j=p.useRef(null),N=s||g.duration,S=p.useRef(0),_=p.useRef(N),k=p.useRef(0),{onToastAdd:P,onToastRemove:C}=g,D=gr(()=>{var R;(y==null?void 0:y.contains(document.activeElement))&&((R=g.viewport)==null||R.focus()),o()}),I=p.useCallback(U=>{!U||U===1/0||(window.clearTimeout(k.current),S.current=new Date().getTime(),k.current=window.setTimeout(D,U))},[D]);p.useEffect(()=>{const U=g.viewport;if(U){const R=()=>{I(_.current),u==null||u()},$=()=>{const F=new Date().getTime()-S.current;_.current=_.current-F,window.clearTimeout(k.current),c==null||c()};return U.addEventListener(Up,$),U.addEventListener(Vp,R),()=>{U.removeEventListener(Up,$),U.removeEventListener(Vp,R)}}},[g.viewport,N,c,u,I]),p.useEffect(()=>{a&&!g.isClosePausedRef.current&&I(N)},[a,N,g.isClosePausedRef,I]),p.useEffect(()=>(P(),()=>C()),[P,C]);const V=p.useMemo(()=>y?f_(y):null,[y]);return g.viewport?i.jsxs(i.Fragment,{children:[V&&i.jsx(WM,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:V}),i.jsx(BM,{scope:r,onClose:D,children:na.createPortal(i.jsx(rv.ItemSlot,{scope:r,children:i.jsx(NM,{asChild:!0,onEscapeKeyDown:oe(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||D(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(ue.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":g.swipeDirection,...w,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:oe(e.onKeyDown,U=>{U.key==="Escape"&&(l==null||l(U.nativeEvent),U.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:oe(e.onPointerDown,U=>{U.button===0&&(x.current={x:U.clientX,y:U.clientY})}),onPointerMove:oe(e.onPointerMove,U=>{if(!x.current)return;const R=U.clientX-x.current.x,$=U.clientY-x.current.y,F=!!j.current,T=["left","right"].includes(g.swipeDirection),O=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,H=T?O(0,R):0,re=T?0:O(0,$),Q=U.pointerType==="touch"?10:2,q={x:H,y:re},M={originalEvent:U,delta:q};F?(j.current=q,wu(FM,h,M,{discrete:!1})):fb(q,g.swipeDirection,Q)?(j.current=q,wu($M,d,M,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(R)>Q||Math.abs($)>Q)&&(x.current=null)}),onPointerUp:oe(e.onPointerUp,U=>{const R=j.current,$=U.target;if($.hasPointerCapture(U.pointerId)&&$.releasePointerCapture(U.pointerId),j.current=null,x.current=null,R){const F=U.currentTarget,T={originalEvent:U,delta:R};fb(R,g.swipeDirection,g.swipeThreshold)?wu(VM,m,T,{discrete:!0}):wu(UM,f,T,{discrete:!0}),F.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),WM=e=>{const{__scopeToast:t,children:r,...n}=e,s=Oh(Fc,t),[a,o]=p.useState(!1),[l,c]=p.useState(!1);return KM(()=>o(!0)),p.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:i.jsx(Rh,{asChild:!0,children:i.jsx(Ih,{...n,children:a&&i.jsxs(i.Fragment,{children:[s.label," ",r]})})})},qM="ToastTitle",o_=p.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return i.jsx(ue.div,{...n,ref:t})});o_.displayName=qM;var HM="ToastDescription",l_=p.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return i.jsx(ue.div,{...n,ref:t})});l_.displayName=HM;var c_="ToastAction",u_=p.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?i.jsx(h_,{altText:r,asChild:!0,children:i.jsx(nv,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${c_}\`. Expected non-empty \`string\`.`),null)});u_.displayName=c_;var d_="ToastClose",nv=p.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=zM(d_,r);return i.jsx(h_,{asChild:!0,children:i.jsx(ue.button,{type:"button",...n,ref:t,onClick:oe(e.onClick,s.onClose)})})});nv.displayName=d_;var h_=p.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return i.jsx(ue.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function f_(e){const t=[];
vendor: 5,842 bytes, lines 40-85
40return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),YM(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!s)if(a){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...f_(n))}}),t}function wu(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?QS(s,a):s.dispatchEvent(a)}var fb=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),a=n>s;return t==="left"||t==="right"?a&&n>r:!a&&s>r};function KM(e=()=>{}){const t=gr(e);ht(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function YM(e){return e.nodeType===e.ELEMENT_NODE}function QM(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Jf(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var JM=r_,m_=s_,p_=a_,g_=o_,x_=l_,v_=u_,y_=nv;function b_(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=b_(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function w_(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=b_(e))&&(n&&(n+=" "),n+=t);return n}const mb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,pb=w_,Io=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return pb(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:a}=t,o=Object.keys(s).map(u=>{const d=r==null?void 0:r[u],h=a==null?void 0:a[u];if(d===null)return null;const f=mb(d)||mb(h);return s[u][f]}),l=r&&Object.entries(r).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:h,className:f,...m}=d;return Object.entries(m).every(w=>{let[g,y]=w;return Array.isArray(y)?y.includes({...a,...l}[g]):{...a,...l}[g]===y})?[...u,h,f]:u},[]);return pb(e,o,c,r==null?void 0:r.class,r==null?void 0:r.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 XM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j_=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).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 ZM={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 e4=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:a,iconNode:o,...l},c)=>p.createElement("svg",{ref:c,...ZM,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:j_("lucide",s),...l},[...o.map(([u,d])=>p.createElement(u,d)),...Array.isArray(a)?a:[a]]));/** 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 X=(e,t)=>{const r=p.forwardRef(({className:n,...s},a)=>p.createElement(e4,{ref:a,iconNode:t,className:j_(`lucide-${XM(e)}`,n),...s}));return r.displayName=`${e}`,r};/** 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 rn=X("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const Lt=X("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 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 gb=X("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"}]]);/** 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 sv=X("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** 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 t4=X("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
85],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 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 Mh=X("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"}]]);/** 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 an=X("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 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 r4=X("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"}]]);/** 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 qs=X("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 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 N_=X("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 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 iv=X("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 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 S_=X("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 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 n4=X("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 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 $d=X("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"}]]);/** 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 __=X("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/** 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 nc=X("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 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 Uc=X("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 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 s4=X("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 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 Dh=X("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 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 i4=X("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 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 xr=X("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 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 sc=X("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** 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 a4=X("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/** 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 Dn=X("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"}]]);/** 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 o4=X("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"}]]);/** 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 Fd=X("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"}]]);/** 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 _n=X("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"}]]);/** 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 k_=X("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/** 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 Hs=X("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"}]]);/** 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 l4=X("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"}]]);/** 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 C_=X("FileAudio",[["path",{d:"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"rslqgf"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0",key:"9f7x3i"}]]);/** 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 c4=X("FileCheck",[["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:"m9 15 2 2 4-4",key:"1grp1n"}]]);/** 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 ic=X("Film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);/** 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 u4=X("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** 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 E_=X("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"}]]);/** 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 Ud=X("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** 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 d4=X("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"}]]);/** 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 P_=X("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/** 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 gt=X("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"}]]);/** 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 h4=X("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/** 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 f4=X("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"}]]);/** 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 m4=X("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"}]]);/** 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 T_=X("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 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 Ye=X("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 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 A_=X("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"}]]);/** 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 p4=X("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"}]]);/** 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 R_=X("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"}]]);/** 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 g4=X("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** 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 x4=X("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"}]]);/** 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 v4=X("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"}]]);/** 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 I_=X("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** 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 y4=X("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** 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 b4=X("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** 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 Vd=X("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 w4=X("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 j4=X("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 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 Lh=X("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 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 O_=X("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 N4=X("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/** 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 Xn=X("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"}]]);/** 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 Bd=X("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3
365kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** 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 av=X("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 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 Ki=X("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 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 S4=X("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** 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 Ks=X("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** 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 qn=X("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"}]]);/** 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 _4=X("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** 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 Pt=X("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"}]]);/** 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 k4=X("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 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 C4=X("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 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 wo=X("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"}]]);/** 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 E4=X("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** 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 P4=X("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"}]]);/** 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 T4=X("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
430],["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"}]]);/** 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 A4=X("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"}]]);/** 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 M_=X("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"}]]);/** 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 Pn=X("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"}]]);/** 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 R4=X("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 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 D_=X("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"}]]);/** 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 I4=X("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"}]]);/** 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 $t=X("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** 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 xb=X("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** 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 Lr=X("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 on=X("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 12,640 bytes, lines 480-485
480],["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 vr=X("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"}]]),ov="-",O4=e=>{const t=D4(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(ov);return l[0]===""&&l.length!==1&&l.shift(),L_(l,t)||M4(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},L_=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?L_(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(ov);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},vb=/^\[(.+)\]$/,M4=e=>{if(vb.test(e)){const t=vb.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},D4=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return $4(Object.entries(e.classGroups),r).forEach(([a,o])=>{zp(o,n,a,t)}),n},zp=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:yb(t,s);a.classGroupId=r;return}if(typeof s=="function"){if(L4(s)){zp(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([a,o])=>{zp(o,yb(t,a),r,n)})})},yb=(e,t)=>{let r=e;return t.split(ov).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},L4=e=>e.isThemeGetter,$4=(e,t)=>t?e.map(([r,n])=>{const s=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[r,s]}):e,F4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(a,o)=>{r.set(a,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let o=r.get(a);if(o!==void 0)return o;if((o=n.get(a))!==void 0)return s(a,o),o},set(a,o){r.has(a)?r.set(a,o):s(a,o)}}},$_="!",U4=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],a=t.length,o=l=>{const c=[];let u=0,d=0,h;for(let y=0;y<l.length;y++){let b=l[y];if(u===0){if(b===s&&(n||l.slice(y,y+a)===t)){c.push(l.slice(d,y)),d=y+a;continue}if(b==="/"){h=y;continue}}b==="["?u++:b==="]"&&u--}const f=c.length===0?l:l.substring(d),m=f.startsWith($_),w=m?f.substring(1):f,g=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:g}};return r?l=>r({className:l,parseClassName:o}):o},V4=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},B4=e=>({cache:F4(e.cacheSize),parseClassName:U4(e),...O4(e)}),z4=/\s+/,G4=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,a=[],o=e.trim().split(z4);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:m}=r(u);let w=!!m,g=n(w?f.substring(0,m):f);if(!g){if(!w){l=u+(l.length>0?" "+l:l);continue}if(g=n(f),!g){l=u+(l.length>0?" "+l:l);continue}w=!1}const y=V4(d).join(":"),b=h?y+$_:y,v=b+g;if(a.includes(v))continue;a.push(v);const x=s(g,w);for(let j=0;j<x.length;++j){const N=x[j];a.push(b+N)}l=u+(l.length>0?" "+l:l)}return l};function W4(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=F_(t))&&(n&&(n+=" "),n+=r);return n}const F_=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=F_(e[n]))&&(r&&(r+=" "),r+=t);return r};function q4(e,...t){let r,n,s,a=o;function o(c){const u=t.reduce((d,h)=>h(d),e());return r=B4(u),n=r.cache.get,s=r.cache.set,a=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=G4(c,r);return s(c,d),d}return function(){return a(W4.apply(null,arguments))}}const $e=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},U_=/^\[(?:([a-z-]+):)?(.+)\]$/i,H4=/^\d+\/\d+$/,K4=new Set(["px","full","screen"]),Y4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Q4=/\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$/,J4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,X4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Z4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mn=e=>Ya(e)||K4.has(e)||H4.test(e),us=e=>Oo(e,"length",oD),Ya=e=>!!e&&!Number.isNaN(Number(e)),Xf=e=>Oo(e,"number",Ya),sl=e=>!!e&&Number.isInteger(Number(e)),eD=e=>e.endsWith("%")&&Ya(e.slice(0,-1)),we=e=>U_.test(e),ds=e=>Y4.test(e),tD=new Set(["length","size","percentage"]),rD=e=>Oo(e,tD,V_),nD=e=>Oo(e,"position",V_),sD=new Set(["image","url"]),iD=e=>Oo(e,sD,cD),aD=e=>Oo(e,"",lD),il=()=>!0,Oo=(e,t,r)=>{const n=U_.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},oD=e=>Q4.test(e)&&!J4.test(e),V_=()=>!1,lD=e=>X4.test(e),cD=e=>Z4.test(e),uD=()=>{const e=$e("colors"),t=$e("spacing"),r=$e("blur"),n=$e("brightness"),s=$e("borderColor"),a=$e("borderRadius"),o=$e("borderSpacing"),l=$e("borderWidth"),c=$e("contrast"),u=$e("grayscale"),d=$e("hueRotate"),h=$e("invert"),f=$e("gap"),m=$e("gradientColorStops"),w=$e("gradientColorStopPositions"),g=$e("inset"),y=$e("margin"),b=$e("opacity"),v=$e("padding"),x=$e("saturate"),j=$e("scale"),N=$e("sepia"),S=$e("skew"),_=$e("space"),k=$e("translate"),P=()=>["auto","contain","none"],C=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",we,t],I=()=>[we,t],V=()=>["",Mn,us],U=()=>["auto",Ya,we],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",we],H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],re=()=>[Ya,we];return{cacheSize:500,separator:":",theme:{colors:[il],spacing:[Mn,us],blur:["none","",ds,we],brightness:re(),borderColor:[e],borderRadius:["none","","full",ds,we],borderSpacing:I(),borderWidth:V(),contrast:re(),grayscale:O(),hueRotate:re(),invert:O(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[eD,us],inset:D(),margin:D(),opacity:re(),padding:I(),saturate:re(),scale:re(),sepia:O(),skew:re(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",we]}],container:["container"],columns:[{columns:[ds]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"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:[...R(),we]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],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",sl,we]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",we]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",sl,we]}],"grid-cols":[{"grid-cols":[il]}],"col-start-end":[{col:["auto",{span:["full",sl,we]},we]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[il]}],"row-start-end":[{row:["auto",{span:[sl,we]},we]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",we]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",we]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],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":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",we,t]}],"min-w":[{"min-w":[we,t,"min","max","fit"]}],"max-w":[{"max-w":[we,t,"none","full","min","max","fit","prose",{screen:[ds]},ds]}],h:[{h:[we,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[we,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[we,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[we,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ds,us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xf]}],"font-family":[{font:[il]}],"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",we]}],"line-clamp":[{"line-clamp":["none",Ya,Xf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Mn,we]}],"list-image":[{"list-image":["none",we]}],"list-style-type":[{list:["none","disc","decimal",we]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Mn,us]}],"underline-offset":[{"underline-offset":["auto",Mn,we]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we]}],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",we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),nD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",rD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},iD]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}
vendor: 5,182 bytes, line 485
485],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:$()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Mn,we]}],"outline-w":[{outline:[Mn,us]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Mn,us]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ds,aD]}],"shadow-color":[{shadow:[il]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ds,we]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[x]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"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",we]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",we]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",we]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[sl,we]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"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",we]}],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",we]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",we]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Mn,us,Xf]}],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"]}}},dD=q4(uD);function J(...e){return dD(w_(e))}const hD=JM,B_=p.forwardRef(({className:e,...t},r)=>i.jsx(m_,{ref:r,className:J("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}));B_.displayName=m_.displayName;const fD=Io("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"}}),z_=p.forwardRef(({className:e,variant:t,...r},n)=>i.jsx(p_,{ref:n,className:J(fD({variant:t}),e),...r}));z_.displayName=p_.displayName;const mD=p.forwardRef(({className:e,...t},r)=>i.jsx(v_,{ref:r,className:J("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}));mD.displayName=v_.displayName;const G_=p.forwardRef(({className:e,...t},r)=>i.jsx(y_,{ref:r,className:J("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:i.jsx(on,{className:"h-4 w-4"})}));G_.displayName=y_.displayName;const W_=p.forwardRef(({className:e,...t},r)=>i.jsx(g_,{ref:r,className:J("text-sm font-semibold",e),...t}));W_.displayName=g_.displayName;const q_=p.forwardRef(({className:e,...t},r)=>i.jsx(x_,{ref:r,className:J("text-sm opacity-90",e),...t}));q_.displayName=x_.displayName;function pD(){const{toasts:e}=un();return i.jsxs(hD,{children:[e.map(function({id:t,title:r,description:n,action:s,...a}){return i.jsxs(z_,{...a,children:[i.jsxs("div",{className:"grid gap-1",children:[r&&i.jsx(W_,{children:r}),n&&i.jsx(q_,{children:n})]}),s,i.jsx(G_,{})]},t)}),i.jsx(B_,{})]})}var bb=["light","dark"],gD="(prefers-color-scheme: dark)",xD=p.createContext(void 0),vD={setTheme:e=>{},themes:[]},yD=()=>{var e;return(e=p.useContext(xD))!=null?e:vD};p.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:a,value:o,attrs:l,nonce:c})=>{let u=a==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(w=>`'${w}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=s?bb.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(w,g=!1,y=!0)=>{let b=o?o[w]:w,v=g?w+"|| ''":`'${b}'`,x="";return s&&y&&!g&&bb.includes(w)&&(x+=`d.style.colorScheme = '${w}';`),r==="class"?g||b?x+=`c.add(${v})`:x+="null":b&&(x+=`d[s](n,${v})`),x},m=e?`!function(){${d}${f(e)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${gD}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(a,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(a,!1,!1)};}${h}}catch(t){}}();`;return p.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var bD=e=>{switch(e){case"success":return ND;case"info":return _D;case"warning":return SD;case"error":return kD;default:return null}},wD=Array(12).fill(0),jD=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},wD.map((r,n)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),ND=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),SD=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.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"})),_D=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),kD=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),CD=W.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"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ED=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Gp=1,PD=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>
vendor: 1,050 bytes, line 485
485{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Gp++,a=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({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 r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,a,o=n.then(async c=>{if(a=["resolve",c],W.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(AD(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:d})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:d})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:d})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Gp++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Qt=new PD,TD=(e,t)=>{let r=(t==null?void 0:t.id)||Gp++;return Qt.addToast({title:e,...t,id:r}),r},AD=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",RD=TD,ID=()=>Qt.toasts,OD=()=>Qt.getActiveToasts(),Te=Object.assign(RD,{success:Qt.success,info:Qt.info,warning:Qt.warning,error:Qt.error,custom:Qt.custom,message:Qt.message,promise:Qt.promise,dismiss:Qt.dismiss,loading:Qt.loading},{getHistory:ID,getToasts:OD});function MD(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}MD(`: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 ju(e){return e.label!==void 0}var DD=3,LD="32px",$D="16px",wb=4e3,FD=356,UD=14,VD=20,BD=200;function zr(...e){return e.filter(Boolean).join(" ")}function zD(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var GD=e=>{var t,r,n,s,a,o,l,c,u,d,h;let{invert:f,toast:m,unstyled:w,interacting:g,setHeights:y,visibleToasts:b,heights:v,index:x,toasts:j,expanded:N,removeToast:S,defaultRichColors:_,closeButton:k,style:P,cancelButtonStyle:C,actionButtonStyle:D,className:I="",descriptionClassName:V="",duration:U,position:R,gap:$,loadingIcon:F,expandByDefault:T,classNames:O,icons:H,closeButtonAriaLabel:re="Close toast",pauseWhenPageIsHidden:
486Q}=e,[q,M]=W.useState(null),[Z,z]=W.useState(null),[A,ee]=W.useState(!1),[L,G]=W.useState(!1),[te,he]=W.useState(!1),[Le,st]=W.useState(!1),[mn,pn]=W.useState(!1),[oi,qo]=W.useState(0),[sa,Uy]=W.useState(0),Ho=W.useRef(m.duration||U||wb),Vy=W.useRef(null),li=W.useRef(null),qA=x===0,HA=x+1<=b,wr=m.type,ia=m.dismissible!==!1,KA=m.className||"",YA=m.descriptionClassName||"",eu=W.useMemo(()=>v.findIndex(ve=>ve.toastId===m.id)||0,[v,m.id]),QA=W.useMemo(()=>{var ve;return(ve=m.closeButton)!=null?ve:k},[m.closeButton,k]),By=W.useMemo(()=>m.duration||U||wb,[m.duration,U]),gf=W.useRef(0),aa=W.useRef(0),zy=W.useRef(0),oa=W.useRef(null),[JA,XA]=R.split("-"),Gy=W.useMemo(()=>v.reduce((ve,Re,Be)=>Be>=eu?ve:ve+Re.height,0),[v,eu]),Wy=ED(),ZA=m.invert||f,xf=wr==="loading";aa.current=W.useMemo(()=>eu*$+Gy,[eu,Gy]),W.useEffect(()=>{Ho.current=By},[By]),W.useEffect(()=>{ee(!0)},[]),W.useEffect(()=>{let ve=li.current;if(ve){let Re=ve.getBoundingClientRect().height;return Uy(Re),y(Be=>[{toastId:m.id,height:Re,position:m.position},...Be]),()=>y(Be=>Be.filter(Fr=>Fr.toastId!==m.id))}},[y,m.id]),W.useLayoutEffect(()=>{if(!A)return;let ve=li.current,Re=ve.style.height;ve.style.height="auto";let Be=ve.getBoundingClientRect().height;ve.style.height=Re,Uy(Be),y(Fr=>Fr.find(Ur=>Ur.toastId===m.id)?Fr.map(Ur=>Ur.toastId===m.id?{...Ur,height:Be}:Ur):[{toastId:m.id,height:Be,position:m.position},...Fr])},[A,m.title,m.description,y,m.id]);let as=W.useCallback(()=>{G(!0),qo(aa.current),y(ve=>ve.filter(Re=>Re.toastId!==m.id)),setTimeout(()=>{S(m)},BD)},[m,S,y,aa]);W.useEffect(()=>{if(m.promise&&wr==="loading"||m.duration===1/0||m.type==="loading")return;let ve;return N||g||Q&&Wy?(()=>{if(zy.current<gf.current){let Re=new Date().getTime()-gf.current;Ho.current=Ho.current-Re}zy.current=new Date().getTime()})():Ho.current!==1/0&&(gf.current=new Date().getTime(),ve=setTimeout(()=>{var Re;(Re=m.onAutoClose)==null||Re.call(m,m),as()},Ho.current)),()=>clearTimeout(ve)},[N,g,m,wr,Q,Wy,as]),W.useEffect(()=>{m.delete&&as()},[as,m.delete]);function eR(){var ve,Re,Be;return H!=null&&H.loading?W.createElement("div",{className:zr(O==null?void 0:O.loader,(ve=m==null?void 0:m.classNames)==null?void 0:ve.loader,"sonner-loader"),"data-visible":wr==="loading"},H.loading):F?W.createElement("div",{className:zr(O==null?void 0:O.loader,(Re=m==null?void 0:m.classNames)==null?void 0:Re.loader,"sonner-loader"),"data-visible":wr==="loading"},F):W.createElement(jD,{className:zr(O==null?void 0:O.loader,(Be=m==null?void 0:m.classNames)==null?void 0:Be.loader),visible:wr==="loading"})}return W.createElement("li",{tabIndex:0,ref:li,className:zr(I,KA,O==null?void 0:O.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[wr],(r=m==null?void 0:m.classNames)==null?void 0:r[wr]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:_,"data-styled":!(m.jsx||m.unstyled||w),"data-mounted":A,"data-promise":!!m.promise,"data-swiped":mn,"data-removed":L,"data-visible":HA,"data-y-position":JA,"data-x-position":XA,"data-index":x,"data-front":qA,"data-swiping":te,"data-dismissible":ia,"data-type":wr,"data-invert":ZA,"data-swipe-out":Le,"data-swipe-direction":Z,"data-expanded":!!(N||T&&A),style:{"--index":x,"--toasts-before":x,"--z-index":j.length-x,"--offset":`${L?oi:aa.current}px`,"--initial-height":T?"auto":`${sa}px`,...P,...m.style},onDragEnd:()=>{he(!1),M(null),oa.current=null},onPointerDown:ve=>{xf||!ia||(Vy.current=new Date,qo(aa.current),ve.target.setPointerCapture(ve.pointerId),ve.target.tagName!=="BUTTON"&&(he(!0),oa.current={x:ve.clientX,y:ve.clientY}))},onPointerUp:()=>{var ve,Re,Be,Fr;if(Le||!ia)return;oa.current=null;let Ur=Number(((ve=li.current)==null?void 0:ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),os=Number(((Re=li.current)==null?void 0:Re.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ci=new Date().getTime()-((Be=Vy.current)==null?void 0:Be.getTime()),Vr=q==="x"?Ur:os,ls=Math.abs(Vr)/ci;if(Math.abs(Vr)>=VD||ls>.11){qo(aa.current),(Fr=m.onDismiss)==null||Fr.call(m,m),z(q==="x"?Ur>0?"right":"left":os>0?"down":"up"),as(),st(!0),pn(!1);return}he(!1),M(null)},onPointerMove:ve=>{var Re,Be,Fr,Ur;if(!oa.current||!ia||((Re=window.getSelection())==null?void 0:Re.toString().length)>0)return;let os=ve.clientY-oa.current.y,ci=ve.clientX-oa.current.x,Vr=(Be=e.swipeDirections)!=null?Be:zD(R);!q&&(Math.abs(ci)>1||Math.abs(os)>1)&&M(Math.abs(ci)>Math.abs(os)?"x":"y");let ls={x:0,y:0};q==="y"?(Vr.includes("top")||Vr.includes("bottom"))&&(Vr.includes("top")&&os<0||Vr.includes("bottom")&&os>0)&&(ls.y=os):q==="x"&&(Vr.includes("left")||Vr.includes("right"))&&(Vr.includes("left")&&ci<0||Vr.includes("right")&&ci>0)&&(ls.x=ci),(Math.abs(ls.x)>0||Math.abs(ls.y)>0)&&pn(!0),(Fr=li.current)==null||Fr.style.setProperty("--swipe-amount-x",`${ls.x}px`),(Ur=li.current)==null||Ur.style.setProperty("--swipe-amount-y",`${ls.y}px`)}},QA&&!m.jsx?W.createElement("button",{"aria-label":re,"data-disabled":xf,"data-close-button":!0,onClick:xf||!ia?()=>{}:()=>{var ve;as(),(ve=m.onDismiss)==null||ve.call(m,m)},className:zr(O==null?void 0:O.closeButton,(s=m==null?void 0:m.classNames)==null?void 0:s.closeButton)},(a=H==null?void 0:H.close)!=null?a:CD):null,m.jsx||p.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:W.createElement(W.Fragment,null,wr||m.icon||m.promise?W.createElement("div",{"data-icon":"",className:zr(O==null?void 0:O.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||eR():null,m.type!=="loading"?m.
486icon||(H==null?void 0:H[wr])||bD(wr):null):null,W.createElement("div",{"data-content":"",className:zr(O==null?void 0:O.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},W.createElement("div",{"data-title":"",className:zr(O==null?void 0:O.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?W.createElement("div",{"data-description":"",className:zr(V,YA,O==null?void 0:O.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),p.isValidElement(m.cancel)?m.cancel:m.cancel&&ju(m.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||C,onClick:ve=>{var Re,Be;ju(m.cancel)&&ia&&((Be=(Re=m.cancel).onClick)==null||Be.call(Re,ve),as())},className:zr(O==null?void 0:O.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,p.isValidElement(m.action)?m.action:m.action&&ju(m.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||D,onClick:ve=>{var Re,Be;ju(m.action)&&((Be=(Re=m.action).onClick)==null||Be.call(Re,ve),!ve.defaultPrevented&&as())},className:zr(O==null?void 0:O.actionButton,(h=m==null?void 0:m.classNames)==null?void 0:h.actionButton)},m.action.label):null))};function jb(){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 WD(e,t){let r={};return[e,t].forEach((n,s)=>{let a=s===1,o=a?"--mobile-offset":"--offset",l=a?$D:LD;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${o}-${u}`]=l:r[`${o}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}var qD=p.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:a,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:h,duration:f,style:m,visibleToasts:w=DD,toastOptions:g,dir:y=jb(),gap:b=UD,loadingIcon:v,icons:x,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:N}=e,[S,_]=W.useState([]),k=W.useMemo(()=>Array.from(new Set([n].concat(S.filter(Q=>Q.position).map(Q=>Q.position)))),[S,n]),[P,C]=W.useState([]),[D,I]=W.useState(!1),[V,U]=W.useState(!1),[R,$]=W.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=W.useRef(null),T=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=W.useRef(null),H=W.useRef(!1),re=W.useCallback(Q=>{_(q=>{var M;return(M=q.find(Z=>Z.id===Q.id))!=null&&M.delete||Qt.dismiss(Q.id),q.filter(({id:Z})=>Z!==Q.id)})},[]);return W.useEffect(()=>Qt.subscribe(Q=>{if(Q.dismiss){_(q=>q.map(M=>M.id===Q.id?{...M,delete:!0}:M));return}setTimeout(()=>{FS.flushSync(()=>{_(q=>{let M=q.findIndex(Z=>Z.id===Q.id);return M!==-1?[...q.slice(0,M),{...q[M],...Q},...q.slice(M+1)]:[Q,...q]})})})}),[]),W.useEffect(()=>{if(d!=="system"){$(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;let Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:q})=>{$(q?"dark":"light")})}catch{Q.addListener(({matches:M})=>{try{$(M?"dark":"light")}catch(Z){console.error(Z)}})}},[d]),W.useEffect(()=>{S.length<=1&&I(!1)},[S]),W.useEffect(()=>{let Q=q=>{var M,Z;s.every(z=>q[z]||q.code===z)&&(I(!0),(M=F.current)==null||M.focus()),q.code==="Escape"&&(document.activeElement===F.current||(Z=F.current)!=null&&Z.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[s]),W.useEffect(()=>{if(F.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,H.current=!1)}},[F.current]),W.createElement("section",{ref:t,"aria-label":`${j} ${T}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((Q,q)=>{var M;let[Z,z]=Q.split("-");return S.length?W.createElement("ol",{key:Q,dir:y==="auto"?jb():y,tabIndex:-1,ref:F,className:l,"data-sonner-toaster":!0,"data-theme":R,"data-y-position":Z,"data-lifted":D&&S.length>1&&!a,"data-x-position":z,style:{"--front-toast-height":`${((M=P[0])==null?void 0:M.height)||0}px`,"--width":`${FD}px`,"--gap":`${b}px`,...m,...WD(c,u)},onBlur:A=>{H.current&&!A.currentTarget.contains(A.relatedTarget)&&(H.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||H.current||(H.current=!0,O.current=A.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{V||I(!1)},onDragEnd:()=>I(!1),onPointerDown:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},S.filter(A=>!A.position&&q===0||A.position===Q).map((A,ee)=>{var L,G;return W.createElement(GD,{key:A.id,icons:x,index:ee,toast:A,defaultRichColors:h,duration:(L=g==null?void 0:g.duration)!=null?L:f,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:w,closeButton:(G=g==null?void 0:g.closeButton)!=null?G:o,interacting:V,position:Q,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:re,toasts:S.filter(te=>te.position==A.position),heights:P.filter(te=>te.position==A.position),setHeights:C,expandByDefault:a,gap:b,loadingIcon:v,expanded:D,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const HD=({...e})=>{const{theme:t="system"}=yD();return i.jsx(qD,{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 KD=lx[" useId ".trim().toString()]||(()=>{}),YD=0;function Hn(e){const[t,r]=p.useState(KD());return ht(()=>{r(n=>n??String(YD++))},[e]),t?`radix-${t}`:""}const QD=["top","right","bottom","left"],Ys=Math.min,or=Math.max,zd=Math.round,Nu=Math.floor,kn=e=>({x:e,y:e}
vendor: 10,772 bytes, line 486
486),JD={left:"right",right:"left",bottom:"top",top:"bottom"},XD={start:"end",end:"start"};function Wp(e,t,r){return or(e,Ys(t,r))}function Zn(e,t){return typeof e=="function"?e(t):e}function es(e){return e.split("-")[0]}function Mo(e){return e.split("-")[1]}function lv(e){return e==="x"?"y":"x"}function cv(e){return e==="y"?"height":"width"}const ZD=new Set(["top","bottom"]);function jn(e){return ZD.has(es(e))?"y":"x"}function uv(e){return lv(jn(e))}function e5(e,t,r){r===void 0&&(r=!1);const n=Mo(e),s=uv(e),a=cv(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Gd(o)),[o,Gd(o)]}function t5(e){const t=Gd(e);return[qp(e),t,qp(t)]}function qp(e){return e.replace(/start|end/g,t=>XD[t])}const Nb=["left","right"],Sb=["right","left"],r5=["top","bottom"],n5=["bottom","top"];function s5(e,t,r){switch(e){case"top":case"bottom":return r?t?Sb:Nb:t?Nb:Sb;case"left":case"right":return t?r5:n5;default:return[]}}function i5(e,t,r,n){const s=Mo(e);let a=s5(es(e),r==="start",n);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(qp)))),a}function Gd(e){return e.replace(/left|right|bottom|top/g,t=>JD[t])}function a5(e){return{top:0,right:0,bottom:0,left:0,...e}}function H_(e){return typeof e!="number"?a5(e):{top:e,right:e,bottom:e,left:e}}function Wd(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function _b(e,t,r){let{reference:n,floating:s}=e;const a=jn(t),o=uv(t),l=cv(o),c=es(t),u=a==="y",d=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,f=n[l]/2-s[l]/2;let m;switch(c){case"top":m={x:d,y:n.y-s.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:h};break;case"left":m={x:n.x-s.width,y:h};break;default:m={x:n.x,y:n.y}}switch(Mo(t)){case"start":m[o]-=f*(r&&u?-1:1);break;case"end":m[o]+=f*(r&&u?-1:1);break}return m}const o5=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:a=[],platform:o}=r,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:h}=_b(u,n,c),f=n,m={},w=0;for(let g=0;g<l.length;g++){const{name:y,fn:b}=l[g],{x:v,y:x,data:j,reset:N}=await b({x:d,y:h,initialPlacement:n,placement:f,strategy:s,middlewareData:m,rects:u,platform:o,elements:{reference:e,floating:t}});d=v??d,h=x??h,m={...m,[y]:{...m[y],...j}},N&&w<=50&&(w++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(u=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:d,y:h}=_b(u,f,c)),g=-1)}return{x:d,y:h,placement:f,strategy:s,middlewareData:m}};async function ac(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:m=0}=Zn(t,e),w=H_(m),y=l[f?h==="floating"?"reference":"floating":h],b=Wd(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(y)))==null||r?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),v=h==="floating"?{x:n,y:s,width:o.floating.width,height:o.floating.height}:o.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),j=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},N=Wd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:x,strategy:c}):v);return{top:(b.top-N.top+w.top)/j.y,bottom:(N.bottom-b.bottom+w.bottom)/j.y,left:(b.left-N.left+w.left)/j.x,right:(N.right-b.right+w.right)/j.x}}const l5=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Zn(e,t)||{};if(u==null)return{};const h=H_(d),f={x:r,y:n},m=uv(s),w=cv(m),g=await o.getDimensions(u),y=m==="y",b=y?"top":"left",v=y?"bottom":"right",x=y?"clientHeight":"clientWidth",j=a.reference[w]+a.reference[m]-f[m]-a.floating[w],N=f[m]-a.reference[m],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let _=S?S[x]:0;(!_||!await(o.isElement==null?void 0:o.isElement(S)))&&(_=l.floating[x]||a.floating[w]);const k=j/2-N/2,P=_/2-g[w]/2-1,C=Ys(h[b],P),D=Ys(h[v],P),I=C,V=_-g[w]-D,U=_/2-g[w]/2+k,R=Wp(I,U,V),$=!c.arrow&&Mo(s)!=null&&U!==R&&a.reference[w]/2-(U<I?C:D)-g[w]/2<0,F=$?U<I?U-I:U-V:0;return{[m]:f[m]+F,data:{[m]:R,centerOffset:U-R-F,...$&&{alignmentOffset:F}},reset:$}}}),c5=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:g=!0,...y}=Zn(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const b=es(s),v=jn(l),x=es(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(u.floating)),N=f||(x||!g?[Gd(l)]:t5(l)),S=w!=="none";!f&&S&&N.push(...i5(l,g,w,j));const _=[l,...N],k=await ac(t,y),P=[];let C=((n=a.flip)==null?void 0:n.overflows)||[];if(d&&P.push(k[b]),h){const U=e5(s,o,j);P.push(k[U[0]],k[U[1]])}if(C=[...C,{placement:s,overflows:P}],!P.every(U=>U<=0)){var D,I;const U=(((D=a.flip)==null?void 0:D.index)||0)+1,R=_[U];if(R&&(!(h==="alignment"?v!==jn(R):!1)||C.every(T=>T.overflows[0]>0&&jn(T.placement)===v)))return{data:{index:U,overflows:C},reset:{placement:R}};let $=(I=C.filter(F=>F.overflows[0]<=0).sort((F,T)=>F.overflows[1]-T.overflows[1])[0])==null?void 0:I.placement;if(!$)switch(m){case"bestFit":{var V;const F=(V=C.filter(T=>{if(S){const O=jn(T.placement);return O===v||O==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(O=>O>0).reduce((O,H)=>O+H,0)]).sort((T,O)=>T[1]-O[1])[0])==null?void 0:V[0];F&&($=F);break}case"initialPlacement":$=l;break}if(s!==$)return{reset:{placement:$}}}return{}}}};function kb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Cb(e){return QD.some(t=>e[t]>=0)}const u5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=Zn(e,t);switch(n){case"referenceHidden":{const a=await ac(t,{...s,elementContext:"reference"}),o=kb(a,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Cb(o)}}}case"escaped":{const a=await ac(t,{...s,altBoundary:!0}),o=kb(a,r.floating);return{data:{escapedOffsets:o,escaped:Cb(o)}}}default:return{}}}}},K_=new Set(["left","top"]);async function d5(e,t){const{placement:r,platform:n,elements:s}=e,a=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=es(r),l=Mo(r),c=jn(r)==="y",u=K_.has(o)?-1:1,d=a&&c?-1:1,h=Zn(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof w=="number"&&(m=l==="end"?w*-1:w),c?{x:m*d,y:f*u}:{x:f*u,y:m*d}}const h5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:a,placement:o,middlewareData:l}=t,c=await d5(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:o}}}}},f5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:y=>{let{x:b,y:v}=y;return{x:b,y:v}}},...c}=Zn(e,t),u={x:r,y:n},d=await ac(t,c),h=jn(es(s)),f=lv(h);let m=u[f],w=u[h];if(a){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=m+d[y],x=m-d[b];m=Wp(v,m,x)}if(o){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=w+d[y],x=w-d[b];w=Wp(v,w,x)}const g=l.fn({...t,[f]:m,[h]:w});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[f]:a,[h]:o}}}}}},m5=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Zn(e,t),d={x:r,y:n},h=jn(s),f=lv(h);let m=d[f],w=d[h];const g=Zn(l,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const x=f==="y"?"height":"width",j=a.reference[f]-a.floating[x]+y.mainAxis,N=a.reference[f]+a.reference[x]-y.mainAxis;m<j?m=j:m>N&&(m=N)}if(u){var b,v;const x=f==="y"?"width":"height",j=K_.has(es(s)),N=a.reference[h]-a.floating[x]+(j&&((b=o.offset)==null?void 0:b[h])||0)+(j?0:y.crossAxis),S=a.reference[h]+a.reference[x]+(j?0:((v=o.offset)==null?void 0:v[h])||0)-(j?y.crossAxis:0);w<N?w=N:w>S&&(w=S)}return{[f]:m,[h]:w}}}},p5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=Zn(e,t),d=await ac(t,u),h=es(s),f=Mo(s),m=jn(s)==="y",{width:w,height:g}=a.floating;let y,b;h==="top"||h==="bottom"?(y=h,b=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(b=h,y=f==="end"?"top":"bottom");const v=g-d.top-d.bottom,x=w-d.left-d.right,j=Ys(g-d[y],v),N=Ys(w-d[b],x),S=!t.middlewareData.shift;let _=j,k=N;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(_=v),S&&!f){const C=or(d.left,0),D=or(d.right,0),I=or(d.top,0),V=or(d.bottom,0);m?k=w-2*(C!==0||D!==0?C+D:or(d.left,d.right)):_=g-2*(I!==0||V!==0?I+V:or(d.top,d.bottom))}await c({...t,availableWidth:k,availableHeight:_});const P=await o.getDimensions(l.floating);return w!==P.width||g!==P.height?{reset:{rects:!0}}:{}}}};function $h(){return typeof window<"u"}function Do(e){return Y_(e)?(e.nodeName||"").toLowerCase():"#document"}function mr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function An(e){var t;return(t=(Y_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Y_(e){return $h()?e instanceof Node||e instanceof mr(e).Node:!1}function ln(e){return $h()?e instanceof Element||e instanceof mr(e).Element:!1}function Tn(e){return $h()?e instanceof HTMLElement||e instanceof mr(e).HTMLElement:!1}function Eb(e){return!$h()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mr(e).ShadowRoot}const g5=new Set(["inline","contents"]);function Vc(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=cn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!g5.has(s)}const x5=new Set(["table","td","th"]);function v5(e){return x5.has(Do(e))}const y5=[":popover-open",":modal"];function Fh(e){return y5.some(t=>{try{return e.matches(t)}catch{return!1}})}const b5=["transform","translate","scale","rotate","perspective"],w5=["transform","translate","scale","rotate","perspective","filter"],j5=["paint","layout","strict","content"];
vendor: 5,011 bytes, line 486
486function dv(e){const t=hv(),r=ln(e)?cn(e):e;return b5.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||w5.some(n=>(r.willChange||"").includes(n))||j5.some(n=>(r.contain||"").includes(n))}function N5(e){let t=Qs(e);for(;Tn(t)&&!jo(t);){if(dv(t))return t;if(Fh(t))return null;t=Qs(t)}return null}function hv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const S5=new Set(["html","body","#document"]);function jo(e){return S5.has(Do(e))}function cn(e){return mr(e).getComputedStyle(e)}function Uh(e){return ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qs(e){if(Do(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Eb(e)&&e.host||An(e);return Eb(t)?t.host:t}function Q_(e){const t=Qs(e);return jo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tn(t)&&Vc(t)?t:Q_(t)}function oc(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Q_(e),a=s===((n=e.ownerDocument)==null?void 0:n.body),o=mr(s);if(a){const l=Hp(o);return t.concat(o,o.visualViewport||[],Vc(s)?s:[],l&&r?oc(l):[])}return t.concat(s,oc(s,[],r))}function Hp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function J_(e){const t=cn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Tn(e),a=s?e.offsetWidth:r,o=s?e.offsetHeight:n,l=zd(r)!==a||zd(n)!==o;return l&&(r=a,n=o),{width:r,height:n,$:l}}function fv(e){return ln(e)?e:e.contextElement}function Qa(e){const t=fv(e);if(!Tn(t))return kn(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:a}=J_(t);let o=(a?zd(r.width):r.width)/n,l=(a?zd(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const _5=kn(0);function X_(e){const t=mr(e);return!hv()||!t.visualViewport?_5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function k5(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==mr(e)?!1:t}function Yi(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),a=fv(e);let o=kn(1);t&&(n?ln(n)&&(o=Qa(n)):o=Qa(e));const l=k5(a,r,n)?X_(a):kn(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,h=s.height/o.y;if(a){const f=mr(a),m=n&&ln(n)?mr(n):n;let w=f,g=Hp(w);for(;g&&n&&m!==w;){const y=Qa(g),b=g.getBoundingClientRect(),v=cn(g),x=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*y.x,j=b.top+(g.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,h*=y.y,c+=x,u+=j,w=mr(g),g=Hp(w)}}return Wd({width:d,height:h,x:c,y:u})}function mv(e,t){const r=Uh(e).scrollLeft;return t?t.left+r:Yi(An(e)).left+r}function Z_(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(r?0:mv(e,n)),a=n.top+t.scrollTop;return{x:s,y:a}}function C5(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const a=s==="fixed",o=An(n),l=t?Fh(t.floating):!1;if(n===o||l&&a)return r;let c={scrollLeft:0,scrollTop:0},u=kn(1);const d=kn(0),h=Tn(n);if((h||!h&&!a)&&((Do(n)!=="body"||Vc(o))&&(c=Uh(n)),Tn(n))){const m=Yi(n);u=Qa(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}const f=o&&!h&&!a?Z_(o,c,!0):kn(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+f.x,y:r.y*u.y-c.scrollTop*u.y+d.y+f.y}}function E5(e){return Array.from(e.getClientRects())}function P5(e){const t=An(e),r=Uh(e),n=e.ownerDocument.body,s=or(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=or(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+mv(e);const l=-r.scrollTop;return cn(n).direction==="rtl"&&(o+=or(t.clientWidth,n.clientWidth)-s),{width:s,height:a,x:o,y:l}}function T5(e,t){const r=mr(e),n=An(e),s=r.visualViewport;let a=n.clientWidth,o=n.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;const u=hv();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l,y:c}}const A5=new Set(["absolute","fixed"]);function R5(e,t){const r=Yi(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,a=Tn(e)?Qa(e):kn(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,u=n*a.y;return{width:o,height:l,x:c,y:u}}function Pb(e,t,r){let n;if(t==="viewport")n=T5(e,r);else if(t==="document")n=P5(An(e));else if(ln(t))n=R5(t,r);else{const s=X_(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Wd(n)}function ek(e,t){const r=Qs(e);return r===t||!ln(r)||jo(r)?!1:cn(r).position==="fixed"||ek(r,t)}function I5(e,t){const r=t.get(e);if(r)return r;let n=oc(e,[],!1).filter(l=>ln(l)&&Do(l)!=="body"),s=null;const a=cn(e).position==="fixed";let o=a?Qs(e):e;for(;ln(o)&&!jo(o);){const l=cn(o),c=dv(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&A5.has(s.position)||Vc(o)&&!c&&ek(e,o))?n=n.filter(d=>d!==o):s=l,o=Qs(o)}return t.set(e,n),n}function O5(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const o=[...r==="clippingAncestors"?Fh(t)?[]:I5(t,this._c):[].concat(r),n],l=o[0],c=o.reduce((u,d)=>{const h=Pb(t,d,s);
vendor: 9,127 bytes, line 486
486return u.top=or(h.top,u.top),u.right=Ys(h.right,u.right),u.bottom=Ys(h.bottom,u.bottom),u.left=or(h.left,u.left),u},Pb(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function M5(e){const{width:t,height:r}=J_(e);return{width:t,height:r}}function D5(e,t,r){const n=Tn(t),s=An(t),a=r==="fixed",o=Yi(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=kn(0);function u(){c.x=mv(s)}if(n||!n&&!a)if((Do(t)!=="body"||Vc(s))&&(l=Uh(t)),n){const m=Yi(t,!0,a,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&u();a&&!n&&s&&u();const d=s&&!n&&!a?Z_(s,l):kn(0),h=o.left+l.scrollLeft-c.x-d.x,f=o.top+l.scrollTop-c.y-d.y;return{x:h,y:f,width:o.width,height:o.height}}function Zf(e){return cn(e).position==="static"}function Tb(e,t){if(!Tn(e)||cn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return An(e)===r&&(r=r.ownerDocument.body),r}function tk(e,t){const r=mr(e);if(Fh(e))return r;if(!Tn(e)){let s=Qs(e);for(;s&&!jo(s);){if(ln(s)&&!Zf(s))return s;s=Qs(s)}return r}let n=Tb(e,t);for(;n&&v5(n)&&Zf(n);)n=Tb(n,t);return n&&jo(n)&&Zf(n)&&!dv(n)?r:n||N5(e)||r}const L5=async function(e){const t=this.getOffsetParent||tk,r=this.getDimensions,n=await r(e.floating);return{reference:D5(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function $5(e){return cn(e).direction==="rtl"}const F5={convertOffsetParentRelativeRectToViewportRelativeRect:C5,getDocumentElement:An,getClippingRect:O5,getOffsetParent:tk,getElementRects:L5,getClientRects:E5,getDimensions:M5,getScale:Qa,isElement:ln,isRTL:$5};function rk(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function U5(e,t){let r=null,n;const s=An(e);function a(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:d,top:h,width:f,height:m}=u;if(l||t(),!f||!m)return;const w=Nu(h),g=Nu(s.clientWidth-(d+f)),y=Nu(s.clientHeight-(h+m)),b=Nu(d),x={rootMargin:-w+"px "+-g+"px "+-y+"px "+-b+"px",threshold:or(0,Ys(1,c))||1};let j=!0;function N(S){const _=S[0].intersectionRatio;if(_!==c){if(!j)return o();_?o(!1,_):n=setTimeout(()=>{o(!1,1e-7)},1e3)}_===1&&!rk(u,e.getBoundingClientRect())&&o(),j=!1}try{r=new IntersectionObserver(N,{...x,root:s.ownerDocument})}catch{r=new IntersectionObserver(N,x)}r.observe(e)}return o(!0),a}function V5(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=fv(e),d=s||a?[...u?oc(u):[],...oc(t)]:[];d.forEach(b=>{s&&b.addEventListener("scroll",r,{passive:!0}),a&&b.addEventListener("resize",r)});const h=u&&l?U5(u,r):null;let f=-1,m=null;o&&(m=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),r()}),u&&!c&&m.observe(u),m.observe(t));let w,g=c?Yi(e):null;c&&y();function y(){const b=Yi(e);g&&!rk(g,b)&&r(),g=b,w=requestAnimationFrame(y)}return r(),()=>{var b;d.forEach(v=>{s&&v.removeEventListener("scroll",r),a&&v.removeEventListener("resize",r)}),h==null||h(),(b=m)==null||b.disconnect(),m=null,c&&cancelAnimationFrame(w)}}const B5=h5,z5=f5,G5=c5,W5=p5,q5=u5,Ab=l5,H5=m5,K5=(e,t,r)=>{const n=new Map,s={platform:F5,...r},a={...s.platform,_c:n};return o5(e,t,{...s,platform:a})};var Y5=typeof document<"u",Q5=function(){},ad=Y5?p.useLayoutEffect:Q5;function qd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!qd(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const a=s[n];if(!(a==="_owner"&&e.$$typeof)&&!qd(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function nk(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rb(e,t){const r=nk(e);return Math.round(t*r)/r}function em(e){const t=p.useRef(e);return ad(()=>{t.current=e}),t}function J5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,h]=p.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=p.useState(n);qd(f,n)||m(n);const[w,g]=p.useState(null),[y,b]=p.useState(null),v=p.useCallback(T=>{T!==S.current&&(S.current=T,g(T))},[]),x=p.useCallback(T=>{T!==_.current&&(_.current=T,b(T))},[]),j=a||w,N=o||y,S=p.useRef(null),_=p.useRef(null),k=p.useRef(d),P=c!=null,C=em(c),D=em(s),I=em(u),V=p.useCallback(()=>{if(!S.current||!_.current)return;const T={placement:t,strategy:r,middleware:f};D.current&&(T.platform=D.current),K5(S.current,_.current,T).then(O=>{const H={...O,isPositioned:I.current!==!1};U.current&&!qd(k.current,H)&&(k.current=H,na.flushSync(()=>{h(H)}))})},[f,t,r,D,I]);ad(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,h(T=>({...T,isPositioned:!1})))},[u]);const U=p.useRef(!1);ad(()=>(U.current=!0,()=>{U.current=!1}),[]),ad(()=>{if(j&&(S.current=j),N&&(_.current=N),j&&N){if(C.current)return C.current(j,N,V);V()}},[j,N,V,C,P]);const R=p.useMemo(()=>({reference:S,floating:_,setReference:v,setFloating:x}),[v,x]),$=p.useMemo(()=>({reference:j,floating:N}),[j,N]),F=p.useMemo(()=>{const T={position:r,left:0,top:0};if(!$.floating)return T;const O=Rb($.floating,d.x),H=Rb($.floating,d.y);return l?{...T,transform:"translate("+O+"px, "+H+"px)",...nk($.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:O,top:H}},[r,l,$.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:V,refs:R,elements:$,floatingStyles:F}),[d,V,R,$,F])}const X5=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ab({element:n.current,padding:s}).fn(r):{}:n?Ab({element:n,padding:s}).fn(r):{}}}},Z5=(e,t)=>({...B5(e),options:[e,t]}),e3=(e,t)=>({...z5(e),options:[e,t]}),t3=(e,t)=>({...H5(e),options:[e,t]}),r3=(e,t)=>({...G5(e),options:[e,t]}),n3=(e,t)=>({...W5(e),options:[e,t]}),s3=(e,t)=>({...q5(e),options:[e,t]}),i3=(e,t)=>({...X5(e),options:[e,t]});var a3="Arrow",sk=p.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...a}=e;return i.jsx(ue.svg,{...a,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});sk.displayName=a3;var o3=sk;function Bc(e){const[t,r]=p.useState(void 0);return ht(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;r({width:o,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var pv="Popper",[ik,Vh]=Kt(pv),[l3,ak]=ik(pv),ok=e=>{const{__scopePopper:t,children:r}=e,[n,s]=p.useState(null);return i.jsx(l3,{scope:t,anchor:n,onAnchorChange:s,children:r})};ok.displayName=pv;var lk="PopperAnchor",ck=p.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,a=ak(lk,r),o=p.useRef(null),l=je(t,o);return p.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:i.jsx(ue.div,{...s,ref:l})});ck.displayName=lk;var gv="PopperContent",[c3,u3]=ik(gv),uk=p.forwardRef((e,t)=>{var A,ee,L,G,te,he;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:w,...g}=e,y=ak(gv,r),[b,v]=p.useState(null),x=je(t,Le=>v(Le)),[j,N]=p.useState(null),S=Bc(j),_=(S==null?void 0:S.width)??0,k=(S==null?void 0:S.height)??0,P=n+(a!=="center"?"-"+a:""),C=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(u)?u:[u],I=D.length>0,V={padding:C,boundary:D.filter(h3),altBoundary:I},{refs:U,floatingStyles:R,placement:$,isPositioned:F,middlewareData:T}=J5({strategy:"fixed",placement:P,whileElementsMounted:(...Le)=>V5(...Le,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[Z5({mainAxis:s+k,alignmentAxis:o}),c&&e3({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?t3():void 0,...V}),c&&r3({...V}),n3({...V,apply:({elements:Le,rects:st,availableWidth:mn,availableHeight:pn})=>{const{width:oi,height:qo}=st.reference,sa=Le.floating.style;sa.setProperty("--radix-popper-available-width",`${mn}px`),sa.setProperty("--radix-popper-available-height",`${pn}px`),sa.setProperty("--radix-popper-anchor-width",`${oi}px`),sa.setProperty("--radix-popper-anchor-height",`${qo}px`)}}),j&&i3({element:j,padding:l}),f3({arrowWidth:_,arrowHeight:k}),f&&s3({strategy:"referenceHidden",...V})]}),[O,H]=fk($),re=gr(w);ht(()=>
vendor: 4,239 bytes, line 486
486{F&&(re==null||re())},[F,re]);const Q=(A=T.arrow)==null?void 0:A.x,q=(ee=T.arrow)==null?void 0:ee.y,M=((L=T.arrow)==null?void 0:L.centerOffset)!==0,[Z,z]=p.useState();return ht(()=>{b&&z(window.getComputedStyle(b).zIndex)},[b]),i.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:F?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(G=T.transformOrigin)==null?void 0:G.x,(te=T.transformOrigin)==null?void 0:te.y].join(" "),...((he=T.hide)==null?void 0:he.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(c3,{scope:r,placedSide:O,onArrowChange:N,arrowX:Q,arrowY:q,shouldHideArrow:M,children:i.jsx(ue.div,{"data-side":O,"data-align":H,...g,ref:x,style:{...g.style,animation:F?void 0:"none"}})})})});uk.displayName=gv;var dk="PopperArrow",d3={top:"bottom",right:"left",bottom:"top",left:"right"},hk=p.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,a=u3(dk,n),o=d3[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(o3,{...s,ref:r,style:{...s.style,display:"block"}})})});hk.displayName=dk;function h3(e){return e!==null}var f3=e=>({name:"transformOrigin",options:e,fn(t){var y,b,v;const{placement:r,rects:n,middlewareData:s}=t,o=((y=s.arrow)==null?void 0:y.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=fk(r),h={start:"0%",center:"50%",end:"100%"}[d],f=(((b=s.arrow)==null?void 0:b.x)??0)+l/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let w="",g="";return u==="bottom"?(w=o?h:`${f}px`,g=`${-c}px`):u==="top"?(w=o?h:`${f}px`,g=`${n.floating.height+c}px`):u==="right"?(w=`${-c}px`,g=o?h:`${m}px`):u==="left"&&(w=`${n.floating.width+c}px`,g=o?h:`${m}px`),{data:{x:w,y:g}}}});function fk(e){const[t,r="center"]=e.split("-");return[t,r]}var mk=ok,pk=ck,gk=uk,xk=hk,[Bh,rK]=Kt("Tooltip",[Vh]),zh=Vh(),vk="TooltipProvider",m3=700,Kp="tooltip.open",[p3,xv]=Bh(vk),yk=e=>{const{__scopeTooltip:t,delayDuration:r=m3,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:a}=e,o=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),i.jsx(p3,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:p.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:s,children:a})};yk.displayName=vk;var lc="Tooltip",[g3,Gh]=Bh(lc),bk=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=xv(lc,e.__scopeTooltip),u=zh(t),[d,h]=p.useState(null),f=Hn(),m=p.useRef(0),w=o??c.disableHoverableContent,g=l??c.delayDuration,y=p.useRef(!1),[b,v]=sn({prop:n,defaultProp:s??!1,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(Kp))):c.onClose(),a==null||a(_)},caller:lc}),x=p.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),j=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,v(!0)},[v]),N=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v(!1)},[v]),S=p.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,v(!0),m.current=0},g)},[g,v]);return p.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),i.jsx(mk,{...u,children:i.jsx(g3,{scope:t,contentId:f,open:b,stateAttribute:x,trigger:d,onTriggerChange:h,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?S():j()},[c.isOpenDelayedRef,S,j]),onTriggerLeave:p.useCallback(()=>{w?N():(window.clearTimeout(m.current),m.current=0)},[N,w]),onOpen:j,onClose:N,disableHoverableContent:w,children:r})})};bk.displayName=lc;var Yp="TooltipTrigger",wk=p.forwardRef((e,t)=>
vendor: 5,622 bytes, line 486
486{const{__scopeTooltip:r,...n}=e,s=Gh(Yp,r),a=xv(Yp,r),o=zh(r),l=p.useRef(null),c=je(t,l,s.onTriggerChange),u=p.useRef(!1),d=p.useRef(!1),h=p.useCallback(()=>u.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),i.jsx(pk,{asChild:!0,...o,children:i.jsx(ue.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:oe(e.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:oe(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:oe(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:oe(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:oe(e.onBlur,s.onClose),onClick:oe(e.onClick,s.onClose)})})});wk.displayName=Yp;var x3="TooltipPortal",[nK,v3]=Bh(x3,{forceMount:void 0}),No="TooltipContent",jk=p.forwardRef((e,t)=>{const r=v3(No,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...a}=e,o=Gh(No,e.__scopeTooltip);return i.jsx(ss,{present:n||o.open,children:o.disableHoverableContent?i.jsx(Nk,{side:s,...a,ref:t}):i.jsx(y3,{side:s,...a,ref:t})})}),y3=p.forwardRef((e,t)=>{const r=Gh(No,e.__scopeTooltip),n=xv(No,e.__scopeTooltip),s=p.useRef(null),a=je(t,s),[o,l]=p.useState(null),{trigger:c,onClose:u}=r,d=s.current,{onPointerInTransitChange:h}=n,f=p.useCallback(()=>{l(null),h(!1)},[h]),m=p.useCallback((w,g)=>{const y=w.currentTarget,b={x:w.clientX,y:w.clientY},v=S3(b,y.getBoundingClientRect()),x=_3(b,v),j=k3(g.getBoundingClientRect()),N=E3([...x,...j]);l(N),h(!0)},[h]);return p.useEffect(()=>()=>f(),[f]),p.useEffect(()=>{if(c&&d){const w=y=>m(y,d),g=y=>m(y,c);return c.addEventListener("pointerleave",w),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",w),d.removeEventListener("pointerleave",g)}}},[c,d,m,f]),p.useEffect(()=>{if(o){const w=g=>{const y=g.target,b={x:g.clientX,y:g.clientY},v=(c==null?void 0:c.contains(y))||(d==null?void 0:d.contains(y)),x=!C3(b,o);v?f():x&&(f(),u())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,d,o,u,f]),i.jsx(Nk,{...e,ref:a})}),[b3,w3]=Bh(lc,{isInside:!1}),j3=dM("TooltipContent"),Nk=p.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=Gh(No,r),u=zh(r),{onClose:d}=c;return p.useEffect(()=>(document.addEventListener(Kp,d),()=>document.removeEventListener(Kp,d)),[d]),p.useEffect(()=>{if(c.trigger){const h=f=>{const m=f.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),i.jsx($c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:i.jsxs(gk,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(j3,{children:n}),i.jsx(b3,{scope:r,isInside:!0,children:i.jsx(IM,{id:c.contentId,role:"tooltip",children:s||n})})]})})});jk.displayName=No;var Sk="TooltipArrow",N3=p.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=zh(r);return w3(Sk,r).isInside?null:i.jsx(xk,{...s,...n,ref:t})});N3.displayName=Sk;function S3(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,s,a)){case a:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function _3(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function k3(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function C3(e,t){const{x:r,y:n}=e;let s=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],u=l.x,d=l.y,h=c.x,f=c.y;d>n!=f>n&&r<(h-u)*(n-d)/(f-d)+u&&(s=!s)}return s}function E3(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),P3(t)}function P3(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const a=r[r.length-1],o=r[r.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var T3=yk,A3=bk,R3=wk,_k=jk;const kk=T3,I3=A3,O3=R3,Ck=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>i.jsx(_k,{ref:n,sideOffset:t,className:J("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
486de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Ck.displayName=_k.displayName;var zc=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(){}},Qi=typeof window>"u"||"Deno"in globalThis;function Jt(){}function M3(e,t){return typeof e=="function"?e(t):e}function Qp(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ek(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Vs(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return typeof e=="function"?e(t):e}function Ib(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(n){if(t.queryHash!==vv(o,t.options))return!1}else if(!uc(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function Ob(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(cc(t.options.mutationKey)!==cc(a))return!1}else if(!uc(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function vv(e,t){return((t==null?void 0:t.queryKeyHashFn)||cc)(e)}function cc(e){return JSON.stringify(e,(t,r)=>Xp(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function uc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>uc(e[r],t[r])):!1}function Pk(e,t){if(e===t)return e;const r=Mb(e)&&Mb(t);if(r||Xp(e)&&Xp(t)){const n=r?e:Object.keys(e),s=n.length,a=r?t:Object.keys(t),o=a.length,l=r?[]:{},c=new Set(n);let u=0;for(let d=0;d<o;d++){const h=r?d:a[d];(!r&&c.has(h)||r)&&e[h]===void 0&&t[h]===void 0?(l[h]=void 0,u++):(l[h]=Pk(e[h],t[h]),l[h]===e[h]&&e[h]!==void 0&&u++)}return s===o&&u===s?e:l}return t}function Jp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Mb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xp(e){if(!Db(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Db(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Db(e){return Object.prototype.toString.call(e)==="[object Object]"}function D3(e){return new Promise(t=>{setTimeout(t,e)})}function Zp(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Pk(e,t):t}function L3(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function $3(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var yv=Symbol();function Tk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===yv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function F3(e,t){return typeof e=="function"?e(...t):!!e}var Ti,js,eo,x1,U3=(x1=class extends zc{constructor(){super();pe(this,Ti);pe(this,js);pe(this,eo);ie(this,eo,t=>{if(!Qi&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){E(this,js)||this.setEventListener(E(this,eo))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,js))==null||t.call(this),ie(this,js,void 0))}setEventListener(t){var r;ie(this,eo,t),(r=E(this,js))==null||r.call(this),ie(this,js,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){E(this,Ti)!==t&&(ie(this,Ti,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof E(this,Ti)=="boolean"?E(this,Ti):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ti=new WeakMap,js=new WeakMap,eo=new WeakMap,x1),bv=new U3,to,Ns,ro,v1,V3=(v1=class extends zc{constructor(){super();pe(this,to,!0);pe(this,Ns);pe(this,ro);ie(this,ro,t=>{if(!Qi&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n
vendor: 25,078 bytes, line 486
486)}}})}onSubscribe(){E(this,Ns)||this.setEventListener(E(this,ro))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Ns))==null||t.call(this),ie(this,Ns,void 0))}setEventListener(t){var r;ie(this,ro,t),(r=E(this,Ns))==null||r.call(this),ie(this,Ns,t(this.setOnline.bind(this)))}setOnline(t){E(this,to)!==t&&(ie(this,to,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return E(this,to)}},to=new WeakMap,Ns=new WeakMap,ro=new WeakMap,v1),Hd=new V3;function eg(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function B3(e){return Math.min(1e3*2**e,3e4)}function Ak(e){return(e??"online")==="online"?Hd.isOnline():!0}var Rk=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function tm(e){return e instanceof Rk}function Ik(e){let t=!1,r=0,n=!1,s;const a=eg(),o=g=>{var y;n||(f(new Rk(g)),(y=e.abort)==null||y.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>bv.isFocused()&&(e.networkMode==="always"||Hd.isOnline())&&e.canRun(),d=()=>Ak(e.networkMode)&&e.canRun(),h=g=>{var y;n||(n=!0,(y=e.onSuccess)==null||y.call(e,g),s==null||s(),a.resolve(g))},f=g=>{var y;n||(n=!0,(y=e.onError)==null||y.call(e,g),s==null||s(),a.reject(g))},m=()=>new Promise(g=>{var y;s=b=>{(n||u())&&g(b)},(y=e.onPause)==null||y.call(e)}).then(()=>{var g;s=void 0,n||(g=e.onContinue)==null||g.call(e)}),w=()=>{if(n)return;let g;const y=r===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(b){g=Promise.reject(b)}Promise.resolve(g).then(h).catch(b=>{var S;if(n)return;const v=e.retry??(Qi?0:3),x=e.retryDelay??B3,j=typeof x=="function"?x(r,b):x,N=v===!0||typeof v=="number"&&r<v||typeof v=="function"&&v(r,b);if(t||!N){f(b);return}r++,(S=e.onFail)==null||S.call(e,r,b),D3(j).then(()=>u()?void 0:m()).then(()=>{t?f(b):w()})})};return{promise:a,cancel:o,continue:()=>(s==null||s(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?w():m().then(w),a)}}var z3=e=>setTimeout(e,0);function G3(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=z3;const a=l=>{t?e.push(l):s(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var kt=G3(),Ai,y1,Ok=(y1=class{constructor(){pe(this,Ai)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Qp(this.gcTime)&&ie(this,Ai,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Qi?1/0:5*60*1e3))}clearGcTimeout(){E(this,Ai)&&(clearTimeout(E(this,Ai)),ie(this,Ai,void 0))}},Ai=new WeakMap,y1),no,Ri,_r,Ii,Ot,Ec,Oi,Yr,Ln,b1,W3=(b1=class extends Ok{constructor(t){super();pe(this,Yr);pe(this,no);pe(this,Ri);pe(this,_r);pe(this,Ii);pe(this,Ot);pe(this,Ec);pe(this,Oi);ie(this,Oi,!1),ie(this,Ec,t.defaultOptions),this.setOptions(t.options),this.observers=[],ie(this,Ii,t.client),ie(this,_r,E(this,Ii).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ie(this,no,q3(this.options)),this.state=t.state??E(this,no),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=E(this,Ot))==null?void 0:t.promise}setOptions(t){this.options={...E(this,Ec),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,_r).remove(this)}setData(t,r){const n=Zp(this.state.data,t,this.options);return Se(this,Yr,Ln).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Se(this,Yr,Ln).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=E(this,Ot))==null?void 0:n.promise;return(s=E(this,Ot))==null||s.cancel(t),r?r.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(E(this,no))}isActive(){return this.observers.some(t=>kr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Vs(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:!Ek(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=E(this,Ot))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=E(this,Ot))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,_r).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(E(this,Ot)&&(E(this,Oi)?E(this,Ot).cancel({revert:!0}):E(this,Ot).cancelRetry()),this.scheduleGc()),E(this,_r).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,Yr,Ln).call(this,{type:"invalidate"})}fetch(t,r){var u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(E(this,Ot))return E(this,Ot).continueRetry(),E(this,Ot).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(m=>m.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(ie(this,Oi,!0),n.signal)})},a=()=>{const f=Tk(this.options,r),w=(()=>{const g={client:E(this,Ii),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return ie(this,Oi,!1),this.options.persister?this.options.persister(f,w,this):f(w)},l=(()=>{const f={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:E(this,Ii),state:this.state,fetchFn:a};return s(f),f})();(u=this.options.behavior)==null||u.onFetch(l,this),ie(this,Ri,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Se(this,Yr,Ln).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta});const c=f=>{var m,w,g,y;tm(f)&&f.silent||Se(this,Yr,Ln).call(this,{type:"error",error:f}),tm(f)||((w=(m=E(this,_r).config).onError)==null||w.call(m,f,this),(y=(g=E(this,_r).config).onSettled)==null||y.call(g,this.state.data,f,this)),this.scheduleGc()};return ie(this,Ot,Ik({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var m,w,g,y;if(f===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(b){c(b);return}(w=(m=E(this,_r).config).onSuccess)==null||w.call(m,f,this),(y=(g=E(this,_r).config).onSettled)==null||y.call(g,f,this.state.error,this),this.scheduleGc()},onError:c,onFail:(f,m)=>{Se(this,Yr,Ln).call(this,{type:"failed",failureCount:f,error:m})},onPause:()=>{Se(this,Yr,Ln).call(this,{type:"pause"})},onContinue:()=>{Se(this,Yr,Ln).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),E(this,Ot).start()}},no=new WeakMap,Ri=new WeakMap,_r=new WeakMap,Ii=new WeakMap,Ot=new WeakMap,Ec=new WeakMap,Oi=new WeakMap,Yr=new WeakSet,Ln=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Mk(n.data,this.options),fetchMeta:t.meta??null};case"success":return ie(this,Ri,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return tm(s)&&s.revert&&E(this,Ri)?{...E(this,Ri),fetchStatus:"idle"}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),kt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),E(this,_r).notify({query:this,type:"updated",action:t})})},b1);function Mk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ak(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function q3(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var vn,w1,H3=(w1=class extends zc{constructor(t={}){super();pe(this,vn);this.config=t,ie(this,vn,new Map)}build(t,r,n){const s=r.queryKey,a=r.queryHash??vv(s,r);let o=this.get(a);return o||(o=new W3({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){E(this,vn).has(t.queryHash)||(E(this,vn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=E(this,vn).get(t.queryHash);r&&(t.destroy(),r===t&&E(this,vn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,vn).get(t)}getAll(){return[...E(this,vn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Ib(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Ib(t,n)):r}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},vn=new WeakMap,w1),yn,Ut,Mi,bn,ms,j1,K3=(j1=class extends Ok{constructor(t){super();pe(this,bn);pe(this,yn);pe(this,Ut);pe(this,Mi);this.mutationId=t.mutationId,ie(this,Ut,t.mutationCache),ie(this,yn,[]),this.state=t.state||Y3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,yn).includes(t)||(E(this,yn).push(t),this.clearGcTimeout(),E(this,Ut).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ie(this,yn,E(this,yn).filter(r=>r!==t)),this.scheduleGc(),E(this,Ut).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,yn).length||(this.state.status==="pending"?this.scheduleGc():E(this,Ut).remove(this))}continue(){var t;return((t=E(this,Mi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,c,u,d,h,f,m,w,g,y,b,v,x,j,N,S,_,k;const r=()=>{Se(this,bn,ms).call(this,{type:"continue"})};ie(this,Mi,Ik({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,C)=>{Se(this,bn,ms).call(this,{type:"failed",failureCount:P,error:C})},onPause:()=>{Se(this,bn,ms).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,Ut).canRun(this)}));const n=this.state.status==="pending",s=!E(this,Mi).canStart();try{if(n)r();else{Se(this,bn,ms).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(a=E(this,Ut).config).onMutate)==null?void 0:o.call(a,t,this));const C=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));C!==this.state.context&&Se(this,bn,ms).call(this,{type:"pending",context:C,variables:t,isPaused:s})}const P=await E(this,Mi).start();return await((d=(u=E(this,Ut).config).onSuccess)==null?void 0:d.call(u,P,t,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,P,t,this.state.context)),await((w=(m=E(this,Ut).config).onSettled)==null?void 0:w.call(m,P,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,P,null,t,this.state.context)),Se(this,bn,ms).call(this,{type:"success",data:P}),P}catch(P){try{throw await((v=(b=E(this,Ut).config).onError)==null?void 0:v.call(b,P,t,this.state.context,this)),await((j=(x=this.options).onError)==null?void 0:j.call(x,P,t,this.state.context)),await((S=(N=E(this,Ut).config).onSettled)==null?void 0:S.call(N,void 0,P,this.state.variables,this.state.context,this)),await((k=(_=this.options).onSettled)==null?void 0:k.call(_,void 0,P,t,this.state.context)),P}finally{Se(this,bn,ms).call(this,{type:"error",error:P})}}finally{E(this,Ut).runNext(this)}}},yn=new WeakMap,Ut=new WeakMap,Mi=new WeakMap,bn=new WeakSet,ms=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),kt.batch(()=>{E(this,yn).forEach(n=>{n.onMutationUpdate(t)}),E(this,Ut).notify({mutation:this,type:"updated",action:t})})},j1);function Y3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Bn,Qr,Pc,N1,Q3=(N1=class extends zc{constructor(t={}){super();pe(this,Bn);pe(this,Qr);pe(this,Pc);this.config=t,ie(this,Bn,new Set),ie(this,Qr,new Map),ie(this,Pc,0)}build(t,r,n){const s=new K3({mutationCache:this,mutationId:++tu(this,Pc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){E(this,Bn).add(t);const r=Su(t);if(typeof r=="string"){const n=E(this,Qr).get(r);n?n.push(t):E(this,Qr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,Bn).delete(t)){const r=Su(t);if(typeof r=="string"){const n=E(this,Qr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&E(this,Qr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Su(t);if(typeof r=="string"){const n=E(this,Qr).get(r),s=n==null?void 0:n.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Su(t);if(typeof r=="string"){const s=(n=E(this,Qr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{E(this,Bn).forEach(t=>{this.notify({type:"removed",mutation:t})}),E(this,Bn).clear(),E(this,Qr).clear()})}getAll(){return Array.from(E(this,Bn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Ob(r,n))}findAll(t={}){return this.getAll().filter(r=>Ob(t,r))}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return kt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Jt))))}},Bn=new WeakMap,Qr=new WeakMap,Pc=new WeakMap,N1);function Su(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Lb(e){return{onFetch:(t,r)=>{var d,h,f,m,w;const n=t.options,s=(f=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const y=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},b=Tk(t.options,t.fetchOptions),v=async(x,j,N)=>{if(g)return Promise.reject();if(j==null&&x.pages.length)return Promise.resolve(x);const _=(()=>{const D={client:t.client,queryKey:t.queryKey,pageParam:j,direction:N?"backward":"forward",meta:t.options.meta};return y(D),D})(),k=await b(_),{maxPages:P}=t.options,C=N?$3:L3;return{pages:C(x.pages,k,P),pageParams:C(x.pageParams,j,P)}};if(s&&a.length){const x=s==="backward",j=x?J3:$b,N={pages:a,pageParams:o},S=j(n,N);l=await v(N,S,x)}else{const x=e??a.length;do{const j=c===0?o[0]??n.initialPageParam:$b(n,l);if(c>0&&j==null)break;l=await v(l,j),c++}while(c<x)}return l};t.options.persister?t.fetchFn=()=>{var g,y;return(y=(g=t.options).persister)==null?void 0:y.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function $b(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function J3(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Xe,Ss,_s,so,io,ks,ao,oo,S1,X3=(S1=class{constructor(e={}){pe(this,Xe);pe(this,Ss);pe(this,_s);pe(this,so);pe(this,io);pe(this,ks);pe(this,ao);pe(this,oo);ie(this,Xe,e.queryCache||new H3),ie(this,Ss,e.mutationCache||new Q3),ie(this,_s,e.defaultOptions||{}),ie(this,so,new Map),ie(this,io,new Map),ie(this,ks,0)}mount(){tu(this,ks)._++,E(this,ks)===1&&(ie(this,ao,bv.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,Xe).onFocus())})),ie(this,oo,Hd.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,Xe).onOnline())})))}unmount(){var e,t;tu(this,ks)._--,E(this,ks)===0&&((e=E(this,ao))==null||e.call(this),ie(this,ao,void 0),(t=E(this,oo))==null||t.call(this),ie(this,oo,void 0))}isFetching(e){return E(this,Xe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return E(this,Ss).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=E(this,Xe).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=E(this,Xe).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Vs(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return E(this,Xe).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=E(this,Xe).get(n.queryHash),a=s==null?void 0:s.state.data,o=M3(t,a);if(o!==void 0)return E(this,Xe).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return kt.batch(()=>E(this,Xe).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=E(this,Xe).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=E(this,Xe);kt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=E(this,Xe);return kt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=kt.batch(()=>E(this,Xe).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Jt).catch(Jt)}invalidateQueries(e,t={}){return kt.batch(()=>(E(this,Xe).findAll(e).forEach(r=>{r.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 r={...t,cancelRefetch:t.cancelRefetch??!0},n=kt.batch(()=>E(this,Xe).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(Jt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=E(this,Xe).build(this,t);return r.isStaleByTime(Vs(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=Lb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=Lb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Hd.isOnline()?E(this,Ss).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,Xe)}getMutationCache(){return E(this,Ss)}getDefaultOptions(){return E(this,_s)}setDefaultOptions(e){ie(this,_s,e)}setQueryDefaults(e,t){E(this,so).set(cc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...E(this,so).values()],r={};return t.forEach(n=>{uc(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){E(this,io).set(cc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...E(this,io).values()],r={};return t.forEach(n=>{uc(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...E(this,_s).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vv(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===yv&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...E(this,_s).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){E(this,Xe).clear(),E(this,Ss).clear()}},Xe=new WeakMap,Ss=new WeakMap,_s=new WeakMap,so=new WeakMap,io=new WeakMap,ks=new WeakMap,ao=new WeakMap,oo=new WeakMap,S1),Yt,_e,Tc,Vt,Di,lo,Cs,Es,Ac,co,uo,Li,$i,Ps,ho,Ee,pl,tg,rg,ng,sg,ig,ag,og,Dk,_1,Z3=(_1=class extends zc{constructor(t,r){super();pe(this,Ee);pe(this,Yt);pe(this,_e);pe(this,Tc);pe(this,Vt);pe(this,Di);pe(this,lo);pe(this,Cs);pe(this,Es);pe(this,Ac);pe(this,co);pe(this,uo);pe(this,Li);pe(this,$i);pe(this,Ps);pe(this,ho,new Set);this.options=r,ie(this,Yt,t),ie(this,Es,null),ie(this,Cs,eg()),this.options.experimental_prefetchInRender||E(this,Cs).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,_e).addObserver(this),Fb(E(this,_e),this.options)?Se(this,Ee,pl).call(this):this.updateResult(),Se(this,Ee,sg).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lg(E(this,_e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lg(E(this,_e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,Ee,ig).call(this),Se(this,Ee,ag).call(this),E(this,_e).removeObserver(this)}setOptions(t){const r=this.options,n=E(this,_e);if(this.options=E(this,Yt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,E(this,_e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,Ee,og).call(this),E(this,_e).setOptions(this.options),r._defaulted&&!Jp(this.options,r)&&E(this,Yt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,_e),observer:this});const s=this.hasListeners();s&&Ub(E(this,_e),n,this.options,r)&&Se(this,Ee,pl).call(this),this.updateResult(),s&&(E(this,_e)!==n||kr(this.options.enabled,E(this,_e))!==kr(r.enabled,E(this,_e))||Vs(this.options.staleTime,E(this,_e))!==Vs(r.staleTime,E(this,_e)))&&Se(this,Ee,tg).call(this);const a=Se(this,Ee,rg).call(this);s&&(E(this,_e)!==n||kr(this.options.enabled,E(this,_e))!==kr(r.enabled,E(this,_e))||a!==E(this,Ps))&&Se(this,Ee,ng).call(this,a)}getOptimisticResult(t){const r=E(this,Yt).getQueryCache().build(E(this,Yt),t),n=this.createResult(r,t);return tL(this,n)&&(ie(this,Vt,n),ie(this,lo,this.options),ie(this,Di,E(this,_e).state)),n}getCurrentResult(){return E(this,Vt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),Reflect.get(n,s))})}trackProp(t){E(this,ho).add(t)}getCurrentQuery(){return E(this,_e)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=E(this,Yt).defaultQueryOptions(t),n=E(this,Yt).getQueryCache().build(E(this,Yt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Se(this,Ee,pl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,Vt)))}createResult(t,r){var P;
vendor: 2,385 bytes, line 486
486const n=E(this,_e),s=this.options,a=E(this,Vt),o=E(this,Di),l=E(this,lo),u=t!==n?t.state:E(this,Tc),{state:d}=t;let h={...d},f=!1,m;if(r._optimisticResults){const C=this.hasListeners(),D=!C&&Fb(t,r),I=C&&Ub(t,n,r,s);(D||I)&&(h={...h,...Mk(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:g,status:y}=h;m=h.data;let b=!1;if(r.placeholderData!==void 0&&m===void 0&&y==="pending"){let C;a!=null&&a.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(C=a.data,b=!0):C=typeof r.placeholderData=="function"?r.placeholderData((P=E(this,uo))==null?void 0:P.state.data,E(this,uo)):r.placeholderData,C!==void 0&&(y="success",m=Zp(a==null?void 0:a.data,C,r),f=!0)}if(r.select&&m!==void 0&&!b)if(a&&m===(o==null?void 0:o.data)&&r.select===E(this,Ac))m=E(this,co);else try{ie(this,Ac,r.select),m=r.select(m),m=Zp(a==null?void 0:a.data,m,r),ie(this,co,m),ie(this,Es,null)}catch(C){ie(this,Es,C)}E(this,Es)&&(w=E(this,Es),m=E(this,co),g=Date.now(),y="error");const v=h.fetchStatus==="fetching",x=y==="pending",j=y==="error",N=x&&v,S=m!==void 0,k={status:y,fetchStatus:h.fetchStatus,isPending:x,isSuccess:y==="success",isError:j,isInitialLoading:N,isLoading:N,data:m,dataUpdatedAt:h.dataUpdatedAt,error:w,errorUpdatedAt:g,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:j&&!S,isPaused:h.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:j&&S,isStale:wv(t,r),refetch:this.refetch,promise:E(this,Cs),isEnabled:kr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const C=V=>{k.status==="error"?V.reject(k.error):k.data!==void 0&&V.resolve(k.data)},D=()=>{const V=ie(this,Cs,k.promise=eg());C(V)},I=E(this,Cs);switch(I.status){case"pending":t.queryHash===n.queryHash&&C(I);break;case"fulfilled":(k.status==="error"||k.data!==I.value)&&D();break;case"rejected":(k.status!=="error"||k.error!==I.reason)&&D();break}}return k}updateResult(){const t=E(this,Vt),r=this.createResult(E(this,_e),this.options);if(ie(this,Di,E(this,_e).state),ie(this,lo,this.options),E(this,Di).data!==void 0&&ie(this,uo,E(this,_e)),Jp(r,t))return;ie(this,Vt,r);const n=()=>
vendor: 5,317 bytes, line 486
486{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!E(this,ho).size)return!0;const o=new Set(a??E(this,ho));return this.options.throwOnError&&o.add("error"),Object.keys(E(this,Vt)).some(l=>{const c=l;return E(this,Vt)[c]!==t[c]&&o.has(c)})};Se(this,Ee,Dk).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,Ee,sg).call(this)}},Yt=new WeakMap,_e=new WeakMap,Tc=new WeakMap,Vt=new WeakMap,Di=new WeakMap,lo=new WeakMap,Cs=new WeakMap,Es=new WeakMap,Ac=new WeakMap,co=new WeakMap,uo=new WeakMap,Li=new WeakMap,$i=new WeakMap,Ps=new WeakMap,ho=new WeakMap,Ee=new WeakSet,pl=function(t){Se(this,Ee,og).call(this);let r=E(this,_e).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Jt)),r},tg=function(){Se(this,Ee,ig).call(this);const t=Vs(this.options.staleTime,E(this,_e));if(Qi||E(this,Vt).isStale||!Qp(t))return;const n=Ek(E(this,Vt).dataUpdatedAt,t)+1;ie(this,Li,setTimeout(()=>{E(this,Vt).isStale||this.updateResult()},n))},rg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,_e)):this.options.refetchInterval)??!1},ng=function(t){Se(this,Ee,ag).call(this),ie(this,Ps,t),!(Qi||kr(this.options.enabled,E(this,_e))===!1||!Qp(E(this,Ps))||E(this,Ps)===0)&&ie(this,$i,setInterval(()=>{(this.options.refetchIntervalInBackground||bv.isFocused())&&Se(this,Ee,pl).call(this)},E(this,Ps)))},sg=function(){Se(this,Ee,tg).call(this),Se(this,Ee,ng).call(this,Se(this,Ee,rg).call(this))},ig=function(){E(this,Li)&&(clearTimeout(E(this,Li)),ie(this,Li,void 0))},ag=function(){E(this,$i)&&(clearInterval(E(this,$i)),ie(this,$i,void 0))},og=function(){const t=E(this,Yt).getQueryCache().build(E(this,Yt),this.options);if(t===E(this,_e))return;const r=E(this,_e);ie(this,_e,t),ie(this,Tc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Dk=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(E(this,Vt))}),E(this,Yt).getQueryCache().notify({query:E(this,_e),type:"observerResultsUpdated"})})},_1);function eL(e,t){return kr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Fb(e,t){return eL(e,t)||e.state.data!==void 0&&lg(e,t,t.refetchOnMount)}function lg(e,t,r){if(kr(t.enabled,e)!==!1&&Vs(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&wv(e,t)}return!1}function Ub(e,t,r,n){return(e!==t||kr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&wv(e,r)}function wv(e,t){return kr(t.enabled,e)!==!1&&e.isStaleByTime(Vs(t.staleTime,e))}function tL(e,t){return!Jp(e.getCurrentResult(),t)}var Lk=p.createContext(void 0),rL=e=>{const t=p.useContext(Lk);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},nL=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(Lk.Provider,{value:e,children:t})),$k=p.createContext(!1),sL=()=>p.useContext($k);$k.Provider;function iL(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var aL=p.createContext(iL()),oL=()=>p.useContext(aL),lL=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},cL=e=>{p.useEffect(()=>{e.clearReset()},[e])},uL=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||F3(r,[e.error,n])),dL=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},hL=(e,t)=>e.isLoading&&e.isFetching&&!t,fL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Vb=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function mL(e,t,r){var h,f,m,w,g;const n=sL(),s=oL(),a=rL(),o=a.defaultQueryOptions(e);(f=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||f.call(h,o),o._optimisticResults=n?"isRestoring":"optimistic",dL(o),lL(o,s),cL(s);const l=!a.getQueryCache().get(o.queryHash),[c]=p.useState(()=>new t(a,o)),u=c.getOptimisticResult(o),d=!n&&e.subscribed!==!1;if(p.useSyncExternalStore(p.useCallback(y=>{const b=d?c.subscribe(kt.batchCalls(y)):Jt;return c.updateResult(),b},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setOptions(o)},[o,c]),fL(o,u))throw Vb(o,c,s);if(uL({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((w=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||w.call(m,o,u),o.experimental_prefetchInRender&&!Qi&&hL(u,n)){const y=l?Vb(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;y==null||y.catch(Jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function Pl(e,t){return mL(e,Z3)}const Fk=p.createContext({theme:"system",setTheme:()=>null});function pL({children:e,defaultTheme:t="dark",storageKey:r="app-theme"}){const[n,s]=p.useState(()=>localStorage.getItem(r)||t);p.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),n==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
486k":"light";o.classList.add(l)}else o.classList.add(n)},[n]);const a={theme:n,setTheme:o=>{localStorage.setItem(r,o),s(o)}};return i.jsx(Fk.Provider,{value:a,children:e})}const gL=()=>{const e=p.useContext(Fk);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};/** 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 dc(){return dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dc.apply(this,arguments)}var Rs;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Rs||(Rs={}));const Bb="popstate";function xL(e){e===void 0&&(e={});function t(n,s){let{pathname:a,search:o,hash:l}=n.location;return cg("",{pathname:a,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:Kd(s)}return yL(t,r,null,e)}function Qe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Uk(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vL(){return Math.random().toString(36).substr(2,8)}function zb(e,t){return{usr:e.state,key:e.key,idx:t}}function cg(e,t,r,n){return r===void 0&&(r=null),dc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Lo(t):t,{state:r,key:t&&t.key||n||vL()})}function Kd(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Lo(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function yL(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:a=!1}=n,o=s.history,l=Rs.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(dc({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function h(){l=Rs.Pop;let y=d(),b=y==null?null:y-u;u=y,c&&c({action:l,location:g.location,delta:b})}function f(y,b){l=Rs.Push;let v=cg(g.location,y,b);u=d()+1;let x=zb(v,u),j=g.createHref(v);try{o.pushState(x,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;s.location.assign(j)}a&&c&&c({action:l,location:g.location,delta:1})}function m(y,b){l=Rs.Replace;let v=cg(g.location,y,b);u=d();let x=zb(v,u),j=g.createHref(v);o.replaceState(x,"",j),a&&c&&c({action:l,location:g.location,delta:0})}function w(y){let b=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof y=="string"?y:Kd(y);return v=v.replace(/ $/,"%20"),Qe(b,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,b)}let g={get action(){return l},get location(){return e(s,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Bb,h),c=y,()=>{s.removeEventListener(Bb,h),c=null}},createHref(y){return t(s,y)},createURL:w,encodeLocation(y){let b=w(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:m,go(y){return o.go(y)}};return g}var Gb;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Gb||(Gb={}));function bL(e,t,r){return r===void 0&&(r="/"),wL(e,t,r,!1)}function wL(e,t,r,n){let s=typeof t=="string"?Lo(t):t,a=So(s.pathname||"/",r);if(a==null)return null;let o=Vk(e);jL(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=IL(a);l=AL(o[c],u,n)}return l}function Vk(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(Qe(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Bs([n,c.relativePath]),d=r.concat(c);a.children&&a.children.length>0&&(Qe(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Vk(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:PL(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let c of Bk(a.path))s(a,o,c)}),t}function Bk(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return s?[a,""]:[a];let o=Bk(n.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function jL(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:TL(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const NL=/^:[\w-]+$/,SL=3,_L=2,kL=1,CL=10,EL=-2,Wb=e=>e==="*";function PL(e,t){let r=e.split("/"),n=r.length;return r.some(Wb)&&(n+=EL),t&&(n+=_L),r.filter(s=>!Wb(s)).reduce((s,a)=>s+(NL.test(a)?SL:a===""?kL:CL),n)}function TL(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function AL(e,t,r){let{routesMeta:n}=e,s={},a="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=a==="/"?t:t.slice(a.length)||"/",h=Yd({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),f=c.route;if(!h&&u&&r&&!n[n.length-1].route.index&&(h=Yd({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!h)return null;
vendor: 9,390 bytes, lines 495-504
495Object.assign(s,h.params),o.push({params:s,pathname:Bs([a,h.pathname]),pathnameBase:LL(Bs([a,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(a=Bs([a,h.pathnameBase]))}return o}function Yd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=RL(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let a=s[0],o=a.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:n.reduce((u,d,h)=>{let{paramName:f,isOptional:m}=d;if(f==="*"){let g=l[h]||"";o=a.slice(0,a.length-g.length).replace(/(.)\/+$/,"$1")}const w=l[h];return m&&!w?u[f]=void 0:u[f]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function RL(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Uk(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 n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function IL(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Uk(!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 So(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function OL(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?Lo(e):e;return{pathname:r?r.startsWith("/")?r:ML(r,t):t,search:$L(n),hash:FL(s)}}function ML(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function rm(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function DL(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function jv(e,t){let r=DL(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Nv(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=Lo(e):(s=dc({},e),Qe(!s.pathname||!s.pathname.includes("?"),rm("?","pathname","search",s)),Qe(!s.pathname||!s.pathname.includes("#"),rm("#","pathname","hash",s)),Qe(!s.search||!s.search.includes("#"),rm("#","search","hash",s)));let a=e===""||s.pathname==="",o=a?"/":s.pathname,l;if(o==null)l=r;else{let h=t.length-1;if(!n&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;s.pathname=f.join("/")}l=h>=0?t[h]:"/"}let c=OL(s,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Bs=e=>e.join("/").replace(/\/\/+/g,"/"),LL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$L=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,FL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function UL(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 VL=["get",...zk];new Set(VL);/** 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 hc(){return hc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hc.apply(this,arguments)}const Wh=p.createContext(null),Gk=p.createContext(null),is=p.createContext(null),qh=p.createContext(null),Rn=p.createContext({outlet:null,matches:[],isDataRoute:!1}),Wk=p.createContext(null);function BL(e,t){let{relative:r}=t===void 0?{}:t;$o()||Qe(!1);let{basename:n,navigator:s}=p.useContext(is),{hash:a,pathname:o,search:l}=Hh(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:Bs([n,o])),s.createHref({pathname:c,search:l,hash:a})}function $o(){return p.useContext(qh)!=null}function dn(){return $o()||Qe(!1),p.useContext(qh).location}function qk(e){p.useContext(is).static||p.useLayoutEffect(e)}function Ce(){let{isDataRoute:e}=p.useContext(Rn);return e?n$():zL()}function zL(){$o()||Qe(!1);let e=p.useContext(Wh),{basename:t,future:r,navigator:n}=p.useContext(is),{matches:s}=p.useContext(Rn),{pathname:a}=dn(),o=JSON.stringify(jv(s,r.v7_relativeSplatPath)),l=p.useRef(!1);return qk(()=>{l.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let h=Nv(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Bs([t,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[t,n,o,a,e])}const GL=p.createContext(null);function WL(e){let t=p.useContext(Rn).outlet;return t&&p.createElement(GL.Provider,{value:e},t)}function Gc(){let{matches:e}=p.useContext(Rn),t=e[e.length-1];return t?t.params:{}}function Hh(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=p.useContext(is),{matches:s}=p.useContext(Rn),{pathname:a}=dn(),o=JSON.stringify(jv(s,n.v7_relativeSplatPath));return p.useMemo(()=>Nv(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function qL(e,t){return HL(e,t)}function HL(e,t,r,n){$o()||Qe(!1);let{navigator:s}=p.useContext(is),{matches:a}=p.useContext(Rn),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=dn(),d;if(t){var h;let y=typeof t=="string"?Lo(t):t;c==="/"||(h=y.pathname)!=null&&h.startsWith(c)||Qe(!1),d=y}else d=u;let f=d.pathname||"/",m=f;if(c!=="/"){let y=c.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let w=bL(e,{pathname:m}),g=XL(w&&w.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:Bs([c,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:Bs([c,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&g?p.createElement(qh.Provider,{value:{location:hc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Rs.Pop}},g):g}function KL(){let e=r$(),t=UL(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),r?p.createElement("pre",{style:s},r):null,null)}const YL=p.createElement(KL,null);class QL extends p.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?p.createElement(Rn.Provider,{value:this.props.routeContext},p.createElement(Wk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function JL(e){let{routeContext:t,match:r,children:n}=e,s=p.useContext(Wh);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),p.createElement(Rn.Provider,{value:t},n)}function XL(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(s=r)==null?void 0:s.errors;if(l!=null){let d=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);d>=0||Qe(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<o.length;d++){let h=o[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:f,errors:m}=r,w=h.route.loader&&f[h.route.id]===void 0&&(!m||m[h.route.id]===void 0);if(h.route.lazy||w){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,f)=>{let m,w=!1,g=null,y=null;r&&(m=l&&h.route.id?l[h.route.id]:void 0,g=h.route.errorElement||YL,c&&(u<0&&f===0?(w=!0,y=null):u===f&&(w=!0,y=h.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,f+1)),v=()=>{let x;return m?x=g:w?x=y:h.route.Component?x=p.createElement(h.route.Component,null):h.route.element?x=h.route.element:x=d,p.createElement(JL,{match:h,routeC
504ontext:{outlet:d,matches:b,isDataRoute:r!=null},children:x})};return r&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?p.createElement(QL,{location:r.location,revalidation:r.revalidation,component:g,error:m,children:v(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):v()},null)}var Hk=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Hk||{}),Qd=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}(Qd||{});function ZL(e){let t=p.useContext(Wh);return t||Qe(!1),t}function e$(e){let t=p.useContext(Gk);return t||Qe(!1),t}function t$(e){let t=p.useContext(Rn);return t||Qe(!1),t}function Kk(e){let t=t$(),r=t.matches[t.matches.length-1];return r.route.id||Qe(!1),r.route.id}function r$(){var e;let t=p.useContext(Wk),r=e$(Qd.UseRouteError),n=Kk(Qd.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function n$(){let{router:e}=ZL(Hk.UseNavigateStable),t=Kk(Qd.UseNavigateStable),r=p.useRef(!1);return qk(()=>{r.current=!0}),p.useCallback(function(s,a){a===void 0&&(a={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,hc({fromRouteId:t},a)))},[e,t])}function s$(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function i$(e){let{to:t,replace:r,state:n,relative:s}=e;$o()||Qe(!1);let{future:a,static:o}=p.useContext(is),{matches:l}=p.useContext(Rn),{pathname:c}=dn(),u=Ce(),d=Nv(t,jv(l,a.v7_relativeSplatPath),c,s==="path"),h=JSON.stringify(d);return p.useEffect(()=>u(JSON.parse(h),{replace:r,state:n,relative:s}),[u,h,s,r,n]),null}function Yk(e){return WL(e.context)}function me(e){Qe(!1)}function a$(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Rs.Pop,navigator:a,static:o=!1,future:l}=e;$o()&&Qe(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:a,static:o,future:hc({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof n=="string"&&(n=Lo(n));let{pathname:d="/",search:h="",hash:f="",state:m=null,key:w="default"}=n,g=p.useMemo(()=>{let y=So(d,c);return y==null?null:{location:{pathname:y,search:h,hash:f,state:m,key:w},navigationType:s}},[c,d,h,f,m,w,s]);return g==null?null:p.createElement(is.Provider,{value:u},p.createElement(qh.Provider,{children:r,value:g}))}function o$(e){let{children:t,location:r}=e;return qL(ug(t),r)}new Promise(()=>{});function ug(e,t){t===void 0&&(t=[]);let r=[];return p.Children.forEach(e,(n,s)=>{if(!p.isValidElement(n))return;let a=[...t,s];if(n.type===p.Fragment){r.push.apply(r,ug(n.props.children,a));return}n.type!==me&&Qe(!1),!n.props.index||!n.props.children||Qe(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=ug(n.props.children,a)),r.push(o)}),r}/** 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 Jd(){return Jd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jd.apply(this,arguments)}function Qk(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,a;for(a=0;a<n.length;a++)s=n[a],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function l$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function c$(e,t){return e.button===0&&(!t||t==="_self")&&!l$(e)}function dg(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function u$(e,t){let r=dg(e);return t&&t.forEach((n,s)=>
513{r.has(s)||t.getAll(s).forEach(a=>{r.append(s,a)})}),r}const d$=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],h$=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],f$="6";try{window.__reactRouterVersion=f$}catch{}const m$=p.createContext({isTransitioning:!1}),p$="startTransition",qb=lx[p$];function g$(e){let{basename:t,children:r,future:n,window:s}=e,a=p.useRef();a.current==null&&(a.current=xL({window:s,v5Compat:!0}));let o=a.current,[l,c]=p.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},d=p.useCallback(h=>{u&&qb?qb(()=>c(h)):c(h)},[c,u]);return p.useLayoutEffect(()=>o.listen(d),[o,d]),p.useEffect(()=>s$(n),[n]),p.createElement(a$,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const x$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",v$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ye=p.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:h}=t,f=Qk(t,d$),{basename:m}=p.useContext(is),w,g=!1;if(typeof u=="string"&&v$.test(u)&&(w=u,x$))try{let x=new URL(window.location.href),j=u.startsWith("//")?new URL(x.protocol+u):new URL(u),N=So(j.pathname,m);j.origin===x.origin&&N!=null?u=N+j.search+j.hash:g=!0}catch{}let y=BL(u,{relative:s}),b=b$(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:s,viewTransition:h});function v(x){n&&n(x),x.defaultPrevented||b(x)}return p.createElement("a",Jd({},f,{href:w||y,onClick:g||a?n:v,ref:r,target:c}))}),Jk=p.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:s=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,h=Qk(t,h$),f=Hh(c,{relative:h.relative}),m=dn(),w=p.useContext(Gk),{navigator:g,basename:y}=p.useContext(is),b=w!=null&&w$(f)&&u===!0,v=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,x=m.pathname,j=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;s||(x=x.toLowerCase(),j=j?j.toLowerCase():null,v=v.toLowerCase()),j&&y&&(j=So(j,y)||j);const N=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let S=x===v||!o&&x.startsWith(v)&&x.charAt(N)==="/",_=j!=null&&(j===v||!o&&j.startsWith(v)&&j.charAt(v.length)==="/"),k={isActive:S,isPending:_,isTransitioning:b},P=S?n:void 0,C;typeof a=="function"?C=a(k):C=[a,S?"active":null,_?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let D=typeof l=="function"?l(k):l;return p.createElement(ye,Jd({},h,{"aria-current":P,className:C,ref:r,style:D,to:c,viewTransition:u}),typeof d=="function"?d(k):d)});var hg;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(hg||(hg={}));var Hb;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Hb||(Hb={}));function y$(e){let t=p.useContext(Wh);return t||Qe(!1),t}function b$(e,t){let{target:r,replace:n,state:s,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=Ce(),u=dn(),d=Hh(e,{relative:o});return p.useCallback(h=>{if(c$(h,r)){h.preventDefault();let f=n!==void 0?n:Kd(u)===Kd(d);c(e,{replace:f,state:s,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,n,s,r,e,a,o,l])}function Sv(e){let t=p.useRef(dg(e)),r=p.useRef(!1),n=dn(),s=p.useMemo(()=>u$(n.search,r.current?null:t.current),[n.search]),a=Ce(),o=p.useCallback((l,c)=>{const u=dg(typeof l=="function"?l(s):l);r.current=!0,a("?"+u,c)},[a,s]);return[s,o]}function w$(e,t){t===void 0&&(t={});let r=p.useContext(m$);r==null&&Qe(!1);let{basename:n}=y$(hg.useViewTransitionState),s=Hh(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=So(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=So(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Yd(s.pathname,o)!=null||Yd(s.pathname,a)!=null}function j$(){const{pathname:e}=dn();return p.useEffect(()=>{window.scrollTo(0,0)},[e]),null}var fg=function(e,t){return fg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},fg(e,t)};function Xk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");fg(e,t);function r(){this.constructor=e}
vendor: 4,280 bytes, line 513
513e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Tr=function(){return Tr=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Tr.apply(this,arguments)};function ri(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function Zk(e,t,r,n){var s=arguments.length,a=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(s<3?o(a):s>3?o(t,r,a):o(t,r))||a);return s>3&&a&&Object.defineProperty(t,r,a),a}function eC(e,t){return function(r,n){t(r,n,e)}}function tC(e,t,r,n,s,a){function o(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var l=n.kind,c=l==="getter"?"get":l==="setter"?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),h,f=!1,m=r.length-1;m>=0;m--){var w={};for(var g in n)w[g]=g==="access"?{}:n[g];for(var g in n.access)w.access[g]=n.access[g];w.addInitializer=function(b){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(b||null))};var y=(0,r[m])(l==="accessor"?{get:d.get,set:d.set}:d[c],w);if(l==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(h=o(y.get))&&(d.get=h),(h=o(y.set))&&(d.set=h),(h=o(y.init))&&s.unshift(h)}else(h=o(y))&&(l==="field"?s.unshift(h):d[c]=h)}u&&Object.defineProperty(u,n.name,d),f=!0}function rC(e,t,r){for(var n=arguments.length>2,s=0;s<t.length;s++)r=n?t[s].call(e,r):t[s].call(e);return n?r:void 0}function nC(e){return typeof e=="symbol"?e:"".concat(e)}function sC(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function iC(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function ce(e,t,r,n){function s(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(d){try{u(n.next(d))}catch(h){o(h)}}function c(d){try{u(n.throw(d))}catch(h){o(h)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}function aC(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,s,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,s=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(d){u=[6,d],s=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Kh=Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};function oC(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Kh(t,e,r)}function Xd(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
vendor: 4,327 bytes, line 513
513if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _v(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),s,a=[],o;try{for(;(t===void 0||t-- >0)&&!(s=n.next()).done;)a.push(s.value)}catch(l){o={error:l}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function lC(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_v(arguments[t]));return e}function cC(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),s=0,t=0;t<r;t++)for(var a=arguments[t],o=0,l=a.length;o<l;o++,s++)n[s]=a[o];return n}function kv(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,a;n<s;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function _o(e){return this instanceof _o?(this.v=e,this):new _o(e)}function uC(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),s,a=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(m){return function(w){return Promise.resolve(w).then(m,h)}}function l(m,w){n[m]&&(s[m]=function(g){return new Promise(function(y,b){a.push([m,g,y,b])>1||c(m,g)})},w&&(s[m]=w(s[m])))}function c(m,w){try{u(n[m](w))}catch(g){f(a[0][3],g)}}function u(m){m.value instanceof _o?Promise.resolve(m.value.v).then(d,h):f(a[0][2],m)}function d(m){c("next",m)}function h(m){c("throw",m)}function f(m,w){m(w),a.shift(),a.length&&c(a[0][0],a[0][1])}}function dC(e){var t,r;return t={},n("next"),n("throw",function(s){throw s}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(s,a){t[s]=e[s]?function(o){return(r=!r)?{value:_o(e[s](o)),done:!1}:a?a(o):o}:a}}function hC(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Xd=="function"?Xd(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(o){return new Promise(function(l,c){o=e[a](o),s(l,c,o.done,o.value)})}}function s(a,o,l,c){Promise.resolve(c).then(function(u){a({value:u,done:l})},o)}}function fC(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var N$=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},mg=function(e){return mg=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},mg(e)};function mC(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=mg(e),n=0;n<r.length;n++)r[n]!=="default"&&Kh(t,e,r[n]);return N$(t,e),t}function pC(e){return e&&e.__esModule?e:{default:e}}function gC(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function xC(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r}function vC(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function yC(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(s=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");
vendor: 1,395 bytes, line 513
513s&&(n=function(){try{s.call(this)}catch(a){return Promise.reject(a)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var S$=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function bC(e){function t(a){e.error=e.hasError?new S$(a,e.error,"An error was suppressed during disposal."):a,e.hasError=!0}var r,n=0;function s(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(s);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(a).then(s,function(o){return t(o),s()})}else n|=1}catch(o){t(o)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return s()}function wC(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,s,a,o){return n?t?".jsx":".js":s&&(!a||!o)?r:s+a+"."+o.toLowerCase()+"js"}):e}const _$={__extends:Xk,__assign:Tr,__rest:ri,__decorate:Zk,__param:eC,__esDecorate:tC,__runInitializers:rC,__propKey:nC,__setFunctionName:sC,__metadata:iC,__awaiter:ce,__generator:aC,__createBinding:Kh,__exportStar:oC,__values:Xd,__read:_v,__spread:lC,__spreadArrays:cC,__spreadArray:kv,__await:_o,__asyncGenerator:uC,__asyncDelegator:dC,__asyncValues:hC,__makeTemplateOb
513ject:fC,__importStar:mC,__importDefault:pC,__classPrivateFieldGet:gC,__classPrivateFieldSet:xC,__classPrivateFieldIn:vC,__addDisposableResource:yC,__disposeResources:bC,__rewriteRelativeImportExtension:wC},k$=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:yC,get __assign(){return Tr},__asyncDelegator:dC,__asyncGenerator:uC,__asyncValues:hC,__await:_o,__awaiter:ce,__classPrivateFieldGet:gC,__classPrivateFieldIn:vC,__classPrivateFieldSet:xC,__createBinding:Kh,__decorate:Zk,__disposeResources:bC,__esDecorate:tC,__exportStar:oC,__extends:Xk,__generator:aC,__importDefault:pC,__importStar:mC,__makeTemplateObject:fC,__metadata:iC,__param:eC,__propKey:nC,__read:_v,__rest:ri,__rewriteRelativeImportExtension:wC,__runInitializers:rC,__setFunctionName:sC,__spread:lC,__spreadArray:kv,__spreadArrays:cC,__values:Xd,default:_$},Symbol.toStringTag,{value:"Module"})),C$=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Cv extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class E$ extends Cv{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Kb extends Cv{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Yb extends Cv{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var pg;(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"})(pg||(pg={}));class P${constructor(t,{headers:r={},customFetch:n,region:s=pg.Any}={}){this.url=t,this.headers=r,this.region=s,this.fetch=C$(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return ce(this,arguments,void 0,function*(r,n={}){var s;let a,o;try{const{headers:l,method:c,body:u,signal:d,timeout:h}=n;let f={},{region:m}=n;m||(m=this.region);const w=new URL(`${this.url}/${r}`);m&&m!=="any"&&(f["x-region"]=m,w.searchParams.set("forceFunctionRegion",m));let g;u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(f["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(f["Content-Type"]="application/json",g=JSON.stringify(u)):g=u;let y=d;h&&(o=new AbortController,a=setTimeout(()=>o.abort(),h),d?(y=o.signal,d.addEventListener("abort",()=>o.abort())):y=o.signal);const b=yield this.fetch(w.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),l),body:g,signal:y}).catch(N=>{throw new E$(N)}),v=b.headers.get("x-relay-error");if(v&&v==="true")throw new Kb(b);if(!b.ok)throw new Yb(b);let x=((s=b.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),j;return x==="application/json"?j=yield b.json():x==="application/octet-stream"||x==="application/pdf"?j=yield b.blob():x==="text/event-stream"?j=b:x==="multipart/form-data"?j=yield b.formData():j=yield b.text(),{data:j,error:null,response:b}}catch(l){return{data:null,error:l,response:l instanceof Yb||l instanceof Kb?l.context:void 0}}finally{a&&clearTimeout(a)}})}}var zt={};const Fo=nR(k$);var _u={},ku={},Cu={},Eu={},Pu={},Tu={},Qb;function jC(){if(Qb)return Tu;Qb=1,Object.defineProperty(Tu,"__esModule",{value:!0});class e extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.co
513de=r.code}}return Tu.default=e,Tu}var Jb;function NC(){if(Jb)return Pu;Jb=1,Object.defineProperty(Pu,"__esModule",{value:!0});const t=Fo.__importDefault(jC());class r{constructor(s){var a,o;this.shouldThrowOnError=!1,this.method=s.method,this.url=s.url,this.headers=new Headers(s.headers),this.schema=s.schema,this.body=s.body,this.shouldThrowOnError=(a=s.shouldThrowOnError)!==null&&a!==void 0?a:!1,this.signal=s.signal,this.isMaybeSingle=(o=s.isMaybeSingle)!==null&&o!==void 0?o:!1,s.fetch?this.fetch=s.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(s,a){return this.headers=new Headers(this.headers),this.headers.set(s,a),this}then(s,a){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 o=this.fetch;let l=o(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async c=>{var u,d,h,f;let m=null,w=null,g=null,y=c.status,b=c.statusText;if(c.ok){if(this.method!=="HEAD"){const N=await c.text();N===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((u=this.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?w=N:w=JSON.parse(N))}const x=(d=this.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),j=(h=c.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");x&&j&&j.length>1&&(g=parseInt(j[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(w)&&(w.length>1?(m={code:"PGRST116",details:`Results contain ${w.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},w=null,g=null,y=406,b="Not Acceptable"):w.length===1?w=w[0]:w=null)}else{const x=await c.text();try{m=JSON.parse(x),Array.isArray(m)&&c.status===404&&(w=[],m=null,y=200,b="OK")}catch{c.status===404&&x===""?(y=204,b="No Content"):m={message:x}}if(m&&this.isMaybeSingle&&(!((f=m==null?void 0:m.details)===null||f===void 0)&&f.includes("0 rows"))&&(m=null,y=200,b="OK"),m&&this.shouldThrowOnError)throw new t.default(m)}return{error:m,data:w,count:g,status:y,statusText:b}});return this.shouldThrowOnError||(l=l.catch(c=>{var u,d,h,f,m,w;let g="";const y=c==null?void 0:c.cause;if(y){const b=(u=y==null?void 0:y.message)!==null&&u!==void 0?u:"",v=(d=y==null?void 0:y.code)!==null&&d!==void 0?d:"";g=`${(h=c==null?void 0:c.name)!==null&&h!==void 0?h:"FetchError"}: ${c==null?void 0:c.message}`,g+=` 514 515Caused by: ${(f=y==null?void 0:y.name)!==null&&f!==void 0?f:"Error"}: ${b}`,v&&(g+=` (${v})`),y!=null&&y.stack&&(g+=` 516${y.stack}`)}else g=(m=c==null?void 0:c.stack)!==null&&m!==void 0?m:"";return{error:{message:`${(w=c==null?void 0:c.name)!==null&&w!==void 0?w:"FetchError"}: ${c==null?void 0:c.message}`,details:g,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),l.then(s,a)}returns(){return this}overrideTypes(){return this}}return Pu.default=r,Pu}var Xb;function SC(){if(Xb)return Eu;Xb=1,Object.defineProperty(Eu,"__esModule",{value:!0});const t=Fo.__importDefault(NC());class r extends t.default{select(s){let a=!1;const o=(s??"*").split("").map(l=>/\s/.test(l)&&!a?"":(l==='"'&&(a=!a),l)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(s,{ascending:a=!0,nullsFirst:o,foreignTable:l,referencedTable:c=l}={}){const u=c?`${c}.order`:"order",d=this.url.searchParams.get(u);return this.url.searchParams.set(u,`${d?`${d},`:""}${s}.${a?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(s,{foreignTable:a,referencedTable:o=a}={}){const l=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(l,`${s}`),this}range(s,a,{foreignTable:o,referencedTable:l=o}={}){const c=typeof l>"u"?"offset":`${l}.offset`,u=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(c,`${s}`),this.url.searchParams.set(u,`${a-s+1}`),this}abortSignal(s){return this.signal=s,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}
516explain({analyze:s=!1,verbose:a=!1,settings:o=!1,buffers:l=!1,wal:c=!1,format:u="text"}={}){var d;const h=[s?"analyze":null,a?"verbose":null,o?"settings":null,l?"buffers":null,c?"wal":null].filter(Boolean).join("|"),f=(d=this.headers.get("Accept"))!==null&&d!==void 0?d:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${u}; for="${f}"; options=${h};`),u==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(s){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${s}`),this}}return Eu.default=r,Eu}var Zb;function Ev(){if(Zb)return Cu;Zb=1,Object.defineProperty(Cu,"__esModule",{value:!0});const t=Fo.__importDefault(SC()),r=new RegExp("[,()]");class n extends t.default{eq(a,o){return this.url.searchParams.append(a,`eq.${o}`),this}neq(a,o){return this.url.searchParams.append(a,`neq.${o}`),this}gt(a,o){return this.url.searchParams.append(a,`gt.${o}`),this}gte(a,o){return this.url.searchParams.append(a,`gte.${o}`),this}lt(a,o){return this.url.searchParams.append(a,`lt.${o}`),this}lte(a,o){return this.url.searchParams.append(a,`lte.${o}`),this}like(a,o){return this.url.searchParams.append(a,`like.${o}`),this}likeAllOf(a,o){return this.url.searchParams.append(a,`like(all).{${o.join(",")}}`),this}likeAnyOf(a,o){return this.url.searchParams.append(a,`like(any).{${o.join(",")}}`),this}ilike(a,o){return this.url.searchParams.append(a,`ilike.${o}`),this}ilikeAllOf(a,o){return this.url.searchParams.append(a,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(a,o){return this.url.searchParams.append(a,`ilike(any).{${o.join(",")}}`),this}is(a,o){return this.url.searchParams.append(a,`is.${o}`),this}in(a,o){const l=Array.from(new Set(o)).map(c=>typeof c=="string"&&r.test(c)?`"${c}"`:`${c}`).join(",");return this.url.searchParams.append(a,`in.(${l})`),this}contains(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cs.{${o.join(",")}}`):this.url.searchParams.append(a,`cs.${JSON.stringify(o)}`),this}containedBy(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cd.{${o.join(",")}}`):this.url.searchParams.append(a,`cd.${JSON.stringify(o)}`),this}rangeGt(a,o){return this.url.searchParams.append(a,`sr.${o}`),this}rangeGte(a,o){return this.url.searchParams.append(a,`nxl.${o}`),this}rangeLt(a,o){return this.url.searchParams.append(a,`sl.${o}`),this}rangeLte(a,o){return this.url.searchParams.append(a,`nxr.${o}`),this}rangeAdjacent(a,o){return this.url.searchParams.append(a,`adj.${o}`),this}overlaps(a,o){return typeof o=="string"?this.url.searchParams.append(a,`ov.${o}`):this.url.searchParams.append(a,`ov.{${o.join(",")}}`),this}textSearch(a,o,{config:l,type:c}={}){let u="";c==="plain"?u="pl":c==="phrase"?u="ph":c==="websearch"&&(u="w");const d=l===void 0?"":`(${l})`;return this.url.searchParams.append(a,`${u}fts${d}.${o}`),this}match(a){return Object.entries(a).forEach(([o,l])=>{this.url.searchParams.append(o,`eq.${l}`)}),this}not(a,o,l){return this.url.searchParams.append(a,`not.${o}.${l}`),this}or(a,{foreignTable:o,referencedTable:l=o}={}){const c=l?`${l}.or`:"or";return this.url.searchParams.append(c,`(${a})`),this}filter(a,o,l){return this.url.searchParams.append(a,`${o}.${l}`),this}}return Cu.default=n,Cu}var ew;function _C(){if(ew)return ku;ew=1,Object.defineProperty(ku,"__esModule",{value:!0});const t=Fo.__importDefault(Ev());class r{constructor(s,{headers:a={},schema:o,fetch:l}){this.url=s,this.headers=new Headers(a),this.schema=o,this.fetch=l}select(s,a){const{head:o=!1,count:l}=a??{},c=o?"HEAD":"GET";let u=!1;const d=(s??"*").split("").map(h=>/\s/.test(h)&&!u?"":(h==='"'&&(u=!u),h)).join("");return this.url.searchParams.set("select",d),l&&this.headers.append("Prefer",`count=${l}`),new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(s,{count:a,defaultToNull:o=!0}={}){var l;const c="POST";if(a&&this.headers.append("Prefer",`count=${a}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const u=s.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(u.length>0){const d=[...new Set(u)].map(h=>`"${h}"`);this.url.searchParams.set("columns",d.join(","))}}return new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}upsert(s,{onConflict:a,ignoreDuplicates:o=!1,count:l,defaultToNull:c=!0}={}){var u;const d="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),a!==void 0&&this.url.searchParams.set("on_conflict",a),l&&this.headers.append("Prefer",`count=${l}`),c||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const h=s.reduce((f,m)=>f.concat(Object.keys(m)),[]);if(h.length>0){const f=[...new Set(h)].map(m=>`"${m}"`);this.url.searchParams.set("columns",f.join(","))}}return new t.default({method:d,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}update(s,{count:a}={}){var o;const l="PATCH";return a&&this.headers.append("Prefer",`count=${a}`),new t.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:s}={}){var a;const o="DELETE";return s&&this.headers.append("Prefer",`count=${s}`),new t.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}}return ku.default=r,ku}var tw;
516function T$(){if(tw)return _u;tw=1,Object.defineProperty(_u,"__esModule",{value:!0});const e=Fo,t=e.__importDefault(_C()),r=e.__importDefault(Ev());class n{constructor(a,{headers:o={},schema:l,fetch:c}={}){this.url=a,this.headers=new Headers(o),this.schemaName=l,this.fetch=c}from(a){const o=new URL(`${this.url}/${a}`);return new t.default(o,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(a){return new n(this.url,{headers:this.headers,schema:a,fetch:this.fetch})}rpc(a,o={},{head:l=!1,get:c=!1,count:u}={}){var d;let h;const f=new URL(`${this.url}/rpc/${a}`);let m;l||c?(h=l?"HEAD":"GET",Object.entries(o).filter(([g,y])=>y!==void 0).map(([g,y])=>[g,Array.isArray(y)?`{${y.join(",")}}`:`${y}`]).forEach(([g,y])=>{f.searchParams.append(g,y)})):(h="POST",m=o);const w=new Headers(this.headers);return u&&w.set("Prefer",`count=${u}`),new r.default({method:h,url:f,headers:w,schema:this.schemaName,body:m,fetch:(d=this.fetch)!==null&&d!==void 0?d:fetch})}}return _u.default=n,_u}Object.defineProperty(zt,"__esModule",{value:!0});var kC=zt.PostgrestError=DC=zt.PostgrestBuilder=OC=zt.PostgrestTransformBuilder=RC=zt.PostgrestFilterBuilder=TC=zt.PostgrestQueryBuilder=EC=zt.PostgrestClient=void 0;const Uo=Fo,CC=Uo.__importDefault(T$());var EC=zt.PostgrestClient=CC.default;const PC=Uo.__importDefault(_C());var TC=zt.PostgrestQueryBuilder=PC.default;const AC=Uo.__importDefault(Ev());var RC=zt.PostgrestFilterBuilder=AC.default;const IC=Uo.__importDefault(SC());var OC=zt.PostgrestTransformBuilder=IC.default;const MC=Uo.__importDefault(NC());var DC=zt.PostgrestBuilder=MC.default;const LC=Uo.__importDefault(jC());kC=zt.PostgrestError=LC.default;var $C=zt.default={PostgrestClient:CC.default,PostgrestQueryBuilder:PC.default,PostgrestFilterBuilder:AC.default,PostgrestTransformBuilder:IC.default,PostgrestBuilder:MC.default,PostgrestError:LC.default};const A$=k1({__proto__:null,get PostgrestBuilder(){return DC},get PostgrestClient(){return EC},get PostgrestError(){return kC},get PostgrestFilterBuilder(){return RC},get PostgrestQueryBuilder(){return TC},get PostgrestTransformBuilder(){return OC},default:$C},[zt]),{PostgrestClient:R$,PostgrestQueryBuilder:sK,PostgrestFilterBuilder:iK,PostgrestTransformBuilder:aK,PostgrestBuilder:oK,PostgrestError:lK}=$C||A$;class I${constructor(){}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 r=process.versions;if(r&&r.node){const n=r.node,s=parseInt(n.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 517import ws from "ws" 518new 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 r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` 519 520Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){const n=this.getWebSocketConstructor();return new n(t,r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const O$="2.83.0",M$=`realtime-js/${O$}`,FC="1.0.0",D$="2.0.0",rw=FC,gg=1e4,L$=1e3,$$=100;var bi;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(bi||(bi={}));var ft;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(ft||(ft={}));var Cr;(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"})(Cr||(Cr={}));var xg;(function(e){e.websocket="websocket"})(xg||(xg={}));var wi;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(wi||(wi={}));class F${constructor(){this.HEADER_LENGTH=1,this.META_LENGTH=4,this.USER_BROADCAST_PUSH_META_LENGTH=5,this.KINDS={push:0,reply:1,broadcast:2,userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST="broadcast"}encode(t,r){if(this._isArrayBuffer(t.payload))return r(this._binaryEncodePush(t));if(t.event===this.BROADCAST&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodePush(t){var r,n;const{event:s,topic:a,payload:o}=t,l=(r=t.ref)!==null&&r!==void 0?r:"",c=(n=t.join_ref)!==null&&n!==void 0?n:"",u=this.META_LENGTH+c.length+l.length+a.length+s.length,d=new ArrayBuffer(this.HEADER_LENGTH+u);let h=new DataView(d),f=0;h.setUint8(f++,this.KINDS.push),h.setUint8(f++,c.length),h.setUint8(f++,l.length),h.setUint8(f++,a.length),h.setUint8(f++,s.length),Array.from(c,w=>
520h.setUint8(f++,w.charCodeAt(0))),Array.from(l,w=>h.setUint8(f++,w.charCodeAt(0))),Array.from(a,w=>h.setUint8(f++,w.charCodeAt(0))),Array.from(s,w=>h.setUint8(f++,w.charCodeAt(0)));var m=new Uint8Array(d.byteLength+o.byteLength);return m.set(new Uint8Array(d),0),m.set(new Uint8Array(o),d.byteLength),m.buffer}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n,s,a;const o=t.topic,l=(r=t.ref)!==null&&r!==void 0?r:"",c=(n=t.join_ref)!==null&&n!==void 0?n:"",u=t.payload.event,d=(a=(s=t.payload)===null||s===void 0?void 0:s.payload)!==null&&a!==void 0?a:new ArrayBuffer(0),h=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+o.length+u.length,f=new ArrayBuffer(this.HEADER_LENGTH+h);let m=new DataView(f),w=0;m.setUint8(w++,this.KINDS.userBroadcastPush),m.setUint8(w++,c.length),m.setUint8(w++,l.length),m.setUint8(w++,o.length),m.setUint8(w++,u.length),m.setUint8(w++,this.BINARY_ENCODING),Array.from(c,y=>m.setUint8(w++,y.charCodeAt(0))),Array.from(l,y=>m.setUint8(w++,y.charCodeAt(0))),Array.from(o,y=>m.setUint8(w++,y.charCodeAt(0))),Array.from(u,y=>m.setUint8(w++,y.charCodeAt(0)));var g=new Uint8Array(f.byteLength+d.byteLength);return g.set(new Uint8Array(f),0),g.set(new Uint8Array(d),f.byteLength),g.buffer}_encodeJsonUserBroadcastPush(t){var r,n,s,a;const o=t.topic,l=(r=t.ref)!==null&&r!==void 0?r:"",c=(n=t.join_ref)!==null&&n!==void 0?n:"",u=t.payload.event,d=(a=(s=t.payload)===null||s===void 0?void 0:s.payload)!==null&&a!==void 0?a:{},f=new TextEncoder().encode(JSON.stringify(d)).buffer,m=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+o.length+u.length,w=new ArrayBuffer(this.HEADER_LENGTH+m);let g=new DataView(w),y=0;g.setUint8(y++,this.KINDS.userBroadcastPush),g.setUint8(y++,c.length),g.setUint8(y++,l.length),g.setUint8(y++,o.length),g.setUint8(y++,u.length),g.setUint8(y++,this.JSON_ENCODING),Array.from(c,v=>g.setUint8(y++,v.charCodeAt(0))),Array.from(l,v=>g.setUint8(y++,v.charCodeAt(0))),Array.from(o,v=>g.setUint8(y++,v.charCodeAt(0))),Array.from(u,v=>g.setUint8(y++,v.charCodeAt(0)));var b=new Uint8Array(w.byteLength+f.byteLength);return b.set(new Uint8Array(w),0),b.set(new Uint8Array(f),w.byteLength),b.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[s,a,o,l,c]=n;return r({join_ref:s,ref:a,topic:o,event:l,payload:c})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.push:return this._decodePush(t,r,s);case this.KINDS.reply:return this._decodeReply(t,r,s);case this.KINDS.broadcast:return this._decodeBroadcast(t,r,s);case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,s)}}_decodePush(t,r,n){const s=r.getUint8(1),a=r.getUint8(2),o=r.getUint8(3);let l=this.HEADER_LENGTH+this.META_LENGTH-1;const c=n.decode(t.slice(l,l+s));l=l+s;const u=n.decode(t.slice(l,l+a));l=l+a;const d=n.decode(t.slice(l,l+o));l=l+o;const h=JSON.parse(n.decode(t.slice(l,t.byteLength)));return{join_ref:c,ref:null,topic:u,event:d,payload:h}}_decodeReply(t,r,n){const s=r.getUint8(1),a=r.getUint8(2),o=r.getUint8(3),l=r.getUint8(4);let c=this.HEADER_LENGTH+this.META_LENGTH;const u=n.decode(t.slice(c,c+s));c=c+s;const d=n.decode(t.slice(c,c+a));c=c+a;const h=n.decode(t.slice(c,c+o));c=c+o;const f=n.decode(t.slice(c,c+l));c=c+l;const m=JSON.parse(n.decode(t.slice(c,t.byteLength))),w={status:f,response:m};return{join_ref:u,ref:d,topic:h,event:Cr.reply,payload:w}}_decodeBroadcast(t,r,n){const s=r.getUint8(1),a=r.getUint8(2);let o=this.HEADER_LENGTH+2;const l=n.decode(t.slice(o,o+s));o=o+s;const c=n.decode(t.slice(o,o+a));o=o+a;const u=JSON.parse(n.decode(t.slice(o,t.byteLength)));return{join_ref:null,ref:null,topic:l,event:c,payload:u}}_decodeUserBroadcast(t,r,n){const s=r.getUint8(1),a=r.getUint8(2),o=r.getUint8(3),l=r.getUint8(4);let c=this.HEADER_LENGTH+4;const u=n.decode(t.slice(c,c+s));c=c+s;const d=n.decode(t.slice(c,c+a));c=c+a;
520const h=n.decode(t.slice(c,c+o));c=c+o;const f=t.slice(c,t.byteLength),m=l===this.JSON_ENCODING?JSON.parse(n.decode(f)):f,w={type:this.BROADCAST,event:d,payload:m};return o>0&&(w.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST,payload:w}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}}class UC{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}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 Me;(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"})(Me||(Me={}));const nw=(e,t,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((a,o)=>(a[o]=U$(o,e,t,s),a),{}):{}},U$=(e,t,r,n)=>{const s=t.find(l=>
520l.name===e),a=s==null?void 0:s.type,o=r[e];return a&&!n.includes(a)?VC(a,o):vg(o)},VC=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return G$(t,r)}switch(e){case Me.bool:return V$(t);case Me.float4:case Me.float8:case Me.int2:case Me.int4:case Me.int8:case Me.numeric:case Me.oid:return B$(t);case Me.json:case Me.jsonb:return z$(t);case Me.timestamp:return W$(t);case Me.abstime:case Me.date:case Me.daterange:case Me.int4range:case Me.int8range:case Me.money:case Me.reltime:case Me.text:case Me.time:case Me.timestamptz:case Me.timetz:case Me.tsrange:case Me.tstzrange:return vg(t);default:return vg(t)}},vg=e=>e,V$=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},B$=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},z$=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},G$=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let a;const o=e.slice(1,r);try{a=JSON.parse("["+o+"]")}catch{a=o?o.split(","):[]}return a.map(l=>VC(t,l))}return e},W$=e=>typeof e=="string"?e.replace(" ","T"):e,BC=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class nm{constructor(t,r,n={},s=gg){this.channel=t,this.event=r,this.payload=n,this.timeout=s,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,r){var n;return this._hasReceived(t)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}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:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var sw;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(sw||(sw={}));class Tl{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},s=>{const{onJoin:a,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Tl.syncState(this.state,s,a,o),this.pendingDiffs.forEach(c=>{this.state=Tl.syncDiff(this.state,c,a,o)}),this.pendingDiffs=[],l()}),this.channel._on(n.diff,{},s=>{const{onJoin:a,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Tl.syncDiff(this.state,s,a,o),l())}),this.onJoin((s,a,o)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:a,newPresences:o})}),this.onLeave((s,a,o)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:a,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,n,s){const a=this.cloneDeep(t),o=this.transformState(r),l={},c={};return this.map(a,(u,d)=>{o[u]||(c[u]=d)}),this.map(o,(u,d)=>{const h=a[u];if(h){const f=d.map(y=>y.presence_ref),m=h.map(y=>y.presence_ref),w=d.filter(y=>m.indexOf(y.presence_ref)<0),g=h.filter(y=>f.indexOf(y.presence_ref)<0);w.length>0&&(l[u]=w),g.length>0&&(c[u]=g)}else l[u]=d}),this.syncDiff(a,{joins:l,leaves:c},n,s)}static syncDiff(t,r,n,s){const{joins:a,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),s||(s=()=>{}),this.map(a,(l,c)=>{var u;
520const d=(u=t[l])!==null&&u!==void 0?u:[];if(t[l]=this.cloneDeep(c),d.length>0){const h=t[l].map(m=>m.presence_ref),f=d.filter(m=>h.indexOf(m.presence_ref)<0);t[l].unshift(...f)}n(l,d,c)}),this.map(o,(l,c)=>{let u=t[l];if(!u)return;const d=c.map(h=>h.presence_ref);u=u.filter(h=>d.indexOf(h.presence_ref)<0),t[l]=u,s(l,u,c),u.length===0&&delete t[l]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const s=t[n];return"metas"in s?r[n]=s.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):r[n]=s,r},{})}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 iw;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(iw||(iw={}));var Al;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Al||(Al={}));var Un;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Un||(Un={}));class Pv{constructor(t,r={config:{}},n){var s,a;if(this.topic=t,this.params=r,this.socket=n,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},r.config),this.timeout=this.socket.timeout,this.joinPush=new nm(this,Cr.join,this.params,this.timeout),this.rejoinTimer=new UC(()=>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(Cr.reply,{},(o,l)=>{this._trigger(this._replyEventName(l),o)}),this.presence=new Tl(this),this.broadcastEndpointURL=BC(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((a=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||a===void 0)&&a.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var n,s,a;if(this.socket.isConnected()||this.socket.connect(),this.state==ft.closed){const{config:{broadcast:o,presence:l,private:c}}=this.params,u=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(m=>m.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[Al.PRESENCE]&&this.bindings[Al.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,h={},f={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(m=>t==null?void 0:t(Un.CHANNEL_ERROR,m)),this._onClose(()=>t==null?void 0:t(Un.CLOSED)),this.updateJoinPayload(Object.assign({config:f},h)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:m})=>{var w;if(this.socket.setAuth(),m===void 0){t==null||t(Un.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,y=(w=g==null?void 0:g.length)!==null&&w!==void 0?w:0,b=[];for(let v=0;v<y;v++){const x=g[v],{filter:{event:j,schema:N,table:S,filter:_}}=x,k=m&&m[v];if(k&&k.event===j&&k.schema===N&&k.table===S&&k.filter===_)b.push(Object.assign(Object.assign({},x),{id:k.id}));else{this.unsubscribe(),this.state=ft.errored,t==null||t(Un.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=b,t&&t(Un.SUBSCRIBED);return}}).receive("error",m=>{this.state=ft.errored,t==null||t(Un.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(m).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Un.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){return this.state===ft.joined&&t===Al.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,r,n)}async httpSend(t,r,n={}){var s;const a=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(r==null)return Promise.reject("Payload is required for httpSend()");const o={method:"POST",headers:{Authorization:a,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;
520try{const u=await l.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,r={}){var n,s;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,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:a,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,l,c;const u=this._push(t.type,t,r.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)&&a("ok"),u.receive("ok",()=>a("ok")),u.receive("error",()=>a("error")),u.receive("timeout",()=>a("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=ft.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Cr.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(s=>{n=new nm(this,Cr.leave,{},t),n.receive("ok",()=>{r(),s("ok")}).receive("timeout",()=>{r(),s("timed out")}).receive("error",()=>{s("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.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,r,n){const s=new AbortController,a=setTimeout(()=>s.abort(),n),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(a),o}_push(t,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new nm(this,t,r,n);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>$$){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,n){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,n){var s,a;const o=t.toLocaleLowerCase(),{close:l,error:c,leave:u,join:d}=Cr;if(n&&[l,c,u,d].indexOf(o)>=0&&n!==this._joinRef())return;let f=this._onMessage(o,r,n);if(r&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(m=>{var w,g,y;return((w=m.filter)===null||w===void 0?void 0:w.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(f,n)):(a=this.bindings[o])===null||a===void 0||a.filter(m=>{var w,g,y,b,v,x;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in m){const j=m.id,N=(w=m.filter)===null||w===void 0?void 0:w.event;return j&&((g=r.ids)===null||g===void 0?void 0:g.includes(j))&&(N==="*"||(N==null?void 0:N.toLocaleLowerCase())===((y=r.data)===null||y===void 0?void 0:y.type.toLocaleLowerCase()))}else{const j=(v=(b=m==null?void 0:m.filter)===null||b===void 0?void 0:b.event)===null||v===void 0?void 0:v.toLocaleLowerCase();return j==="*"||j===((x=r==null?void 0:r.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===o}).map(m=>{if(typeof f=="object"&&"ids"in f){const w=f.data,{schema:g,table:y,commit_timestamp:b,type:v,errors:x}=w;f=Object.assign(Object.assign({},{schema:g,table:y,commit_timestamp:b,eventType:v,new:{},old:{},errors:x}),this._getPayloadRecords(w))}m.callback(f,n)})}_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,r,n){const s=t.toLocaleLowerCase(),a={type:s,filter:r,callback:n};return this.bindings[s]?this.bindings[s].push(a):this.bindings[s]=[a],this}_off(t,r){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(s=>{var a;return!(((a=s.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===n&&Pv.isEqual(s.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(t[n]!==r[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Cr.close,{},t)}_onError(t){this._on(Cr.error,{},r=>t(r))}_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 r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=nw(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=nw(t.columns,t.old_record)),r}}const sm=()=>{},Au={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},q$=[1e3,2e3,5e3,1e4],H$=1e4,K$=` 521 addEventListener("message", (e) => { 522 if (e.data.event === "start") { 523 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 524 } 525 });`;
525class Y${constructor(t,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=gg,this.transport=null,this.heartbeatIntervalMs=Au.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=sm,this.ref=0,this.reconnectTimer=null,this.vsn=rw,this.logger=sm,this.conn=null,this.sendBuffer=[],this.serializer=new F$,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=s=>s?(...a)=>s(...a):(...a)=>fetch(...a),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${xg.websocket}`,this.httpEndpoint=BC(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=I$.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const r=t.message;throw r.includes("Node.js")?new Error(`${r} 526 527To use Realtime in Node.js, you need to provide a WebSocket implementation: 528 529Option 1: Use Node.js 22+ which has native WebSocket support 530Option 2: Install and provide the "ws" package: 531 532 npm install ws 533 534 import ws from "ws" 535 const client = new RealtimeClient(url, { 536 ...options, 537 transport: ws 538 })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,n){this.logger(t,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case bi.connecting:return wi.Connecting;case bi.open:return wi.Open;case bi.closing:return wi.Closing;default:return wi.Closed}}isConnected(){return this.connectionState()===wi.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const n=`realtime:${t}`,s=this.getChannels().find(a=>a.topic===n);if(s)return s;{const a=new Pv(`realtime:${t}`,r,this);return this.channels.push(a),a}}push(t){const{topic:r,event:n,payload:s,ref:a}=t,o=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${r} ${n} (${a})`,s),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(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(L$,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.sc
538heduleTimeout()},Au.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}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 r=this.channels.find(n=>n.topic===t&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply")try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error")}catch(u){this.log("error","error in heartbeat callback",u)}r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:s,payload:a,ref:o}=r,l=o?`(${o})`:"",c=a.status||"";this.log("receive",`${c} ${n} ${s} ${l}`.trim(),a),this.channels.filter(u=>u._isMember(n)).forEach(u=>u._trigger(s,a,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.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(){if(this.conn){if(this.conn.readyState===bi.open||this.conn.readyState===bi.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}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._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),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=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.sc
538heduleTimeout(),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(Cr.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const n=t.match(/\?/)?"&":"?",s=new URLSearchParams(r);return`${t}${n}${s}`}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([K$],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r;t?r=t:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(n=>{const s={access_token:r,version:M$};r&&n.updateJoinPayload(s),n.joinedOnce&&n._isJoined()&&n._push(Cr.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(n=>{try{n(r)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new UC(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Au.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,n,s,a,o,l,c,u,d,h,f,m;switch(this.transport=(r=t==null?void 0:t.transport)!==null&&r!==void 0?r:null,this.timeout=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:gg,this.heartbeatIntervalMs=(s=t==null?void 0:t.heartbeatIntervalMs)!==null&&s!==void 0?s:Au.HEARTBEAT_INTERVAL,this.worker=(a=t==null?void 0:t.worker)!==null&&a!==void 0?a:!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:sm,this.vsn=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:rw,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=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:w=>q$[w-1]||H$,this.vsn){case FC:this.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:(w,g)=>g(JSON.stringify(w)),this.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:(w,g)=>g(JSON.parse(w));break;case D$:this.encode=(f=t==null?void 0:t.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(m=t==null?void 0:t.decode)!==null&&m!==void 0?m:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(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 Tv extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function We(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class Q$ extends Tv{constructor(t,r,n){super(t),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class yg extends Tv{constructor(t,r){super(t),this.name="StorageUnknownError",this.originalError=r}}const Av=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),J$=()=>Response,bg=e=>{if(Array.isArray(e))return e.map(r=>bg(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));t[s]=bg(n)}),t},X$=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)},im=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},Z$=(e,t,r)=>ce(void 0,void 0,void 0,function*(){const n=yield J$();e instanceof n&&!(r!=null&&r.noResolveJson)?e.json().then(s=>{const a=e.status||500,o=(s==null?void 0:s.statusCode)||a+"";t(new Q$(im(s),a,o))}).catch(s=>{t(new yg(im(s),s))}):t(new yg(im(e),e))}),eF=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!n?s:(X$(n)?(s.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(n)):s.body=n,t!=null&&t.duplex&&(s.duplex=t.duplex),Object.assign(Object.assign({},s),r))};function Wc(e,t,r,n,s,a){return ce(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(r,eF(t,n,s,a)).then(c=>{if(!c.ok)throw c;return n!=null&&n.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>Z$(c,l,n))})})}function fc(e,t,r,n){return ce(this,void 0,void 0,function*(){return Wc(e,"GET",t,r,n)})}function Kr(e,t,r,n,s){return ce(this,void 0,void 0,function*(){return Wc(e,"POST",t,n,s,r)})}function wg(e,t,r,n,s){return ce(this,void 0,void 0,function*(){return Wc(e,"PUT",t,n,s,r)})}function tF(e,t,r,n){return ce(this,void 0,void 0,function*(){return Wc(e,"HEAD",t,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function Rv(e,t,r,n,s){return ce(this,void 0,void 0,function*(){return Wc(e,"DELETE",t,n,s,r)})}class rF{constructor(t,r){this.downloadFn=t,this.shouldThrowOnError=r}then(t,r){return this.execute().then(t,r)}execute(){return ce(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(We(t))return{data:null,error:t};throw t}})}}var zC;
538class nF{constructor(t,r){this.downloadFn=t,this.shouldThrowOnError=r,this[zC]="BlobDownloadBuilder",this.promise=null}asStream(){return new rF(this.downloadFn,this.shouldThrowOnError)}then(t,r){return this.getPromise().then(t,r)}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 ce(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(We(t))return{data:null,error:t};throw t}})}}zC=Symbol.toStringTag;const sF={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},aw={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class iF{constructor(t,r={},n,s){this.shouldThrowOnError=!1,this.url=t,this.headers=r,this.bucketId=n,this.fetch=Av(s)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(t,r,n,s){return ce(this,void 0,void 0,function*(){try{let a;const o=Object.assign(Object.assign({},aw),s);let l=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&n instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),c&&a.append("metadata",this.encodeMetadata(c)),a.append("",n)):typeof FormData<"u"&&n instanceof FormData?(a=n,a.has("cacheControl")||a.append("cacheControl",o.cacheControl),c&&!a.has("metadata")&&a.append("metadata",this.encodeMetadata(c))):(a=n,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(c))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!o.duplex&&(o.duplex="half")),s!=null&&s.headers&&(l=Object.assign(Object.assign({},l),s.headers));const u=this._removeEmptyFolders(r),d=this._getFinalPath(u),h=yield(t=="PUT"?wg:Kr)(this.fetch,`${this.url}/object/${d}`,a,Object.assign({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:u,id:h.Id,fullPath:h.Key},error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(We(a))return{data:null,error:a};throw a}})}upload(t,r,n){return ce(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,r,n)})}uploadToSignedUrl(t,r,n,s){return ce(this,void 0,void 0,function*(){const a=this._removeEmptyFolders(t),o=this._getFinalPath(a),l=new URL(this.url+`/object/upload/sign/${o}`);l.searchParams.set("token",r);try{let c;const u=Object.assign({upsert:aw.upsert},s),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",u.cacheControl)):(c=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType);const h=yield wg(this.fetch,l.toString(),c,{headers:d});return{data:{path:a,fullPath:h.Key},error:null}}catch(c){if(this.shouldThrowOnError)throw c;if(We(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(t,r){return ce(this,void 0,void 0,function*(){try{let n=this._getFinalPath(t);const s=Object.assign({},this.headers);r!=null&&r.upsert&&(s["x-upsert"]="true");const a=yield Kr(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:s}),o=new URL(this.url+a.url),l=o.searchParams.get("token");if(!l)throw new Tv("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:l},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(We(n))return{data:null,error:n};throw n}})}update(t,r,n){return ce(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,r,n)})}move(t,r,n){return ce(this,void 0,void 0,function*(){try{return{data:yield Kr(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(We(s))return{data:null,error:s};throw s}})}copy(t,r,n){return ce(this,void 0,void 0,function*(){try{return{data:{path:(yield Kr(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(We(s))return{data:null,error:s};throw s}})}createSignedUrl(t,r,n){return ce(this,void 0,void 0,function*(){try{let s=this._getFinalPath(t),a=yield Kr(this.fetch,`${this.url}/object/sign/${s}
538`,Object.assign({expiresIn:r},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return a={signedUrl:encodeURI(`${this.url}${a.signedURL}${o}`)},{data:a,error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(We(s))return{data:null,error:s};throw s}})}createSignedUrls(t,r,n){return ce(this,void 0,void 0,function*(){try{const s=yield Kr(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:t},{headers:this.headers}),a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:s.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${a}`):null})),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(We(s))return{data:null,error:s};throw s}})}download(t,r){const s=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=a?`?${a}`:"",l=this._getFinalPath(t),c=()=>fc(this.fetch,`${this.url}/${s}/${l}${o}`,{headers:this.headers,noResolveJson:!0});return new nF(c,this.shouldThrowOnError)}info(t){return ce(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{const n=yield fc(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:bg(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(We(n))return{data:null,error:n};throw n}})}exists(t){return ce(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{return yield tF(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(We(n)&&n instanceof yg){const s=n.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:n}}throw n}})}getPublicUrl(t,r){const n=this._getFinalPath(t),s=[],a=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";a!==""&&s.push(a);const l=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});c!==""&&s.push(c);let u=s.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${n}${u}`)}}}remove(t){return ce(this,void 0,void 0,function*(){try{return{data:yield Rv(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(We(r))return{data:null,error:r};throw r}})}list(t,r,n){return ce(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},sF),r),{prefix:t||""});return{data:yield Kr(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},n),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(We(s))return{data:null,error:s};throw s}})}listV2(t,r){return ce(this,void 0,void 0,function*(){try{const n=Object.assign({},t);return{data:yield Kr(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(We(n))return{data:null,error:n};throw n}})}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 r=[];return t.width&&r.push(`width=${t.width}`),t.height&&r.push(`height=${t.height}`),t.resize&&r.push(`resize=${t.resize}`),t.format&&r.push(`format=${t.format}`),t.quality&&r.push(`quality=${t.quality}`),r.join("&")}}const GC="2.83.0",WC={"X-Client-Info":`storage-js/${GC}`};class aF{constructor(t,r={},n,s){this.shouldThrowOnError=!1;const a=new URL(t);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase.")),this.url=a.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},WC),r),this.fetch=Av(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(t){return ce(this,void 0,void 0,function*(){try{const r=this.listBucketOptionsToQueryString(t);return{data:yield fc(this.fetch,`${this.url}/bucket${r}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(We(r))return{data:null,error:r};throw r}})}getBucket(t){return ce(this,void 0,void 0,function*(){try{return{data:yield fc(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(We(r))return{data:null,error:r};throw r}})}createBucket(t){return ce(this,arguments,void 0,function*(r,n={public:!1}){try{return{data:yield Kr(this.fetch,`${this.url}/bucket`,{id:r,name:r,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(We(s))return{data:null,error:s};throw s}})}updateBucket(t,r){return ce(this,void 0,void 0,function*(){try{return{data:yield wg(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(We(n))return{data:null,error:n};throw n}})}emptyBucket(t){return ce(this,void 0,void 0,function*(){try{return{data:yield Kr(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(We(r))return{data:null,error:r};throw r}})}deleteBucket(t){return ce(this,void 0,void 0,function*(){try{return{data:yield Rv(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(We(r))return{data:null,error:r};throw r}})}listBucketOptionsToQueryString(t){const r={};return t&&("limit"in t&&(r.limit=String(t.limit)),"offset"in t&&(r.offset=String(t.offset)),t.search&&(r.search=t.search),t.sortColumn&&(r.sortColumn=t.sortColumn),t.sortOrder&&(r.sortOrder=t.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}}class oF{constructor(t,r={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},WC),r),this.fetch=Av(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(t){return ce(this,void 0,void 0,function*(){try{return{data:yield Kr(this.fetch,`${this.url}/bucket`,{name:t},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(We(r))return{data:null,error:r};throw r}})}listBuckets(t){return ce(this,void 0,void 0,function*(){try{const r=new
538URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),s=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return{data:yield fc(this.fetch,s,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(We(r))return{data:null,error:r};throw r}})}deleteBucket(t){return ce(this,void 0,void 0,function*(){try{return{data:yield Rv(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(We(r))return{data:null,error:r};throw r}})}}const Iv={"X-Client-Info":`storage-js/${GC}`,"Content-Type":"application/json"};class qC extends Error{constructor(t){super(t),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function ur(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}class am extends qC{constructor(t,r,n){super(t),this.name="StorageVectorsApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class lF extends qC{constructor(t,r){super(t),this.name="StorageVectorsUnknownError",this.originalError=r}}var ow;(function(e){e.InternalError="InternalError",e.S3VectorConflictException="S3VectorConflictException",e.S3VectorNotFoundException="S3VectorNotFoundException",e.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",e.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",e.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(ow||(ow={}));const Ov=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),cF=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)},lw=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),uF=(e,t,r)=>ce(void 0,void 0,void 0,function*(){if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(r!=null&&r.noResolveJson)){const s=e.status||500,a=e;if(typeof a.json=="function")a.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||s+"";t(new am(lw(o),s,l))}).catch(()=>{const o=s+"",l=a.statusText||`HTTP ${s} error`;t(new am(l,s,o))});else{const o=s+"",l=a.statusText||`HTTP ${s} error`;t(new am(l,s,o))}}else t(new lF(lw(e),e))}),dF=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return n?(cF(n)?(s.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(n)):s.body=n,Object.assign(Object.assign({},s),r)):s};function hF(e,t,r,n,s,a){return ce(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(r,dF(t,n,s,a)).then(c=>{if(!c.ok)throw c;if(n!=null&&n.noResolveJson)return c;const u=c.headers.get("content-type");return!u||!u.includes("application/json")?{}:c.json()}).then(c=>o(c)).catch(c=>uF(c,l,n))})})}function dr(e,t,r,n,s){return ce(this,void 0,void 0,function*(){return hF(e,"POST",t,n,s,r)})}class fF{constructor(t,r={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Iv),r),this.fetch=Ov(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(t){return ce(this,void 0,void 0,function*(){try{return{data:(yield dr(this.fetch,`${this.url}/CreateIndex`,t,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ur(r))return{data:null,error:r};throw r}})}getIndex(t,r){return ce(this,void 0,void 0,function*(){try{return{data:yield dr(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:t,indexName:r},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ur(n))return{data:null,error:n};throw n}})}listIndexes(t){return ce(this,void 0,void 0,function*(){try{return{data:yield dr(this.fetch,`${this.url}/ListIndexes`,t,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ur(r))return{data:null,error:r};throw r}})}deleteIndex(t,r){return ce(this,void 0,void 0,function*(){try{return{data:(yield dr(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:t,indexName:r},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ur(n))return{data:null,error:n};throw n}})}}class mF{constructor(t,r={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Iv),r),this.fetch=Ov(n)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(t){return ce(this,void 0,void 0,function*(){try{if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield dr(this.fetch,`${this.url}/PutVectors`,t,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ur(r))return{data:null,error:r};throw r}})}getVectors(t){return ce(this,void 0,void 0,function*(){try{return{data:yield dr(this.fetch,`${this.url}/GetVectors`,t,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ur(r))return{data:null,error:r};throw r}})}listVectors(t){return ce(this,void 0,void 0,function*(){try{if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
538if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return{data:yield dr(this.fetch,`${this.url}/ListVectors`,t,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ur(r))return{data:null,error:r};throw r}})}queryVectors(t){return ce(this,void 0,void 0,function*(){try{return{data:yield dr(this.fetch,`${this.url}/QueryVectors`,t,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ur(r))return{data:null,error:r};throw r}})}deleteVectors(t){return ce(this,void 0,void 0,function*(){try{if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield dr(this.fetch,`${this.url}/DeleteVectors`,t,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ur(r))return{data:null,error:r};throw r}})}}class pF{constructor(t,r={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Iv),r),this.fetch=Ov(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(t){return ce(this,void 0,void 0,function*(){try{return{data:(yield dr(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ur(r))return{data:null,error:r};throw r}})}getBucket(t){return ce(this,void 0,void 0,function*(){try{return{data:yield dr(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:t},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ur(r))return{data:null,error:r};throw r}})}listBuckets(){return ce(this,arguments,void 0,function*(t={}){try{return{data:yield dr(this.fetch,`${this.url}/ListVectorBuckets`,t,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ur(r))return{data:null,error:r};throw r}})}deleteBucket(t){return ce(this,void 0,void 0,function*(){try{return{data:(yield dr(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ur(r))return{data:null,error:r};throw r}})}}class gF extends pF{constructor(t,r={}){super(t,r.headers||{},r.fetch)}from(t){return new xF(this.url,this.headers,t,this.fetch)}}class xF extends fF{constructor(t,r,n,s){super(t,r,s),this.vectorBucketName=n}createIndex(t){const r=Object.create(null,{createIndex:{get:()=>super.createIndex}});return ce(this,void 0,void 0,function*(){return r.createIndex.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const t=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return ce(this,arguments,void 0,function*(r={}){return t.listIndexes.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName}))})}getIndex(t){const r=Object.create(null,{getIndex:{get:()=>super.getIndex}});return ce(this,void 0,void 0,function*(){return r.getIndex.call(this,this.vectorBucketName,t)})}deleteIndex(t){const r=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return ce(this,void 0,void 0,function*(){return r.deleteIndex.call(this,this.vectorBucketName,t)})}index(t){return new vF(this.url,this.headers,this.vectorBucketName,t,this.fetch)}}class vF extends mF{constructor(t,r,n,s,a){super(t,r,a),this.vectorBucketName=n,this.indexName=s}putVectors(t){const r=Object.create(null,{putVectors:{get:()=>super.putVectors}});return ce(this,void 0,void 0,function*(){return r.putVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(t){const r=Object.create(null,{getVectors:{get:()=>super.getVectors}});return ce(this,void 0,void 0,function*(){return r.getVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const t=Object.create(null,{listVectors:{get:()=>super.listVectors}});return ce(this,arguments,void 0,function*(r={}){return t.listVectors.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(t){const r=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return ce(this,void 0,void 0,function*(){return r.queryVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(t){const r=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return ce(this,void 0,void 0,function*(){return r.deleteVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class yF extends aF{constructor(t,r={},n,s){super(t,r,n,s)}from(t){return new iF(this.url,this.headers,t,this.fetch)}get vectors(){return new gF(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new oF(this.url+"/iceberg",this.headers,this.fetch)}}const bF="2.83.0";let gl="";typeof Deno<"u"?gl="deno":typeof document<"u"?gl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?gl="react-native":gl="node";const wF={"X-Client-Info":`supabase-js-${gl}/${bF}`},jF={headers:wF},NF={schema:"public"},SF={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},_F={},kF=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),CF=()=>Headers,EF=(e,t,r)=>{const n=kF(r),s=CF();return async(a,o)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let u=new s(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),n(a,Object.assign(Object.assign({},o),{headers:u}))}};function PF(e){return e.endsWith("/")?e:e+"/"}function TF(e,t){var r,n;const{db:s,auth:a,realtime:o,global:l}=e,{db:c,auth:u,realtime:d,global:h}=t,f={db:Object.assign(Object.assign({},c),s),auth:Object.assign(Object.assign({},u),a),realtime:Object.assign(Object.assign({},d),o),storage:{},global:Object.assign(Object.assign(Object.assign({},h),l),{headers:Object.assign(Object.assign({},(r=h==null?void 0:h.headers)!==null&&r!==void 0?r:{}),(n=l==null?void 0:l.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function AF(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");
538if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(PF(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const HC="2.83.0",ja=30*1e3,jg=3,om=jg*ja,RF="http://localhost:9999",IF="supabase.auth.token",OF={"X-Client-Info":`gotrue-js/${HC}`},Ng="X-Supabase-Api-Version",KC={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},MF=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,DF=10*60*1e3;class mc extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function de(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class LF extends mc{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function $F(e){return de(e)&&e.name==="AuthApiError"}class ji extends mc{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class ni extends mc{constructor(t,r,n,s){super(t,n,s),this.name=r,this.status=n}}class ir extends ni{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function FF(e){return de(e)&&e.name==="AuthSessionMissingError"}class ua extends ni{constructor(){super("Auth session or user missing","AuthInvalidToken
538ResponseError",500,void 0)}}class Ru extends ni{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Iu extends ni{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function UF(e){return de(e)&&e.name==="AuthImplicitGrantRedirectError"}class cw extends ni{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Sg extends ni{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function lm(e){return de(e)&&e.name==="AuthRetryableFetchError"}class uw extends ni{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class _g extends ni{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Zd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),dw=` 539\r=`.split(""),VF=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<dw.length;t+=1)e[dw[t].charCodeAt(0)]=-2;for(let t=0;t<Zd.length;t+=1)e[Zd[t].charCodeAt(0)]=t;return e})();function hw(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Zd[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Zd[n]),t.queuedBits-=6}}function YC(e,t,r){const n=VF[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function fw(e){const t=[],r=o=>{t.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},a=o=>{GF(o,n,r)};for(let o=0;o<e.length;o+=1)YC(e.charCodeAt(o),s,a);return t.join("")}function BF(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 zF(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}BF(n,t)}}function GF(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;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&&r(t.codepoint)}}function Ja(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)YC(e.charCodeAt(s),r,n);return new Uint8Array(t)}function WF(e){const t=[];return zF(e,r=>t.push(r)),new Uint8Array(t)}function ki(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};return e.forEach(s=>hw(s,r,n)),hw(null,r,n),t.join("")}function qF(e){return Math.round(Date.now()/1e3)+e}function HF(){return Symbol("auth-callback")}const wt=()=>typeof window<"u"&&typeof document<"u",di={tested:!1,writable:!1},QC=()=>{if(!wt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(di.tested)return di.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),di.tested=!0,di.writable=!0}catch{di.tested=!0,di.writable=!1}return di.writable};function KF(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,a)=>{t[a]=s})}catch{}return r.searchParams.forEach((n,s)=>{t[s]=n}),t}const JC=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),YF=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Na=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},hi=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},hs=async(e,t)=>{await e.removeItem(t)};class Yh{constructor(){this.promise=new Yh.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}Yh.promiseConstructor=Promise;function cm(e){const t=e.split(".");if(t.length!==3)throw new _g("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!MF.test(t[n]))throw new _g("JWT not in base64url format");return{header:JSON.parse(fw(t[0])),payload:JSON.parse(fw(t[1])),signature:Ja(t[2]),raw:{header:t[0],payload:t[1]}}}async function QF(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function JF(e,t){return new Promise((n,s)=>{(async()=>{for(let a=0;a<1/0;a++)try{const o=await e(a);if(!t(a,null,o)){n(o);return}}catch(o){if(!t(a,o)){s(o);return}}})()})}function XF(e){return("0"+e.toString(16)).substr(-2)}function ZF(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let a=0;a<56;a++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(t),Array.from(t,XF).join("")}async function eU(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(a=>String.fromCharCode(a)).join("")}async function tU(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code
539challenge method will default to use plain instead of sha256."),e;const r=await eU(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function da(e,t,r=!1){const n=ZF();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await Na(e,`${t}-code-verifier`,s);const a=await tU(n);return[a,n===a?"plain":"s256"]}const rU=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function nU(e){const t=e.headers.get(Ng);if(!t||!t.match(rU))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function sU(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 iU(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 aU=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ha(e){if(!aU.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function um(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function oU(e,t){return new Proxy(e,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const a=n.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,n,s)}})}function mw(e){return JSON.parse(JSON.stringify(e))}const xi=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),lU=[502,503,504];async function pw(e){var t;if(!YF(e))throw new Sg(xi(e),0);if(lU.includes(e.status))throw new Sg(xi(e),e.status);let r;try{r=await e.json()}catch(a){throw new ji(xi(a),a)}let n;const s=nU(e);if(s&&s.getTime()>=KC["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new uw(xi(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new ir}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((a,o)=>a&&typeof o=="string",!0))throw new uw(xi(r),e.status,r.weak_password.reasons);throw new LF(xi(r),e.status||500,n)}const cU=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function fe(e,t,r,n){var s;const a=Object.assign({},n==null?void 0:n.headers);a[Ng]||(a[Ng]=KC["2024-01-01"].name),n!=null&&n.jwt&&(a.Authorization=`Bearer ${n.jwt}`);const o=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await uU(e,t,r+l,{headers:a,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function uU(e,t,r,n,s,a){const o=cU(t,n,s,a);let l;try{l=await e(r,Object.assign({},o))}catch(c){throw console.error(c),new Sg(xi(c),0)}if(l.ok||await pw(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(c){await pw(c)}}function Gr(e){var t;let r=null;fU(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=qF(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function gw(e){const t=Gr(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((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function ws(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function dU(e){return{data:e,error:null}}function hU(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:a}=e,o=ri(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:a},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function xw(e){return e}function fU(e){return e.access_token&&e.refresh_token&&e.expires_in}const dm=["global","local","others"];class mU{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=JC(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,r=dm[0]){if(dm.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${dm.j
539oin(", ")}`);try{return await fe(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(de(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await fe(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:ws})}catch(n){if(de(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=ri(t,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await fe(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:hU,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(de(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await fe(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:ws})}catch(r){if(de(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,s,a,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await fe(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""},xform:xw});if(d.error)throw d.error;const h=await d.json(),f=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(w=>{const g=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(w.split(";")[1].split("=")[1]);u[`${y}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(de(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){ha(t);try{return await fe(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:ws})}catch(r){if(de(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){ha(t);try{return await fe(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:ws})}catch(n){if(de(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){ha(t);try{return await fe(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:ws})}catch(n){if(de(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){ha(t.userId);try{const{data:r,error:n}=await fe(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(de(r))return{data:null,error:r};throw r}}async _deleteFactor(t){ha(t.userId),ha(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(r){if(de(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,s,a,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await fe(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""},xform:xw});if(d.error)throw d.error;const h=await d.json(),f=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(w=>{const g=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(w.split(";")[1].split("=")[1]);u[`${y}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(de(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await fe(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(de(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await fe(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(de(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await fe(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(de(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await fe(this.fetch,"DELET
539E",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(de(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await fe(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(de(r))return{data:null,error:r};throw r}}}function vw(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const fa={debug:!!(globalThis&&QC()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class XC extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class pU extends XC{}async function gU(e,t,r){fa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;return t>0&&setTimeout(()=>{n.abort(),fa.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:n.signal},async s=>{if(s){fa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await r()}finally{fa.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}else{if(t===0)throw fa.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new pU(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(fa.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null," "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}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 r()}}))}function xU(){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 ZC(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function vU(e){return parseInt(e,16)}function yU(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function bU(e){var t;const{chainId:r,domain:n,expirationTime:s,issuedAt:a=new Date,nonce:o,notBefore:l,requestId:c,resources:u,scheme:d,uri:h,version:f}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 540`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const m=ZC(e.address),w=d?`${d}://${n}`:n,g=e.statement?`${e.statement} 541`:"",y=`${w} wants you to sign in with your Ethereum account: 542${m} 543 544${g}`;let b=`URI: ${h} 545Version: ${f} 546Chain ID: ${r}${o?` 547Nonce: ${o}`:""} 548Issued At: ${a.toISOString()}`;if(s&&(b+=` 549Expiration Time: ${s.toISOString()}`),l&&(b+=` 550Not Before: ${l.toISOString()}`),c&&(b+=` 551Request ID: ${c}`),u){let v=` 552Resources:`;for(const x of u){if(!x||typeof x!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${x}`);v+=` 553- ${x}`}b+=v}return`${y} 554${b}`}
554class ct extends Error{constructor({message:t,code:r,cause:n,name:s}){var a;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(a=s??(n instanceof Error?n.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=r}}class eh extends ct{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function wU({error:e,options:t}){var r,n,s;const{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ct({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=a.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new ct({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=a.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new ct({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=a.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new ct({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 ct({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new ct({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return a.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new ct({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new ct({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(e2(o)){if(a.rp.id!==o)return new ct({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ct({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new ct({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 ct({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 ct({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function jU({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ct({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new ct({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(e2(n)){if(r.rpId!==n)return new ct({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ct({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new ct({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 ct({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class NU{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}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 SU=new NU;function _U(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:r,excludeCredentials:n}=e,s=ri(e,["challenge","user","excludeCredentials"]),a=Ja(t).buffer,o=Object.assign(Object.assign({},r),{id:Ja(r.id).buffer}),l=Object.assign(Object.assign({}
554,s),{challenge:a,user:o});if(n&&n.length>0){l.excludeCredentials=new Array(n.length);for(let c=0;c<n.length;c++){const u=n[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Ja(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function kU(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:r}=e,n=ri(e,["challenge","allowCredentials"]),s=Ja(t).buffer,a=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){a.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const l=r[o];a.allowCredentials[o]=Object.assign(Object.assign({},l),{id:Ja(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function CU(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:ki(new Uint8Array(e.response.attestationObject)),clientDataJSON:ki(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function EU(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:ki(new Uint8Array(s.authenticatorData)),clientDataJSON:ki(new Uint8Array(s.clientDataJSON)),signature:ki(new Uint8Array(s.signature)),userHandle:s.userHandle?ki(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function e2(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function yw(){var e,t;return!!(wt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function PU(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new eh("Browser returned unexpected credential type",t)}:{data:null,error:new eh("Empty credential response",t)}}catch(t){return{data:null,error:wU({error:t,options:e})}}}async function TU(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new eh("Browser returned unexpected credential type",t)}:{data:null,error:new eh("Empty credential response",t)}}catch(t){return{data:null,error:jU({error:t,options:e})}}}const AU={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},RU={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function th(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of e)if(s)for(const a in s){const o=s[a];if(o!==void 0)if(Array.isArray(o))n[a]=o;else if(r(o))n[a]=o;else if(t(o)){const l=n[a];t(l)?n[a]=th(l,o):n[a]=th(o)}else n[a]=o}return n}function IU(e,t){return th(AU,e,t||{})}function OU(e,t){return th(RU,e,t||{})}class MU{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:r,friendlyName:n,signal:s},a){try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!o)return{data:null,error:l};const c=s??SU.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:u}=o.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${n}`),u.displayName||(u.displayName=u.name)}
554switch(o.webauthn.type){case"create":{const u=IU(o.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:d,error:h}=await PU({publicKey:u,signal:c});return d?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}case"request":{const u=OU(o.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:d,error:h}=await TU(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:u,signal:c}));return d?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}}}catch(o){return de(o)?{data:null,error:o}:{data:null,error:new ji("Unexpected error in challenge",o)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},a){if(!r)return{data:null,error:new mc("rpId is required for WebAuthn authentication")};try{if(!yw())return{data:null,error:new ji("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:a});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:n,credential_response:c.credential_response}})}catch(o){return de(o)?{data:null,error:o}:{data:null,error:new ji("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},a){if(!r)return{data:null,error:new mc("rpId is required for WebAuthn registration")};try{if(!yw())return{data:null,error:new ji("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(d=>{var h;return(h=d.data)===null||h===void 0?void 0:h.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:a});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:n,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(o){return de(o)?{data:null,error:o}:{data:null,error:new ji("Unexpected error in register",o)}}}}xU();const DU={url:RF,storageKey:IF,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:OF,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function bw(e,t,r){return await r()}const ma={};class pc{get jwks(){var t,r;return(r=(t=ma[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){ma[this.storageKey]=Object.assign(Object.assign({},ma[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=ma[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){ma[this.storageKey]=Object.assign(Object.assign({},ma[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,s;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;const a=Object.assign(Object.assign({},DU),t);if(this.storageKey=a.storageKey,this.instanceID=(r=pc.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,pc.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&wt()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.admin=new mU({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=JC(a.fetch),this.lock=a.lock||bw,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,a.lock?this.lock=a.lock:wt()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=gU:this.lock=bw,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 MU(this)}
554,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(a.storage?this.storage=a.storage:QC()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=vw(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=vw(this.memoryStorage)),wt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${HC}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(wt()&&(r=KF(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),wt()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:a}=await this._getSessionFromURL(r,n);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),UF(a)){const c=(t=a.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:a}}return await this._removeSession(),{error:a}}const{session:o,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return de(r)?this._returnResult({error:r}):this._returnResult({error:new ji("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,s;try{const a=await fe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:Gr}),{data:o,error:l}=a;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(de(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(t){var r,n,s;try{let a;if("email"in t){const{email:d,password:h,options:f}=t;let m=null,w=null;this.flowType==="pkce"&&([m,w]=await da(this.storage,this.storageKey)),a=await fe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:d,password:h,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:m,code_challenge_method:w},xform:Gr})}else if("phone"in t){const{phone:d,password:h,options:f}=t;a=await fe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},channel:(s=f==null?void 0:f.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:Gr})}else throw new Ru("You must provide either an email or phone number and a password");const{data:o,error:l}=a;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(de(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(t){try{let r;if("email"in t){const{email:a,password:o,options:l}=t;r=await fe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:gw})}else if("phone"in t){const{phone:a,password:o,options:l}=t;r=await fe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:gw})}else throw new Ru("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const a=new ua;return this._returnResult({data:{user:null,session:null},error:a})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(de(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,s,a;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(a=t.o
554ptions)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,s,a,o,l,c,u,d,h,f;let m,w;if("message"in t)m=t.message,w=t.signature;else{const{chain:g,wallet:y,statement:b,options:v}=t;let x;if(wt())if(typeof y=="object")x=y;else{const P=window;if("ethereum"in P&&typeof P.ethereum=="object"&&"request"in P.ethereum&&typeof P.ethereum.request=="function")x=P.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=y}const j=new URL((r=v==null?void 0:v.url)!==null&&r!==void 0?r:window.location.href),N=await x.request({method:"eth_requestAccounts"}).then(P=>P).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=ZC(N[0]);let _=(n=v==null?void 0:v.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!_){const P=await x.request({method:"eth_chainId"});_=vU(P)}const k={domain:j.host,address:S,statement:b,uri:j.href,version:"1",chainId:_,nonce:(s=v==null?void 0:v.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(a=v==null?void 0:v.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=v==null?void 0:v.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=v==null?void 0:v.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=v==null?void 0:v.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=v==null?void 0:v.signInWithEthereum)===null||d===void 0?void 0:d.resources};m=bU(k),w=await x.request({method:"personal_sign",params:[yU(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:w},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Gr});if(y)throw y;if(!g||!g.session||!g.user){const b=new ua;return this._returnResult({data:{user:null,session:null},error:b})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:y})}catch(g){if(de(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var r,n,s,a,o,l,c,u,d,h,f,m;let w,g;if("message"in t)w=t.message,g=t.signature;else{const{chain:y,wallet:b,statement:v,options:x}=t;let j;if(wt())if(typeof b=="object")j=b;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 b!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=b}const N=new URL((r=x==null?void 0:x.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in j&&j.signIn){const S=await j.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x==null?void 0:x.signInWithSolana),{version:"1",domain:N.host,uri:N.href}),v?{statement:v}:null));let _;if(Array.isArray(S)&&S[0]&&typeof S[0]=="object")_=S[0];else if(S&&typeof S=="object"&&"signedMessage"in S&&"signature"in S)_=S;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)w=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),g=_.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");w=[`${N.host} wants you to sign in with your Solana account:`,j.publicKey.toBase58(),...v?["",v,""]:[""],"Version: 1",`URI: ${N.href}`,`Issued At: ${(s=(n=x==null?void 0:x.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((a=x==null?void 0:x.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((o=x==null?void 0:x.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${x.signInWithSolana.expirationTime}`]:[],...!((l=x==null?void 0:x.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((c=x==null?void 0:x.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((u=x==null?void 0:x.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((h=(d=x==null?void 0:x.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...x.signInWithSolana.resources.map(_=>`- ${_}`)]:[]].join(` 555`);const S=await j.signMessage(new TextEncoder().encode(w),"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:b}=await fe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:ki(g)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:Gr});if(b)throw b;if(!y||!y.session||!y.user){const v=new ua;return this._returnResult({data:{user:null,session:null},error:v})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:b})}catch(y){if(de(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async _exchangeCodeForSession(t){const r=await hi(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{const{data:a,error:o}=await fe(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:Gr});if(await hs(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const l=new ua;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:s??null}),error:o})}catch(a){if(de(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(t){try{const{options:r,provider:n,token:s,access_token:a,nonce:o}=t,l=await fe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:a,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Gr}),{data:c,error:u}=l;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new ua;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(r){if(de(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,s,a,o;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await da(this.storage,this.storageKey));const{error:h}=await fe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(n=c==null?void 0:c.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await fe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(a=c==null?void 0:c.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new Ru("You must provide either an email or phone number.")}catch(l){if(de(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var r,n;try{let s,a;"options"in t&&(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo,a=(n=t.options)===null||n===void 0?void 0:n.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:a}}),redirectTo:s,xform:Gr});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(de(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var r,n,s,a,o;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await da(this.storage,this.storageKey));const u=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:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:dU});return!((a=u.data)===null||a===void 0)&&a.url&&wt()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(de(l))return this._returnResult({data:null,error:l});throw l}}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:r},error:n}=t;if(n)throw n;if(!r)throw new ir;const{error:s}=await fe(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(de(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:s,options:a}=t,{error:o}=await fe(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:n,type:s,options:a}=t,{data:o,error:l}=await fe(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new Ru("You must provide either an email or phone number and a type")}catch(r){if(de(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}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 r=await hi(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
555id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<om:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const o=await hi(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=um()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=oU(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:s},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:ws}):await this._useSession(async r=>{var n,s,a;const{data:o,error:l}=r;if(l)throw l;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new ir}:await fe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&a!==void 0?a:void 0,xform:ws})})}catch(r){if(de(r))return FF(r)&&(await this._removeSession(),await hs(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:s,error:a}=n;if(a)throw a;if(!s.session)throw new ir;const o=s.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await da(this.storage,this.storageKey));const{data:u,error:d}=await fe(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:ws});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(de(n))return this._returnResult({data:{user:null},error:n});throw n}}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 ir;const r=Date.now()/1e3;let n=r,s=!0,a=null;const{payload:o}=cm(t.access_token);if(o.exp&&(n=o.exp,s=n<=r),s){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};a=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)throw c;a={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(r){if(de(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}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 r=>{var n;if(!t){const{data:o,error:l}=r;if(l)throw l;t=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new ir;const{data:s,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(de(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!wt())throw new Iu("No browser detected.");
555if(t.error||t.error_description||t.error_code)throw new Iu(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new cw("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Iu("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new cw("No code detected.");const{data:v,error:x}=await this._exchangeCodeForSession(t.code);if(x)throw x;const j=new URL(window.location.href);return j.searchParams.delete("code"),window.history.replaceState(window.history.state,"",j.toString()),{data:{session:v.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:a,refresh_token:o,expires_in:l,expires_at:c,token_type:u}=t;if(!a||!l||!o||!u)throw new Iu("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(l);let f=d+h;c&&(f=parseInt(c));const m=f-d;m*1e3<=ja&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${h}s`);const w=f-h;d-w>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",w,f,d):d-w<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",w,f,d);const{data:g,error:y}=await this._getUser(a);if(y)throw y;const b={provider_token:n,provider_refresh_token:s,access_token:a,expires_in:h,expires_at:f,refresh_token:o,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:b,redirectType:t.type},error:null})}catch(n){if(de(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await hi(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}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 r=>{var n;const{data:s,error:a}=r;if(a)return this._returnResult({error:a});const o=(n=s.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!($F(l)&&(l.status===404||l.status===401||l.status===403)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await hs(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=HF(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,s;try{const{data:{session:a},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",t,"session",a)}catch(a){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",a),console.error(a)}})}async resetPasswordForEmail(t,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await da(this.storage,this.storageKey,!0));try{return await fe(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(a){if(de(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(de(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:s}=await this._useSession(async a=>{var o,l,c,u,d;const{data:h,error:f}=a;if(f)throw f;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:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return wt()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(de(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:a}}=r;if(s)throw s;const{options:o,provider:l,token:c,access_token:u,nonce:d}=t,h=await fe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=a==null?void 0:a.access_token)!==null&&n!==void 0?n:void 0,body:{provider:l,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Gr}),{data:f,error:m}=h;return m?this._returnResult({data:{user:null,session:null},error:m}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new ua}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:m}))}catch(s){if(de(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,s;const{data:a,error:o}=r;if(o)throw o;
555return await fe(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(n=a.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(de(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await JF(async s=>(s>0&&await QF(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await fe(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Gr})),(s,a)=>{const o=200*Math.pow(2,s);return a&&lm(a)&&Date.now()+o-n<ja})}catch(n){if(this._debug(r,"error",n),de(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),wt()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await hi(this.storage,this.storageKey);if(s&&this.userStorage){let o=await hi(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await Na(this.userStorage,this.storageKey+"-user",o)),s.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:um()}else if(s&&!s.user&&!s.user){const o=await hi(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await hs(this.storage,this.storageKey+"-user"),await Na(this.storage,this.storageKey,s)):s.user=um()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const a=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<om;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${om}s`),a){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),lm(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(s.access_token);!l&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new ir;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Yh;const{data:a,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!a.session)throw new ir;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const l={data:a.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(a){if(this._debug(s,"error",a),de(a)){const o={data:null,error:a};return lm(a)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(a),a}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,r,n=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const a=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,r)}catch(c){a.push(c)}});if(await Promise.all(o),a.length>0){for(let l=0;l<a.length;l+=1)console.error(a[l]);throw a[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Na(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const a=mw(s);await Na(this.storage,this.storageKey,a)}else{const s=mw(r);await Na(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),await hs(this.storage,this.storageKey),await hs(this.storage,this.storageKey+"-code-verifier"),await hs(this.storage,this.storageKey+"-user"),this.userStorage&&await hs(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;
555try{t&&wt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),ja);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 r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-t)/ja);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${ja}ms, refresh threshold is ${jg} ticks`),s<=jg&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof XC)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!wt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>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 r=`#_onVisibilityChanged(${t})`;this._debug(r,"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(r,"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,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[a,o]=await da(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(l.toString())}if(n!=null&&n.queryParams){const a=new URLSearchParams(n.queryParams);s.push(a.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:s,error:a}=r;return a?this._returnResult({data:null,error:a}):await fe(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(de(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,s;const{data:a,error:o}=r;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await fe(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if(de(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?CU(t.webauthn.credential_response):EU(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:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(r){if(de(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=await fe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.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:_U(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:kU(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(de(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const a of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])s.all.push(a),a.status==="verified"&&s[a.factor_type].push(a);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(){var t,r;const{data:{session:n},error:s}
555=await this.getSession();if(s)return this._returnResult({data:null,error:s});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=cm(n.access_token);let o=null;a.aal&&(o=a.aal);let l=o;((r=(t=n.user.factors)===null||t===void 0?void 0:t.filter(d=>d.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");const u=a.amr||[];return{data:{currentLevel:o,nextLevel:l,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await fe(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new ir})})}catch(r){if(de(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new ir});const o=await fe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&wt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(de(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new ir});const o=await fe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&wt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(de(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await fe(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new ir})})}catch(t){if(de(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await fe(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},xform:()=>({data:{},error:null})}):this._returnResult({data:null,error:new ir})})}catch(r){if(de(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(l=>l.kid===t);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(l=>l.kid===t),n&&this.jwks_cached_at+DF>s)return n;const{data:a,error:o}=await fe(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=s,n=a.keys.find(l=>l.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:m,error:w}
555=await this.getSession();if(w||!m.session)return this._returnResult({data:null,error:w});n=m.session.access_token}const{header:s,payload:a,signature:o,raw:{header:l,payload:c}}=cm(n);r!=null&&r.allowExpired||sU(a.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:m}=await this.getUser(n);if(m)throw m;return{data:{claims:a,header:s,signature:o},error:null}}const d=iU(s.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,o,WF(`${l}.${c}`)))throw new _g("Invalid JWT signature");return{data:{claims:a,header:s,signature:o},error:null}}catch(n){if(de(n))return this._returnResult({data:null,error:n});throw n}}}pc.nextInstanceID={};const LU=pc;class $U extends LU{constructor(t){super(t)}}class FU{constructor(t,r,n){var s,a,o;this.supabaseUrl=t,this.supabaseKey=r;const l=AF(t);if(!r)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`,u={db:NF,realtime:_F,auth:Object.assign(Object.assign({},SF),{storageKey:c}),global:jF},d=TF(n??{},u);this.storageKey=(s=d.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(a=d.global.headers)!==null&&a!==void 0?a:{},d.accessToken?(this.accessToken=d.accessToken,this.auth=new Proxy({},{get:(h,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=d.auth)!==null&&o!==void 0?o:{},this.headers,d.global.fetch),this.fetch=EF(r,this._getAccessToken.bind(this),d.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},d.realtime)),this.accessToken&&this.accessToken().then(h=>this.realtime.setAuth(h)).catch(h=>console.warn("Failed to set initial Realtime auth token:",h)),this.rest=new R$(new URL("rest/v1",l).href,{headers:this.headers,schema:d.db.schema,fetch:this.fetch}),this.storage=new yF(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),d.accessToken||this._listenForAuthEvents()}get functions(){return new P$(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,r={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,r,n)}channel(t,r={config:{}}){return this.realtime.channel(t,r)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t,r;if(this.accessToken)return await this.accessToken();const{data:n}=await this.auth.getSession();return(r=(t=n.session)===null||t===void 0?void 0:t.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:a,storageKey:o,flowType:l,lock:c,debug:u,throwOnError:d},h,f){const m={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new $U({url:this.authUrl.href,headers:Object.assign(Object.assign({},m),h),storageKey:o,autoRefreshToken:t,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:a,flowType:l,lock:c,debug:u,throwOnError:d,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(w=>w.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new Y$(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((r,n)=>{this._handleTokenChanged(r,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(t,r,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const UU=(e,t,r)=>new FU(e,t,r);function VU(){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}VU()&&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
555ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const BU="https://jocpxkmlukhfmvcxuayv.supabase.co",zU="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImpvY3B4a21sdWtoZm12Y3h1YXl2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjM1MTg0NDcsImV4cCI6MjA3OTA5NDQ0N30.VrD_uANd_GdDggWZsJHpkgJuQPRST3f-ZBdZ8h72oL8",Y=UU(BU,zU,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}});function Tt(){const[e,t]=p.useState(null),[r,n]=p.useState(null),[s,a]=p.useState(null),[o,l]=p.useState(!0);p.useEffect(()=>{const{data:{subscription:d}}=Y.auth.onAuthStateChange((h,f)=>{n(f),t((f==null?void 0:f.user)??null),f!=null&&f.user?setTimeout(()=>{c(f.user.id)},0):a(null)});return Y.auth.getSession().then(({data:{session:h}})=>{n(h),t((h==null?void 0:h.user)??null),h!=null&&h.user&&c(h.user.id),l(!1)}),()=>d.unsubscribe()},[]);const c=async d=>{const{data:h,error:f}=await Y.from("users_meta").select("*").eq("user_id",d).maybeSingle();if(f){console.error("Error fetching user meta:",f);return}a(h)};return{user:e,session:r,userMeta:s,loading:o,refreshUserMeta:()=>{e&&c(e.id)}}}const Rl=p.forwardRef(({className:e,activeClassName:t,pendingClassName:r,to:n,...s},a)=>i.jsx(Jk,{ref:a,to:n,className:({isActive:o,isPending:l})=>J(e,o&&t,l&&r),...s}));Rl.displayName="NavLink";const GU=Io("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),B=p.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},a)=>{const o=n?Ro:"button";return i.jsx(o,{className:J(GU({variant:t,size:r,className:e})),ref:a,...s})});B.displayName="Button";function Mv({className:e}){const{theme:t,setTheme:r}=gL(),n=t==="dark"||t==="system"&&window.matchMedia("(prefers-color-scheme: dark)").matches;return i.jsx(B,{variant:"ghost",size:"icon",className:e,onClick:()=>r(n?"light":"dark"),"aria-label":"Toggle theme",children:n?i.jsx(E4,{className:"w-4 h-4"}):i.jsx(y4,{className:"w-4 h-4"})})}var t2={exports:{}},r2={};/** 556 * @license React 557 * use-sync-external-store-shim.production.js 558 * 559 * Copyright (c) Meta Platforms, Inc. and affiliates. 560 * 561 * This source code is licensed under the MIT license found in the 562 * LICENSE file in the root directory of this source tree. 563 */var ko=p;function WU(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qU=typeof Object.is=="function"?Object.is:WU,HU=ko.useState,KU=ko.useEffect,YU=ko.useLayoutEffect,QU=ko.useDebugValue;function JU(e,t){var r=t(),n=HU({inst:{value:r,getSnapshot:t}}),s=n[0].inst,a=n[1];return YU(function(){s.value=r,s.getSnapshot=t,hm(s)&&a({inst:s})},[e,r,t]),KU(function(){return hm(s)&&a({inst:s}),e(function(){hm(s)&&a({inst:s})})},[e]),QU(r),r}function hm(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!qU(e,r)}catch{return!0}}function XU(e,t){return t()}var ZU=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?XU:JU;r2.useSyncExternalStore=ko.useSyncExternalStore!==void 0?ko.useSyncExternalStore:ZU;t2.exports=r2;var e6=t2.exports;function t6(){return e6.useSyncExternalStore(r6,()=>!0,()=>!1)}function r6(){return()=>{}}var Dv="Avatar",[n6,cK]=Kt(Dv),[s6,n2]=n6(Dv),s2=p.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[s,a]=p.useState("idle");return i.jsx(s6,{scope:r,imageLoadingStatus:s,onImageLoadingStatusChange:a,children:i.jsx(ue.span,{...n,ref:t})})});s2.displayName=Dv;var i2="AvatarImage",a2=p.forwardRef((e,t)=>
vendor: 6,803 bytes, line 563
563{const{__scopeAvatar:r,src:n,onLoadingStatusChange:s=()=>{},...a}=e,o=n2(i2,r),l=i6(n,a),c=gr(u=>{s(u),o.onImageLoadingStatusChange(u)});return ht(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?i.jsx(ue.img,{...a,ref:t,src:n}):null});a2.displayName=i2;var o2="AvatarFallback",l2=p.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...s}=e,a=n2(o2,r),[o,l]=p.useState(n===void 0);return p.useEffect(()=>{if(n!==void 0){const c=window.setTimeout(()=>l(!0),n);return()=>window.clearTimeout(c)}},[n]),o&&a.imageLoadingStatus!=="loaded"?i.jsx(ue.span,{...s,ref:t}):null});l2.displayName=o2;function ww(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function i6(e,{referrerPolicy:t,crossOrigin:r}){const n=t6(),s=p.useRef(null),a=n?(s.current||(s.current=new window.Image),s.current):null,[o,l]=p.useState(()=>ww(a,e));return ht(()=>{l(ww(a,e))},[a,e]),ht(()=>{const c=h=>()=>{l(h)};if(!a)return;const u=c("loaded"),d=c("error");return a.addEventListener("load",u),a.addEventListener("error",d),t&&(a.referrerPolicy=t),typeof r=="string"&&(a.crossOrigin=r),()=>{a.removeEventListener("load",u),a.removeEventListener("error",d)}},[a,r,t]),o}var c2=s2,u2=a2,d2=l2;const Lv=p.forwardRef(({className:e,...t},r)=>i.jsx(c2,{ref:r,className:J("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Lv.displayName=c2.displayName;const a6=p.forwardRef(({className:e,...t},r)=>i.jsx(u2,{ref:r,className:J("aspect-square h-full w-full",e),...t}));a6.displayName=u2.displayName;const $v=p.forwardRef(({className:e,...t},r)=>i.jsx(d2,{ref:r,className:J("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));$v.displayName=d2.displayName;const fm=768;function o6(){const[e,t]=p.useState(void 0);return p.useEffect(()=>{const r=window.matchMedia(`(max-width: ${fm-1}px)`),n=()=>{t(window.innerWidth<fm)};return r.addEventListener("change",n),t(window.innerWidth<fm),()=>r.removeEventListener("change",n)},[]),!!e}const tt=p.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{type:t,className:J("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));tt.displayName="Input";var l6="Separator",jw="horizontal",c6=["horizontal","vertical"],h2=p.forwardRef((e,t)=>{const{decorative:r,orientation:n=jw,...s}=e,a=u6(n)?n:jw,l=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return i.jsx(ue.div,{"data-orientation":a,...l,...s,ref:t})});h2.displayName=l6;function u6(e){return c6.includes(e)}var f2=h2;const m2=p.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>i.jsx(f2,{ref:s,decorative:r,orientation:t,className:J("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));m2.displayName=f2.displayName;var mm="focusScope.autoFocusOnMount",pm="focusScope.autoFocusOnUnmount",Nw={bubbles:!1,cancelable:!0},d6="FocusScope",Fv=p.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=p.useState(null),u=gr(s),d=gr(a),h=p.useRef(null),f=je(t,g=>c(g)),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(n){let g=function(x){if(m.paused||!l)return;const j=x.target;l.contains(j)?h.current=j:ps(h.current,{select:!0})},y=function(x){if(m.paused||!l)return;const j=x.relatedTarget;j!==null&&(l.contains(j)||ps(h.current,{select:!0}))},b=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&ps(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const v=new MutationObserver(b);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),v.disconnect()}}},[n,l,m.paused]),p.useEffect(()=>{if(l){_w.add(m);const g=document.activeElement;if(!l.contains(g)){const b=new CustomEvent(mm,Nw);l.addEventListener(mm,u),l.dispatchEvent(b),b.defaultPrevented||(h6(x6(p2(l)),{select:!0}),document.activeElement===g&&ps(l))}return()=>{l.removeEventListener(mm,u),setTimeout(()=>{const b=new CustomEvent(pm,Nw);l.addEventListener(pm,d),l.dispatchEvent(b),b.defaultPrevented||ps(g??document.body,{select:!0}),l.removeEventListener(pm,d),_w.remove(m)},0)}}},[l,u,d,m]);const w=p.useCallback(g=>{if(!r&&!n||m.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(y&&b){const v=g.currentTarget,[x,j]=f6(v);x&&j?!g.shiftKey&&b===j?(g.preventDefault(),r&&ps(x,{select:!0})):g.shiftKey&&b===x&&(g.preventDefault(),r&&ps(j,{select:!0})):b===v&&g.preventDefault()}},[r,n,m.paused]);return i.jsx(ue.div,{tabIndex:-1,...o,ref:f,onKeyDown:w})});Fv.displayName=d6;function h6(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ps(n,{select:t}),document.activeElement!==r)return}function f6(e){const t=p2(e),r=Sw(t,e),n=Sw(t.reverse(),e);return[r,n]}function p2(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Sw(e,t){for(const r of e)if(!m6(r,{upTo:t}))return r}function m6(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 p6(e){return e instanceof HTMLInputElement&&"select"in e}function ps(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&p6(e)&&t&&e.select()}}var _w=g6();function g6(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=kw(e,t),e.unshift(t)},remove(t){var r;e=kw(e,t),(r=e[0])==null||r.resume()}}}function kw(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function x6(e){return e.filter(t=>t.tagName!=="A")}var gm=0;function g2(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cw()),document.body.insertAdjacentElement("beforeend",e[1]??Cw()),gm++,()=>{gm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),gm--}},[])}function Cw(){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: 4,904 bytes, lines 563-578
563style.position="fixed",e.style.pointerEvents="none",e}var od="right-scroll-bar-position",ld="width-before-scroll-bar",v6="with-scroll-bars-hidden",y6="--removed-body-scroll-bar-size";function xm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function b6(e,t){var r=p.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var w6=typeof window<"u"?p.useLayoutEffect:p.useEffect,Ew=new WeakMap;function j6(e,t){var r=b6(null,function(n){return e.forEach(function(s){return xm(s,n)})});return w6(function(){var n=Ew.get(r);if(n){var s=new Set(n),a=new Set(e),o=r.current;s.forEach(function(l){a.has(l)||xm(l,null)}),a.forEach(function(l){s.has(l)||xm(l,o)})}Ew.set(r,e)},[e]),r}function N6(e){return e}function S6(e,t){t===void 0&&(t=N6);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var o=t(a,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(n=!0;r.length;){var o=r;r=[],o.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(a),o=r}var c=function(){var d=o;o=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),r}}}};return s}function _6(e){e===void 0&&(e={});var t=S6(null);return t.options=Tr({async:!0,ssr:!1},e),t}var x2=function(e){var t=e.sideCar,r=ri(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return p.createElement(n,Tr({},r))};x2.isSideCarExport=!0;function k6(e,t){return e.useMedium(t),x2}var v2=_6(),vm=function(){},Qh=p.forwardRef(function(e,t){var r=p.useRef(null),n=p.useState({onScrollCapture:vm,onWheelCapture:vm,onTouchMoveCapture:vm}),s=n[0],a=n[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,m=e.noRelative,w=e.noIsolation,g=e.inert,y=e.allowPinchZoom,b=e.as,v=b===void 0?"div":b,x=e.gapMode,j=ri(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=f,S=j6([r,t]),_=Tr(Tr({},j),s);return p.createElement(p.Fragment,null,d&&p.createElement(N,{sideCar:v2,removeScrollBar:u,shards:h,noRelative:m,noIsolation:w,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:r,gapMode:x}),o?p.cloneElement(p.Children.only(l),Tr(Tr({},_),{ref:S})):p.createElement(v,Tr({},_,{className:c,ref:S}),l))});Qh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qh.classNames={fullWidth:ld,zeroRight:od};var C6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function E6(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=C6();return t&&e.setAttribute("nonce",t),e}function P6(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function T6(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var A6=function(){var e=0,t=null;return{add:function(r){e==0&&(t=E6())&&(P6(t,r),T6(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},R6=function(){var e=A6();return function(t,r){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},y2=function(){var e=R6(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},I6={left:0,top:0,right:0,gap:0},ym=function(e){return parseInt(e||"",10)||0},O6=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[ym(r),ym(n),ym(s)]},M6=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return I6;var t=O6(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},D6=y2(),Xa="data-scroll-locked",L6=function(e,t,r,n){var s=e.left,a=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),` 564 .`.concat(v6,` { 565 overflow: hidden `).concat(n,`; 566 padding-right: `).concat(l,"px ").concat(n,`; 567 } 568 body[`).concat(Xa,`] { 569 overflow: hidden `).concat(n,`; 570 overscroll-behavior: contain; 571 `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` 572 padding-left: `.concat(s,`px; 573 padding-top: `).concat(a,`px; 574 padding-right: `).concat(o,`px; 575 margin-left:0; 576 margin-top:0; 577 margin-right: `).concat(l,"px ").concat(n,`; 578 `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";
578")].filter(Boolean).join(""),` 579 } 580 581 .`).concat(od,` { 582 right: `).concat(l,"px ").concat(n,`; 583 } 584 585 .`).concat(ld,` { 586 margin-right: `).concat(l,"px ").concat(n,`; 587 } 588 589 .`).concat(od," .").concat(od,` { 590 right: 0 `).concat(n,`; 591 } 592 593 .`).concat(ld," .").concat(ld,` { 594 margin-right: 0 `).concat(n,`; 595 } 596 597 body[`).concat(Xa,`] { 598 `).concat(y6,": ").concat(l,`px; 599 } 600`)},Pw=function(){var e=parseInt(document.body.getAttribute(Xa)||"0",10);return isFinite(e)?e:0},$6=function(){p.useEffect(function(){return document.body.setAttribute(Xa,(Pw()+1).toString()),function(){var e=Pw()-1;e<=0?document.body.removeAttribute(Xa):document.body.setAttribute(Xa,e.toString())}},[])},F6=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;$6();var a=p.useMemo(function(){return M6(s)},[s]);return p.createElement(D6,{styles:L6(a,!t,s,r?"":"!important")})},kg=!1;if(typeof window<"u")try{var Ou=Object.defineProperty({},"passive",{get:function(){return kg=!0,!0}});window.addEventListener("test",Ou,Ou),window.removeEventListener("test",Ou,Ou)}catch{kg=!1}var pa=kg?{passive:!1}:!1,U6=function(e){return e.tagName==="TEXTAREA"},b2=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!U6(e)&&r[t]==="visible")},V6=function(e){return b2(e,"overflowY")},B6=function(e){return b2(e,"overflowX")},Tw=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=w2(e,n);if(s){var a=j2(e,n),o=a[1],l=a[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},z6=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},G6=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},w2=function(e,t){return e==="v"?V6(t):B6(t)},j2=function(e,t){return e==="v"?z6(t):G6(t)},W6=function(e,t){return e==="h"&&t==="rtl"?-1:1},q6=function(e,t,r,n,s){var a=W6(e,window.getComputedStyle(t).direction),o=a*n,l=r.target,c=t.contains(l),u=!1,d=o>0,h=0,f=0;do{if(!l)break;var m=j2(e,l),w=m[0],g=m[1],y=m[2],b=g-y-a*w;(w||b)&&w2(e,l)&&(h+=b,f+=w);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(u=!0),u}
vendor: 5,298 bytes, lines 600-603
600,Mu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Aw=function(e){return[e.deltaX,e.deltaY]},Rw=function(e){return e&&"current"in e?e.current:e},H6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},K6=function(e){return` 601 .block-interactivity-`.concat(e,` {pointer-events: none;} 602 .allow-interactivity-`).concat(e,` {pointer-events: all;} 603`)},Y6=0,ga=[];function Q6(e){var t=p.useRef([]),r=p.useRef([0,0]),n=p.useRef(),s=p.useState(Y6++)[0],a=p.useState(y2)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=kv([e.lockRef.current],(e.shards||[]).map(Rw),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var b=Mu(g),v=r.current,x="deltaX"in g?g.deltaX:v[0]-b[0],j="deltaY"in g?g.deltaY:v[1]-b[1],N,S=g.target,_=Math.abs(x)>Math.abs(j)?"h":"v";if("touches"in g&&_==="h"&&S.type==="range")return!1;var k=Tw(_,S);if(!k)return!0;if(k?N=_:(N=_==="v"?"h":"v",k=Tw(_,S)),!k)return!1;if(!n.current&&"changedTouches"in g&&(x||j)&&(n.current=N),!N)return!0;var P=n.current||N;return q6(P,y,g,P==="h"?x:j,!0)},[]),c=p.useCallback(function(g){var y=g;if(!(!ga.length||ga[ga.length-1]!==a)){var b="deltaY"in y?Aw(y):Mu(y),v=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&H6(N.delta,b)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(o.current.shards||[]).map(Rw).filter(Boolean).filter(function(N){return N.contains(y.target)}),j=x.length>0?l(y,x[0]):!o.current.noIsolation;j&&y.cancelable&&y.preventDefault()}}},[]),u=p.useCallback(function(g,y,b,v){var x={name:g,delta:y,target:b,should:v,shadowParent:J6(b)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(j){return j!==x})},1)},[]),d=p.useCallback(function(g){r.current=Mu(g),n.current=void 0},[]),h=p.useCallback(function(g){u(g.type,Aw(g),g.target,l(g,e.lockRef.current))},[]),f=p.useCallback(function(g){u(g.type,Mu(g),g.target,l(g,e.lockRef.current))},[]);p.useEffect(function(){return ga.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,pa),document.addEventListener("touchmove",c,pa),document.addEventListener("touchstart",d,pa),function(){ga=ga.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,pa),document.removeEventListener("touchmove",c,pa),document.removeEventListener("touchstart",d,pa)}},[]);var m=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(a,{styles:K6(s)}):null,m?p.createElement(F6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function J6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const X6=k6(v2,Q6);var Uv=p.forwardRef(function(e,t){return p.createElement(Qh,Tr({},e,{ref:t,sideCar:X6}))});Uv.classNames=Qh.classNames;var Z6=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xa=new WeakMap,Du=new WeakMap,Lu={},bm=0,N2=function(e){return e&&(e.host||N2(e.parentNode))},eV=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=N2(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},tV=function(e,t,r,n){var s=eV(t,Array.isArray(e)?e:[e]);Lu[r]||(Lu[r]=new WeakMap);var a=Lu[r],o=[],l=new Set,c=new Set(s),u=function(h){!h||l.has(h)||(l.add(h),u(h.parentNode))};s.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(f){if(l.has(f))d(f);else try{var m=f.getAttribute(n),w=m!==null&&m!=="false",g=(xa.get(f)||0)+1,y=(a.get(f)||0)+1;xa.set(f,g),a.set(f,y),o.push(f),g===1&&w&&Du.set(f,!0),y===1&&f.setAttribute(r,"true"),w||f.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),l.clear(),bm++,function(){o.forEach(function(h){var f=xa.get(h)-1,m=a.get(h)-1;xa.set(h,f),a.set(h,m),f||(Du.has(h)||h.removeAttribute(n),Du.delete(h)),m||h.removeAttribute(r)}),bm--,bm||(xa=new WeakMap,xa=new WeakMap,Du=new WeakMap,Lu={})}},S2=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=Z6(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),tV(n,s,r,"aria-hidden")):function(){return null}},Jh="Dialog",[_2,uK]=Kt(Jh),[rV,hn]=_2(Jh),k2=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=p.useRef(null),c=p.useRef(null),[u,d]=sn({prop:n,defaultProp:s??!1,onChange:a,caller:Jh});return i.jsx(rV,{scope:t,triggerRef:l,contentRef:c,contentId:Hn(),titleId:Hn(),descriptionId:Hn(),open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(h=>!h),[d]),modal:o,children:r})};k2.displayName=Jh;var C2="DialogTrigger",nV=p.forwardRef((e,t)=>
vendor: 3,710 bytes, line 603
603{const{__scopeDialog:r,...n}=e,s=hn(C2,r),a=je(t,s.triggerRef);return i.jsx(ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":zv(s.open),...n,ref:a,onClick:oe(e.onClick,s.onOpenToggle)})});nV.displayName=C2;var Vv="DialogPortal",[sV,E2]=_2(Vv,{forceMount:void 0}),P2=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,a=hn(Vv,t);return i.jsx(sV,{scope:t,forceMount:r,children:p.Children.map(n,o=>i.jsx(ss,{present:r||a.open,children:i.jsx(Rh,{asChild:!0,container:s,children:o})}))})};P2.displayName=Vv;var rh="DialogOverlay",T2=p.forwardRef((e,t)=>{const r=E2(rh,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,a=hn(rh,e.__scopeDialog);return a.modal?i.jsx(ss,{present:n||a.open,children:i.jsx(aV,{...s,ref:t})}):null});T2.displayName=rh;var iV=bo("DialogOverlay.RemoveScroll"),aV=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=hn(rh,r);return i.jsx(Uv,{as:iV,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(ue.div,{"data-state":zv(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Ji="DialogContent",A2=p.forwardRef((e,t)=>{const r=E2(Ji,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,a=hn(Ji,e.__scopeDialog);return i.jsx(ss,{present:n||a.open,children:a.modal?i.jsx(oV,{...s,ref:t}):i.jsx(lV,{...s,ref:t})})});A2.displayName=Ji;var oV=p.forwardRef((e,t)=>{const r=hn(Ji,e.__scopeDialog),n=p.useRef(null),s=je(t,r.contentRef,n);return p.useEffect(()=>{const a=n.current;if(a)return S2(a)},[]),i.jsx(R2,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:oe(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:oe(e.onFocusOutside,a=>a.preventDefault())})}),lV=p.forwardRef((e,t)=>{const r=hn(Ji,e.__scopeDialog),n=p.useRef(!1),s=p.useRef(!1);return i.jsx(R2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),a.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),R2=p.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,...o}=e,l=hn(Ji,r),c=p.useRef(null),u=je(t,c);return g2(),i.jsxs(i.Fragment,{children:[i.jsx(Fv,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx($c,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":zv(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(cV,{titleId:l.titleId}),i.jsx(dV,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Bv="DialogTitle",I2=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=hn(Bv,r);return i.jsx(ue.h2,{id:s.titleId,...n,ref:t})});I2.displayName=Bv;var O2="DialogDescription",M2=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=hn(O2,r);return i.jsx(ue.p,{id:s.descriptionId,...n,ref:t})});M2.displayName=O2;var D2="DialogClose",L2=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=hn(D2,r);return i.jsx(ue.button,{type:"button",...n,ref:t,onClick:oe(e.onClick,()=>s.onOpenChange(!1))})});L2.displayName=D2;function zv(e){return e?"open":"closed"}
603var $2="DialogTitleWarning",[dK,F2]=lM($2,{contentName:Ji,titleName:Bv,docsSlug:"dialog"}),cV=({titleId:e})=>{const t=F2($2),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 604 605If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 606 607For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},uV="DialogDescriptionWarning",dV=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${F2(uV).contentName}}.`;return p.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},U2=k2,V2=P2,Xh=T2,Zh=A2,ef=I2,tf=M2,B2=L2;const hV=U2,fV=V2,z2=p.forwardRef(({className:e,...t},r)=>i.jsx(Xh,{className:J("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:r}));z2.displayName=Xh.displayName;const mV=Io("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"}}),G2=p.forwardRef(({side:e="right",className:t,children:r,...n},s)=>i.jsxs(fV,{children:[i.jsx(z2,{}),i.jsxs(Zh,{ref:s,className:J(mV({side:e}),t),...n,children:[r,i.jsxs(B2,{className:"absolute right-4 top-4 roun
607ded-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:[i.jsx(on,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));G2.displayName=Zh.displayName;const pV=p.forwardRef(({className:e,...t},r)=>i.jsx(ef,{ref:r,className:J("text-lg font-semibold text-foreground",e),...t}));pV.displayName=ef.displayName;const gV=p.forwardRef(({className:e,...t},r)=>i.jsx(tf,{ref:r,className:J("text-sm text-muted-foreground",e),...t}));gV.displayName=tf.displayName;function Oe({className:e,...t}){return i.jsx("div",{className:J("animate-pulse rounded-md bg-muted",e),...t})}const xV="sidebar:state",vV=60*60*24*7,yV="16rem",bV="18rem",wV="3rem",jV="b",W2=p.createContext(null);function qc(){const e=p.useContext(W2);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Gv=p.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:s,children:a,...o},l)=>{const c=o6(),[u,d]=p.useState(!1),[h,f]=p.useState(e),m=t??h,w=p.useCallback(v=>{const x=typeof v=="function"?v(m):v;r?r(x):f(x),document.cookie=`${xV}=${x}; path=/; max-age=${vV}`},[r,m]),g=p.useCallback(()=>c?d(v=>!v):w(v=>!v),[c,w,d]);p.useEffect(()=>{const v=x=>{x.key===jV&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[g]);const y=m?"expanded":"collapsed",b=p.useMemo(()=>({state:y,open:m,setOpen:w,isMobile:c,openMobile:u,setOpenMobile:d,toggleSidebar:g}),[y,m,w,c,u,d,g]);return i.jsx(W2.Provider,{value:b,children:i.jsx(kk,{delayDuration:0,children:i.jsx("div",{style:{"--sidebar-width":yV,"--sidebar-width-icon":wV,...s},className:J("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:l,...o,children:a})})})});Gv.displayName="SidebarProvider";const Wv=p.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...a},o)=>{const{isMobile:l,state:c,openMobile:u,setOpenMobile:d}=qc();return r==="none"?i.jsx("div",{className:J("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:o,...a,children:s}):l?i.jsx(hV,{open:u,onOpenChange:d,...a,children:i.jsx(G2,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":bV},side:e,children:i.jsx("div",{className:"flex h-full w-full flex-col",children:s})})}):i.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?r:"","data-variant":t,"data-side":e,children:[i.jsx("div",{className:J("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]")}),i.jsx("div",{className:J("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",n),...a,children:i.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:s})})]})});Wv.displayName="Sidebar";const q2=p.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:s}=qc();return i.jsxs(B,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:J("h-7 w-7 text-center",e),onClick:a=>{t==null||t(a),s()},...r,children:[i.jsx(w4,{}),i.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});q2.displayName="SidebarTrigger";const NV=p.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=qc();return i.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:J("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})});NV.displayName="SidebarRail";const SV=p.forwardRef(({className:e,...t},r)=>i.jsx("main",{ref:r,className:J("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-
607h-[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}));SV.displayName="SidebarInset";const _V=p.forwardRef(({className:e,...t},r)=>i.jsx(tt,{ref:r,"data-sidebar":"input",className:J("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));_V.displayName="SidebarInput";const H2=p.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"header",className:J("flex flex-col gap-2 p-2",e),...t}));H2.displayName="SidebarHeader";const K2=p.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"footer",className:J("flex flex-col gap-2 p-2",e),...t}));K2.displayName="SidebarFooter";const kV=p.forwardRef(({className:e,...t},r)=>i.jsx(m2,{ref:r,"data-sidebar":"separator",className:J("mx-2 w-auto bg-sidebar-border",e),...t}));kV.displayName="SidebarSeparator";const qv=p.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"content",className:J("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));qv.displayName="SidebarContent";const Y2=p.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"group",className:J("relative flex w-full min-w-0 flex-col p-2",e),...t}));Y2.displayName="SidebarGroup";const Q2=p.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const s=t?Ro:"div";return i.jsx(s,{ref:n,"data-sidebar":"group-label",className:J("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),...r})});Q2.displayName="SidebarGroupLabel";const CV=p.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const s=t?Ro:"button";return i.jsx(s,{ref:n,"data-sidebar":"group-action",className:J("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),...r})});CV.displayName="SidebarGroupAction";const J2=p.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"group-content",className:J("w-full text-sm",e),...t}));J2.displayName="SidebarGroupContent";const Hv=p.forwardRef(({className:e,...t},r)=>i.jsx("ul",{ref:r,"data-sidebar":"menu",className:J("flex w-full min-w-0 flex-col gap-1",e),...t}));Hv.displayName="SidebarMenu";const nh=p.forwardRef(({className:e,...t},r)=>i.jsx("li",{ref:r,"data-sidebar":"menu-item",className:J("group/menu-item relative",e),...t}));nh.displayName="SidebarMenuItem";const EV=Io("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"}}),Il=p.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:s,className:a,...o},l)=>{const c=e?Ro:"button",{isMobile:u,state:d}=qc(),h=i.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:J(EV({variant:r,size:n}),a),...o});return s?(typeof s=="string"&&(s={children:s}),i.jsxs(I3,{children:[i.jsx(O3,{asChild:!0,children:h}),i.jsx(Ck,{side:"right",align:"center",hidden:d!=="collapsed"||u,...s})]})):h});Il.displayName="SidebarMenuButton";const PV=p.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},s)=>{const a=t?Ro:"button";return i.jsx(a,{ref:s,"data-sidebar":"menu-action",className:J("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",r&&"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),...n})});PV.displayName="SidebarMenuAction";const TV=p.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:J("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}));TV.displayName="SidebarMenuBadge";const AV=p.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const s=p.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return i.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:J("flex h-8 items-center gap-2 rounded-md px-2",e),...r,children:[t&&i.jsx(Oe,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),i.jsx(Oe,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});AV.displayName="SidebarMenuSkeleton";const RV=p.forwardRef(({className:e,...t},r)=>i.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:J("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}));RV.displayName="SidebarMenuSub";const IV=p.forwardRef(({...e},t)=>i.jsx("li",{ref:t,...e}));IV.displayName="SidebarMenuSubItem";const OV=p.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...s},a)=>{const o=e?Ro:"a";return i.jsx(o,{ref:a,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:J("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",n),...s})});OV.displayName="SidebarMenuSubButton";const gc="/assets/logo-BncmkVBA.png",MV=[{title:"Home",url:"/dashboard",icon:T_},{title:"Video Models",url:"/models",icon:$t},{title:"Image Models",url:"/image-models",icon:gt},{title:"AI Avatars",url:"/avatars",icon:an},{title:"Gallery",url:"/images",icon:h4},{title:"API",url:"/api-docs",icon:sc}];function DV(){var f;const{user:e,userMeta:t}=Tt(),r=Ce(),n=dn(),{state:s,toggleSidebar:a}=qc(),o=s==="collapsed",l=(t==null?void 0:t.credits)||0,{data:c}=Pl({queryKey:["is-admin",e==null?void 0:e.id],queryFn:async()=>{const{data:m,error:w}=await Y.rpc("is_admin",{uid:e==null?void 0:e.id});if(w)throw w;return m},enabled:!!(e!=null&&e.id)}),u=async()=>{await Y.auth.signOut(),Te.success("Signed out"),r("/auth")},d=m=>
607t!=null&&t.display_name?t.display_name.slice(0,2).toUpperCase():(m==null?void 0:m.slice(0,2).toUpperCase())||"U",h=m=>n.pathname===m||n.pathname.startsWith(m+"/");return i.jsxs(Wv,{collapsible:"icon",className:"border-r border-sidebar-border/60 bg-sidebar",children:[i.jsx(H2,{className:"p-3",children:i.jsxs("div",{className:`flex items-center ${o?"justify-center":"justify-between"} h-10`,children:[!o&&i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-primary/10 flex items-center justify-center shrink-0",children:i.jsx("img",{src:gc,alt:"Logo",className:"w-5 h-5 object-contain"})}),i.jsx("span",{className:"text-base font-bold tracking-tight text-sidebar-foreground",children:"MyReelGen"})]}),i.jsx("button",{onClick:a,className:"w-7 h-7 rounded-lg flex items-center justify-center text-sidebar-foreground/50 hover:text-sidebar-foreground hover:bg-sidebar-accent/10 transition-colors",children:o?i.jsx(S_,{className:"w-4 h-4"}):i.jsx(iv,{className:"w-4 h-4"})})]})}),i.jsx(qv,{className:"px-2 py-2",children:i.jsxs(Hv,{className:"space-y-0.5",children:[MV.map(m=>{const w=h(m.url);return i.jsx(nh,{children:i.jsx(Il,{asChild:!0,tooltip:m.title,children:i.jsxs(Rl,{to:m.url,className:`flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all text-sm font-medium ${w?"bg-primary/12 text-primary":"text-sidebar-foreground/60 hover:text-sidebar-foreground hover:bg-sidebar-accent/8"}`,children:[i.jsx(m.icon,{className:"w-[18px] h-[18px] shrink-0"}),o?i.jsx("span",{className:"sr-only",children:m.title}):i.jsx("span",{children:m.title})]})})},m.title)}),c&&i.jsx(nh,{children:i.jsx(Il,{asChild:!0,tooltip:"Admin",children:i.jsxs(Rl,{to:"/admin",className:`flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all text-sm font-medium ${h("/admin")?"bg-primary/12 text-primary":"text-sidebar-foreground/60 hover:text-sidebar-foreground hover:bg-sidebar-accent/8"}`,children:[i.jsx(Ks,{className:"w-[18px] h-[18px] shrink-0"}),o?i.jsx("span",{className:"sr-only",children:"Admin"}):i.jsx("span",{children:"Admin"})]})})})]})}),i.jsxs(K2,{className:"p-2 space-y-1 border-t border-sidebar-border/40",children:[i.jsx(Il,{asChild:!0,tooltip:`${l} credits`,children:i.jsxs(Rl,{to:"/profile",className:"flex items-center gap-3 px-3 py-2.5 rounded-xl text-sm hover:bg-sidebar-accent/8 transition-all",children:[i.jsx("div",{className:"w-[18px] h-[18px] shrink-0 flex items-center justify-center",children:i.jsx(Pt,{className:"w-4 h-4 text-primary"})}),o?i.jsxs("span",{className:"sr-only",children:["Credits: ",l.toLocaleString()]}):i.jsxs("div",{className:"flex items-center justify-between flex-1 min-w-0",children:[i.jsx("span",{className:"text-sidebar-foreground/60 font-medium",children:"Credits"}),i.jsx("span",{className:"text-sm font-bold text-sidebar-foreground",children:l.toLocaleString()})]})]})}),i.jsx("div",{className:`flex items-center ${o?"justify-center":"px-3"} py-1`,children:i.jsx(Mv,{className:"w-8 h-8 text-sidebar-foreground/50 hover:text-sidebar-foreground"})}),i.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[i.jsxs("button",{onClick:()=>r("/profile"),className:"flex items-center gap-3 flex-1 min-w-0 px-1 py-1.5 rounded-xl hover:bg-sidebar-accent/8 transition-all",children:[i.jsx(Lv,{className:"w-8 h-8 shrink-0",children:i.jsx($v,{className:"bg-primary/12 text-primary text-xs font-bold",children:d(e==null?void 0:e.email)})}),!o&&i.jsx("div",{className:"flex-1 min-w-0 text-left",children:i.jsx("p",{className:"text-sm font-medium text-sidebar-foreground truncate",children:(t==null?void 0:t.display_name)||((f=e==null?void 0:e.email)==null?void 0:f.split("@")[0])||"User"})})]}),!o&&i.jsx("button",{onClick:u,className:"w-8 h-8 rounded-lg flex items-center justify-center text-sidebar-foreground/40 hover:text-destructive hover:bg-destructive/10 transition-colors shrink-0",title:"Sign out",children:i.jsx(p4,{className:"w-4 h-4"})})]})]})]})}const X2=p.createContext({});function LV(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const Kv=typeof window<"u",$V=Kv?p.useLayoutEffect:p.useEffect,Yv=p.createContext(null);function Qv(e,t){e.indexOf(t)===-1&&e.push(t)}function Jv(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const ts=(e,t,r)=>r>t?t:r<e?e:r;let sh=()=>{};const rs={},Z2=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function eE(e){return typeof e=="object"&&e!==null}const tE=e=>/^0[^.\s]+$/u.test(e);function Xv(e){let t;return()=>(t===void 0&&(t=e()),t)}const Or=e=>e,FV=(e,t)=>r=>
vendor: 27,442 bytes, line 607
607t(e(r)),Hc=(...e)=>e.reduce(FV),xc=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n};class Zv{constructor(){this.subscriptions=[]}add(t){return Qv(this.subscriptions,t),()=>Jv(this.subscriptions,t)}notify(t,r,n){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,r,n);else for(let a=0;a<s;a++){const o=this.subscriptions[a];o&&o(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Cn=e=>e*1e3,Rr=e=>e/1e3;function rE(e,t){return t?e*(1e3/t):0}const nE=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,UV=1e-7,VV=12;function BV(e,t,r,n,s){let a,o,l=0;do o=t+(r-t)/2,a=nE(o,n,s)-e,a>0?r=o:t=o;while(Math.abs(a)>UV&&++l<VV);return o}function Kc(e,t,r,n){if(e===t&&r===n)return Or;const s=a=>BV(a,0,1,e,r);return a=>a===0||a===1?a:nE(s(a),t,n)}const sE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,iE=e=>t=>1-e(1-t),aE=Kc(.33,1.53,.69,.99),ey=iE(aE),oE=sE(ey),lE=e=>(e*=2)<1?.5*ey(e):.5*(2-Math.pow(2,-10*(e-1))),ty=e=>1-Math.sin(Math.acos(e)),cE=iE(ty),uE=sE(ty),zV=Kc(.42,0,1,1),GV=Kc(0,0,.58,1),dE=Kc(.42,0,.58,1),WV=e=>Array.isArray(e)&&typeof e[0]!="number",hE=e=>Array.isArray(e)&&typeof e[0]=="number",Iw={linear:Or,easeIn:zV,easeInOut:dE,easeOut:GV,circIn:ty,circInOut:uE,circOut:cE,backIn:ey,backInOut:oE,backOut:aE,anticipate:lE},qV=e=>typeof e=="string",Ow=e=>{if(hE(e)){sh(e.length===4);const[t,r,n,s]=e;return Kc(t,r,n,s)}else if(qV(e))return sh(Iw[e]!==void 0),Iw[e];return e},$u=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Mw={value:null,addProjectionMetrics:null};function HV(e,t){let r=new Set,n=new Set,s=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(h){o.has(h)&&(d.schedule(h),e()),c++,h(l)}const d={schedule:(h,f=!1,m=!1)=>{const g=m&&s?r:n;return f&&o.add(h),g.has(h)||g.add(h),h},cancel:h=>{n.delete(h),o.delete(h)},process:h=>{if(l=h,s){a=!0;return}s=!0,[r,n]=[n,r],r.forEach(u),t&&Mw.value&&Mw.value.frameloop[t].push(c),c=0,r.clear(),s=!1,a&&(a=!1,d.process(h))}};return d}const KV=40;function fE(e,t){let r=!1,n=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,o=$u.reduce((x,j)=>(x[j]=HV(a,t?j:void 0),x),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:h,preRender:f,render:m,postRender:w}=o,g=()=>{const x=rs.useManualTiming?s.timestamp:performance.now();r=!1,rs.useManualTiming||(s.delta=n?1e3/60:Math.max(Math.min(x-s.timestamp,KV),1)),s.timestamp=x,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),h.process(s),f.process(s),m.process(s),w.process(s),s.isProcessing=!1,r&&t&&(n=!1,e(g))},y=()=>{r=!0,n=!0,s.isProcessing||e(g)};return{schedule:$u.reduce((x,j)=>{const N=o[j];return x[j]=(S,_=!1,k=!1)=>(r||y(),N.schedule(S,_,k)),x},{}),cancel:x=>{for(let j=0;j<$u.length;j++)o[$u[j]].cancel(x)},state:s,steps:o}}const{schedule:Ge,cancel:Js,state:Nt,steps:wm}=fE(typeof requestAnimationFrame<"u"?requestAnimationFrame:Or,!0);let cd;function YV(){cd=void 0}const er={now:()=>(cd===void 0&&er.set(Nt.isProcessing||rs.useManualTiming?Nt.timestamp:performance.now()),cd),set:e=>{cd=e,queueMicrotask(YV)}},mE=e=>t=>typeof t=="string"&&t.startsWith(e),ry=mE("--"),QV=mE("var(--"),ny=e=>QV(e)?JV.test(e.split("/*")[0].trim()):!1,JV=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Vo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},vc={...Vo,transform:e=>ts(0,1,e)},Fu={...Vo,default:1},Ol=e=>Math.round(e*1e5)/1e5,sy=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function XV(e){return e==null}const ZV=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,iy=(e,t)=>r=>!!(typeof r=="string"&&ZV.test(r)&&r.startsWith(e)||t&&!XV(r)&&Object.prototype.hasOwnProperty.call(r,t)),pE=(e,t,r)=>n=>{if(typeof n!="string")return n;const[s,a,o,l]=n.match(sy);return{[e]:parseFloat(s),[t]:parseFloat(a),[r]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},eB=e=>ts(0,255,e),jm={...Vo,transform:e=>Math.round(eB(e))},Ci={test:iy("rgb","red"),parse:pE("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+jm.transform(e)+", "+jm.transform(t)+", "+jm.transform(r)+", "+Ol(vc.transform(n))+")"};function tB(e){let t="",r="",n="",s="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),s=e.substring(4,5),t+=t,r+=r,n+=n,s+=s),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}}const Cg={test:iy("#"),parse:tB,transform:Ci.transform},Yc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),gs=Yc("deg"),En=Yc("%"),ge=Yc("px"),rB=Yc("vh"),nB=Yc("vw"),Dw={...En,parse:e=>En.parse(e)/100,transform:e=>En.transform(e*100)},Da={test:iy("hsl","hue"),parse:pE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+En.transform(Ol(t))+", "+En.transform(Ol(r))+", "+Ol(vc.transform(n))+")"},ut={test:e=>Ci.test(e)||Cg.test(e)||Da.test(e),parse:e=>Ci.test(e)?Ci.parse(e):Da.test(e)?Da.parse(e):Cg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ci.transform(e):Da.transform(e),getAnimatableNone:e=>{const t=ut.parse(e);return t.alpha=0,ut.transform(t)}},sB=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function iB(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(sy))==null?void 0:t.length)||0)+(((r=e.match(sB))==null?void 0:r.length)||0)>0}const gE="number",xE="color",aB="var",oB="var(",Lw="${}",lB=/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 yc(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(lB,c=>(ut.test(c)?(n.color.push(a),s.push(xE),r.push(ut.parse(c))):c.startsWith(oB)?(n.var.push(a),s.push(aB),r.push(c)):(n.number.push(a),s.push(gE),r.push(parseFloat(c))),++a,Lw)).split(Lw);return{values:r,split:l,indexes:n,types:s}}function vE(e){return yc(e).values}function yE(e){const{split:t,types:r}=yc(e),n=t.length;return s=>{let a="";for(let o=0;o<n;o++)if(a+=t[o],s[o]!==void 0){const l=r[o];l===gE?a+=Ol(s[o]):l===xE?a+=ut.transform(s[o]):a+=s[o]}return a}}const cB=e=>typeof e=="number"?0:ut.test(e)?ut.getAnimatableNone(e):e;function uB(e){const t=vE(e);return yE(e)(t.map(cB))}const Xs={test:iB,parse:vE,createTransformer:yE,getAnimatableNone:uB};function Nm(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function dB({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let s=0,a=0,o=0;if(!t)s=a=o=r;else{const l=r<.5?r*(1+t):r+t-r*t,c=2*r-l;s=Nm(c,l,e+1/3),a=Nm(c,l,e),o=Nm(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:n}}function ih(e,t){return r=>r>0?t:e}const He=(e,t,r)=>e+(t-e)*r,Sm=(e,t,r)=>{const n=e*e,s=r*(t*t-n)+n;return s<0?0:Math.sqrt(s)},hB=[Cg,Ci,Da],fB=e=>hB.find(t=>t.test(e));function $w(e){const t=fB(e);if(!t)return!1;let r=t.parse(e);return t===Da&&(r=dB(r)),r}const Fw=(e,t)=>{const r=$w(e),n=$w(t);if(!r||!n)return ih(e,t);const s={...r};return a=>(s.red=Sm(r.red,n.red,a),s.green=Sm(r.green,n.green,a),s.blue=Sm(r.blue,n.blue,a),s.alpha=He(r.alpha,n.alpha,a),Ci.transform(s))},Eg=new Set(["none","hidden"]);function mB(e,t){return Eg.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function pB(e,t){return r=>He(e,t,r)}function ay(e){return typeof e=="number"?pB:typeof e=="string"?ny(e)?ih:ut.test(e)?Fw:vB:Array.isArray(e)?bE:typeof e=="object"?ut.test(e)?Fw:gB:ih}function bE(e,t){const r=[...e],n=r.length,s=e.map((a,o)=>ay(a)(a,t[o]));return a=>{for(let o=0;o<n;o++)r[o]=s[o](a);return r}}function gB(e,t){const r={...e,...t},n={};for(const s in r)e[s]!==void 0&&t[s]!==void 0&&(n[s]=ay(e[s])(e[s],t[s]));return s=>{for(const a in n)r[a]=n[a](s);return r}}function xB(e,t){const r=[],n={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],o=e.indexes[a][n[a]],l=e.values[o]??0;r[s]=l,n[a]++}return r}const vB=(e,t)=>{const r=Xs.createTransformer(t),n=yc(e),s=yc(t);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?Eg.has(e)&&!s.values.length||Eg.has(t)&&!n.values.length?mB(e,t):Hc(bE(xB(n,s),s.values),r):ih(e,t)};function wE(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?He(e,t,r):ay(e)(e,t)}const yB=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>Ge.update(t,r),stop:()=>Js(t),now:()=>Nt.isProcessing?Nt.timestamp:er.now()}},jE=(e,t,r=10)=>{let n="";const s=Math.max(Math.round(t/r),2);for(let a=0;a<s;a++)n+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},ah=2e4;function oy(e){let t=0;const r=50;let n=e.next(t);for(;!n.done&&t<ah;)t+=r,n=e.next(t);return t>=ah?1/0:t}function bB(e,t=100,r){const n=r({...e,keyframes:[0,t]}),s=Math.min(oy(n),ah);return{type:"keyframes",ease:a=>n.next(s*a).value/t,duration:Rr(s)}}const wB=5;function NE(e,t,r){const n=Math.max(t-wB,0);return rE(r-e(n),t-n)}const Ze={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},_m=.001;function jB({duration:e=Ze.duration,bounce:t=Ze.bounce,velocity:r=Ze.velocity,mass:n=Ze.mass}){let s,a,o=1-t;o=ts(Ze.minDamping,Ze.maxDamping,o),e=ts(Ze.minDuration,Ze.maxDuration,Rr(e)),o<1?(s=u=>{const d=u*o,h=d*e,f=d-r,m=Pg(u,o),w=Math.exp(-h);return _m-f/m*w},a=u=>{const h=u*o*e,f=h*r+r,m=Math.pow(o,2)*Math.pow(u,2)*e,w=Math.exp(-h),g=Pg(Math.pow(u,2),o);return(-s(u)+_m>0?-1:1)*((f-m)*w)/g}):(s=u=>{const d=Math.exp(-u*e),h=(u-r)*e+1;return-_m+d*h},a=u=>{const d=Math.exp(-u*e),h=(r-u)*(e*e);return d*h});const l=5/e,c=SB(s,a,l);if(e=Cn(e),isNaN(c))return{stiffness:Ze.stiffness,damping:Ze.damping,duration:e};{const u=Math.pow(c,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:e}}}const NB=12;function SB(e,t,r){let n=r;for(let s=1;s<NB;s++)n=n-e(n)/t(n);return n}function Pg(e,t){return e*Math.sqrt(1-t*t)}const _B=["duration","bounce"],kB=["stiffness","damping","mass"];function Uw(e,t){return t.some(r=>e[r]!==void 0)}function CB(e){let t={velocity:Ze.velocity,stiffness:Ze.stiffness,damping:Ze.damping,mass:Ze.mass,isResolvedFromDuration:!1,...e};if(!Uw(e,kB)&&Uw(e,_B))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),s=n*n,a=2*ts(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ze.mass,stiffness:s,damping:a}}else{const r=jB(e);t={...t,...r,mass:Ze.mass},t.isResolvedFromDuration=!0}return t}function oh(e=Ze.visualDuration,t=Ze.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:s}=r;const a=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:h,velocity:f,isResolvedFromDuration:m}=CB({...r,velocity:-Rr(r.velocity||0)}),w=f||0,g=u/(2*Math.sqrt(c*d)),y=o-a,b=Rr(Math.sqrt(c/d)),v=Math.abs(y)<5;n||(n=v?Ze.restSpeed.granular:Ze.restSpeed.default),s||(s=v?Ze.restDelta.granular:Ze.restDelta.default);let x;if(g<1){const N=Pg(b,g);x=S=>{const _=Math.exp(-g*b*S);return o-_*((w+g*b*y)/N*Math.sin(N*S)+y*Math.cos(N*S))}}else if(g===1)x=N=>o-Math.exp(-b*N)*(y+(w+b*y)*N);else{const N=b*Math.sqrt(g*g-1);x=S=>{const _=Math.exp(-g*b*S),k=Math.min(N*S,300);return o-_*((w+g*b*y)*Math.sinh(k)+N*y*Math.cosh(k))/N}}const j={calculatedDuration:m&&h||null,next:N=>{const S=x(N);if(m)l.done=N>=h;else{let _=N===0?w:0;g<1&&(_=N===0?Cn(w):NE(x,N,S));const k=Math.abs(_)<=n,P=Math.abs(o-S)<=s;l.done=k&&P}return l.value=l.done?o:S,l},toString:()=>{const N=Math.min(oy(j),ah),S=jE(_=>j.next(N*_).value,N,30);return N+"ms "+S},toTransition:()=>{}};return j}oh.applyToOptions=e=>{const t=bB(e,100,oh);return e.ease=t.ease,e.duration=Cn(t.duration),e.type="keyframes",e};function Tg({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const h=e[0],f={done:!1,value:h},m=k=>l!==void 0&&k<l||c!==void 0&&k>c,w=k=>l===void 0?c:c===void 0||Math.abs(l-k)<Math.abs(c-k)?l:c;let g=r*t;const y=h+g,b=o===void 0?y:o(y);b!==y&&(g=b-h);const v=k=>-g*Math.exp(-k/n),x=k=>b+v(k),j=k=>{const P=v(k),C=x(k);f.done=Math.abs(P)<=u,f.value=f.done?b:C};let N,S;const _=k=>{m(f.value)&&(N=k,S=oh({keyframes:[f.value,w(f.value)],velocity:NE(x,k,f.value),damping:s,stiffness:a,restDelta:u,restSpeed:d}))};return _(0),{calculatedDuration:null,next:k=>{let P=!1;return!S&&N===void 0&&(P=!0,j(k),_(k)),N!==void 0&&k>=N?S.next(k-N):(!P&&j(k),f)}}}function EB(e,t,r){const n=[],s=r||rs.mix||wE,a=e.length-1;for(let o=0;o<a;o++){let l=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||Or:t;l=Hc(c,l)}n.push(l)}return n}function PB(e,t,{clamp:r=!0,ease:n,mixer:s}={}){const a=e.length;if(sh(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=EB(t,n,s),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(d<e[h+1]);h++);const f=xc(e[h],e[h+1],d);return l[h](f)};return r?d=>u(ts(e[0],e[a-1],d)):u}function TB(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const s=xc(0,t,n);e.push(He(r,1,s))}}function AB(e){const t=[0];return TB(t,e.length-1),t}function RB(e,t){return e.map(r=>r*t)}function IB(e,t){return e.map(()=>t||dE).splice(0,e.length-1)}function Ml({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const s=WV(n)?n.map(Ow):Ow(n),a={done:!1,value:t[0]},o=RB(r&&r.length===t.length?r:AB(t),e),l=PB(o,t,{ease:Array.isArray(s)?s:IB(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const OB=e=>e!==null;function ly(e,{repeat:t,repeatType:r="loop"},n,s=1){const a=e.filter(OB),l=s<0||t&&r!=="loop"&&t%2===1?0:a.length-1;return!l||n===void 0?a[l]:n}const MB={decay:Tg,inertia:Tg,tween:Ml,keyframes:Ml,spring:oh};function SE(e){typeof e.type=="string"&&(e.type=MB[e.type])}class cy{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}const DB=e=>e/100;class uy extends cy{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,s;const{motionValue:r}=this.options;r&&r.updatedAt!==er.now()&&this.tick(er.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(n=this.options).onStop)==null||s.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;SE(t);const{type:r=Ml,repeat:n=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=t;let{keyframes:l}=t;const c=r||Ml;c!==Ml&&typeof l[0]!="number"&&(this.mixKeyframes=Hc(DB,wE(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=oy(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:s,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:f,repeatDelay:m,type:w,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const b=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let x=this.currentTime,j=n;if(h){const k=Math.min(this.currentTime,s)/l;let P=Math.floor(k),C=k%1;!C&&k>=1&&(C=1),C===1&&P--,P=Math.min(P,h+1),!!(P%2)&&(f==="reverse"?(C=1-C,m&&(C-=m/l)):f==="mirror"&&(j=o)),x=ts(0,1,C)*l}const N=v?{done:!1,value:d[0]}:j.next(x);a&&(N.value=a(N.value));let{done:S}=N;!v&&c!==null&&(S=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return _&&w!==Tg&&(N.value=ly(d,this.options,y,this.speed)),g&&g(N.value),_&&this.finish(),N}then(t,r){return this.finished.then(t,r)}get duration(){return Rr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Rr(t)}get time(){return Rr(this.currentTime)}set time(t){var r;t=Cn(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),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(er.now());const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=Rr(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:t=yB,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(a=(s=this.options).onPlay)==null||a.call(s);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),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(er.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.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 r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}function LB(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ei=e=>e*180/Math.PI,Ag=e=>{const t=Ei(Math.atan2(e[1],e[0]));return Rg(t)},$B={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ag,rotateZ:Ag,skewX:e=>Ei(Math.atan(e[1])),skewY:e=>Ei(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Rg=e=>(e=e%360,e<0&&(e+=360),e),Vw=Ag,Bw=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),zw=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),FB={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Bw,scaleY:zw,scale:e=>(Bw(e)+zw(e))/2,rotateX:e=>Rg(Ei(Math.atan2(e[6],e[5]))),rotateY:e=>Rg(Ei(Math.atan2(-e[2],e[0]))),rotateZ:Vw,rotate:Vw,skewX:e=>Ei(Math.atan(e[4])),skewY:e=>Ei(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ig(e){return e.includes("scale")?1:0}function Og(e,t){if(!e||e==="none")return Ig(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,s;if(r)n=FB,s=r;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=$B,s=l}if(!s)return Ig(t);const a=n[t],o=s[1].split(",").map(VB);return typeof a=="function"?a(o):o[a]}const UB=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return Og(r,t)};function VB(e){return parseFloat(e.trim())}const Bo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zo=new Set(Bo),Gw=e=>e===Vo||e===ge,BB=new Set(["x","y","z"]),zB=Bo.filter(e=>!BB.has(e));function GB(e){const t=[];return zB.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const Vi={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),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})=>Og(t,"x"),y:(e,{transform:t})=>Og(t,"y")};Vi.translateX=Vi.x;Vi.translateY=Vi.y;const Bi=new Set;let Mg=!1,Dg=!1,Lg=!1;function _E(){if(Dg){const e=Array.from(Bi).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const s=GB(n);s.length&&(r.set(n,s),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const s=r.get(n);s&&s.forEach(([a,o])=>{var l;(l=n.getValue(a))==null||l.set(o)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Dg=!1,Mg=!1,Bi.forEach(e=>e.complete(Lg)),Bi.clear()}function kE(){Bi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Dg=!0)})}function WB(){Lg=!0,kE(),_E(),Lg=!1}class dy{constructor(t,r,n,s,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=s,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Bi.add(this),Mg||(Mg=!0,Ge.read(kE),Ge.resolveKeyframes(_E))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:s}=this;if(t[0]===null){const a=s==null?void 0:s.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&r){const l=n.readValue(r,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),s&&a===void 0&&s.set(t[0])}LB(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Bi.delete(this)}cancel(){this.state==="scheduled"&&(Bi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qB=e=>e.startsWith("--");function HB(e,t,r){qB(t)?e.style.setProperty(t,r):e.style[t]=r}const KB=Xv(()=>window.ScrollTimeline!==void 0),YB={};function QB(e,t){const r=Xv(e);return()=>YB[t]??r()}const CE=QB(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xl=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,Ww={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xl([0,.65,.55,1]),circOut:xl([.55,0,1,.45]),backIn:xl([.31,.01,.66,-.59]),backOut:xl([.33,1.53,.69,.99])};function EE(e,t){if(e)return typeof e=="function"?CE()?jE(e,t):"ease-out":hE(e)?xl(e):Array.isArray(e)?e.map(r=>EE(r,t)||Ww.easeOut):Ww[e]}function JB(e,t,r,{delay:n=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:r};c&&(d.offset=c);const h=EE(l,s);Array.isArray(h)&&(d.easing=h);const f={delay:n,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),e.animate(d,f)}function PE(e){return typeof e=="function"&&"applyToOptions"in e}function XB({type:e,...t}){return PE(e)&&CE()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ZB extends cy{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:r,name:n,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,sh(typeof t.type!="string");const u=XB(t);this.animation=JB(r,n,s,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=ly(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):HB(r,n,d),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,r;(r=(t=this.animation).finish)==null||r.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,r;this.isPseudoElement||(r=(t=this.animation).commitStyles)==null||r.call(t)}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return Rr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Rr(t)}get time(){return Rr(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Cn(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:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&KB()?(this.animation.timeline=t,Or):r(this)}}const TE={anticipate:lE,backInOut:oE,circInOut:uE};function e8(e){return e in TE}function t8(e){typeof e.ease=="string"&&e8(e.ease)&&(e.ease=TE[e.ease])}const qw=10;class r8 extends ZB{constructor(t){t8(t),SE(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:s,element:a,...o}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const l=new uy({...o,autoplay:!1}),c=Cn(this.finishedTime??this.time);r.setWithVelocity(l.sample(c-qw).value,l.sample(c).value,qw),l.stop()}}const Hw=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Xs.test(e)||e==="0")&&!e.startsWith("url("));function n8(e){const t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function s8(e,t,r,n){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=Hw(s,t),l=Hw(a,t);return!o||!l?!1:n8(e)||(r==="spring"||PE(r))&&n}function $g(e){e.duration=0,e.type="keyframes"}const i8=new Set(["opacity","clipPath","filter","transform"]),a8=Xv(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function o8(e){var d;const{motionValue:t,name:r,repeatDelay:n,repeatType:s,damping:a,type:o}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return a8()&&r&&i8.has(r)&&(r!=="transform"||!u)&&!c&&!n&&s!=="mirror"&&a!==0&&o!=="inertia"}const l8=40;class c8 extends cy{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:
607o="loop",keyframes:l,name:c,motionValue:u,element:d,...h}){var w;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=er.now();const f={autoplay:t,delay:r,type:n,repeat:s,repeatDelay:a,repeatType:o,name:c,motionValue:u,element:d,...h},m=(d==null?void 0:d.KeyframeResolver)||dy;this.keyframeResolver=new m(l,(g,y,b)=>this.onKeyframesResolved(g,y,f,!b),c,u,d),(w=this.keyframeResolver)==null||w.scheduleResolve()}onKeyframesResolved(t,r,n,s){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=n;this.resolvedAt=er.now(),s8(t,a,o,l)||((rs.instantAnimations||!c)&&(d==null||d(ly(t,n,r))),t[0]=t[t.length-1],$g(n),n.repeat=0);const f={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>l8?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},m=!u&&o8(f)?new r8({...f,element:f.motionValue.owner.current}):new uy(f);m.finished.then(()=>this.notifyFinished()).catch(Or),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,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),WB()),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 u8=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function d8(e){const t=u8.exec(e);if(!t)return[,];const[,r,n,s]=t;return[`--${r??n}`,s]}function AE(e,t,r=1){const[n,s]=d8(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const o=a.trim();return Z2(o)?parseFloat(o):o}return ny(s)?AE(s,t,r+1):s}function hy(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const RE=new Set(["width","height","top","left","right","bottom",...Bo]),h8={test:e=>e==="auto",parse:e=>e},IE=e=>t=>t.test(e),OE=[Vo,ge,En,gs,nB,rB,h8],Kw=e=>OE.find(IE(e));function f8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||tE(e):!0}const m8=new Set(["brightness","contrast","saturate","opacity"]);function p8(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(sy)||[];if(!n)return e;const s=r.replace(n,"");let a=m8.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+s+")"}const g8=/\b([a-z-]*)\(.*?\)/gu,Fg={...Xs,getAnimatableNone:e=>{const t=e.match(g8);return t?t.map(p8).join(" "):e}},Yw={...Vo,transform:Math.round},x8={rotate:gs,rotateX:gs,rotateY:gs,rotateZ:gs,scale:Fu,scaleX:Fu,scaleY:Fu,scaleZ:Fu,skew:gs,skewX:gs,skewY:gs,distance:ge,translateX:ge,translateY:ge,translateZ:ge,x:ge,y:ge,z:ge,perspective:ge,transformPerspective:ge,opacity:vc,originX:Dw,originY:Dw,originZ:ge},fy={borderWidth:ge,borderTopWidth:ge,borderRightWidth:ge,borderBottomWidth:ge,borderLeftWidth:ge,borderRadius:ge,radius:ge,borderTopLeftRadius:ge,borderTopRightRadius:ge,borderBottomRightRadius:ge,borderBottomLeftRadius:ge,width:ge,maxWidth:ge,height:ge,maxHeight:ge,top:ge,right:ge,bottom:ge,left:ge,padding:ge,paddingTop:ge,paddingRight:ge,paddingBottom:ge,paddingLeft:ge,margin:ge,marginTop:ge,marginRight:ge,marginBottom:ge,marginLeft:ge,backgroundPositionX:ge,backgroundPositionY:ge,...x8,zIndex:Yw,fillOpacity:vc,strokeOpacity:vc,numOctaves:Yw},v8={...fy,color:ut,backgroundColor:ut,outlineColor:ut,fill:ut,stroke:ut,borderColor:ut,borderTopColor:ut,borderRightColor:ut,borderBottomColor:ut,borderLeftColor:ut,filter:Fg,WebkitFilter:Fg},ME=e=>v8[e];function DE(e,t){let r=ME(e);return r!==Fg&&(r=Xs),r.getAnimatableNone?r.getAnimatableNone(t):void 0}
vendor: 6,456 bytes, line 607
607const y8=new Set(["auto","none","0"]);function b8(e,t,r){let n=0,s;for(;n<e.length&&!s;){const a=e[n];typeof a=="string"&&!y8.has(a)&&yc(a).values.length&&(s=e[n]),n++}if(s&&r)for(const a of t)e[a]=DE(r,s)}class w8 extends dy{constructor(t,r,n,s,a){super(t,r,n,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),ny(u))){const d=AE(u,r.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!RE.has(n)||t.length!==2)return;const[s,a]=t,o=Kw(s),l=Kw(a);if(o!==l)if(Gw(o)&&Gw(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else Vi[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:r}=this,n=[];for(let s=0;s<t.length;s++)(t[s]===null||f8(t[s]))&&n.push(s);n.length&&b8(t,n,r)}measureInitialState(){const{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Vi[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;const s=r[r.length-1];s!==void 0&&t.getValue(n,s).jump(s,!1)}measureEndState(){var l;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(r);s&&s.jump(this.measuredOrigin,!1);const a=n.length-1,o=n[a];n[a]=Vi[r](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,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function j8(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const LE=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function N8(e){return eE(e)&&"offsetHeight"in e}const Qw=30,S8=e=>!isNaN(parseFloat(e));class _8{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var a;const s=er.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=er.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=S8(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new Zv);const n=this.events[t].add(r);return t==="change"?()=>{n(),Ge.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&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=er.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Qw)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,Qw);return rE(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),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,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Co(e,t){return new _8(e,t)}const{schedule:my,cancel:hK}=fE(queueMicrotask,!1),Wr={x:!1,y:!1};function $E(){return Wr.x||Wr.y}function k8(e){return e==="x"||e==="y"?Wr[e]?null:(Wr[e]=!0,()=>{Wr[e]=!1}):Wr.x||Wr.y?null:(Wr.x=Wr.y=!0,()=>{Wr.x=Wr.y=!1})}function FE(e,t){const r=j8(e),n=new AbortController,s={passive:!0,...t,signal:n.signal};return[r,s,()=>n.abort()]}function Jw(e){return!(e.pointerType==="touch"||$E())}function C8(e,t,r={}){const[n,s,a]=FE(e,r),o=l=>{if(!Jw(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=h=>{Jw(h)&&(u(h),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,s)};return n.forEach(l=>{l.addEventListener("pointerenter",o,s)}),a}const UE=(e,t)=>t?e===t?!0:UE(e,t.parentElement):!1,py=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,E8=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function P8(e){return E8.has(e.tagName)||e.tabIndex!==-1}const ud=new WeakSet;function Xw(e){return t=>{t.key==="Enter"&&e(t)}}function km(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const T8=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=Xw(()=>{if(ud.has(r))return;km(r,"down");const s=Xw(()=>{km(r,"up")}),a=()=>km(r,"cancel");r.addEventListener("keyup",s,t),r.addEventListener("blur",a,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function Zw(e){return py(e)&&!$E()}function A8(e,t,r={}){const[n,s,a]=FE(e,r),o=l=>{const c=l.currentTarget;if(!Zw(l))return;ud.add(c);const u=t(c,l),d=(m,w)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),ud.has(c)&&ud.delete(c),Zw(m)&&typeof u=="function"&&u(m,{success:w})},h=m=>{d(m,c===window||c===document||r.useGlobalTarget||UE(c,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",f,s)};
vendor: 8,729 bytes, line 607
607return n.forEach(l=>{(r.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),N8(l)&&(l.addEventListener("focus",u=>T8(u,s)),!P8(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function VE(e){return eE(e)&&"ownerSVGElement"in e}function R8(e){return VE(e)&&e.tagName==="svg"}const Dt=e=>!!(e&&e.getVelocity),I8=[...OE,ut,Xs],O8=e=>I8.find(IE(e)),BE=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function M8(e=!0){const t=p.useContext(Yv);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:s}=t,a=p.useId();p.useEffect(()=>{if(e)return s(a)},[e]);const o=p.useCallback(()=>e&&n&&n(a),[a,n,e]);return!r&&n?[!1,o]:[!0]}const zE=p.createContext({strict:!1}),ej={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"]},Eo={};for(const e in ej)Eo[e]={isEnabled:t=>ej[e].some(r=>!!t[r])};function D8(e){for(const t in e)Eo[t]={...Eo[t],...e[t]}}const L8=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 lh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||L8.has(e)}let GE=e=>!lh(e);function $8(e){typeof e=="function"&&(GE=t=>t.startsWith("on")?!lh(t):e(t))}try{$8(require("@emotion/is-prop-valid").default)}catch{}function F8(e,t,r){const n={};for(const s in e)s==="values"&&typeof e.values=="object"||(GE(s)||r===!0&&lh(s)||!t&&!lh(s)||e.draggable&&s.startsWith("onDrag"))&&(n[s]=e[s]);return n}const rf=p.createContext({});function nf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function bc(e){return typeof e=="string"||Array.isArray(e)}const gy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],xy=["initial",...gy];function sf(e){return nf(e.animate)||xy.some(t=>bc(e[t]))}function WE(e){return!!(sf(e)||e.variants)}function U8(e,t){if(sf(e)){const{initial:r,animate:n}=e;return{initial:r===!1||bc(r)?r:void 0,animate:bc(n)?n:void 0}}return e.inherit!==!1?t:{}}function V8(e){const{initial:t,animate:r}=U8(e,p.useContext(rf));return p.useMemo(()=>({initial:t,animate:r}),[tj(t),tj(r)])}function tj(e){return Array.isArray(e)?e.join(" "):e}const wc={};function B8(e){for(const t in e)wc[t]=e[t],ry(t)&&(wc[t].isCSSVariable=!0)}function qE(e,{layout:t,layoutId:r}){return zo.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!wc[e]||e==="opacity")}const z8={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},G8=Bo.length;function W8(e,t,r){let n="",s=!0;for(let a=0;a<G8;a++){const o=Bo[a],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||r){const u=LE(l,fy[o]);if(!c){s=!1;const d=z8[o]||o;n+=`${d}(${u}) `}r&&(t[o]=u)}}return n=n.trim(),r?n=r(t,s?"":n):s&&(n="none"),n}function vy(e,t,r){const{style:n,vars:s,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(zo.has(c)){o=!0;continue}else if(ry(c)){s[c]=u;continue}else{const d=LE(u,fy[c]);c.startsWith("origin")?(l=!0,a[c]=d):n[c]=d}}if(t.transform||(o||r?n.transform=W8(t,e.transform,r):n.transform&&(n.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;n.transformOrigin=`${c} ${u} ${d}`}}const yy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function HE(e,t,r){for(const n in t)!Dt(t[n])&&!qE(n,r)&&(e[n]=t[n])}function q8({transformTemplate:e},t){return p.useMemo(()=>{const r=yy();return vy(r,t,e),Object.assign({},r.vars,r.style)},[t])}function H8(e,t){const r=e.style||{},n={};return HE(n,r,e),Object.assign(n,q8(e,t)),n}function K8(e,t){const r={},n=H8(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}const Y8={offset:"stroke-dashoffset",array:"stroke-dasharray"},Q8={offset:"strokeDashoffset",array:"strokeDasharray"};function J8(e,t,r=1,n=0,s=!0){e.pathLength=1;const a=s?Y8:Q8;e[a.offset]=ge.transform(-n);const o=ge.transform(t),l=ge.transform(r);e[a.array]=`${o} ${l}`}function KE(e,{attrX:t,attrY:r,attrScale:n,pathLength:s,pathSpacing:a=1,pathOffset:o=0,...l},c,u,d){if(vy(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:f}=e;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox),t!==void 0&&(h.x=t),r!==void 0&&(h.y=r),n!==void 0&&(h.scale=n),s!==void 0&&J8(h,s,a,o,!1)}const YE=()=>({...yy(),attrs:{}}),QE=e=>typeof e=="string"&&e.toLowerCase()==="svg";function X8(e,t,r,n){const s=p.useMemo(()=>{const a=YE();return KE(a,t,QE(n),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};HE(a,e.style,e),s.style={...a,...s.style}}return s}const Z8=["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 by(e){return typeof e!="string"||e.includes("-")?!1:!!(Z8.indexOf(e)>-1||/[A-Z]/u.test(e))}function ez(e,t,r,{latestValues:n},s,a=!1){const l=(by(e)?X8:K8)(t,n,s,e),c=F8(t,typeof e=="string",a),u=e!==p.Fragment?{...c,...l,ref:r}:{},{children:d}=t,h=p.useMemo(()=>Dt(d)?d.get():d,[d]);return p.createElement(e,{...u,children:h})}function rj(e){const t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function wy(e,t,r,n){if(typeof t=="function"){const[s,a]=rj(n);t=t(r!==void 0?r:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=rj(n);t=t(r!==void 0?r:e.custom,s,a)}return t}function dd(e){return Dt(e)?e.get():e}function tz({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,s){return{latestValues:rz(r,n,s,e),renderState:t()}}function rz(e,t,r,n){const s={},a=n(e,{});for(const f in a)s[f]=dd(a[f]);let{initial:o,animate:l}=e;const c=sf(e),u=WE(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=r?r.initial===!1:!1;d=d||o===!1;const h=d?l:o;if(h&&typeof h!="boolean"&&!nf(h)){const f=Array.isArray(h)?h:[h];for(let m=0;m<f.length;m++){const w=wy(e,f[m]);if(w){const{transitionEnd:g,transition:y,...b}=w;for(const v in b){let x=b[v];if(Array.isArray(x)){const j=d?x.length-1:0;x=x[j]}x!==null&&(s[v]=x)}for(const v in g)s[v]=g[v]}}}return s}const JE=e=>(t,r)=>{const n=p.useContext(rf),s=p.useContext(Yv),a=()=>tz(e,t,n,s);return r?a():LV(a)};function jy(e,t,r){var a;const{style:n}=e,s={};for(const o in n)(Dt(n[o])||t.style&&Dt(t.style[o])||qE(o,e)||((a=r==null?void 0:r.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=n[o]);return s}const nz=JE({scrapeMotionValuesFromProps:jy,createRenderState:yy});function XE(e,t,r){const n=jy(e,t,r);for(const s in e)if(Dt(e[s])||Dt(t[s])){const a=Bo.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;n[a]=e[s]}return n}const sz=JE({scrapeMotionValuesFromProps:XE,createRenderState:YE}),iz=Symbol.for("motionComponentSymbol");function La(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function az(e,t,r){return p.useCallback(n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):La(r)&&(r.current=n))},[t])}const Ny=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),oz="framerAppearId",ZE="data-"+Ny(oz),eP=p.createContext({});function lz(e,t,r,n,s){var g,y;const{visualElement:a}=p.useContext(rf),o=p.useContext(zE),l=p.useContext(Yv),c=p.useContext(BE).reducedMotion,u=p.useRef(null);n=n||o.renderer,!u.current&&n&&(u.current=n(e,{visualState:t,parent:a,props:r,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}
vendor: 12,182 bytes, line 607
607));const d=u.current,h=p.useContext(eP);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&cz(u.current,r,s,h);const f=p.useRef(!1);p.useInsertionEffect(()=>{d&&f.current&&d.update(r,l)});const m=r[ZE],w=p.useRef(!!m&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,m))&&((y=window.MotionHasOptimisedAnimation)==null?void 0:y.call(window,m)));return $V(()=>{d&&(f.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),w.current&&d.animationState&&d.animationState.animateChanges())}),p.useEffect(()=>{d&&(!w.current&&d.animationState&&d.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)==null||b.call(window,m)}),w.current=!1),d.enteringChildren=void 0)}),d}function cz(e,t,r,n){const{layoutId:s,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:tP(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&La(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,crossfade:d,layoutScroll:c,layoutRoot:u})}function tP(e){if(e)return e.options.allowProjection!==!1?e.projection:tP(e.parent)}function Cm(e,{forwardMotionProps:t=!1}={},r,n){r&&D8(r);const s=by(e)?sz:nz;function a(l,c){let u;const d={...p.useContext(BE),...l,layoutId:uz(l)},{isStatic:h}=d,f=V8(l),m=s(l,h);if(!h&&Kv){dz();const w=hz(d);u=w.MeasureLayout,f.visualElement=lz(e,m,d,n,w.ProjectionNode)}return i.jsxs(rf.Provider,{value:f,children:[u&&f.visualElement?i.jsx(u,{visualElement:f.visualElement,...d}):null,ez(e,l,az(m,f.visualElement,c),m,h,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=p.forwardRef(a);return o[iz]=e,o}function uz({layoutId:e}){const t=p.useContext(X2).id;return t&&e!==void 0?t+"-"+e:e}function dz(e,t){p.useContext(zE).strict}function hz(e){const{drag:t,layout:r}=Eo;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:t!=null&&t.isEnabled(e)||r!=null&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function fz(e,t){if(typeof Proxy>"u")return Cm;const r=new Map,n=(a,o)=>Cm(a,o,e,t),s=(a,o)=>n(a,o);return new Proxy(s,{get:(a,o)=>o==="create"?n:(r.has(o)||r.set(o,Cm(o,void 0,e,t)),r.get(o))})}function rP({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function mz({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function pz(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function Em(e){return e===void 0||e===1}function Ug({scale:e,scaleX:t,scaleY:r}){return!Em(e)||!Em(t)||!Em(r)}function vi(e){return Ug(e)||nP(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function nP(e){return nj(e.x)||nj(e.y)}function nj(e){return e&&e!=="0%"}function ch(e,t,r){const n=e-r,s=t*n;return r+s}function sj(e,t,r,n,s){return s!==void 0&&(e=ch(e,s,n)),ch(e,r,n)+t}function Vg(e,t=0,r=1,n,s){e.min=sj(e.min,t,r,n,s),e.max=sj(e.max,t,r,n,s)}function sP(e,{x:t,y:r}){Vg(e.x,t.translate,t.scale,t.originPoint),Vg(e.y,r.translate,r.scale,r.originPoint)}const ij=.999999999999,aj=1.0000000000001;function gz(e,t,r,n=!1){const s=r.length;if(!s)return;t.x=t.y=1;let a,o;for(let l=0;l<s;l++){a=r[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Fa(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,sP(e,o)),n&&vi(a.latestValues)&&Fa(e,a.latestValues))}t.x<aj&&t.x>ij&&(t.x=1),t.y<aj&&t.y>ij&&(t.y=1)}function $a(e,t){e.min=e.min+t,e.max=e.max+t}function oj(e,t,r,n,s=.5){const a=He(e.min,e.max,s);Vg(e,t,r,a,n)}function Fa(e,t){oj(e.x,t.x,t.scaleX,t.scale,t.originX),oj(e.y,t.y,t.scaleY,t.scale,t.originY)}function iP(e,t){return rP(pz(e.getBoundingClientRect(),t))}function xz(e,t,r){const n=iP(e,r),{scroll:s}=t;return s&&($a(n.x,s.offset.x),$a(n.y,s.offset.y)),n}const lj=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ua=()=>({x:lj(),y:lj()}),cj=()=>({min:0,max:0}),it=()=>({x:cj(),y:cj()}),Bg={current:null},aP={current:!1};function vz(){if(aP.current=!0,!!Kv)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Bg.current=e.matches;e.addEventListener("change",t),t()}else Bg.current=!1}const yz=new WeakMap;function bz(e,t,r){for(const n in t){const s=t[n],a=r[n];if(Dt(s))e.addValue(n,s);else if(Dt(a))e.addValue(n,Co(s,{owner:e}));else if(a!==s)if(e.hasValue(n)){const o=e.getValue(n);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(n);e.addValue(n,Co(o!==void 0?o:s,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const uj=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class wz{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:a,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=dy,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 f=er.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Ge.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=r.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=sf(r),this.isVariantNode=WE(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(r,{},this);for(const f in h){const m=h[f];c[f]!==void 0&&Dt(m)&&m.set(c[f])}}mount(t){var r;this.current=t,yz.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((n,s)=>this.bindToMotionValue(s,n)),aP.current||vz(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Bg.current,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Js(this.notifyUpdate),Js(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const n=this.features[r];n&&(n.unmount(),n.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,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=zo.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=r.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Ge.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{s(),a&&a(),r.owner&&r.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 Eo){const r=Eo[t];if(!r)continue;const{isEnabled:n,Feature:s}=r;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):it()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<uj.length;n++){const s=uj[n];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,o=t[a];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=bz(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){const n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=Co(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(Z2(n)||tE(n))?n=parseFloat(n):!O8(n)&&Xs.test(r)&&(n=DE(t,r)),this.setBaseTarget(t,Dt(n)?n.get():n)),Dt(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var a;const{initial:r}=this.props;let n;if(typeof r=="string"||typeof r=="object"){const o=wy(this.props,r,(a=this.presenceContext)==null?void 0:a.custom);o&&(n=o[t])}if(r&&n!==void 0)return n;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Dt(s)?s:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Zv),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){my.render(this.render)}}class oP extends wz{constructor(){super(...arguments),this.KeyframeResolver=w8}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Dt(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function lP(e,{style:t,vars:r},n,s){const a=e.style;let o;for(o in t)a[o]=t[o];s==null||s.applyProjectionStyles(a,n);for(o in r)a.setProperty(o,r[o])}function jz(e){return window.getComputedStyle(e)}class Nz extends oP{constructor(){super(...arguments),this.type="html",this.renderInstance=lP}readValueFromInstance(t,r){var n;if(zo.has(r))return(n=this.projection)!=null&&n.isProjecting?Ig(r):UB(t,r);{const s=jz(t),a=(ry(r)?s.getPropertyValue(r):s[r])||0;
vendor: 1,038 bytes, line 607
607return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:r}){return iP(t,r)}build(t,r,n){vy(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return jy(t,r,n)}}const cP=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 Sz(e,t,r,n){lP(e,t,void 0,n);for(const s in t.attrs)e.setAttribute(cP.has(s)?s:Ny(s),t.attrs[s])}class _z extends oP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=it}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(zo.has(r)){const n=ME(r);return n&&n.default||0}return r=cP.has(r)?r:Ny(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return XE(t,r,n)}build(t,r,n){KE(t,r,this.isSVGTag,
vendor: 4,393 bytes, line 607
607n.transformTemplate,n.style)}renderInstance(t,r,n,s){Sz(t,r,n,s)}mount(t){this.isSVGTag=QE(t.tagName),super.mount(t)}}const kz=(e,t)=>by(e)?new _z(t):new Nz(t,{allowProjection:e!==p.Fragment});function Za(e,t,r){const n=e.getProps();return wy(n,t,r!==void 0?r:n.custom,e)}const zg=e=>Array.isArray(e);function Cz(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Co(r))}function Ez(e){return zg(e)?e[e.length-1]||0:e}function Pz(e,t){const r=Za(e,t);let{transitionEnd:n={},transition:s={},...a}=r||{};a={...a,...n};for(const o in a){const l=Ez(a[o]);Cz(e,o,l)}}function Tz(e){return!!(Dt(e)&&e.add)}function Gg(e,t){const r=e.getValue("willChange");if(Tz(r))return r.add(t);if(!r&&rs.WillChange){const n=new rs.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function uP(e){return e.props[ZE]}const Az=e=>e!==null;function Rz(e,{repeat:t,repeatType:r="loop"},n){const s=e.filter(Az),a=t&&r!=="loop"&&t%2===1?0:s.length-1;return!a||n===void 0?s[a]:n}const Iz={type:"spring",stiffness:500,damping:25,restSpeed:10},Oz=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Mz={type:"keyframes",duration:.8},Dz={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Lz=(e,{keyframes:t})=>t.length>2?Mz:zo.has(e)?e.startsWith("scale")?Oz(t[1]):Iz:Dz;function $z({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:s,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const Sy=(e,t,r,n={},s,a)=>o=>{const l=hy(n,e)||{},c=l.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Cn(c);const d={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:f=>{t.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:s};$z(l)||Object.assign(d,Lz(e,d)),d.duration&&(d.duration=Cn(d.duration)),d.repeatDelay&&(d.repeatDelay=Cn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&($g(d),d.delay===0&&(h=!0)),(rs.instantAnimations||rs.skipAnimations)&&(h=!0,$g(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,h&&!a&&t.get()!==void 0){const f=Rz(d.keyframes,l);if(f!==void 0){Ge.update(()=>{d.onUpdate(f),d.onComplete()});return}}return l.isSync?new uy(d):new c8(d)};function Fz({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function dP(e,t,{delay:r=0,transitionOverride:n,type:s}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;n&&(a=n);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const d in l){const h=e.getValue(d,e.latestValues[d]??null),f=l[d];if(f===void 0||u&&Fz(u,d))continue;const m={delay:r,...hy(a||{},d)},w=h.get();if(w!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===w&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const b=uP(e);if(b){const v=window.MotionHandoffAnimation(b,d,Ge);v!==null&&(m.startTime=v,g=!0)}}Gg(e,d),h.start(Sy(d,h,f,e.shouldReduceMotion&&RE.has(d)?{type:!1}:m,e,g));const y=h.animation;y&&c.push(y)}return o&&Promise.all(c).then(()=>{Ge.update(()=>{o&&Pz(e,o)})}),c}function hP(e,t,r,n=0,s=1){const a=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),o=e.size,l=(o-1)*n;return typeof r=="function"?r(a,o):s===1?a*n:l-a*n}function Wg(e,t,r={}){var c;const n=Za(e,t,r.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(s=r.transitionOverride);const a=n?()=>Promise.all(dP(e,n,r)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:f}=s;return Uz(e,t,u,d,h,f,r)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(r.delay)])}function Uz(e,t,r=0,n=0,s=0,a=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(Wg(c,t,{...o,delay:r+(typeof n=="function"?0:n)+hP(e.variantChildren,c,n,s,a)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function Vz(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const s=t.map(a=>Wg(e,a,r));n=Promise.all(s)}else if(typeof t=="string")n=Wg(e,t,r);else{const s=typeof t=="function"?Za(e,t,r.custom):t;n=Promise.all(dP(e,s,r))}return n.then(()=>
vendor: 8,440 bytes, line 607
607{e.notify("AnimationComplete",t)})}function fP(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}const Bz=xy.length;function mP(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?mP(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const t={};for(let r=0;r<Bz;r++){const n=xy[r],s=e.props[n];(bc(s)||s===!1)&&(t[n]=s)}return t}const zz=[...gy].reverse(),Gz=gy.length;function Wz(e){return t=>Promise.all(t.map(({animation:r,options:n})=>Vz(e,r,n)))}function qz(e){let t=Wz(e),r=dj(),n=!0;const s=c=>(u,d)=>{var f;const h=Za(e,d,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:w,...g}=h;u={...u,...g,...w}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,d=mP(e.parent)||{},h=[],f=new Set;let m={},w=1/0;for(let y=0;y<Gz;y++){const b=zz[y],v=r[b],x=u[b]!==void 0?u[b]:d[b],j=bc(x),N=b===c?v.isActive:null;N===!1&&(w=y);let S=x===d[b]&&x!==u[b]&&j;if(S&&n&&e.manuallyAnimateOnMount&&(S=!1),v.protectedKeys={...m},!v.isActive&&N===null||!x&&!v.prevProp||nf(x)||typeof x=="boolean")continue;const _=Hz(v.prevProp,x);let k=_||b===c&&v.isActive&&!S&&j||y>w&&j,P=!1;const C=Array.isArray(x)?x:[x];let D=C.reduce(s(b),{});N===!1&&(D={});const{prevResolvedValues:I={}}=v,V={...I,...D},U=F=>{k=!0,f.has(F)&&(P=!0,f.delete(F)),v.needsAnimating[F]=!0;const T=e.getValue(F);T&&(T.liveStyle=!1)};for(const F in V){const T=D[F],O=I[F];if(m.hasOwnProperty(F))continue;let H=!1;zg(T)&&zg(O)?H=!fP(T,O):H=T!==O,H?T!=null?U(F):f.add(F):T!==void 0&&f.has(F)?U(F):v.protectedKeys[F]=!0}v.prevProp=x,v.prevResolvedValues=D,v.isActive&&(m={...m,...D}),n&&e.blockInitialAnimation&&(k=!1);const R=S&&_;k&&(!R||P)&&h.push(...C.map(F=>{const T={type:b};if(typeof F=="string"&&n&&!R&&e.manuallyAnimateOnMount&&e.parent){const{parent:O}=e,H=Za(O,F);if(O.enteringChildren&&H){const{delayChildren:re}=H.transition||{};T.delay=hP(O.enteringChildren,e,re)}}return{animation:F,options:T}}))}if(f.size){const y={};if(typeof u.initial!="boolean"){const b=Za(e,Array.isArray(u.initial)?u.initial[0]:u.initial);b&&b.transition&&(y.transition=b.transition)}f.forEach(b=>{const v=e.getBaseTarget(b),x=e.getValue(b);x&&(x.liveStyle=!0),y[b]=v??null}),h.push({animation:y})}let g=!!h.length;return n&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(g=!1),n=!1,g?t(h):Promise.resolve()}function l(c,u){var h;if(r[c].isActive===u)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(f=>{var m;return(m=f.animationState)==null?void 0:m.setActive(c,u)}),r[c].isActive=u;const d=o(c);for(const f in r)r[f].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>r,reset:()=>{r=dj()}}}function Hz(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!fP(t,e):!1}function fi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dj(){return{animate:fi(!0),whileInView:fi(),whileHover:fi(),whileTap:fi(),whileDrag:fi(),whileFocus:fi(),exit:fi()}}class si{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Kz extends si{constructor(t){super(t),t.animationState||(t.animationState=qz(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();nf(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Yz=0;class Qz extends si{constructor(){super(...arguments),this.id=Yz++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const s=this.node.animationState.setActive("exit",!t);r&&!t&&s.then(()=>{r(this.id)})}mount(){const{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Jz={animation:{Feature:Kz},exit:{Feature:Qz}};function jc(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function Qc(e){return{point:{x:e.pageX,y:e.pageY}}}const Xz=e=>t=>py(t)&&e(t,Qc(t));function Dl(e,t,r,n){return jc(e,t,Xz(r),n)}const pP=1e-4,Zz=1-pP,eG=1+pP,gP=.01,tG=0-gP,rG=0+gP;function Gt(e){return e.max-e.min}function nG(e,t,r){return Math.abs(e-t)<=r}function hj(e,t,r,n=.5){e.origin=n,e.originPoint=He(t.min,t.max,e.origin),e.scale=Gt(r)/Gt(t),e.translate=He(r.min,r.max,e.origin)-e.originPoint,(e.scale>=Zz&&e.scale<=eG||isNaN(e.scale))&&(e.scale=1),(e.translate>=tG&&e.translate<=rG||isNaN(e.translate))&&(e.translate=0)}function Ll(e,t,r,n){hj(e.x,t.x,r.x,n?n.originX:void 0),hj(e.y,t.y,r.y,n?n.originY:void 0)}function fj(e,t,r){e.min=r.min+t.min,e.max=e.min+Gt(t)}function sG(e,t,r){fj(e.x,t.x,r.x),fj(e.y,t.y,r.y)}function mj(e,t,r){e.min=t.min-r.min,e.max=e.min+Gt(t)}function $l(e,t,r){mj(e.x,t.x,r.x),mj(e.y,t.y,r.y)}function Nr(e){return[e("x"),e("y")]}const xP=({current:e})=>e?e.ownerDocument.defaultView:null,pj=(e,t)=>Math.abs(e-t);function iG(e,t){const r=pj(e.x,t.x),n=pj(e.y,t.y);return Math.sqrt(r**2+n**2)}class vP{constructor(t,r,{transformPagePoint:n,contextWindow:s=window,dragSnapToOrigin:a=!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 f=Tm(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,w=iG(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!w)return;const{point:g}=f,{timestamp:y}=Nt;this.history.push({...g,timestamp:y});const{onStart:b,onMove:v}=this.handlers;m||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,f)},this.handlePointerMove=(f,m)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Pm(m,this.transformPagePoint),Ge.update(this.updatePoint,!0)},this.handlePointerUp=(f,m)=>{this.end();const{onEnd:w,onSessionEnd:g,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Tm(f.type==="pointercancel"?this.lastMoveEventInfo:Pm(m,this.transformPagePoint),this.history);this.startEvent&&w&&w(f,b),g&&g(f,b)},!py(t))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=s||window;const l=Qc(t),c=Pm(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Nt;this.history=[{...u,timestamp:d}];const{onSessionStart:h}=r;h&&h(t,Tm(c,this.history)),this.removeListeners=Hc(Dl(this.contextWindow,"pointermove",this.handlePointerMove),Dl(this.contextWindow,"pointerup",this.handlePointerUp),Dl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Js(this.updatePoint)}}function Pm(e,t){return t?{point:t(e.point)}:e}function gj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Tm({point:e},t){return{point:e,delta:gj(e,yP(t)),offset:gj(e,aG(t)),velocity:oG(t,.1)}}function aG(e){return e[0]}function yP(e){return e[e.length-1]}function oG(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const s=yP(e);for(;r>=0&&(n=e[r],!(s.timestamp-n.timestamp>Cn(t)));)r--;if(!n)return{x:0,y:0};const a=Rr(s.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const o={x:(s.x-n.x)/a,y:(s.y-n.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function lG(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?He(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?He(r,e,n.max):Math.min(e,r)),e}function xj(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function cG(e,{top:t,left:r,bottom:n,right:s}){return{x:xj(e.x,r,s),y:xj(e.y,t,n)}}function vj(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function uG(e,t){return{x:vj(e.x,t.x),y:vj(e.y,t.y)}}function dG(e,t){let r=.5;const n=Gt(e),s=Gt(t);return s>n?r=xc(t.min,t.max-n,e.min):n>s&&(r=xc(e.min,e.max-s,t.min)),ts(0,1,r)}function hG(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const qg=.35;function fG(e=qg){return e===!1?e=0:e===!0&&(e=qg),{x:yj(e,"left","right"),y:yj(e,"to
607p","bottom")}}function yj(e,t,r){return{min:bj(e,t),max:bj(e,r)}}function bj(e,t){return typeof e=="number"?e:e[t]||0}const mG=new WeakMap;class pG{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=it(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=h=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Qc(h).point)},o=(h,f)=>{const{drag:m,dragPropagation:w,onDragStart:g}=this.getProps();if(m&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=k8(m),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nr(b=>{let v=this.getAxisMotionValue(b).get()||0;if(En.test(v)){const{projection:x}=this.visualElement;if(x&&x.layout){const j=x.layout.layoutBox[b];j&&(v=Gt(j)*(parseFloat(v)/100))}}this.originPoint[b]=v}),g&&Ge.postRender(()=>g(h,f)),Gg(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:m,dragDirectionLock:w,onDirectionLock:g,onDrag:y}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:b}=f;if(w&&this.currentDirection===null){this.currentDirection=gG(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),y&&y(h,f)},c=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Nr(h=>{var f;return this.getAnimationState(h)==="paused"&&((f=this.getAxisMotionValue(h).animation)==null?void 0:f.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new vP(t,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:n,contextWindow:xP(this.visualElement)})}stop(t,r){const n=t||this.latestPointerEvent,s=r||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!n)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Ge.postRender(()=>l(n,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){const{drag:s}=this.getProps();if(!n||!Uu(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=lG(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,s=this.constraints;t&&La(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=cG(n.layoutBox,t):this.constraints=!1,this.elastic=fG(r),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Nr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=hG(n.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!La(t))return!1;const n=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=xz(n,s.root,this.visualElement.getTransformPagePoint());let o=uG(s.layout.layoutBox,a);if(r){const l=r(mz(o));this.hasMutatedConstraints=!!l,l&&(o=rP(l))}return o}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Nr(d=>{if(!Uu(d,r,this.currentDirection))return;
vendor: 9,516 bytes, line 607
607let h=c&&c[d]||{};o&&(h={min:0,max:0});const f=s?200:1e6,m=s?40:1e7,w={type:"inertia",velocity:n?t[d]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...a,...h};return this.startAxisValueAnimation(d,w)});return Promise.all(u).then(l)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return Gg(this.visualElement,t),n.start(Sy(t,n,0,r,this.visualElement,!1))}stopAnimation(){Nr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Nr(t=>{var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.state}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),s=n[r];return s||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Nr(r=>{const{drag:n}=this.getProps();if(!Uu(r,n,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(r);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[r];a.set(t[r]-He(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!La(r)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Nr(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=dG({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Nr(o=>{if(!Uu(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(He(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;mG.set(this.visualElement,this);const t=this.visualElement.current,r=Dl(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),n=()=>{const{dragConstraints:c}=this.getProps();La(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,a=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Ge.read(n);const o=jc(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Nr(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=c[d].translate,h.set(h.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),r(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:o=qg,dragMomentum:l=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function Uu(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function gG(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class xG extends si{constructor(t){super(t),this.removeGroupControls=Or,this.removeListeners=Or,this.controls=new pG(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Or}unmount(){this.removeGroupControls(),this.removeListeners()}}const wj=e=>(t,r)=>{e&&Ge.postRender(()=>e(t,r))};class vG extends si{constructor(){super(...arguments),this.removePointerDownListener=Or}onPointerDown(t){this.session=new vP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xP(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:wj(t),onStart:wj(r),onMove:n,onEnd:(a,o)=>{delete this.session,s&&Ge.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=Dl(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 hd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function jj(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const al={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ge.test(e))e=parseFloat(e);else return e;const r=jj(e,t.target.x),n=jj(e,t.target.y);return`${r}% ${n}%`}},yG={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,s=Xs.parse(e);if(s.length>5)return n;const a=Xs.createTransformer(e),o=typeof s[0]!="number"?1:0,l=r.x.scale*t.x,c=r.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const u=He(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),a(s)}};let Am=!1;class bG extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:s}=this.props,{projection:a}=t;B8(wG),a&&(r.group&&r.group.add(a),n&&n.register&&s&&n.register(a),Am&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),hd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:s,isPresent:a}=this.props,{projection:o}=n;return o&&(o.isPresent=a,Am=!0,s||t.layoutDependency!==r||r===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Ge.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),my.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:s}=t;Am=!0,s&&(s.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(s),n&&n.deregister&&n.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function bP(e){const[t,r]=M8(),n=p.useContext(X2);return i.jsx(bG,{...e,layoutGroup:n,switchLayoutGroup:p.useContext(eP),isPresent:t,safeToRemove:r})}const wG={borderRadius:{...al,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:al,borderTopRightRadius:al,borderBottomLeftRadius:al,borderBottomRightRadius:al,boxShadow:yG};function jG(e,t,r){const n=Dt(e)?e:Co(e);return n.start(Sy("",n,t,r)),n.animation}const NG=(e,t)=>e.depth-t.depth;class SG{constructor(){this.children=[],this.isDirty=!1}add(t){Qv(this.children,t),this.isDirty=!0}remove(t){Jv(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(NG),this.isDirty=!1,this.children.forEach(t)}}function _G(e,t){const r=er.now(),n=({timestamp:s})=>{const a=s-r;a>=t&&(Js(n),e(a-t))};return Ge.setup(n,!0),()=>Js(n)}const wP=["TopLeft","TopRight","BottomLeft","BottomRight"],kG=wP.length,Nj=e=>typeof e=="string"?parseFloat(e):e,Sj=e=>typeof e=="number"||ge.test(e);function CG(e,t,r,n,s,a){s?(e.opacity=He(0,r.opacity??1,EG(n)),e.opacityExit=He(t.opacity??1,0,PG(n))):a&&(e.opacity=He(t.opacity??1,r.opacity??1,n));for(let o=0;o<kG;o++){const l=`border${wP[o]}Radius`;let c=_j(t,l),u=_j(r,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Sj(c)===Sj(u)?(e[l]=Math.max(He(Nj(c),Nj(u),n),0),(En.test(u)||En.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||r.rotate)&&(e.rotate=He(t.rotate||0,r.rotate||0,n))}function _j(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const EG=jP(0,.5,cE),PG=jP(.5,.95,Or);function jP(e,t,r){return n=>n<e?0:n>t?1:r(xc(e,t,n))}function kj(e,t){e.min=t.min,e.max=t.max}function jr(e,t){kj(e.x,t.x),kj(e.y,t.y)}function Cj(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ej(e,t,r,n,s){return e-=t,e=ch(e,1/r,n),s!==void 0&&(e=ch(e,1/s,n)),e}function TG(e,t=0,r=1,n=.5,s,a=e,o=e){if(En.test(t)&&(t=parseFloat(t),t=He(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=He(a.min,a.max,n);e===a&&(l-=t),e.min=Ej(e.min,t,r,l,s),e.max=Ej(e.max,t,r,l,s)}function Pj(e,t,[r,n,s],a,o){TG(e,t[r],t[n],t[s],t.scale,a,o)}const AG=["x","scaleX","originX"],RG=["y","scaleY","originY"];function Tj(e,t,r,n){Pj(e.x,t,AG,r?r.x:void 0,n?n.x:void 0),Pj(e.y,t,RG,r?r.y:void 0,n?n.y:void 0)}function Aj(e){return e.translate===0&&e.scale===1}function NP(e){return Aj(e.x)&&Aj(e.y)}function Rj(e,t){return e.min===t.min&&e.max===t.max}function IG(e,t){return Rj(e.x,t.x)&&Rj(e.y,t.y)}function Ij(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function SP(e,t){return Ij(e.x,t.x)&&Ij(e.y,t.y)}function Oj(e){return Gt(e.x)/Gt(e.y)}function Mj(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class OG{constructor(){this.members=[]}add(t){Qv(this.members,t),t.scheduleRender()}remove(t){if(Jv(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){const r=this.members.findIndex(s=>t===s);if(r===0)return!1;let n;for(let s=r;s>=0;s--){const a=this.members[s];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1}promote(t,r){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&n.hide()}}
vendor: 7,808 bytes, line 607
607exitAnimationComplete(){this.members.forEach(t=>{const{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function MG(e,t,r){let n="";const s=e.x.translate/t.x,a=e.y.translate/t.y,o=(r==null?void 0:r.z)||0;if((s||a||o)&&(n=`translate3d(${s}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:u,rotate:d,rotateX:h,rotateY:f,skewX:m,skewY:w}=r;u&&(n=`perspective(${u}px) ${n}`),d&&(n+=`rotate(${d}deg) `),h&&(n+=`rotateX(${h}deg) `),f&&(n+=`rotateY(${f}deg) `),m&&(n+=`skewX(${m}deg) `),w&&(n+=`skewY(${w}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(n+=`scale(${l}, ${c})`),n||"none"}const Rm=["","X","Y","Z"],DG=1e3;let LG=0;function Im(e,t,r,n){const{latestValues:s}=t;s[e]&&(r[e]=s[e],t.setStaticValue(e,0),n&&(n[e]=0))}function _P(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=uP(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",Ge,!(s||a))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&_P(n)}function kP({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=LG++,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=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(UG),this.nodes.forEach(GG),this.nodes.forEach(WG),this.nodes.forEach(VG)},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 SG)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Zv),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=VE(o)&&!R8(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let d,h=0;const f=()=>this.root.updateBlockedByResize=!1;Ge.read(()=>{h=window.innerWidth}),e(o,()=>{const m=window.innerWidth;m!==h&&(h=m,this.root.updateBlockedByResize=!0,d&&d(),d=_G(f,250),hd.hasAnimatedSinceResize&&(hd.hasAnimatedSinceResize=!1,this.nodes.forEach($j)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||u.getDefaultTransition()||QG,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=u.getProps(),b=!this.targetLayout||!SP(this.targetLayout,m),v=!h&&f;if(this.options.layoutRoot||this.resumeFrom||v||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...hy(w,"layout"),onPlay:g,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(d,v)}else h||$j(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(),Js(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(qG),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&&_P(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const h=this.path[d];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Dj);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Lj);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(zG),this.nodes.forEach($G),this.nodes.forEach(FG)):this.nodes.forEach(Lj),this.clearAllSnapshots();const l=er.now();Nt.delta=ts(0,1e3/60,l-Nt.timestamp),Nt.timestamp=l,Nt.isProcessing=!0,wm.update.process(Nt),wm.preRender.process(Nt),wm.render.process(Nt),Nt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,my.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(BG),this.sharedNodes.forEach(HG)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ge.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ge.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Gt(this.snapshot.measuredBox.x)&&!Gt(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=it(),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=n(this.instance);
vendor: 4,945 bytes, line 607
607this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!NP(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||vi(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),JG(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return it();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(XG))){const{scroll:d}=this.root;d&&($a(l.x,d.offset.x),$a(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=it();if(jr(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:h,options:f}=d;d!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&jr(l,o),$a(l.x,h.offset.x),$a(l.y,h.offset.y))}return l}applyTransform(o,l=!1){const c=it();jr(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Fa(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),vi(d.latestValues)&&Fa(c,d.latestValues)}return vi(this.latestValues)&&Fa(c,this.latestValues),c}removeTransform(o){const l=it();jr(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!vi(u.latestValues))continue;Ug(u.latestValues)&&u.updateSnapshot();const d=it(),h=u.measurePageBox();jr(d,h),Tj(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return vi(this.latestValues)&&Tj(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!==Nt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var f;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||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!(!this.layout||!(d||h))){if(this.resolvedRelativeTargetAt=Nt.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=it(),this.relativeTargetOrigin=it(),$l(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),jr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=it(),this.targetWithTransforms=it()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sG(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jr(this.target,this.layout.layoutBox),sP(this.target,this.targetDelta)):jr(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=it(),this.relativeTargetOrigin=it(),$l(this.relativeTargetOrigin,this.target,m.target),jr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Ug(this.parent.latestValues)||nP(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 w;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(w=this.parent)!=null&&w.isProjectionDirty)&&
vendor: 4,158 bytes, line 607
607(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Nt.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;jr(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;gz(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=it());const{target:m}=o;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cj(this.prevProjectionDelta.x,this.projectionDelta.x),Cj(this.prevProjectionDelta.y,this.projectionDelta.y)),Ll(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Mj(this.projectionDelta.x,this.prevProjectionDelta.x)||!Mj(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=Ua(),this.projectionDelta=Ua(),this.projectionDeltaWithTransform=Ua()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},h=Ua();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const f=it(),m=c?c.source:void 0,w=this.layout?this.layout.source:void 0,g=m!==w,y=this.getStack(),b=!y||y.members.length<=1,v=!!(g&&!b&&this.options.crossfade===!0&&!this.path.some(YG));this.animationProgress=0;let x;this.mixTargetDelta=j=>{const N=j/1e3;Fj(h.x,o.x,N),Fj(h.y,o.y,N),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($l(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),KG(this.relativeTarget,this.relativeTargetOrigin,f,N),x&&IG(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=it()),jr(x,this.relativeTarget)),g&&(this.animationValues=d,CG(d,u,this.latestValues,N,v,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Js(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ge.update(()=>{hd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Co(0)),this.currentAnimation=jG(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(DG),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&CP(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||it();const h=Gt(this.layout.layoutBox.x);
vendor: 9,405 bytes, line 607
607c.x.min=o.target.x.min,c.x.max=c.x.min+h;const f=Gt(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}jr(l,c),Fa(l,d),Ll(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new OG),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Im("z",o,u,this.animationValues);for(let d=0;d<Rm.length;d++)Im(`rotate${Rm[d]}`,o,u,this.animationValues),Im(`skew${Rm[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=dd(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=dd(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!vi(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=MG(this.projectionDeltaWithTransform,this.treeScale,d);c&&(h=c(d,h)),o.transform=h;const{x:f,y:m}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${m.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const w in wc){if(d[w]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:b}=wc[w],v=h==="none"?d[w]:g(d[w],u);if(y){const x=y.length;for(let j=0;j<x;j++)o[y[j]]=v}else b?this.options.visualElement.renderState.vars[w]=v:o[w]=v}this.options.layoutId&&(o.pointerEvents=u===this?dd(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(Dj),this.root.sharedNodes.clear()}}}function $G(e){e.updateLayout()}function FG(e){var r;const t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;a==="size"?Nr(h=>{const f=o?t.measuredBox[h]:t.layoutBox[h],m=Gt(f);f.min=n[h].min,f.max=f.min+m}):CP(a,t.layoutBox,n)&&Nr(h=>{const f=o?t.measuredBox[h]:t.layoutBox[h],m=Gt(n[h]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+m)});const l=Ua();Ll(l,n,t.layoutBox);const c=Ua();o?Ll(c,e.applyTransform(s,!0),t.measuredBox):Ll(c,n,t.layoutBox);const u=!NP(l);let d=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:m}=h;if(f&&m){const w=it();$l(w,t.layoutBox,f.layoutBox);const g=it();$l(g,n,m.layoutBox),SP(w,g)||(d=!0),h.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=w,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function UG(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 VG(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function BG(e){e.clearSnapshot()}function Dj(e){e.clearMeasurements()}function Lj(e){e.isLayoutDirty=!1}function zG(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function $j(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function GG(e){e.resolveTargetDelta()}function WG(e){e.calcProjection()}function qG(e){e.resetSkewAndRotation()}function HG(e){e.removeLeadSnapshot()}function Fj(e,t,r){e.translate=He(t.translate,0,r),e.scale=He(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function Uj(e,t,r,n){e.min=He(t.min,r.min,n),e.max=He(t.max,r.max,n)}function KG(e,t,r,n){Uj(e.x,t.x,r.x,n),Uj(e.y,t.y,r.y,n)}function YG(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const QG={duration:.45,ease:[.4,0,.1,1]},Vj=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Bj=Vj("applewebkit/")&&!Vj("chrome/")?Math.round:Or;function zj(e){e.min=Bj(e.min),e.max=Bj(e.max)}function JG(e){zj(e.x),zj(e.y)}function CP(e,t,r){return e==="position"||e==="preserve-aspect"&&!nG(Oj(t),Oj(r),.2)}function XG(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const ZG=kP({attachResizeListener:(e,t)=>jc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Om={current:void 0},EP=kP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Om.current){const e=new ZG({});e.mount(window),e.setOptions({layoutScroll:!0}),Om.current=e}return Om.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),eW={pan:{Feature:vG},drag:{Feature:xG,ProjectionNode:EP,MeasureLayout:bP}};function Gj(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const s="onHover"+r,a=n[s];a&&Ge.postRender(()=>a(t,Qc(t)))}class tW extends si{mount(){const{current:t}=this.node;t&&(this.unmount=C8(t,(r,n)=>(Gj(this.node,n,"Start"),s=>Gj(this.node,s,"End"))))}unmount(){}}class rW extends si{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=Hc(jc(this.node.current,"focus",()=>this.onFocus()),jc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wj(e,t,r){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const s="onTap"+(r==="End"?"":r),a=n[s];a&&Ge.postRender(()=>a(t,Qc(t)))}class nW extends si{mount(){const{current:t}=this.node;t&&(this.unmount=A8(t,(r,n)=>(Wj(this.node,n,"Start"),(s,{success:a})=>Wj(this.node,s,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Hg=new WeakMap,Mm=new WeakMap,sW=e=>{const t=Hg.get(e.target);t&&t(e)},iW=e=>{e.forEach(sW)};function aW({root:e,...t}){const r=e||document;Mm.has(r)||Mm.set(r,{});const n=Mm.get(r),s=JSON.stringify(t);return n[s]||(n[s]=new IntersectionObserver(iW,{root:e,...t})),n[s]}function oW(e,t,r){const n=aW(t);return Hg.set(e,r),n.observe(e),()=>{Hg.delete(e),n.unobserve(e)}}const lW={some:0,all:1};class cW extends si{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:s="some",once:a}=t,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof s=="number"?s:lW[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),f=u?d:h;f&&f(c)};return oW(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(uW(t,r))&&this.startObserver()}unmount(){}}function uW({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}
607const dW={inView:{Feature:cW},tap:{Feature:nW},focus:{Feature:rW},hover:{Feature:tW}},hW={layout:{ProjectionNode:EP,MeasureLayout:bP}},fW={...Jz,...dW,...eW,...hW},se=fz(fW,kz),mW=[{icon:d4,url:"/dashboard",label:"Home"},{icon:$t,url:"/models",label:"Video"},{icon:gt,url:"/image-models",label:"Image"},{icon:Pt,url:"/avatars",label:"Avatar"},{icon:D_,url:"/profile",label:"Profile"}];function pW(){const e=dn();return i.jsxs("nav",{className:"fixed bottom-0 left-0 right-0 z-50 md:hidden",children:[i.jsx("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xl border-t border-border/50"}),i.jsx("div",{className:"relative flex items-center justify-around px-2 h-[72px] pb-[env(safe-area-inset-bottom)]",children:mW.map(t=>{const r=e.pathname===t.url||t.url!=="/dashboard"&&e.pathname.startsWith(t.url);return i.jsxs(Jk,{to:t.url,className:"relative flex flex-col items-center justify-center w-16 h-14 touch-manipulation",children:[r&&i.jsx(se.div,{layoutId:"activeTab",className:"absolute -top-1 w-12 h-1 rounded-full bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:35}}),i.jsx(se.div,{className:J("flex items-center justify-center w-12 h-10 rounded-2xl transition-colors duration-200",r?"bg-primary/15":"bg-transparent"),whileTap:{scale:.9},transition:{type:"spring",stiffness:400,damping:25},children:i.jsx(t.icon,{className:J("w-5 h-5 transition-colors duration-200",r?"text-primary":"text-muted-foreground"),strokeWidth:r?2.5:2})}),i.jsx("span",{className:J("text-[10px] font-medium mt-0.5 transition-colors duration-200",r?"text-primary":"text-muted-foreground"),children:t.label})]},t.url)})})]})}function gW(){const{user:e,loading:t}=Tt(),r=Ce();return p.useEffect(()=>{!t&&!e&&r("/auth")},[e,t,r]),t?i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Oe,{className:"h-12 w-48"}),i.jsx(Oe,{className:"h-4 w-32"})]})}):e?i.jsx(Gv,{children:i.jsxs("div",{className:"min-h-screen flex w-full bg-background",children:[i.jsx(DV,{}),i.jsx("main",{className:"flex-1 overflow-auto",style:{WebkitOverflowScrolling:"touch"},children:i.jsx("div",{className:"container mx-auto px-4 py-4 sm:py-6 pb-24 md:pb-6 max-w-[1440px]",children:i.jsx(Yk,{})})}),i.jsx(pW,{})]})}):null}const xW=[{title:"Dashboard",url:"/admin",icon:T_,end:!0}];function vW(){return i.jsx(Wv,{className:"border-r border-border/50",children:i.jsx(qv,{children:i.jsxs(Y2,{children:[i.jsx(Q2,{className:"text-lg font-semibold px-4 py-3 text-sidebar-foreground",children:"Admin Panel"}),i.jsx(J2,{children:i.jsx(Hv,{className:"text-sidebar-foreground",children:xW.map(e=>i.jsx(nh,{children:i.jsx(Il,{asChild:!0,children:i.jsxs(Rl,{to:e.url,end:e.end,className:"hover:bg-sidebar-accent",activeClassName:"bg-sidebar-accent text-sidebar-foreground font-medium",children:[i.jsx(e.icon,{className:"h-4 w-4 text-sidebar-foreground"}),i.jsx("span",{children:e.title})]})})},e.title))})})]})})})}function yW(){const{user:e,loading:t}=Tt(),{data:r,isLoading:n}=Pl({queryKey:["is-admin",e==null?void 0:e.id],queryFn:async()=>{if(!(e!=null&&e.id))return!1;const{data:s,error:a}=await Y.rpc("is_admin",{uid:e.id});if(a)throw a;return s},enabled:!!(e!=null&&e.id)});return t||n?i.jsxs("div",{className:"min-h-screen bg-background p-8",children:[i.jsx(Oe,{className:"h-12 w-64 mb-8"}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(Oe,{className:"h-32 w-full"}),i.jsx(Oe,{className:"h-32 w-full"}),i.jsx(Oe,{className:"h-32 w-full"})]})]}):!e||!r?i.jsx(i$,{to:"/dashboard",replace:!0}):i.jsx(Gv,{children:i.jsxs("div",{className:"min-h-screen flex w-full",children:[i.jsx(vW,{}),i.jsxs("div",{className:"flex-1 flex flex-col",children:[i.jsx("header",{className:"h-14 flex items-center border-b border-border/50 px-6",children:i.jsx(q2,{})}),i.jsx("main",{className:"flex-1 p-6",children:i.jsx(Yk,{})})]})]})})}const va={hidden:{opacity:0,y:30},visible:e=>({opacity:1,y:0,transition:{delay:e*.1,duration:.6,ease:[.16,1,.3,1]}})},bW=[{icon:$t,title:"AI Video Generation",description:"Create stunning videos with Sora 2, Hailuo, Veo 3.1 and more cutting-edge models"},{icon:gt,title:"AI Image Generation",description:"Generate beautiful images with Flux, DALL·E, Midjourney-style models"},{icon:an,title:"AI Avatars",description:"Create lifelike talking avatars from a single photo with natural expressions"},{icon:vr,title:"Lightning Fast",description:"Get results in seconds with optimized inference and smart queuing"},{icon:Ks,title:"Enterprise Ready",description:"Secure API access, team management, and usage analytics built-in"}
607,{icon:E_,title:"Multi-Currency",description:"Pay in USD, PKR, INR, or AED â flexible pricing for everyone"}],wW=[{name:"Sora 2 Pro",provider:"OpenAI",tag:"Video"},{name:"Hailuo 2.3",provider:"MiniMax",tag:"Video"},{name:"Veo 3.1",provider:"Google",tag:"Video"},{name:"Grok Imagine",provider:"xAI",tag:"Video"},{name:"Seedance",provider:"ByteDance",tag:"Video"},{name:"Wan 2.6",provider:"Alibaba",tag:"Video"}],jW=()=>{const{user:e,loading:t}=Tt(),r=Ce();return p.useEffect(()=>{!t&&e&&r("/dashboard")},[e,t,r]),t||e?null:i.jsxs("div",{className:"min-h-screen bg-background text-foreground overflow-x-hidden",children:[i.jsx("header",{className:"fixed top-0 inset-x-0 z-50 bg-background/70 backdrop-blur-xl border-b border-border/30",children:i.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between px-4 sm:px-6 h-16",children:[i.jsxs("div",{className:"flex items-center gap-6",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-primary/10 flex items-center justify-center",children:i.jsx("img",{src:gc,alt:"MyReelGen",className:"w-5 h-5 object-contain"})}),i.jsx("span",{className:"text-lg font-bold tracking-tight",children:"MyReelGen"})]}),i.jsx("nav",{className:"hidden md:flex items-center gap-1",children:[{label:"Features",href:"/features"},{label:"Pricing",href:"/pricing"},{label:"Blog",href:"/blog"},{label:"About",href:"/about"}].map(n=>i.jsx(ye,{to:n.href,className:"px-3 py-2 text-sm text-muted-foreground hover:text-foreground transition-colors rounded-lg hover:bg-muted/50",children:n.label},n.href))})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Mv,{}),i.jsx(B,{variant:"ghost",size:"sm",onClick:()=>r("/auth"),children:"Sign In"}),i.jsxs(B,{size:"sm",onClick:()=>r("/auth"),className:"rounded-full px-5",children:["Get Started ",i.jsx(Lt,{className:"w-3.5 h-3.5 ml-1"})]})]})]})}),i.jsxs("section",{className:"relative pt-32 pb-20 sm:pt-40 sm:pb-28 px-4",children:[i.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[i.jsx("div",{className:"absolute top-1/4 left-1/2 -translate-x-1/2 w-[600px] h-[600px] bg-primary/10 rounded-full blur-[120px]"}),i.jsx("div",{className:"absolute top-1/3 left-1/4 w-[300px] h-[300px] bg-accent-foreground/5 rounded-full blur-[80px]"})]}),i.jsxs("div",{className:"relative max-w-4xl mx-auto text-center space-y-8",children:[i.jsxs(se.div,{custom:0,variants:va,initial:"hidden",animate:"visible",className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full border border-border/50 bg-card/50 backdrop-blur-sm text-sm text-muted-foreground",children:[i.jsx(Pt,{className:"w-3.5 h-3.5 text-primary"}),"Powered by the world's best AI models"]}),i.jsxs(se.h1,{custom:1,variants:va,initial:"hidden",animate:"visible",className:"text-4xl sm:text-6xl lg:text-7xl font-bold tracking-tight leading-[1.1]",children:["Create Stunning"," ",i.jsx("span",{className:"text-primary",children:"AI Videos"})," ","& Images"]}),i.jsx(se.p,{custom:2,variants:va,initial:"hidden",animate:"visible",className:"text-lg sm:text-xl text-muted-foreground max-w-2xl mx-auto",children:"Access premium AI models like Sora 2, Veo 3.1, and Hailuo â generate cinematic videos, stunning images, and lifelike avatars in seconds."}),i.jsxs(se.div,{custom:3,variants:va,initial:"hidden",animate:"visible",className:"flex flex-col sm:flex-row items-center justify-center gap-3",children:[i.jsxs(B,{size:"lg",onClick:()=>r("/auth"),className:"rounded-full px-8 h-12 text-base gap-2",children:[i.jsx(Lh,{className:"w-4 h-4"})," Start Creating Free"]}),i.jsx(B,{variant:"outline",size:"lg",onClick:()=>{var n;(n=document.getElementById("features"))==null||n.scrollIntoView({behavior:"smooth"})},className:"rounded-full px-8 h-12 text-base",children:"See Features"})]}),i.jsxs(se.div,{custom:4,variants:va,initial:"hidden",animate:"visible",className:"flex items-center justify-center gap-1 text-sm text-muted-foreground pt-4",children:[i.jsx("div",{className:"flex -space-x-2",children:[1,2,3,4].map(n=>i.jsx("div",{className:"w-7 h-7 rounded-full bg-primary/20 border-2 border-background flex items-center justify-center",children:i.jsx(wo,{className:"w-3 h-3 text-primary"})},n))}),i.jsx("span",{className:"ml-2",children:"Trusted by 2,000+ creators"})]})]})]}),i.jsx("section",{className:"py-12 border-y border-border/20",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-4",children:[i.jsx("p",{className:"text-center text-sm text-muted-foreground mb-6 uppercase tracking-widest font-medium",children:"Premium AI Models"}),i.jsx("div",{className:"flex flex-wrap items-center justify-center gap-3",children:wW.map(n=>i.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 rounded-full border border-border/40 bg-card/50 backdrop-blur-sm",children:[i.jsx("span",{className:"font-semibold text-sm",children:n.name}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["by ",n.provider]})]},n.name))})]})}),i.jsx("section",{id:"features",className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-6xl mx-auto",children:[i.jsxs(se.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},className:"text-center mb-14",children:[i.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Everything you need to create"}),i.jsx("p",{className:"text-muted-foreground text-lg max-w-xl mx-auto",children:"One platform, unlimited creative potential"})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:bW.map((n,s)=>
607i.jsxs(se.div,{custom:s,variants:va,initial:"hidden",whileInView:"visible",viewport:{once:!0},className:"group p-6 rounded-2xl border border-border/40 bg-card/50 hover:bg-card hover:border-primary/20 hover:shadow-lg transition-all",children:[i.jsx("div",{className:"w-11 h-11 rounded-xl bg-primary/10 flex items-center justify-center mb-4 group-hover:bg-primary/15 transition-colors",children:i.jsx(n.icon,{className:"w-5 h-5 text-primary"})}),i.jsx("h3",{className:"font-semibold text-lg mb-2",children:n.title}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n.description})]},n.title))})]})}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs(se.div,{initial:{opacity:0,scale:.95},whileInView:{opacity:1,scale:1},viewport:{once:!0},transition:{duration:.5},className:"max-w-3xl mx-auto text-center p-10 sm:p-16 rounded-3xl border border-border/40 bg-card/50 backdrop-blur-sm relative overflow-hidden",children:[i.jsx("div",{className:"absolute inset-0 bg-primary/5 pointer-events-none"}),i.jsxs("div",{className:"relative",children:[i.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Ready to create?"}),i.jsx("p",{className:"text-muted-foreground text-lg mb-8 max-w-md mx-auto",children:"Join thousands of creators using AI to produce incredible content."}),i.jsxs(B,{size:"lg",onClick:()=>r("/auth"),className:"rounded-full px-10 h-12 text-base gap-2",children:["Get Started Free ",i.jsx(S_,{className:"w-4 h-4"})]})]})]})}),i.jsx("footer",{className:"border-t border-border/20 py-12 px-4",children:i.jsxs("div",{className:"max-w-6xl mx-auto",children:[i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-8 mb-8",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:"Product"}),i.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsx("li",{children:i.jsx(ye,{to:"/features",className:"hover:text-foreground transition-colors",children:"Features"})}),i.jsx("li",{children:i.jsx(ye,{to:"/pricing",className:"hover:text-foreground transition-colors",children:"Pricing"})}),i.jsx("li",{children:i.jsx(ye,{to:"/changelog",className:"hover:text-foreground transition-colors",children:"Changelog"})}),i.jsx("li",{children:i.jsx(ye,{to:"/api-docs",className:"hover:text-foreground transition-colors",children:"API"})})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:"Company"}),i.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsx("li",{children:i.jsx(ye,{to:"/about",className:"hover:text-foreground transition-colors",children:"About"})}),i.jsx("li",{children:i.jsx(ye,{to:"/blog",className:"hover:text-foreground transition-colors",children:"Blog"})}),i.jsx("li",{children:i.jsx(ye,{to:"/customers",className:"hover:text-foreground transition-colors",children:"Customers"})}),i.jsx("li",{children:i.jsx(ye,{to:"/contact",className:"hover:text-foreground transition-colors",children:"Contact"})})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:"Use Cases"}),i.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsx("li",{children:i.jsx(ye,{to:"/use-cases/ecommerce",className:"hover:text-foreground transition-colors",children:"E-commerce"})}),i.jsx("li",{children:i.jsx(ye,{to:"/use-cases/marketing",className:"hover:text-foreground transition-colors",children:"Marketing"})}),i.jsx("li",{children:i.jsx(ye,{to:"/use-cases/real-estate",className:"hover:text-foreground transition-colors",children:"Real Estate"})}),i.jsx("li",{children:i.jsx(ye,{to:"/use-cases",className:"hover:text-foreground transition-colors",children:"All Use Cases"})})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:"Compare"}),i.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsx("li",{children:i.jsx(ye,{to:"/compare/runwayml",className:"hover:text-foreground transition-colors",children:"vs RunwayML"})}),i.jsx("li",{children:i.jsx(ye,{to:"/compare/pika",className:"hover:text-foreground transition-colors",children:"vs Pika"})}),i.jsx("li",{children:i.jsx(ye,{to:"/compare/synthesia",className:"hover:text-foreground transition-colors",children:"vs
607Synthesia"})}),i.jsx("li",{children:i.jsx(ye,{to:"/compare",className:"hover:text-foreground transition-colors",children:"All Comparisons"})})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:"Legal"}),i.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsx("li",{children:i.jsx(ye,{to:"/privacy",className:"hover:text-foreground transition-colors",children:"Privacy"})}),i.jsx("li",{children:i.jsx(ye,{to:"/terms",className:"hover:text-foreground transition-colors",children:"Terms"})}),i.jsx("li",{children:i.jsx(ye,{to:"/cookies",className:"hover:text-foreground transition-colors",children:"Cookies"})}),i.jsx("li",{children:i.jsx(ye,{to:"/acceptable-use",className:"hover:text-foreground transition-colors",children:"Acceptable Use"})})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:"Trust"}),i.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsx("li",{children:i.jsx(ye,{to:"/security",className:"hover:text-foreground transition-colors",children:"Security"})}),i.jsx("li",{children:i.jsx(ye,{to:"/status",className:"hover:text-foreground transition-colors",children:"Status"})}),i.jsx("li",{children:i.jsx(ye,{to:"/gdpr",className:"hover:text-foreground transition-colors",children:"GDPR"})})]})]})]}),i.jsxs("div",{className:"pt-8 border-t border-border/20 flex flex-col sm:flex-row items-center justify-between gap-4 text-sm text-muted-foreground",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:gc,alt:"MyReelGen",className:"w-4 h-4 object-contain"}),i.jsx("span",{className:"font-medium text-foreground",children:"MyReelGen"})]}),i.jsxs("p",{children:["© ",new Date().getFullYear()," MyReelGen. All rights reserved."]})]})]})})]})};var NW="authorization_response",SW="/~oauth/initiate",_W=["https://oauth.lovable.app"];function kW(e){let t;const r=new Promise(a=>{t=a}),n=a=>{if(!e.some(c=>a.origin===c))return;const l=a.data;!l||typeof l!="object"||l.type===NW&&t(l.response)},s=()=>{window.removeEventListener("message",n)};return window.addEventListener("message",n),{cleanup:s,messagePromise:r}}function CW(e){const t=window.screenX!==0||window.screenY!==0||!e,r=t?window.outerWidth*.5:window.screen.width*.5,n=t?window.outerHeight*.5:window.screen.height*.5,s=t?window.screenX+(window.outerWidth-r)/2:(window.screen.width-r)/2,a=t?window.screenY+(window.outerHeight-n)/2:(window.screen.height-n)/2;return{width:r,height:n,left:s,top:a}}function EW(){return typeof crypto<"u"&&crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(16))].map(e=>e.toString(16).padStart(2,"0")).join(""):Math.random().toString(36).substring(2)+Date.now().toString(36)}function PW(e={}){const t=e.oauthBrokerUrl??SW,r=e.supportedOAuthOrigins??_W;async function n(s,a={}){let o=!1;try{o=window.self!==window.top}catch{o=!0}const l=EW(),c=a.redirect_uri??window.location.origin,u=new URLSearchParams({provider:s,redirect_uri:c,state:l,...a.extraParams});if(!o)return window.location.href=`${t}?${u.toString()}`,{error:null,redirected:!0};u.set("response_mode","web_message");const d=`${t}?${u.toString()}`,{messagePromise:h,cleanup:f}=kW(r),m=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);let w;if(m)w=window.open(d,"_blank");else{const{width:b,height:v,left:x,top:j}=CW(o);w=window.open(d,"oauth",`width=${b},height=${v},left=${x},top=${j}`)}if(!w)return f(),{error:new Error("Popup was blocked")};let g;const y=new Promise((b,v)=>{g=setInterval(()=>{w.closed&&(clearInterval(g),v(new Error("Sign in was cancelled")))},500)});try{const b=await Promise.race([h,y]);return b.error?b.error==="legacy_flow"?{error:new Error("This flow is not supported in Preview mode. Please open the app in a new tab to sign in.")}:{error:new Error(b.error_description??"Sign in failed")}:b.state!==l?{error:new Error("State is invalid")}:!b.access_token||!b.refresh_token?{error:new Error("No tokens received")}:{tokens:{access_token:b.access_token,refresh_token:b.refresh_token},error:null}}catch(b){return{error:b instanceof Error?b:new Error(String(b))}}finally{clearInterval(g),f(),w==null||w.close()}}return{signInWithOAuth:n}}function TW(e){return PW(e)}const AW=TW({}),RW={auth:{signInWithOAuth:async(e,t)=>{const r=await AW.signInWithOAuth(e,{redirect_uri:t==null?void 0:t.redirect_uri,extraParams:{...t==null?void 0:t.extraParams}});if(r.redirected||r.error)return r;try{await Y.auth.setSession(r.tokens)}catch(n){return{error:n instanceof Error?n:new Error(String(n))}}return r}}};var IW="Label",PP=p.forwardRef((e,t)=>
607i.jsx(ue.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));PP.displayName=IW;var TP=PP;const OW=Io("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),le=p.forwardRef(({className:e,...t},r)=>i.jsx(TP,{ref:r,className:J(OW(),e),...t}));le.displayName=TP.displayName;const ae=p.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:J("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ae.displayName="Card";const ot=p.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:J("flex flex-col space-y-1.5 p-6",e),...t}));ot.displayName="CardHeader";const lt=p.forwardRef(({className:e,...t},r)=>i.jsx("h3",{ref:r,className:J("text-2xl font-semibold leading-none tracking-tight",e),...t}));lt.displayName="CardTitle";const $r=p.forwardRef(({className:e,...t},r)=>i.jsx("p",{ref:r,className:J("text-sm text-muted-foreground",e),...t}));$r.displayName="CardDescription";const be=p.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:J("p-6 pt-0",e),...t}));be.displayName="CardContent";const MW=p.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:J("flex items-center p-6 pt-0",e),...t}));MW.displayName="CardFooter";const DW=()=>{const[e,t]=p.useState(!0),[r,n]=p.useState(""),[s,a]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(""),[d,h]=p.useState(!1),f=Ce(),m=async w=>{if(w.preventDefault(),h(!0),!e){const g=c.replace(/[\s\-\(\)]/g,"");if(!g||!/^\+\d{10,15}$/.test(g)){Te.error("Please enter a valid WhatsApp number in E.164 format (e.g., +923xxxxxxxxx)");return}try{const{data:y}=await Y.from("users_meta").select("user_id").eq("whatsapp_number",g.replace("+","")).single();if(y){Te.error("This WhatsApp number is already used by another account.");return}}catch{}}try{if(e){const{error:g}=await Y.auth.signInWithPassword({email:r,password:s});if(g)throw g;Te.success("Welcome back!"),f("/dashboard")}else{const{data:g,error:y}=await Y.auth.signUp({email:r,password:s,options:{emailRedirectTo:`${window.location.origin}/`,data:{display_name:o}}});if(y)throw y;if(g.user){const b=c.replace(/[\s\-\(\)]/g,"").replace("+","");await Y.from("users_meta").update({whatsapp_number:b,whatsapp_verified:!1}).eq("user_id",g.user.id),Te.success("Account created successfully!"),f("/dashboard")}}}catch(g){Te.error(g.message||"Authentication failed")}finally{h(!1)}};return i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background via-background to-accent p-4",children:i.jsxs(ae,{className:"w-full max-w-md
607shadow-elegant border-border/50 bg-card/95 backdrop-blur-sm",children:[i.jsxs(ot,{className:"space-y-1 text-center",children:[i.jsx("div",{className:"mx-auto w-12 h-12 bg-gradient-to-br from-primary to-accent-foreground rounded-xl flex items-center justify-center mb-4",children:i.jsx(Pt,{className:"w-6 h-6 text-primary-foreground"})}),i.jsx(lt,{className:"text-2xl font-bold text-card-foreground",children:"MyReelGen AI"}),i.jsx($r,{children:e?"Sign in to your account":"Create a new account"})]}),i.jsxs(be,{children:[i.jsxs("form",{onSubmit:m,className:"space-y-4",children:[!e&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"displayName",children:"Display Name"}),i.jsx(tt,{id:"displayName",placeholder:"Your name",value:o,onChange:w=>l(w.target.value),required:!e})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"whatsappNumber",children:"WhatsApp Number"}),i.jsx(tt,{id:"whatsappNumber",type:"tel",placeholder:"+923xxxxxxxxx",value:c,onChange:w=>u(w.target.value),required:!e,className:c&&!/^\+\d{10,15}$/.test(c.replace(/[\s\-\(\)]/g,""))?"border-destructive":""}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"E.164 format required (e.g., +923250754569)"}),c&&!/^\+\d{10,15}$/.test(c.replace(/[\s\-\(\)]/g,""))&&i.jsx("p",{className:"text-xs text-destructive",children:"Must start with + and contain 10-15 digits"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"email",children:"Email"}),i.jsx(tt,{id:"email",type:"email",placeholder:"[email protected]",value:r,onChange:w=>n(w.target.value),required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"password",children:"Password"}),i.jsx(tt,{id:"password",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:s,onChange:w=>a(w.target.value),required:!0,minLength:6})]}),i.jsx(B,{type:"submit",className:"w-full",disabled:d,children:d?"Loading...":e?"Sign In":"Sign Up"})]}),i.jsxs("div",{className:"relative my-4",children:[i.jsx("div",{className:"absolute inset-0 flex items-center",children:i.jsx("span",{className:"w-full border-t border-border"})}),i.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:i.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"Or continue with"})})]}),i.jsxs(B,{type:"button",variant:"outline",className:"w-full",onClick:async()=>{const{error:w}=await RW.auth.signInWithOAuth("google",{redirect_uri:window.location.origin});w&&Te.error(w.message||"Google sign-in failed")},children:[i.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[i.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),i.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),i.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),i.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Continue with Google"]}),i.jsx("div",{className:"mt-4 text-center text-sm",children:i.jsx("button",{type:"button",onClick:()=>t(!e),className:"text-primary hover:underline",children:e?"Don't have an account? Sign up":"Already have an account? Sign in"})})]})]})})};function AP(){const[e,t]=p.useState(0),[r,n]=p.useState(0),[s,a]=p.useState(!0);p.useEffect(()=>{o();const c=Y.channel("credits-changes").on("postgres_changes",{event:"UPDATE",schema:"public",table:"users_meta"},u=>{const d=u.new;t(d.credits||0),n(d.wallet_balance||0)}).subscribe();return()=>{Y.removeChannel(c)}},[]);const o=async()=>{try{const{data:{user:c},error:u}=await Y.auth.getUser();if(u||!c){a(!1);return}const{data:d,error:h}=await Y.from("users_meta").select("credits, wallet_balance").eq("user_id",c.id).single();if(h){console.error("Error fetching credits:",h),a(!1);return}t(d.credits||0),n(d.wallet_balance||0)}catch(c){console.error("Error in fetchCredits:",c)}finally{a(!1)}};return{credits:e,walletBalance:r,loading:s,refreshCredits:()=>{o()}}}const LW=Io("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 xe({className:e,variant:t,...r}){return i.jsx("div",{className:J(LW({variant:t}),e),...r})}var _y="Progress",ky=100,[$W,mK]=Kt(_y),[FW,UW]=$W(_y),RP=p.forwardRef((e,t)=>
607{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:a=VW,...o}=e;(s||s===0)&&!qj(s)&&console.error(BW(`${s}`,"Progress"));const l=qj(s)?s:ky;n!==null&&!Hj(n,l)&&console.error(zW(`${n}`,"Progress"));const c=Hj(n,l)?n:null,u=uh(c)?a(c,l):void 0;return i.jsx(FW,{scope:r,value:c,max:l,children:i.jsx(ue.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":uh(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":MP(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});RP.displayName=_y;var IP="ProgressIndicator",OP=p.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=UW(IP,r);return i.jsx(ue.div,{"data-state":MP(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});OP.displayName=IP;function VW(e,t){return`${Math.round(e/t*100)}%`}function MP(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function uh(e){return typeof e=="number"}function qj(e){return uh(e)&&!isNaN(e)&&e>0}function Hj(e,t){return uh(e)&&!isNaN(e)&&e<=t&&e>=0}function BW(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ky}\`.`}function zW(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: 608 - a positive number 609 - less than the value passed to \`max\` (or ${ky} if no \`max\` prop is set) 610 - \`null\` or \`undefined\` if the progress is indeterminate. 611 612Defaulting to \`null\`.`}var DP=RP,GW=OP;const Cy=p.forwardRef(({className:e,value:t,...r},n)=>i.jsx(DP,{ref:n,className:J("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:i.jsx(GW,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Cy.displayName=DP.displayName;const ya={hidden:{opacity:0,y:20},visible:e=>({opacity:1,y:0,transition:{delay:e*.08,duration:.4,ease:[0,0,.2,1]}})},WW=()=>{var h;const{user:e,userMeta:t,loading:r}=Tt(),{credits:n}=AP(),s=Ce(),{data:a}=Pl({queryKey:["recent-videos",e==null?void 0:e.id],queryFn:async()=>{const{data:f}=await Y.from("video_generations").select("id, status, created_at, model_id, credits_used").eq("user_id",e.id).order("created_at",{ascending:!1}).limit(5);return f||[]},enabled:!!(e!=null&&e.id)}),{data:o}=Pl({queryKey:["recent-images",e==null?void 0:e.id],queryFn:async()=>{const{data:f}=await Y.from("image_generations").select("id, status, created_at, model_id, credits_used").eq("user_id",e.id).order("created_at",{ascending:!1}).limit(5);return f||[]},enabled:!!(e!=null&&e.id)}),{data:l}=Pl({queryKey:["dashboard-stats",e==null?void 0:e.id],queryFn:async()=>{const[f,m]=await Promise.all([Y.from("video_generations").select("id",{count:"exact",head:!0}).eq("user_id",e.id),Y.from("image_generations").select("id",{count:"exact",head:!0}).eq("user_id",e.id)]);return{totalVideos:f.count||0,totalImages:m.count||0}},enabled:!!(e!=null&&e.id)});if(r)return i.jsxs("div",{className:"space-y-6",children:[i.jsx(Oe,{className:"h-24 w-full rounded-2xl"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.jsx(Oe,{className:"h-36 rounded-2xl"}),i.jsx(Oe,{className:"h-36 rounded-2xl"}),i.jsx(Oe,{className:"h-36 rounded-2xl"})]})]});const c=(t==null?void 0:t.display_name)||((h=e==null?void 0:e.email)==null?void 0:h.split("@")[0])||"there",u=1e3,d=[{label:"Generate Video",icon:$t,path:"/models",color:"from-blue-500 to-indigo-600"},{label:"Generate Image",icon:gt,path:"/image-models",color:"from-pink-500 to-rose-600"},{label:"AI Avatars",icon:an,path:"/avatars",color:"from-amber-500 to-orange-600"}];return i.jsxs("div",{className:"space-y-6 max-w-6xl",children:[i.jsxs(se.div,{initial:"hidden",animate:"visible",custom:0,variants:ya,className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-primary/10 via-primary/5 to-background border border-border/50 p-6 md:p-8",children:[i.jsxs("div",{className:"relative z-10",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(Pt,{className:"w-5 h-5 text-primary"}),i.jsx(xe,{variant:"secondary",className:"text-xs font-medium",children:(t==null?void 0:t.subscription_status)==="active"?"Pro":"Free Plan"})]}),i.jsxs("h1",{className:"text-2xl md:text-3xl font-bold text-foreground mt-2",children:["Welcome back, ",c," ð"]}),i.jsx("p",{className:"text-muted-foreground mt-1 text-sm md:text-base",children:"Create stunning AI-generated videos, images, and avatars."})]}),i.jsx("div",{className:"absolute -right-8 -bottom-8 w-40 h-40 rounded-full bg-primary/5 blur-2xl"})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[i.jsx(se.div,{initial:"hidden",animate:"visible",custom:1,variants:ya,children:i.jsx(ae,{className:"border-border/50 bg-card hover:shadow-md transition-shadow",children:i.jsxs(be,{className:"p-5",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("div",{className:"p-2.5 rounded-xl bg-primary/10",children:i.jsx(a4,{className:"w-5 h-5 text-primary"})}),i.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Balance"})]}),i.jsx("p",{className:"text-3xl font-bold text-foreground",children:n.toLocaleStr
612ing()}),i.jsx(Cy,{value:Math.min(n/u*100,100),className:"h-1.5 mt-3"}),i.jsxs(B,{variant:"link",size:"sm",className:"p-0 h-auto mt-2 text-xs text-primary",onClick:()=>s("/profile"),children:["Buy more credits ",i.jsx(Lt,{className:"w-3 h-3 ml-1"})]})]})})}),i.jsx(se.div,{initial:"hidden",animate:"visible",custom:2,variants:ya,children:i.jsx(ae,{className:"border-border/50 bg-card hover:shadow-md transition-shadow",children:i.jsxs(be,{className:"p-5",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("div",{className:"p-2.5 rounded-xl bg-blue-500/10",children:i.jsx($t,{className:"w-5 h-5 text-blue-500"})}),i.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Videos"})]}),i.jsx("p",{className:"text-3xl font-bold text-foreground",children:(l==null?void 0:l.totalVideos)??0}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Total generated"})]})})}),i.jsx(se.div,{initial:"hidden",animate:"visible",custom:3,variants:ya,children:i.jsx(ae,{className:"border-border/50 bg-card hover:shadow-md transition-shadow",children:i.jsxs(be,{className:"p-5",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("div",{className:"p-2.5 rounded-xl bg-pink-500/10",children:i.jsx(gt,{className:"w-5 h-5 text-pink-500"})}),i.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Images"})]}),i.jsx("p",{className:"text-3xl font-bold text-foreground",children:(l==null?void 0:l.totalImages)??0}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Total generated"})]})})})]}),i.jsxs(se.div,{initial:"hidden",animate:"visible",custom:4,variants:ya,children:[i.jsxs("h2",{className:"text-lg font-semibold text-foreground mb-3 flex items-center gap-2",children:[i.jsx(vr,{className:"w-4 h-4 text-primary"})," Quick Actions"]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:d.map(f=>i.jsxs(B,{variant:"outline",className:"h-auto p-5 flex flex-col items-center gap-3 border-border/50 hover:border-primary/30 hover:bg-primary/5 transition-all group",onClick:()=>s(f.path),children:[i.jsx("div",{className:`p-3 rounded-xl bg-gradient-to-br ${f.color} text-white group-hover:scale-110 transition-transform`,children:i.jsx(f.icon,{className:"w-6 h-6"})}),i.jsx("span",{className:"text-sm font-medium text-foreground",children:f.label})]},f.label))})]}),i.jsxs(se.div,{initial:"hidden",animate:"visible",custom:5,variants:ya,children:[i.jsxs("h2",{className:"text-lg font-semibold text-foreground mb-3 flex items-center gap-2",children:[i.jsx(xr,{className:"w-4 h-4 text-primary"})," Recent Activity"]}),i.jsx(ae,{className:"border-border/50",children:i.jsx(be,{className:"p-0",children:!(a!=null&&a.length)&&!(o!=null&&o.length)?i.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[i.jsx(A4,{className:"w-10 h-10 text-muted-foreground/40 mb-3"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"No generations yet"}),i.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Start creating to see your activity here"})]}):i.jsx("div",{className:"divide-y divide-border/50",children:[...(a||[]).map(f=>({...f,type:"video"})),...(o||[]).map(f=>({...f,type:"image"}))].sort((f,m)=>new Date(m.created_at).getTime()-new Date(f.created_at).getTime()).slice(0,8).map(f=>{var m;return i.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 hover:bg-muted/30 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:`p-1.5 rounded-lg ${f.type==="video"?"bg-blue-500/10":"bg-pink-500/10"}`,children:f.type==="video"?i.jsx($t,{className:"w-4 h-4 text-blue-500"}):i.jsx(gt,{className:"w-4 h-4 text-pink-500"})}),i.jsxs("div",{children:[i.jsxs("p",{className:"text-sm font-medium text-foreground capitalize",children:[f.type," · ",(m=f.model_id)==null?void 0:m.replace(/-/g," ").slice(0,20)]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(f.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[f.credits_used&&i.jsxs("span",{className:"text-xs text-muted-foreground",children:[f.credits_used," cr"]}),i.jsx(xe,{variant:f.status==="completed"?"default":f.status==="failed"?"destructive":"secondary",className:"text-[10px] px-2",children:f.status})]})]},f.id)})})})})]})]})};function Ey(e=!0){const[t,r]=p.useState([]),[n,s]=p.useState(!0),[a,o]=p.useState(null);p.useEffect(()=>{l()},[e]);const l=async()=>{try{s(!0);let u=Y.from("ai_models").select("*").order("price",{ascending:!0});e&&(u=u.eq("enabled",!0));const{data:d,error:h}=await u;if(h)throw h;const f=(d||[]).map(m=>({...m,resolution_supported:Array.isArray(m.resolution_supported)?m.resolution_supported:JSON.parse(m.resolution_supported),durations_supp
612orted:Array.isArray(m.durations_supported)?m.durations_supported:JSON.parse(m.durations_supported),api_metadata:typeof m.api_metadata=="object"&&m.api_metadata!==null?m.api_metadata:JSON.parse(m.api_metadata),generation_types:Array.isArray(m.generation_types)?m.generation_types:[],input_rules:typeof m.input_rules=="object"&&m.input_rules!==null?m.input_rules:{},pricing_credits:typeof m.pricing_credits=="object"&&m.pricing_credits!==null?m.pricing_credits:{},showcase:typeof m.showcase=="object"&&m.showcase!==null?m.showcase:{}}));r(f),o(null)}catch(u){console.error("Error fetching models:",u),o(u instanceof Error?u.message:"Failed to fetch models")}finally{s(!1)}};return{models:t,loading:n,error:a,refreshModels:()=>{l()}}}const qW={OpenAI:"from-emerald-500/20 to-teal-500/10",MiniMax:"from-blue-500/20 to-cyan-500/10","Google DeepMind":"from-amber-500/20 to-orange-500/10",ByteDance:"from-rose-500/20 to-pink-500/10",xAI:"from-violet-500/20 to-purple-500/10",Alibaba:"from-orange-500/20 to-yellow-500/10"},HW={OpenAI:"text-emerald-500",MiniMax:"text-blue-500","Google DeepMind":"text-amber-500",ByteDance:"text-rose-500",xAI:"text-violet-500",Alibaba:"text-orange-500"},KW={New:{icon:Pt,className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20"},Popular:{icon:vr,className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20"},Pro:{icon:Fd,className:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20"},Premium:{icon:Fd,className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20"}};function LP({groupName:e,provider:t,modelCount:r,category:n,description:s,slug:a,tag:o}){const l=Ce(),c=qW[t]||"from-primary/20 to-primary/5",u=HW[t]||"text-primary",d=()=>n.toLowerCase().includes("voice")?i.jsx(I_,{className:"w-10 h-10"}):n.toLowerCase().includes("image")?i.jsx(gt,{className:"w-10 h-10"}):i.jsx($t,{className:"w-10 h-10"}),h=()=>e.toLowerCase().includes("sora")||e.toLowerCase().includes("veo")||e.toLowerCase().includes("grok")?["Text to Video","Image to Video"]:["Image to Video"],f=o?KW[o]:null;return i.jsxs(ae,{className:"group cursor-pointer overflow-hidden border-border/50 bg-card hover:border-primary/30 hover:shadow-md transition-all duration-300 active:scale-[0.98]",onClick:()=>l(`/model/${a}`),children:[i.jsxs("div",{className:`aspect-[16/9] relative overflow-hidden bg-gradient-to-br ${c}`,children:[i.jsx("div",{className:`absolute inset-0 flex items-center justify-center ${u} opacity-40 group-hover:opacity-70 group-hover:scale-110 transition-all duration-500`,children:d()}),i.jsx("div",{className:"absolute top-2.5 left-2.5 flex flex-wrap gap-1.5",children:h().map(m=>i.jsx(xe,{variant:"secondary",className:"text-[10px] bg-background/80 dark:bg-background/60 backdrop-blur-sm border-0 font-medium",children:m},m))}),f&&i.jsx("div",{className:"absolute top-2.5 right-2.5",children:i.jsxs(xe,{className:`text-[10px] border font-semibold gap-1 ${f.className}`,children:[i.jsx(f.icon,{className:"w-3 h-3"}),o]})}),i.jsx("div",{className:"absolute bottom-0 inset-x-0 h-12 bg-gradient-to-t from-card to-transparent"})]}),i.jsxs("div",{className:"p-4 space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"font-bold text-base text-foreground group-hover:text-primary transition-colors",children:e}),i.jsxs("span",{className:"text-[10px] text-muted-foreground bg-muted/50 dark:bg-muted/30 px-2 py-0.5 rounded-full",children:[r," ",r===1?"variant":"variants"]})]}),i.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:t}),s&&i.jsx("p",{className:"text-xs text-muted-foreground/70 line-clamp-2 leading-relaxed",children:s})]})]})}function $P(){return i.jsxs(ae,{className:"border-border/50 bg-card overflow-hidden",children:[i.jsx(Oe,{className:"aspect-[16/9] w-full bg-muted/30"}),i.jsxs(be,{className:"p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(Oe,{className:"h-5 w-3/4 rounded-full bg-muted/30"}),i.jsx(Oe,{className:"h-4 w-16 rounded-full bg-muted/30"})]}),i.jsx(Oe,{className:"h-3 w-1/3 rounded-full bg-muted/30"}),i.jsx(Oe,{className:"h-3 w-full rounded-full bg-muted/30"})]})]})}const ol={hidden:{opacity:0,y:16},visible:e=>({opacity:1,y:0,transition:{delay:e*.06,duration:.4,ease:[.16,1,.3,1]}})},YW=[{name:"UGC Ad Generator",description:"Upload a product image â AI generates authentic UGC-style video ads",route:"/agent/ugc-ad-generator",credits:300,icon:qn,gradient:"from-
612amber-500/20 via-orange-500/10 to-rose-500/10",iconColor:"text-amber-500",tag:"Popular"},{name:"Sora Watermark Remover",description:"Remove watermarks from Sora-generated videos automatically",route:"/agent/sora-watermark-remover",credits:10,icon:Lr,gradient:"from-violet-500/20 via-purple-500/10 to-indigo-500/10",iconColor:"text-violet-500"}],QW=()=>{const{models:e,loading:t}=Ey(),[r,n]=p.useState(""),[s,a]=p.useState("all"),o=Ce(),l=[{name:"Hailuo 2.3",provider:"MiniMax",description:"Cinematic image-to-video AI model with stunning quality",models:e.filter(f=>f.model_group==="hailuo-2-3"&&f.enabled),category:"video",slug:"hailuo-2-3",tag:"Popular"},{name:"Sora 2",provider:"OpenAI",description:"Text-to-video & image-to-video generation",models:e.filter(f=>f.model_group==="sora-2"&&f.enabled),category:"video",slug:"sora-2",tag:"New"},{name:"Sora 2 Pro",provider:"OpenAI",description:"High quality advanced video model for professionals",models:e.filter(f=>f.model_group==="sora-2-pro"&&f.enabled),category:"video",slug:"sora-2-pro",tag:"Pro"},{name:"Grok Imagine",provider:"xAI",description:"Multimodal text & image-to-video model",models:e.filter(f=>f.model_group==="grok-imagine"&&f.enabled),category:"video",slug:"grok-imagine"},{name:"Veo 3.1",provider:"Google DeepMind",description:"Cinematic high-fidelity video generation",models:e.filter(f=>(f.model_group==="veo-3"||f.model_group==="veo-3-1")&&f.enabled),category:"video",slug:"veo-3",tag:"Premium"},{name:"Seedance",provider:"ByteDance",description:"Fast image-to-video with camera control",models:e.filter(f=>f.model_group==="seedance"&&f.enabled),category:"video",slug:"seedance"},{name:"Wan 2.6",provider:"Alibaba",description:"Multi-shot 1080p with stable characters and native audio",models:e.filter(f=>f.model_group==="wan-2-6"&&f.enabled),category:"video",slug:"wan-2-6"}].filter(f=>f.models.length>0),c=["all",...new Set(l.map(f=>f.provider))],u=l.filter(f=>{const m=!r||f.name.toLowerCase().includes(r.toLowerCase())||f.provider.toLowerCase().includes(r.toLowerCase()),w=s==="all"||f.provider===s;return m&&w}),d=YW.filter(f=>!r||f.name.toLowerCase().includes(r.toLowerCase())),h=d.length>0&&s==="all";return i.jsxs("div",{className:"space-y-6 pb-8",children:[i.jsxs(se.div,{custom:0,variants:ol,initial:"hidden",animate:"visible",className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold text-foreground",children:"Video Models"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose from the world's best AI video generation models"})]}),i.jsxs("button",{onClick:()=>o("/api-docs"),className:"hidden sm:flex items-center gap-2 px-4 py-2 rounded-xl bg-card border border-border/50 text-sm font-medium text-muted-foreground hover:text-foreground hover:border-primary/30 transition-all",children:[i.jsx(sc,{className:"w-4 h-4"}),"API Docs"]})]}),i.jsxs(se.div,{custom:1,variants:ol,initial:"hidden",animate:"visible",className:"space-y-3",children:[i.jsxs("div",{className:"relative max-w-md",children:[i.jsx(Ki,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),i.jsx(tt,{placeholder:"Search models or providersâ¦",value:r,onChange:f=>n(f.target.value),className:"pl-10 h-10 rounded-xl bg-card border-border/40 focus:border-primary/50"})]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:c.map(f=>i.jsx("button",{onClick:()=>a(f),className:`px-3 py-1.5 rounded-full text-xs font-medium transition-all ${s===f?"bg-primary text-primary-foreground":"bg-card border border-border/40 text-muted-foreground hover:text-foreground hover:border-border"}`,children:f==="all"?"All Models":f},f))})]}),h&&i.jsxs(se.div,{custom:2,variants:ol,initial:"hidden",animate:"visible",className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(sv,{className:"w-5 h-5 text-primary"}),i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Agents"})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:d.map((f,m)=>{const w=f.icon;return i.jsx(se.div,{custom:m+3,variants:ol,initial:"hidden",animate:"visible",children:i.jsxs(ae,{className:"group cursor-pointer overflow-hidden border-border/40 bg-card hover:border-primary/30 hover:shadow-xl hover:shadow-
612primary/5 transition-all duration-300 active:scale-[0.98]",onClick:()=>o(f.route),children:[i.jsxs("div",{className:`aspect-[2.2/1] bg-gradient-to-br ${f.gradient} relative flex items-center justify-center overflow-hidden`,children:[i.jsx("div",{className:"absolute -top-6 -right-6 w-24 h-24 rounded-full bg-primary/5 group-hover:bg-primary/10 transition-colors"}),i.jsx("div",{className:"absolute -bottom-4 -left-4 w-16 h-16 rounded-full bg-primary/5 group-hover:bg-primary/10 transition-colors"}),i.jsx(w,{className:`w-12 h-12 ${f.iconColor} opacity-50 group-hover:opacity-80 group-hover:scale-110 transition-all duration-300`}),f.tag&&i.jsx("div",{className:"absolute top-2.5 left-2.5",children:i.jsxs(xe,{className:"text-[10px] bg-primary/90 text-primary-foreground border-0 shadow-sm",children:[i.jsx(vr,{className:"w-2.5 h-2.5 mr-0.5"}),f.tag]})}),i.jsx("div",{className:"absolute top-2.5 right-2.5",children:i.jsxs(xe,{variant:"secondary",className:"text-[10px] bg-background/80 dark:bg-background/60 backdrop-blur-sm border-0 font-semibold",children:[f.credits," Credits"]})})]}),i.jsxs(be,{className:"p-4 space-y-2",children:[i.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:f.name}),i.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:f.description}),i.jsx("div",{className:"flex gap-1.5",children:i.jsxs(xe,{variant:"outline",className:"text-[10px] gap-1 border-border/40",children:[i.jsx(Pt,{className:"w-3 h-3"})," AI Agent"]})})]})]})},f.name)})})]}),t?i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:6}).map((f,m)=>i.jsx($P,{},m))}):u.length>0?i.jsxs("div",{className:"space-y-3",children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Generation Models"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:u.map((f,m)=>i.jsx(se.div,{custom:m+d.length+3,variants:ol,initial:"hidden",animate:"visible",children:i.jsx(LP,{groupName:f.name,provider:f.provider,modelCount:f.models.length,category:f.category,description:f.description,slug:f.slug,tag:f.tag})},f.name))})]}):h?null:i.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[i.jsx(Ki,{className:"w-10 h-10 text-muted-foreground/20 mb-3"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:r?"No models found":"No models available"})]})]})},JW=[{id:"ai-headshot",name:"AI Passport & LinkedIn Headshot",description:"Upload your photo, get a professional headshot",icon:an,cost:"4 cr",features:["Photo Upload","4 Styles","Auto-generate"],gradient:"from-pink-500 to-rose-500",route:"/agent/ai-headshot"},{id:"ghost-mannequin",name:"AI Ghost Mannequin",description:"Transform product photos into clean e-commerce images",icon:qn,cost:"4 cr",features:["Product Enhancement","Background removal","Studio quality"],gradient:"from-indigo-500 to-violet-500",route:"/agent/ghost-mannequin"}],XW=[{id:"nano-banana",name:"Nano Banana",description:"Text to Image via Gemini 3",icon:Pt,cost:"4 cr",features:["Text to Image","Multiple sizes","PNG/JPEG"],gradient:"from-amber-500 to-orange-500"},{id:"nano-banana-edit",name:"Nano Banana Edit",description:"Edit images with text instructions",icon:Lr,cost:"4 cr",features:["Image Editing","Up to 10 images","Text instructions"],gradient:"from-violet-500 to-pink-500"},{id:"nano-banana-pro",name:"Nano Banana Pro",description:"High-res generation up to 4K",icon:vr,cost:"18-24 cr",features:["Up to 4K","Reference images","10K prompts"],gradient:"from-blue-500 to-cyan-500"}],ZW=[{id:"seedream-v4-text-to-image",name:"Seedream V4",description:"ByteDance high-quality text-to-image",icon:P_,cost:"10 cr",features:["Text to Image","Up to 4K"],gradient:"from-emerald-500 to-teal-500"},{id:"seedream-v4-edit",name:"Seedream V4 Edit",description:"ByteDance AI image editing",icon:Lr,cost:"12 cr",features:["Image Editing","Up to 4K"],gradient:"from-teal-500 to-cyan-500"},{id:"flux-kontext-pro",name:"Flux Kontext Pro",description:"High-quality Flux text-to-image",icon:Vd,cost:"15 cr",features:["Text to Image","Pro quality"],gradient:"from-violet-500 to-purple-500"},{id:"gpt4o-image",name:"GPT-4o Image",description:"OpenAI GPT-4o image generation",icon:sv,cost:"20 cr",features:["Text to Image","Image Edit"],gradient:"from-green-500 to-emerald-500"}],eq=[{id:"recraft-crisp-upscale",name:"Recraft Crisp Upscale",description:"AI upscaling with detail enhancement",icon:__,cost:"8 cr",features:["Image Upscale","Detail enhance"],gradient:"from-rose-500 to-pink-500"},{id:"topaz-image-upscale",name:"Topaz Image Upscale",description:"Professional-grade AI upscaling",icon:vr,cost:"6 cr",features:["Up to 8x","Pro quality"],gradient:"from-
612amber-500 to-orange-500"},{id:"recraft-remove-background",name:"Remove Background",description:"AI background removal",icon:k_,cost:"4 cr",features:["Background removal","Fast"],gradient:"from-sky-500 to-blue-500"}],tq=()=>{var y,b,v;const e=Ce(),{models:t,loading:r}=Ey(),[n,s]=p.useState(""),a=[{name:"DALL-E 3",provider:"OpenAI",description:"DALL-E 3 â high-quality text-to-image",models:t.filter(x=>x.model_group==="dalle-3"&&x.enabled),category:"image",slug:"dalle-3",showcase:(y=t.find(x=>x.model_group==="dalle-3"))==null?void 0:y.showcase},{name:"Midjourney",provider:"Midjourney",description:"Midjourney â artistic image generation",models:t.filter(x=>x.model_group==="midjourney"&&x.enabled),category:"image",slug:"midjourney",showcase:(b=t.find(x=>x.model_group==="midjourney"))==null?void 0:b.showcase},{name:"Stable Diffusion",provider:"Stability AI",description:"Stable Diffusion â open-source image generation",models:t.filter(x=>x.model_group==="stable-diffusion"&&x.enabled),category:"image",slug:"stable-diffusion",showcase:(v=t.find(x=>x.model_group==="stable-diffusion"))==null?void 0:v.showcase}].filter(x=>x.models.length>0),o=x=>x.filter(j=>!n||j.name.toLowerCase().includes(n.toLowerCase())||j.description.toLowerCase().includes(n.toLowerCase())),l=o(XW),c=o(ZW),u=o(eq),d=n?a.filter(x=>x.name.toLowerCase().includes(n.toLowerCase())):a,h=o(JW),f=x=>{const j=x.icon;return i.jsxs(ae,{className:"group overflow-hidden border-border/50 bg-card hover:border-primary/30 hover:shadow-md transition-all cursor-pointer active:scale-[0.98]",onClick:()=>e(x.route),children:[i.jsxs(ot,{className:"p-4 pb-2",children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("div",{className:`p-2 rounded-lg bg-gradient-to-br ${x.gradient} text-white`,children:i.jsx(j,{className:"w-4 h-4"})}),i.jsx(xe,{variant:"outline",className:"text-[10px] font-semibold",children:x.cost})]}),i.jsx(lt,{className:"text-sm font-semibold leading-tight",children:x.name}),i.jsx($r,{className:"text-xs line-clamp-2",children:x.description})]}),i.jsx(be,{className:"p-4 pt-1",children:i.jsx("div",{className:"flex flex-wrap gap-1",children:x.features.map(N=>i.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-muted text-muted-foreground",children:N},N))})})]},x.id)},m=x=>{const j=x.icon;return i.jsxs(ae,{className:"group overflow-hidden border-border/50 bg-card hover:border-primary/30 hover:shadow-md transition-all cursor-pointer active:scale-[0.98]",onClick:()=>e(`/image-generation?model=${x.id}`),children:[i.jsxs(ot,{className:"pb-2",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx("div",{className:`p-2.5 rounded-xl bg-gradient-to-br ${x.gradient} text-white`,children:i.jsx(j,{className:"h-5 w-5"})}),i.jsx(xe,{variant:"secondary",className:"text-[10px]",children:x.cost})]}),i.jsx(lt,{className:"mt-2 text-base",children:x.name}),i.jsx($r,{className:"text-xs",children:x.description})]}),i.jsxs(be,{className:"space-y-3 pt-0",children:[i.jsx("div",{className:"flex flex-wrap gap-1.5",children:x.features.map((N,S)=>i.jsx(xe,{variant:"outline",className:"text-[10px]",children:N},S))}),i.jsxs(B,{size:"sm",className:"w-full text-xs group-hover:bg-primary/90",children:["Generate ",i.jsx(Lt,{className:"h-3 w-3 ml-1 group-hover:translate-x-0.5 transition-transform"})]})]})]},x.id)},w=({title:x,badge:j})=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:x}),j&&i.jsx(xe,{variant:"secondary",className:"text-[10px]",children:j})]}),g=l.length===0&&c.length===0&&u.length===0&&d.length===0&&h.length===0;return i.jsxs("div",{className:"space-y-6 pb-8 animate-fade-in",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("h1",{className:"text-xl sm:text-2xl font-bold text-foreground",children:"Image Models"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Create stunning AI images & edits"})]}),i.jsxs("div",{className:"relative max-w-sm",children:[i.jsx(Ki,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),i.jsx(tt,{placeholder:"Search image modelsâ¦",value:n,onChange:x=>s(x.target.value),className:"pl-10 h-10 rounded-xl bg-muted/30 border-border/50 focus:border-primary/50"})]}),h.length>0&&i.jsxs("div",{className:"space-y-3",children:[i.jsx(w,{title:"AI Image Agents",badge:"New"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:h.map(f)})]}),l.length>0&&i.jsxs("div",{className:"space-y-3",children:[i.jsx(w,{title:"Nano Banana",badge:"Active"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:l.map(m)})]}),c.length>0&&i.jsxs("div",{className:"space-y-3",children:[i.jsx(w,{title:"Image Generation",badge:"Active"}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4",children:c.map(m)})]}),u.length>0&&i.jsxs("div",{className:"space-y-3",children:[i.jsx(w,{title:"Utilities",badge:"Active"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:u.map(m)})]}),r?i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:3}).map((x,j)=>i.jsx($P,{},j))}):d.length>0?i.jsxs("div",{className:"space-y-3",children:[i.jsx(w,{title:"More Models",badge:"Coming Soon"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(x=>i.jsx(LP,{groupName:x.name,provider:x.provider,modelCount:x.models.length,category:x.category,description:x.description,slug:x.slug,showcase:x.showcase},x.name))})]}):g?i.jsxs("div",{className:"flex flex-col items-center py-16 text-center",children:[i.jsx(Ki,{className:"w-10 h-10 text-muted-foreground
612/30 mb-3"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:n?"No models found":"No models available"})]}):null]})},In=p.forwardRef(({className:e,...t},r)=>i.jsx("textarea",{className:J("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-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:r,...t}));In.displayName="Textarea";function dh(e,[t,r]){return Math.min(r,Math.max(t,e))}var rq=p.createContext(void 0);function Jc(e){const t=p.useContext(rq);return e||t||"ltr"}function Xc(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var nq=[" ","Enter","ArrowUp","ArrowDown"],sq=[" ","Enter"],Xi="Select",[af,of,iq]=Ah(Xi),[Go,pK]=Kt(Xi,[iq,Vh]),lf=Vh(),[aq,ii]=Go(Xi),[oq,lq]=Go(Xi),FP=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:f,required:m,form:w}=e,g=lf(t),[y,b]=p.useState(null),[v,x]=p.useState(null),[j,N]=p.useState(!1),S=Jc(u),[_,k]=sn({prop:n,defaultProp:s??!1,onChange:a,caller:Xi}),[P,C]=sn({prop:o,defaultProp:l,onChange:c,caller:Xi}),D=p.useRef(null),I=y?w||!!y.closest("form"):!0,[V,U]=p.useState(new Set),R=Array.from(V).map($=>$.props.value).join(";");return i.jsx(mk,{...g,children:i.jsxs(aq,{required:m,scope:t,trigger:y,onTriggerChange:b,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:Hn(),value:P,onValueChange:C,open:_,onOpenChange:k,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[i.jsx(af.Provider,{scope:t,children:i.jsx(oq,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback($=>{U(F=>new Set(F).add($))},[]),onNativeOptionRemove:p.useCallback($=>{U(F=>{const T=new Set(F);return T.delete($),T})},[]),children:r})}),I?i.jsxs(cT,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:h,value:P,onChange:$=>C($.target.value),disabled:f,form:w,children:[P===void 0?i.jsx("option",{value:""}):null,Array.from(V)]},R):null]})})};FP.displayName=Xi;var UP="SelectTrigger",VP=p.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,a=lf(r),o=ii(UP,r),l=o.disabled||n,c=je(t,o.onTriggerChange),u=of(r),d=p.useRef("touch"),[h,f,m]=dT(g=>{const y=u().filter(x=>!x.disabled),b=y.find(x=>x.value===o.value),v=hT(y,g,b);v!==void 0&&o.onValueChange(v.value)}),w=g=>{l||(o.onOpenChange(!0),m()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return i.jsx(pk,{asChild:!0,...a,children:i.jsx(ue.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":uT(o.value)?"":void 0,...s,ref:c,onClick:oe(s.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&w(g)}),onPointerDown:oe(s.onPointerDown,g=>{d.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(w(g),g.preventDefault())}),onKeyDown:oe(s.onKeyDown,g=>{const y=h.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(y&&g.key===" ")&&nq.includes(g.key)&&(w(),g.preventDefault())})})})});VP.displayName=UP;var BP="SelectValue",zP=p.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:a,placeholder:o="",...l}=e,c=ii(BP,r),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,h=je(t,c.onValueNodeChange);return ht(()=>{u(d)},[u,d]),i.jsx(ue.span,{...l,ref:h,style:{pointerEvents:"none"},children:uT(c.value)?i.jsx(i.Fragment,{children:o}):a})});zP.displayName=BP;var cq="SelectIcon",GP=p.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return i.jsx(ue.span,{"aria-hidden":!0,...s,ref:t,children:n||"â¼"})});GP.displayName=cq;var uq="SelectPortal",WP=e=>i.jsx(Rh,{asChild:!0,...e});WP.displayName=uq;var Zi="SelectContent",qP=p.forwardRef((e,t)=>
vendor: 14,874 bytes, line 612
612{const r=ii(Zi,e.__scopeSelect),[n,s]=p.useState();if(ht(()=>{s(new DocumentFragment)},[]),!r.open){const a=n;return a?na.createPortal(i.jsx(HP,{scope:e.__scopeSelect,children:i.jsx(af.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),a):null}return i.jsx(KP,{...e,ref:t})});qP.displayName=Zi;var qr=10,[HP,ai]=Go(Zi),dq="SelectContentImpl",hq=bo("SelectContent.RemoveScroll"),KP=p.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:w,hideWhenDetached:g,avoidCollisions:y,...b}=e,v=ii(Zi,r),[x,j]=p.useState(null),[N,S]=p.useState(null),_=je(t,A=>j(A)),[k,P]=p.useState(null),[C,D]=p.useState(null),I=of(r),[V,U]=p.useState(!1),R=p.useRef(!1);p.useEffect(()=>{if(x)return S2(x)},[x]),g2();const $=p.useCallback(A=>{const[ee,...L]=I().map(he=>he.ref.current),[G]=L.slice(-1),te=document.activeElement;for(const he of A)if(he===te||(he==null||he.scrollIntoView({block:"nearest"}),he===ee&&N&&(N.scrollTop=0),he===G&&N&&(N.scrollTop=N.scrollHeight),he==null||he.focus(),document.activeElement!==te))return},[I,N]),F=p.useCallback(()=>$([k,x]),[$,k,x]);p.useEffect(()=>{V&&F()},[V,F]);const{onOpenChange:T,triggerPointerDownPosRef:O}=v;p.useEffect(()=>{if(x){let A={x:0,y:0};const ee=G=>{var te,he;A={x:Math.abs(Math.round(G.pageX)-(((te=O.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(G.pageY)-(((he=O.current)==null?void 0:he.y)??0))}},L=G=>{A.x<=10&&A.y<=10?G.preventDefault():x.contains(G.target)||T(!1),document.removeEventListener("pointermove",ee),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",L,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",L,{capture:!0})}}},[x,T,O]),p.useEffect(()=>{const A=()=>T(!1);return window.addEventListener("blur",A),window.addEventListener("resize",A),()=>{window.removeEventListener("blur",A),window.removeEventListener("resize",A)}},[T]);const[H,re]=dT(A=>{const ee=I().filter(te=>!te.disabled),L=ee.find(te=>te.ref.current===document.activeElement),G=hT(ee,A,L);G&&setTimeout(()=>G.ref.current.focus())}),Q=p.useCallback((A,ee,L)=>{const G=!R.current&&!L;(v.value!==void 0&&v.value===ee||G)&&(P(A),G&&(R.current=!0))},[v.value]),q=p.useCallback(()=>x==null?void 0:x.focus(),[x]),M=p.useCallback((A,ee,L)=>{const G=!R.current&&!L;(v.value!==void 0&&v.value===ee||G)&&D(A)},[v.value]),Z=n==="popper"?Kg:YP,z=Z===Kg?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:w,hideWhenDetached:g,avoidCollisions:y}:{};return i.jsx(HP,{scope:r,content:x,viewport:N,onViewportChange:S,itemRefCallback:Q,selectedItem:k,onItemLeave:q,itemTextRefCallback:M,focusSelectedItem:F,selectedItemText:C,position:n,isPositioned:V,searchRef:H,children:i.jsx(Uv,{as:hq,allowPinchZoom:!0,children:i.jsx(Fv,{asChild:!0,trapped:v.open,onMountAutoFocus:A=>{A.preventDefault()},onUnmountAutoFocus:oe(s,A=>{var ee;(ee=v.trigger)==null||ee.focus({preventScroll:!0}),A.preventDefault()}),children:i.jsx($c,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:A=>A.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:i.jsx(Z,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:A=>A.preventDefault(),...b,...z,onPlaced:()=>U(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:oe(b.onKeyDown,A=>{const ee=A.ctrlKey||A.altKey||A.metaKey;if(A.key==="Tab"&&A.preventDefault(),!ee&&A.key.length===1&&re(A.key),["ArrowUp","ArrowDown","Home","End"].includes(A.key)){let G=I().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(A.key)&&(G=G.slice().reverse()),["ArrowUp","ArrowDown"].includes(A.key)){const te=A.target,he=G.indexOf(te);G=G.slice(he+1)}setTimeout(()=>$(G)),A.preventDefault()}})})})})})})});KP.displayName=dq;var fq="SelectItemAlignedPosition",YP=p.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,a=ii(Zi,r),o=ai(Zi,r),[l,c]=p.useState(null),[u,d]=p.useState(null),h=je(t,_=>d(_)),f=of(r),m=p.useRef(!1),w=p.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:b,focusSelectedItem:v}=o,x=p.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&g&&y&&b){const _=a.trigger.getBoundingClientRect(),k=u.getBoundingClientRect(),P=a.valueNode.getBoundingClientRect(),C=b.getBoundingClientRect();if(a.dir!=="rtl"){const te=C.left-k.left,he=P.left-te,Le=_.left-he,st=_.width+Le,mn=Math.max(st,k.width),pn=window.innerWidth-qr,oi=dh(he,[qr,Math.max(qr,pn-mn)]);l.style.minWidth=st+"px",l.style.left=oi+"px"}else{const te=k.right-C.right,he=window.innerWidth-P.right-te,Le=window.innerWidth-_.right-he,st=_.width+Le,mn=Math.max(st,k.width),pn=window.innerWidth-qr,oi=dh(he,[qr,Math.max(qr,pn-mn)]);l.style.minWidth=st+"px",l.style.right=oi+"px"}const D=f(),I=window.innerHeight-qr*2,V=g.scrollHeight,U=window.getComputedStyle(u),R=parseInt(U.borderTopWidth,10),$=parseInt(U.paddingTop,10),F=parseInt(U.borderBottomWidth,10),T=parseInt(U.paddingBottom,10),O=R+$+V+T+F,H=Math.min(y.offsetHeight*5,O),re=window.getComputedStyle(g),Q=parseInt(re.paddingTop,10),q=parseInt(re.paddingBottom,10),M=_.top+_.height/2-qr,Z=I-M,z=y.offsetHeight/2,A=y.offsetTop+z,ee=R+$+A,L=O-ee;if(ee<=M){const te=D.length>0&&y===D[D.length-1].ref.current;l.style.bottom="0px";const he=u.clientHeight-g.offsetTop-g.offsetHeight,Le=Math.max(Z,z+(te?q:0)+he+F),st=ee+Le;l.style.height=st+"px"}else{const te=D.length>0&&y===D[0].ref.current;l.style.top="0px";const Le=Math.max(M,R+g.offsetTop+(te?Q:0)+z)+L;l.style.height=Le+"px",g.scrollTop=ee-M+g.offsetTop}l.style.margin=`${qr}px 0`,l.style.minHeight=H+"px",l.style.maxHeight=I+"px",n==null||n(),requestAnimationFrame(()=>m.current=!0)}},[f,a.trigger,a.valueNode,l,u,g,y,b,a.dir,n]);ht(()=>x(),[x]);const[j,N]=p.useState();ht(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const S=p.useCallback(_=>{_&&w.current===!0&&(x(),v==null||v(),w.current=!1)},[x,v]);return i.jsx(pq,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:S,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:i.jsx(ue.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});YP.displayName=fq;var mq="SelectPopperPosition",Kg=p.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=qr,...a}=e,o=lf(r);return i.jsx(gk,{...o,...a,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...a.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)"}})});Kg.displayName=mq;var[pq,Py]=Go(Zi,{}),Yg="SelectViewport",QP=p.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,a=ai(Yg,r),o=Py(Yg,r),l=je(t,a.onViewportChange),c=p.useRef(0);return i.jsxs(i.Fragment,{children:[i.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:n}),i.jsx(af.Slot,{scope:r,children:i.jsx(ue.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:oe(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&h){const m=Math.abs(c.current-d.scrollTop);if(m>0){const w=window.innerHeight-qr*2,g=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),b=Math.max(g,y);if(b<w){const v=b+m,x=Math.min(w,v),j=v-x;h.style.height=x+"px",h.style.bottom==="0px"&&(d.scrollTop=j>0?j:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});QP.displayName=Yg;var JP="SelectGroup",[gq,xq]=Go(JP),vq=p.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Hn();return i.jsx(gq,{scope:r,id:s,children:i.jsx(ue.div,{role:"group","aria-labelledby":s,...n,ref:t})})});vq.displayName=JP;var XP="SelectLabel",ZP=p.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=xq(XP,r);return i.jsx(ue.div,{id:s.id,...n,ref:t})});ZP.displayName=XP;var hh="SelectItem",[yq,eT]=Go(hh),tT=p.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:a,...o}=e,l=ii(hh,r),c=ai(hh,r),u=l.value===n,[d,h]=p.useState(a??""),[f,m]=p.useState(!1),w=je(t,v=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,v,n,s)}),g=Hn(),y=p.useRef("touch"),b=()=>{s||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")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 i.jsx(yq,{scope:r,value:n,disabled:s,textId:g,isSelected:u,onItemTextChange:p.useCallback(v=>{h(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:i.jsx(af.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:i.jsx(ue.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:w,onFocus:oe(o.onFocus,()=>m(!0)),onBlur:oe(o.onBlur,()=>m(!1)),onClick:oe(o.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:oe(o.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:oe(o.onPointerDown,v=>{y.current=v.pointerType}),onPointerMove:oe(o.onPointerMove,v=>{var x;y.current=v.pointerType,s?(x=c.onItemLeave)==null||x.call(c):y.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:oe(o.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:oe(o.onKeyDown,v=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&v.key===" "||(sq.includes(v.key)&&b(),v.key===" "&&v.preventDefault())})})})})});tT.displayName=hh;var vl="SelectItemText",rT=p.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...a}=e,o=ii(vl,r),l=ai(vl,r),c=eT(vl,r),u=lq(vl,r),[d,h]=p.useState(null),f=je(t,b=>h(b),c.onItemTextChange,b=>{var v;return(v=l.itemTextRefCallback)==null?void 0:v.call(l,b,c.value,c.disabled)}),m=d==null?void 0:d.textContent,w=p.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return ht(()=>(g(w),()=>y(w)),[g,y,w]),i.jsxs(i.Fragment,{children:[i.jsx(ue.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?na.createPortal(a.children,o.valueNode):null]})});rT.displayName=vl;var nT="SelectItemIndicator",sT=p.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return eT(nT,r).isSelected?i.jsx(ue.span,{"aria-hidden":!0,...n,ref:t}):null});sT.displayName=nT;var Qg="SelectScrollUpButton",iT=p.forwardRef((e,t)=>{const r=ai(Qg,e.__scopeSelect),n=Py(Qg,e.__scopeSelect),[s,a]=p.useState(!1),o=je(t,n.onScrollButtonChange);return ht(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?i.jsx(oT,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});iT.displayName=Qg;var Jg="SelectScrollDownButton",aT=p.forwardRef((e,t)=>{const r=ai(Jg,e.__scopeSelect),n=Py(Jg,e.__scopeSelect),[s,a]=p.useState(!1),o=je(t,n.onScrollButtonChange);return ht(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;a(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?i.jsx(oT,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});aT.displayName=Jg;var oT=p.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,a=ai("SelectScrollButton",r),o=p.useRef(null),l=of(r),c=p.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return p.useEffect(()=>()=>c(),[c]),ht(()=>{var d;const u=l().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),i.jsx(ue.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:oe(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:oe(s.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:oe(s.onPointerLeave,()=>{c()})})}),bq="SelectSeparator",lT=p.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return i.jsx(ue.div,{"aria-hidden":!0,...n,ref:t})});lT.displayName=bq;var Xg="SelectArrow",wq=p.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=lf(r),a=ii(Xg,r),o=ai(Xg,r);return a.open&&o.position==="popper"?i.jsx(xk,{...s,...n,ref:t}):null});wq.displayName=Xg;var jq="SelectBubbleInput",cT=p.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=p.useRef(null),a=je(n,s),o=Xc(t);return p.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const h=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(h)}},[o,t]),i.jsx(ue.select,{...r,style:{...e_,...r.style},ref:a,defaultValue:t})});cT.displayName=jq;function uT(e){return e===""||e===void 0}function dT(e){const t=gr(e),r=p.useRef(""),n=p.useRef(0),s=p.useCallback(o=>{const l=r.current+o;t(l),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),a=p.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,a]}function hT(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let o=Nq(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function Nq(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Sq=FP,fT=VP,_q=zP,kq=GP,Cq=WP,mT=qP,Eq=QP,pT=ZP,gT=tT,Pq=rT,Tq=sT,xT=iT,vT=aT,yT=lT;const St=Sq,_t=_q,vt=p.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(fT,{ref:n,className:J("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
612ing-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),...r,children:[t,i.jsx(kq,{asChild:!0,children:i.jsx(N_,{className:"h-4 w-4 opacity-50"})})]}));vt.displayName=fT.displayName;const bT=p.forwardRef(({className:e,...t},r)=>i.jsx(xT,{ref:r,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(n4,{className:"h-4 w-4"})}));bT.displayName=xT.displayName;const wT=p.forwardRef(({className:e,...t},r)=>i.jsx(vT,{ref:r,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(N_,{className:"h-4 w-4"})}));wT.displayName=vT.displayName;const yt=p.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>i.jsx(Cq,{children:i.jsxs(mT,{ref:s,className:J("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",r==="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:r,...n,children:[i.jsx(bT,{}),i.jsx(Eq,{className:J("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(wT,{})]})}));yt.displayName=mT.displayName;const Aq=p.forwardRef(({className:e,...t},r)=>i.jsx(pT,{ref:r,className:J("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Aq.displayName=pT.displayName;const Ie=p.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(gT,{ref:n,className:J("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),...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(Tq,{children:i.jsx(qs,{className:"h-4 w-4"})})}),i.jsx(Pq,{children:t})]}));Ie.displayName=gT.displayName;const Rq=p.forwardRef(({className:e,...t},r)=>i.jsx(yT,{ref:r,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));Rq.displayName=yT.displayName;const ll=[{id:"nano-banana",name:"Nano Banana",description:"Text to Image generation",icon:Pt,maxPromptLength:5e3,requiresImage:!1,supportsImage:!1,maxImages:0,getCost:()=>4,sizes:["1:1","16:9","9:16","4:5","auto"]},{id:"nano-banana-edit",name:"Nano Banana Edit",description:"Edit images with text instructions",icon:Lr,maxPromptLength:5e3,requiresImage:!0,supportsImage:!0,maxImages:10,getCost:()=>4,sizes:["1:1","16:9","9:16","4:5","auto"]},{id:"nano-banana-pro",name:"Nano Banana Pro",description:"High-resolution generation up to 4K",icon:vr,maxPromptLength:1e4,requiresImage:!1,supportsImage:!0,maxImages:1,getCost:e=>e==="4K"?24:18,sizes:[],resolutions:["1K","2K","4K"],aspectRatios:["1:1","16:9","9:16","4:3","3:4"]},{id:"seedream-v4-text-to-image",name:"Seedream V4",description:"ByteDance high-quality text-to-image",icon:P_,maxPromptLength:5e3,requiresImage:!1,supportsImage:!1,maxImages:0,getCost:e=>e==="4K"?20:e==="2K"?14:10,sizes:["square","square_hd","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],resolutions:["1K","2K","4K"]},{id:"seedream-v4-edit",name:"Seedream V4 Edit",description:"ByteDance AI-powered image editing",icon:Lr,maxPromptLength:5e3,requiresImage:!0,supportsImage:!0,maxImages:1,getCost:e=>e==="4K"?24:e==="2K"?16:12,sizes:["square","square_hd","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"],resolutions:["1K","2K","4K"]},{id:"flux-kontext-pro",name:"Flux Kontext Pro",description:"High-quality Flux text-to-image",icon:Vd,maxPromptLength:5e3,requiresImage:!1,supportsImage:!1,maxImages:0,getCost:()=>15,sizes:[],aspectRatios:["1:1","16:9","9:16"]},{id:"flux-kontext-max",name:"Flux Kontext Max Edit",description:"Flux-powered image editing",icon:Vd,maxPromptLength:5e3,requiresImage:!0,supportsImage:!0,maxImages:1,getCost:()=>20,sizes:[],aspectRatios:["1:1","16:9","9:16"]},{id:"4o-image",name:"GPT-4o Image",description:"OpenAI GPT-4o image generation",icon:sv,maxPromptLength:5e3,requiresImage:!1,supportsImage:!0,maxImages:4,getCost:(e,t,r)=>(r||1)>=4?50:(r||1)>=2?30:18,sizes:[],aspectRatios:["1:1","3:2","2:3"]},{id:"recraft-crisp-upscale",name:"Recraft Crisp Upscale",description:"AI-powered image upscaling",icon:__,maxPromptLength:0,requiresImage:!0,supportsImage:!0,maxImages:1,getCost:()=>8,sizes:[]},{id:"topaz-image-upscale",name:"Topaz Image Upscale",description:"Professional AI image upscaling",icon:vr,maxPromptLength:0,requiresImage:!0,supportsImage:!0,maxImages:1,getCost:(e,t)=>
612t==="8"?12:t==="4"?8:t==="2"?6:4,sizes:[],upscaleFactors:["1","2","4","8"]},{id:"recraft-remove-background",name:"Recraft Remove Background",description:"Remove backgrounds from images",icon:k_,maxPromptLength:0,requiresImage:!0,supportsImage:!0,maxImages:1,getCost:()=>4,sizes:[]}],Kj={pending:{label:"Pending",icon:xr,color:"bg-muted text-muted-foreground"},waiting:{label:"Waiting",icon:xr,color:"bg-yellow-500/20 text-yellow-500"},queuing:{label:"In Queue",icon:Ye,color:"bg-blue-500/20 text-blue-500"},generating:{label:"Generating",icon:Pt,color:"bg-purple-500/20 text-purple-500"},completed:{label:"Completed",icon:nc,color:"bg-green-500/20 text-green-500"},failed:{label:"Failed",icon:Dh,color:"bg-destructive/20 text-destructive"}};function Iq(){const{toast:e}=un(),[t]=Sv(),r=t.get("model"),[n,s]=p.useState(ll.find(L=>L.id===r)||ll[0]),[a,o]=p.useState(""),[l,c]=p.useState("1:1"),[u,d]=p.useState("png"),[h,f]=p.useState("1K"),[m,w]=p.useState("1:1"),[g,y]=p.useState("2"),[b,v]=p.useState(1),[x,j]=p.useState([]),[N,S]=p.useState([]),[_,k]=p.useState(!1),[P,C]=p.useState(!1),D=p.useRef(null),[I,V]=p.useState([]),[U,R]=p.useState(!0),[$,F]=p.useState(new Set),T=n.getCost(h,g,b);p.useEffect(()=>{O();const L=Y.channel("image-generations").on("postgres_changes",{event:"*",schema:"public",table:"image_generations"},G=>{G.eventType==="INSERT"?V(te=>[G.new,...te]):G.eventType==="UPDATE"&&V(te=>te.map(he=>he.id===G.new.id?G.new:he))}).subscribe();return()=>{Y.removeChannel(L)}},[]);const O=async()=>{try{const{data:{user:L}}=await Y.auth.getUser();if(!L)return;const{data:G,error:te}=await Y.from("image_generations").select("*").eq("user_id",L.id).order("created_at",{ascending:!1}).limit(20);if(te)throw te;V(G||[])}catch(L){console.error("Error fetching generations:",L)}finally{R(!1)}},H=async L=>{const G=L.target.files;if(!G||G.length===0)return;if(N.length+x.length+G.length>n.maxImages){e({title:"Maximum images reached",description:`You can only add up to ${n.maxImages} images`,variant:"destructive"});return}S(he=>[...he,...Array.from(G)]),D.current&&(D.current.value="")},re=L=>{S(G=>G.filter((te,he)=>he!==L))},Q=async L=>{const G=[];for(const te of N){const he=te.name.split(".").pop(),Le=`${Date.now()}_${Math.random().toString(36).substring(7)}.${he}`,st=`${L}/${Le}`,{error:mn}=await Y.storage.from("video-generation-images").upload(st,te,{contentType:te.type,upsert:!1});if(mn)throw new Error(`Failed to upload image: ${mn.message}`);const{data:{publicUrl:pn}}=Y.storage.from("video-generation-images").getPublicUrl(st);G.push(pn)}return G},q=async()=>{if(n.maxPromptLength>0&&!a.trim()){e({title:"Prompt required",description:"Please enter a prompt for your image",variant:"destructive"});return}if(n.maxPromptLength>0&&a.length>n.maxPromptLength){e({title:"Prompt too long",description:`Prompt must be ${n.maxPromptLength} characters or less`,variant:"destructive"});return}if(n.requiresImage&&x.length===0&&N.length===0){e({title:"Image required",description:"Please upload at least one image",variant:"destructive"});return}C(!0);try{const{data:{session:L}}=await Y.auth.getSession();if(!(L!=null&&L.access_token)||!(L!=null&&L.user)){e({title:"Not authenticated",description:"Please sign in to generate images",variant:"destructive"});return}let G=[...x];if(N.length>0){k(!0);try{const Le=await Q(L.user.id);G=[...G,...Le]}finally{k(!1)}}const te=await fetch("https://jocpxkmlukhfmvcxuayv.supabase.co/functions/v1/kie-create-task",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${L.access_token}`},body:JSON.stringify({model_id:n.id,prompt:n.maxPromptLength>0?a:void 0,image_size:l,output_format:u,image_urls:G.length>0?G:void 0,resolution:h,aspect_ratio:m,upscale_factor:g,n_variants:b})}),he=await te.json();if(!te.ok)throw new Error(he.error||"Failed to create task");e({title:"Image generation started",description:`Task created. Cost: ${T} credits`}),o(""),j([]),S([])}catch(L){console.error("Error generating image:",L),e({title:"Generation failed",description:L instanceof Error?L.message:"Failed to start image generation",variant:"destructive"})}finally{C(!1)}},M=async L=>{if(!$.has(L)){F(G=>new Set(G).add(L));try{const{data:{session:G}}=await Y.auth.getSession();if(!(G!=null&&G.access_token))return;const he=await(await fetch("https://jocpxkmlukhfmvcxuayv.supabase.co/functions/v1/kie-poll-status",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${G.access_token}`},body:JSON.stringify({generation_id:L})})).json();he.success&&e({title:"Status updated",description:`Status: ${he.status}`})}catch(G){console.error("Error polling status:",G)}finally{F(G=>{const te=new Set(G);return te.delete(L),te})}}},Z=async(L,G)=>{try{const he=await(await fetch(L)).blob(),Le=URL.createObjectURL(he),st=document.createElement("a");st.href=Le,st.download=`${n.id}-image-${G+1}.png`,document.body.appendChild(st),st.click(),document.body.removeChild(st),URL.revokeObjectURL(Le)}catch(te){console.error("Error downloading image:",te),e({title:"Download failed",description:"Failed to download image",variant:"destructive"})}},z=L=>{const G=Kj[L]||Kj.pending,te=G.icon;return i.jsxs(xe,{className:`${G.color} gap-1`,children:[i.jsx(te,{className:`h-3 w-3 ${L==="queuing"||L==="generating"?"animate-spin":""}`}),G.label]})},A=L=>{var G;return((G=ll.find(te=>te.id===L))==null?void 0:G.name)||L},ee=n.icon;return i.jsxs("div",{className:"min-h-screen p-6 space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[i.jsx("div",{className:"p-3 rounded-xl bg-gradient-to-br from-yellow-500 to-orange-500",children:i.jsx(ee,{className:"h-6 w-6 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-bold",children:n.name}),i.jsx("p",{className:"text-muted-foreground",children:n.description})]}),i.jsxs(xe,{variant:"secondary",className:"ml-auto",children:[T," credits / image"]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[i.jsxs(ae,{className:"border-border/50 bg-card/50 backdrop-blur",children:[i.jsx(ot,{children:i.jsxs(lt,{className:"flex items-center gap-2",children:[i.jsx(gt,{className:"h-5 w-5"}),"Generate Image"]})}),i.jsxs(be,{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Model"}),i.jsxs(St,{value:n.id,onValueChange:L=>s(ll.find(G=>
612G.id===L)),children:[i.jsx(vt,{children:i.jsx(_t,{})}),i.jsx(yt,{children:ll.map(L=>{const G=L.icon;return i.jsx(Ie,{value:L.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(G,{className:"h-4 w-4"}),i.jsx("span",{children:L.name}),i.jsxs(xe,{variant:"outline",className:"ml-2 text-xs",children:[L.getCost()," credits"]})]})},L.id)})})]})]}),n.maxPromptLength>0&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-2 block",children:n.requiresImage?"Edit Instructions":"Prompt"}),i.jsx(In,{placeholder:n.requiresImage?"Describe how you want to edit the image...":"Describe the image you want to generate...",value:a,onChange:L=>o(L.target.value),className:"min-h-[120px] resize-none",maxLength:n.maxPromptLength}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[a.length,"/",n.maxPromptLength," characters"]})]}),n.supportsImage&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-2 block",children:n.requiresImage?"Images (Required)":"Reference Images (Optional)"}),i.jsxs("div",{className:"space-y-3",children:[N.length>0&&i.jsx("div",{className:"grid grid-cols-2 gap-2",children:N.map((L,G)=>i.jsx("div",{className:"relative group border border-border rounded-lg p-2 bg-muted/30",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(gt,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"text-xs truncate flex-1",children:L.name}),i.jsx(B,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>re(G),children:i.jsx(on,{className:"h-3 w-3"})})]})},G))}),N.length+x.length<n.maxImages&&i.jsxs("div",{onClick:()=>{var L;return(L=D.current)==null?void 0:L.click()},className:"border-2 border-dashed border-border/50 rounded-lg p-6 text-center cursor-pointer hover:border-primary/50 transition-colors",children:[i.jsx(Pn,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to upload images"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"PNG, JPG up to 50MB"}),i.jsx("input",{ref:D,type:"file",accept:"image/*",multiple:n.maxImages>1,onChange:H,className:"hidden"})]}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[N.length+x.length,"/",n.maxImages," images"]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.resolutions&&n.resolutions.length>0&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Resolution"}),i.jsxs(St,{value:h,onValueChange:f,children:[i.jsx(vt,{children:i.jsx(_t,{})}),i.jsx(yt,{children:n.resolutions.map(L=>i.jsx(Ie,{value:L,children:L},L))})]})]}),n.aspectRatios&&n.aspectRatios.length>0&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Aspect Ratio"}),i.jsxs(St,{value:m,onValueChange:w,children:[i.jsx(vt,{children:i.jsx(_t,{})}),i.jsx(yt,{children:n.aspectRatios.map(L=>i.jsx(Ie,{value:L,children:L},L))})]})]}),n.sizes.length>0&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Size"}),i.jsxs(St,{value:l,onValueChange:c,children:[i.jsx(vt,{children:i.jsx(_t,{})}),i.jsx(yt,{children:n.sizes.map(L=>i.jsx(Ie,{value:L,children:L},L))})]})]}),n.upscaleFactors&&n.upscaleFactors.length>0&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Upscale Factor"}),i.jsxs(St,{value:g,onValueChange:y,children:[i.jsx(vt,{children:i.jsx(_t,{})}),i.jsx(yt,{children:n.upscaleFactors.map(L=>i.jsxs(Ie,{value:L,children:[L,"x"]},L))})]})]}),n.id==="4o-image"&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Variants"}),i.jsxs(St,{value:String(b),onValueChange:L=>v(Number(L)),children:[i.jsx(vt,{children:i.jsx(_t,{})}),i.jsxs(yt,{children:[i.jsx(Ie,{value:"1",children:"1 variant (18 credits)"}),i.jsx(Ie,{value:"2",children:"2 variants (30 credits)"}),i.jsx(Ie,{value:"4",children:"4 variants (50 credits)"})]})]})]}),n.sizes.length>0&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Format"}),i.jsxs(St,{value:u,onValueChange:d,children:[i.jsx(vt,{children:i.jsx(_t,{})}),i.jsxs(yt,{children:[i.jsx(Ie,{value:"png",children:"PNG"}),i.jsx(Ie,{value:"jpeg",children:"JPEG"})]})]})]})]}),i.jsx(B,{onClick:q,disabled:P||_||n.maxPromptLength>0&&!a.trim()||n.requiresImage&&N.length===0&&x.length===0,className:"w-full",children:P||_?i.jsx(Ye,{className:"h-4 w-4 animate-spin"}):i.jsxs(i.Fragment,{children:[i.jsx(ee,{className:"h-4 w-4 mr-2"}),"Generate ⢠",T," credits"]})})]})]}),i.jsxs(ae,{className:"border-border/50 bg-card/50 backdrop-blur",children:[i.jsx(ot,{children:i.jsxs(lt,{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(xr,{className:"h-5 w-5"}),"Recent Generations"]}),i.jsx(B,{variant:"ghost",size:"sm",onClick:O,children:i.jsx(Xn,{className:"h-4 w-4"})})]})}),i.jsx(be,{children:U?i.jsx("div",{className:"space-y-4",children:[1,2,3].map(L=>i.jsx(Oe,{className:"h-24 w-full"},L))}):I.length===0?i.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[i.jsx(gt,{className:"h-12 w-12 mx-auto mb-3 opacity-50"}),i.jsx("p",{children:"No generations yet"}),i.jsx("p",{className:"text-sm",children:"Create your first image above!"})]}):i.jsx("div",{className:"space-y-4 max-h-[500px] overflow-y-auto",children:I.map(L=>i.jsxs("div",{className:"p-4 rounded-lg bg-background/50 border border-border/50 space-y-3",children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx(xe,{variant:"outline",className:"mb-2 text-xs",children:A(L.model_id)}),i.jsx("p",{className:"text-sm line-clamp-2",children:L.prompt})]}),z(L.status)]}),L.status!=="completed"&&L.status!=="failed"&&i.jsx(B,{variant:"outline",size:"sm",onClick:()=>M(L.id),disabled:$.has(L.id),className:"w-full",children:$.has(L.id)?i.jsxs(i.Fragment,{children:[i.jsx(Ye,{className:"h-3 w-3 mr-2 animate-spin"}),"Checking..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Xn,{className:"h-3 w-3 mr-2"}),"Check Status"]})}),L.status==="failed"&&L.error_message&&i.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[i.jsx($d,{className:"h-4 w-4"}),L.error_message]}),L.status==="completed"&&L.result_urls&&L.result_urls.length>0&&i.jsx("div",{className:"grid grid-cols-2 gap-2",children:L.result_urls.map((G,te)=>i.jsxs("div",{className:"relative group",children:[i.jsx("img",{src:G,alt:`Generated image ${te+1}`,className:"w-full h-24 object-cover rounded-md"}),i.jsx(B,{variant:"secondary",size:"icon",className:"absolute top-1 right-1 h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>Z(G,te),children:i.jsx(_n,{className:"h-3 w-3"})})]},te))}),i.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[i.jsxs("span",{children:[L.image_size," ⢠",L.cost," credits"]}
612),i.jsx("span",{children:new Date(L.created_at).toLocaleString()})]})]},L.id))})})]})]})]})}var jT=["PageUp","PageDown"],NT=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ST={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Wo="Slider",[Zg,Oq,Mq]=Ah(Wo),[_T,gK]=Kt(Wo,[Mq]),[Dq,cf]=_T(Wo),kT=p.forwardRef((e,t)=>{const{name:r,min:n=0,max:s=100,step:a=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[n],value:d,onValueChange:h=()=>{},onValueCommit:f=()=>{},inverted:m=!1,form:w,...g}=e,y=p.useRef(new Set),b=p.useRef(0),x=o==="horizontal"?Lq:$q,[j=[],N]=sn({prop:d,defaultProp:u,onChange:D=>{var V;(V=[...y.current][b.current])==null||V.focus(),h(D)}}),S=p.useRef(j);function _(D){const I=zq(j,D);C(D,I)}function k(D){C(D,b.current)}function P(){const D=S.current[b.current];j[b.current]!==D&&f(j)}function C(D,I,{commit:V}={commit:!1}){const U=Hq(a),R=Kq(Math.round((D-n)/a)*a+n,U),$=dh(R,[n,s]);N((F=[])=>{const T=Vq(F,$,I);if(qq(T,c*a)){b.current=T.indexOf($);const O=String(T)!==String(F);return O&&V&&f(T),O?T:F}else return F})}return i.jsx(Dq,{scope:e.__scopeSlider,name:r,disabled:l,min:n,max:s,valueIndexToChangeRef:b,thumbs:y.current,values:j,orientation:o,form:w,children:i.jsx(Zg.Provider,{scope:e.__scopeSlider,children:i.jsx(Zg.Slot,{scope:e.__scopeSlider,children:i.jsx(x,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:oe(g.onPointerDown,()=>{l||(S.current=j)}),min:n,max:s,inverted:m,onSlideStart:l?void 0:_,onSlideMove:l?void 0:k,onSlideEnd:l?void 0:P,onHomeKeyDown:()=>!l&&C(n,0,{commit:!0}),onEndKeyDown:()=>!l&&C(s,j.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:I})=>{if(!l){const R=jT.includes(D.key)||D.shiftKey&&NT.includes(D.key)?10:1,$=b.current,F=j[$],T=a*R*I;C(F+T,$,{commit:!0})}}})})})})});kT.displayName=Wo;var[CT,ET]=_T(Wo,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Lq=p.forwardRef((e,t)=>{const{min:r,max:n,dir:s,inverted:a,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...d}=e,[h,f]=p.useState(null),m=je(t,x=>f(x)),w=p.useRef(void 0),g=Jc(s),y=g==="ltr",b=y&&!a||!y&&a;function v(x){const j=w.current||h.getBoundingClientRect(),N=[0,j.width],_=Ty(N,b?[r,n]:[n,r]);return w.current=j,_(x-j.left)}return i.jsx(CT,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:i.jsx(PT,{dir:g,"data-orientation":"horizontal",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const j=v(x.clientX);o==null||o(j)},onSlideMove:x=>{const j=v(x.clientX);l==null||l(j)},onSlideEnd:()=>{w.current=void 0,c==null||c()},onStepKeyDown:x=>{const N=ST[b?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:N?-1:1})}})})}),$q=p.forwardRef((e,t)=>{const{min:r,max:n,inverted:s,onSlideStart:a,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...u}=e,d=p.useRef(null),h=je(t,d),f=p.useRef(void 0),m=!s;function w(g){const y=f.current||d.current.getBoundingClientRect(),b=[0,y.height],x=Ty(b,m?[n,r]:[r,n]);return f.current=y,x(g-y.top)}return i.jsx(CT,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:i.jsx(PT,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const y=w(g.clientY);a==null||a(y)},onSlideMove:g=>{const y=w(g.clientY);o==null||o(y)},onSlideEnd:()=>{f.current=void 0,l==null||l()},onStepKeyDown:g=>{const b=ST[m?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:b?-1:1})}})})}),PT=p.forwardRef((e,t)=>{const{__scopeSlider:r,onSlideStart:n,onSlideMove:s,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:c,...u}=e,d=cf(Wo,r);return i.jsx(ue.span,{...u,ref:t,onKeyDown:oe(e.onKeyDown,h=>{h.key==="Home"?(o(h),h.preventDefault()):h.key==="End"?(l(h),h.preventDefault()):jT.concat(NT).includes(h.key)&&(c(h),h.preventDefault())}),onPointerDown:oe(e.onPointerDown,h=>{const f=h.target;f.setPointerCapture(h.pointerId),h.preventDefault(),d.thumbs.has(f)?f.focus():n(h)}),onPointerMove:oe(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:oe(e.onPointerUp,h=>{const f=h.target;f.hasPointerCapture(h.pointerId)&&(f.releasePointerCapture(h.pointerId),a(h))})})}),TT="SliderTrack",AT=p.forwardRef((e,t)=>
612{const{__scopeSlider:r,...n}=e,s=cf(TT,r);return i.jsx(ue.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});AT.displayName=TT;var ex="SliderRange",RT=p.forwardRef((e,t)=>{const{__scopeSlider:r,...n}=e,s=cf(ex,r),a=ET(ex,r),o=p.useRef(null),l=je(t,o),c=s.values.length,u=s.values.map(f=>MT(f,s.min,s.max)),d=c>1?Math.min(...u):0,h=100-Math.max(...u);return i.jsx(ue.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:l,style:{...e.style,[a.startEdge]:d+"%",[a.endEdge]:h+"%"}})});RT.displayName=ex;var tx="SliderThumb",IT=p.forwardRef((e,t)=>{const r=Oq(e.__scopeSlider),[n,s]=p.useState(null),a=je(t,l=>s(l)),o=p.useMemo(()=>n?r().findIndex(l=>l.ref.current===n):-1,[r,n]);return i.jsx(Fq,{...e,ref:a,index:o})}),Fq=p.forwardRef((e,t)=>{const{__scopeSlider:r,index:n,name:s,...a}=e,o=cf(tx,r),l=ET(tx,r),[c,u]=p.useState(null),d=je(t,v=>u(v)),h=c?o.form||!!c.closest("form"):!0,f=Bc(c),m=o.values[n],w=m===void 0?0:MT(m,o.min,o.max),g=Bq(n,o.values.length),y=f==null?void 0:f[l.size],b=y?Gq(y,w,l.direction):0;return p.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),i.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${w}% + ${b}px)`},children:[i.jsx(Zg.ItemSlot,{scope:e.__scopeSlider,children:i.jsx(ue.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":o.min,"aria-valuenow":m,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...a,ref:d,style:m===void 0?{display:"none"}:e.style,onFocus:oe(e.onFocus,()=>{o.valueIndexToChangeRef.current=n})})}),h&&i.jsx(OT,{name:s??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:m},n)]})});IT.displayName=tx;var Uq="RadioBubbleInput",OT=p.forwardRef(({__scopeSlider:e,value:t,...r},n)=>{const s=p.useRef(null),a=je(s,n),o=Xc(t);return p.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const h=new Event("input",{bubbles:!0});d.call(l,t),l.dispatchEvent(h)}},[o,t]),i.jsx(ue.input,{style:{display:"none"},...r,ref:a,defaultValue:t})});OT.displayName=Uq;function Vq(e=[],t,r){const n=[...e];return n[r]=t,n.sort((s,a)=>s-a)}function MT(e,t,r){const a=100/(r-t)*(e-t);return dh(a,[0,100])}function Bq(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function zq(e,t){if(e.length===1)return 0;const r=e.map(s=>Math.abs(s-t)),n=Math.min(...r);return r.indexOf(n)}function Gq(e,t,r){const n=e/2,a=Ty([0,50],[0,n]);return(n-a(t)*r)*r}function Wq(e){return e.slice(0,-1).map((t,r)=>e[r+1]-t)}function qq(e,t){if(t>0){const r=Wq(e);return Math.min(...r)>=t}return!0}function Ty(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Hq(e){return(String(e).split(".")[1]||"").length}function Kq(e,t){const r=Math.pow(10,t);return Math.round(e*r)/r}var DT=kT,Yq=AT,Qq=RT,Jq=IT;const $n=p.forwardRef(({className:e,...t},r)=>i.jsxs(DT,{ref:r,className:J("relative flex w-full touch-none select-none items-center",e),...t,children:[i.jsx(Yq,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:i.jsx(Qq,{className:"absolute h-full bg-primary"})}),i.jsx(Jq,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background 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"})]}));$n.displayName=DT.displayName;var uf="Switch",[Xq,xK]=Kt(uf),[Zq,eH]=Xq(uf),LT=p.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...h}=e,[f,m]=p.useState(null),w=je(t,x=>m(x)),g=p.useRef(!1),y=f?d||!!f.closest("form"):!0,[b,v]=sn({prop:s,defaultProp:a??!1,onChange:u,caller:uf});return i.jsxs(Zq,{scope:r,checked:b,disabled:l,children:[i.jsx(ue.button,{type:"button",role:"switch","aria-checked":b,"aria-required":o,"data-state":VT(b),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:w,onClick:oe(e.onClick,x=>{v(j=>!j),y&&(g.current=x.isPropagationStopped(),g.current||x.stopPropagation())})}),y&&i.jsx(UT,{control:f,bubbles:!g.current,name:n,value:c,checked:b,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});LT.displayName=uf;var $T="SwitchThumb",FT=p.forwardRef((e,t)=>
612{const{__scopeSwitch:r,...n}=e,s=eH($T,r);return i.jsx(ue.span,{"data-state":VT(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});FT.displayName=$T;var tH="SwitchBubbleInput",UT=p.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},a)=>{const o=p.useRef(null),l=je(o,a),c=Xc(r),u=Bc(t);return p.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==r&&m){const w=new Event("click",{bubbles:n});m.call(d,r),d.dispatchEvent(w)}},[c,r,n]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});UT.displayName=tH;function VT(e){return e?"checked":"unchecked"}var BT=LT,rH=FT;const Fl=p.forwardRef(({className:e,...t},r)=>i.jsx(BT,{className:J("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:r,children:i.jsx(rH,{className:J("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")})}));Fl.displayName=BT.displayName;const Yj=[{id:"elevenlabs-tts-turbo-2-5",name:"Text to Speech (Turbo)",description:"Fast, high-quality English TTS with natural voices",icon:xb,type:"tts",requiresAudio:!1,requiresText:!0,getCost:e=>{var r;const t=((r=e==null?void 0:e.text)==null?void 0:r.length)||0;return Math.ceil(t/1e3)*12},voices:["Rachel","Adam","Antoni","Arnold","Bella","Domi","Elli","Josh","Sam"]},{id:"elevenlabs-tts-multilingual-v2",name:"Text to Speech (Multilingual)",description:"Multilingual narration with 29+ language support",icon:xb,type:"tts",requiresAudio:!1,requiresText:!0,getCost:e=>{var r;const t=((r=e==null?void 0:e.text)==null?void 0:r.length)||0;return Math.ceil(t/1e3)*12},voices:["Rachel","Adam","Antoni","Arnold","Bella","Domi","Elli","Josh","Sam"]},{id:"elevenlabs-sound-effect-v2",name:"Sound Effect Generator",description:"Generate custom sound effects from text descriptions",icon:b4,type:"sfx",requiresAudio:!1,requiresText:!0,getCost:e=>{const t=Number((e==null?void 0:e.duration_seconds)||10);return Math.ceil(t*.24)},outputFormats:["mp3_44100_128","mp3_22050_32","pcm_16000","pcm_44100"],maxDuration:300},{id:"elevenlabs-speech-to-text",name:"Speech to Text",description:"Transcribe audio with speaker diarization and event tagging",icon:I_,type:"stt",requiresAudio:!0,requiresText:!1,getCost:e=>{const t=Number((e==null?void 0:e.duration_minutes)||1);return Math.ceil(t*3.5)}},{id:"elevenlabs-audio-isolation",name:"Audio Isolation",description:"Remove background noise and music, keep voice",icon:C_,type:"isolation",requiresAudio:!0,requiresText:!1,getCost:e=>{const t=Number((e==null?void 0:e.duration_seconds)||60);return Math.ceil(t*.2)}}];function nH(){const e=Ce(),{credits:t,refreshCredits:r}=AP(),[n,s]=p.useState("elevenlabs-tts-turbo-2-5"),[a,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(null),[h,f]=p.useState("Rachel"),[m,w]=p.useState([.5]),[g,y]=p.useState([.75]),[b,v]=p.useState([0]),[x,j]=p.useState([1]),[N,S]=p.useState([10]),[_,k]=p.useState(!1),[P,C]=p.useState([.3]),[D,I]=p.useState("mp3_44100_128"),[V,U]=p.useState(""),[R,$]=p.useState(!1),[F,T]=p.useState(!1),[O,H]=p.useState(!1),[re,Q]=p.useState(!1),q=Yj.find(A=>A.id===n),M=(q==null?void 0:q.getCost({text:a,duration_seconds:N[0],duration_minutes:N[0]/60}))||0,Z=async A=>{if(!A.type.startsWith("audio/")){Te.error("Please upload an audio file");return}Q(!0);try{const{data:{user:ee}}=await Y.auth.getUser();if(!ee)throw new Error("Not authenticated");const L=A.name.split(".").pop(),G=`${ee.id}/${Date.now()}.${L}`,{error:te}=await Y.storage.from("video-generation-images").upload(G,A);if(te)throw te;const{data:{publicUrl:he}}=Y.storage.from("video-generation-images").getPublicUrl(G);c(he),d(A),Te.success("Audio uploaded successfully")}catch(ee){console.error("Upload error:",ee),Te.error("Failed to upload audio")}finally{Q(!1)}},z=async()=>
612{if(q){if(q.requiresText&&!a.trim()){Te.error("Please enter text");return}if(q.requiresAudio&&!l){Te.error("Please upload an audio file");return}if(t<M){Te.error("Insufficient credits"),e("/profile");return}H(!0);try{const{data:{session:A}}=await Y.auth.getSession();if(!A)throw new Error("Not authenticated");const ee={model_id:n};q.type==="tts"?(ee.prompt=a,ee.voice=h,ee.stability=m[0],ee.similarity_boost=g[0],ee.style=b[0],ee.speed=x[0],V&&(ee.language_code=V)):q.type==="sfx"?(ee.prompt=a,ee.duration_seconds=N[0],ee.loop=_,ee.prompt_influence=P[0],ee.output_format=D):q.type==="stt"?(ee.audio_url=l,ee.diarize=R,ee.tag_audio_events=F,V&&(ee.language_code=V),ee.duration_minutes=N[0]/60):q.type==="isolation"&&(ee.audio_url=l,ee.duration_seconds=N[0]);const L=await fetch("https://jocpxkmlukhfmvcxuayv.supabase.co/functions/v1/kie-create-audio-task",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${A.access_token}`},body:JSON.stringify(ee)}),G=await L.json();if(!L.ok)throw new Error(G.error||"Generation failed");Te.success("Audio generation started!"),r(),o(""),c(""),d(null)}catch(A){console.error("Generation error:",A),Te.error(A instanceof Error?A.message:"Generation failed")}finally{H(!1)}}};return i.jsxs("div",{className:"container mx-auto p-6 max-w-6xl",children:[i.jsxs("div",{className:"mb-8",children:[i.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Audio Generation"}),i.jsx("p",{className:"text-muted-foreground mt-2",children:"Generate speech, sound effects, transcribe audio, and more"})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[i.jsx("div",{className:"lg:col-span-1 space-y-4",children:i.jsxs(ae,{children:[i.jsxs(ot,{children:[i.jsx(lt,{className:"text-lg",children:"Select Model"}),i.jsx($r,{children:"Choose an audio AI model"})]}),i.jsx(be,{className:"space-y-3",children:Yj.map(A=>i.jsx("button",{onClick:()=>s(A.id),className:`w-full p-4 rounded-lg border text-left transition-all ${n===A.id?"border-primary bg-primary/10":"border-border hover:border-primary/50"}`,children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(A.icon,{className:"w-5 h-5 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:A.name}),i.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:A.description})]})]})},A.id))})]})}),i.jsx("div",{className:"lg:col-span-2 space-y-6",children:i.jsxs(ae,{children:[i.jsxs(ot,{children:[i.jsxs(lt,{className:"text-lg flex items-center gap-2",children:[i.jsx(Lr,{className:"w-5 h-5"}),q==null?void 0:q.name]}),i.jsx($r,{children:q==null?void 0:q.description})]}),i.jsxs(be,{className:"space-y-6",children:[(q==null?void 0:q.requiresText)&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{children:q.type==="sfx"?"Sound Description":"Text to Speak"}),i.jsx(In,{value:a,onChange:A=>o(A.target.value),placeholder:q.type==="sfx"?"Describe the sound effect you want to generate...":"Enter the text you want to convert to speech...",className:"min-h-[120px]"}),i.jsxs("div",{className:"text-xs text-muted-foreground text-right",children:[a.length," characters"]})]}),(q==null?void 0:q.requiresAudio)&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{children:"Audio File"}),u?i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted rounded-lg",children:[i.jsx(C_,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"flex-1 truncate",children:u.name}),i.jsx(B,{variant:"ghost",size:"icon",onClick:()=>{d(null),c("")},children:i.jsx(on,{className:"w-4 h-4"})})]}):i.jsxs("label",{className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-border rounded-lg cursor-pointer hover:border-primary/50 transition-colors",children:[i.jsx("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:re?i.jsx(Ye,{className:"w-8 h-8 animate-spin text-muted-foreground"}):i.jsxs(i.Fragment,{children:[i.jsx(Pn,{className:"w-8 h-8 text-muted-foreground mb-2"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to upload audio file"})]})}),i.jsx("input",{type:"file",className:"hidden",accept:"audio/*",onChange:A=>{var L;const ee=(L=A.target.files)==null?void 0:L[0];ee&&Z(ee)},disabled:re})]})]}),(q==null?void 0:q.type)==="tts"&&q.voices&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{children:"Voice"}),i.jsxs(St,{value:h,onValueChange:f,children:[i.jsx(vt,{children:i.jsx(_t,{})}),i.jsx(yt,{children:q.voices.map(A=>i.jsx(Ie,{value:A,children:A},A))})]})]}),(q==null?void 0:q.type)==="tts"&&i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs(le,{children:["Stability: ",m[0].toFixed(2)]}
612),i.jsx($n,{value:m,onValueChange:w,min:0,max:1,step:.05})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(le,{children:["Similarity: ",g[0].toFixed(2)]}),i.jsx($n,{value:g,onValueChange:y,min:0,max:1,step:.05})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(le,{children:["Style: ",b[0].toFixed(2)]}),i.jsx($n,{value:b,onValueChange:v,min:0,max:1,step:.05})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(le,{children:["Speed: ",x[0].toFixed(2),"x"]}),i.jsx($n,{value:x,onValueChange:j,min:.7,max:1.2,step:.05})]})]}),(q==null?void 0:q.type)==="sfx"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs(le,{children:["Duration: ",N[0],"s"]}),i.jsx($n,{value:N,onValueChange:S,min:1,max:q.maxDuration||300,step:1})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(le,{children:["Prompt Influence: ",P[0].toFixed(2)]}),i.jsx($n,{value:P,onValueChange:C,min:0,max:1,step:.05})]})]}),i.jsx("div",{className:"flex items-center gap-4",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Fl,{checked:_,onCheckedChange:k}),i.jsx(le,{children:"Loop"})]})}),q.outputFormats&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{children:"Output Format"}),i.jsxs(St,{value:D,onValueChange:I,children:[i.jsx(vt,{children:i.jsx(_t,{})}),i.jsx(yt,{children:q.outputFormats.map(A=>i.jsx(Ie,{value:A,children:A},A))})]})]})]}),(q==null?void 0:q.type)==="stt"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs(le,{children:["Estimated Duration: ",N[0],"s"]}),i.jsx($n,{value:N,onValueChange:S,min:1,max:600,step:1})]}),i.jsxs("div",{className:"flex flex-wrap gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Fl,{checked:R,onCheckedChange:$}),i.jsx(le,{children:"Speaker Diarization"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Fl,{checked:F,onCheckedChange:T}),i.jsx(le,{children:"Tag Audio Events"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{children:"Language Code (optional)"}),i.jsx(tt,{value:V,onChange:A=>U(A.target.value),placeholder:"e.g., eng, spa, fra"})]})]}),(q==null?void 0:q.type)==="isolation"&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs(le,{children:["Estimated Duration: ",N[0],"s"]}),i.jsx($n,{value:N,onValueChange:S,min:1,max:600,step:1})]}),n==="elevenlabs-tts-multilingual-v2"&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{children:"Language Code (optional)"}),i.jsx(tt,{value:V,onChange:A=>U(A.target.value),placeholder:"e.g., en, es, fr, de, zh"})]}),i.jsxs("div",{className:"flex items-center justify-between pt-4 border-t",children:[i.jsxs("div",{className:"text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Estimated Cost: "}),i.jsxs("span",{className:"font-bold text-foreground",children:[M," credits"]}),i.jsxs("span",{className:"text-muted-foreground ml-2",children:["(Available: ",t,")"]})]}),i.jsx(B,{onClick:z,disabled:O||t<M,className:"min-w-[140px]",children:O?i.jsxs(i.Fragment,{children:[i.jsx(Ye,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Lr,{className:"w-4 h-4 mr-2"}),"Generate"]})})]})]})]})})]})]})}const sH=()=>{const[e,t]=p.useState(""),r=Ce(),n=[{name:"AI Fake Movie Trailer",description:"Create cinematic AI-generated fake movie trailers from text prompts and optional reference images",icon:ic,category:"Video",slug:"movie-trailer",available:!0,credits:8},{name:"AI Product Launch Teaser",description:"Generate professional product launch teaser videos. Provide a description and optional product image",icon:Bd,category:"Video",slug:"product-teaser",available:!0,credits:8},{name:"Sora 2 Watermark Remover",description:"Remove watermarks from Sora-generated videos instantly with AI",icon:Lr,category:"Video",slug:"sora-watermark-remover",available:!0,credits:10},{name:"UGC Ad Generator",description:"Upload a product image â AI analyzes it and generates authentic UGC-style video ads that feel real and relatable",icon:qn,category:"Marketing",slug:"ugc-ad-generator",available:!0,credits:10},{name:"Wedding Card Generator",description:"Design beautiful, personalized wedding invitation cards with AI assistance",icon:Ud,category:"Events",slug:"wedding-card-generator",available:!1}],s=e?n.filter(a=>a.name.toLowerCase().includes(e.toLowerCase())||a.description.toLowerCase().includes(e.toLowerCase())||a.category.toLowerCase().includes(e.toLowerCase())):n;return i.jsxs("div",{className:"space-y-8 animate-fade-in pb-8",children:[i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"flex items-center gap-3",children:i.jsx("h1",{className:"text-5xl font-bold bg-gradient-to-r from-foreground via-primary to-accent bg-clip-text text-transparent leading-tight",children:"AI Agents"})}
612),i.jsx("p",{className:"text-muted-foreground/80 text-lg max-w-3xl",children:"Specialized AI agents for specific creative tasks. From marketing content to event materials, our agents help you create professional results instantly."})]}),i.jsx("div",{className:"max-w-md",children:i.jsxs("div",{className:"relative",children:[i.jsx(Ki,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/60"}),i.jsx(tt,{type:"text",placeholder:"Search AI agents...",value:e,onChange:a=>t(a.target.value),className:"pl-10 bg-white/[0.03] border-white/10 focus:border-primary/50"})]})})]}),s.length>0?i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:s.map(a=>{const o=a.icon;return i.jsx(ae,{className:`group relative overflow-hidden border-white/10 bg-card/50 backdrop-blur-sm transition-all duration-300 ${a.available?"cursor-pointer hover:border-primary/50 hover:shadow-lg hover:shadow-primary/20":"opacity-60 cursor-not-allowed"}`,onClick:()=>a.available&&r(`/agent/${a.slug}`),children:i.jsxs("div",{className:"p-6 space-y-4",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx("div",{className:"p-3 rounded-xl bg-primary/10 group-hover:bg-primary/20 transition-colors",children:i.jsx(o,{className:"w-6 h-6 text-primary"})}),i.jsx("span",{className:"px-3 py-1 text-xs font-medium rounded-full bg-accent/20 text-accent-foreground border border-accent/30",children:a.category})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-xl font-semibold text-foreground group-hover:text-primary transition-colors",children:a.name}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:a.description})]}),i.jsxs("div",{className:"flex items-center justify-between pt-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-primary/60 group-hover:text-primary transition-colors",children:[i.jsx(Pt,{className:"w-4 h-4"}),i.jsx("span",{className:"text-xs font-medium",children:"AI Powered"})]}),a.available&&a.credits?i.jsxs(xe,{className:"bg-primary/20 text-primary border-primary/30 text-xs",children:[a.credits," Credits"]}):a.available?null:i.jsxs(xe,{variant:"secondary",className:"text-xs",children:[i.jsx(xr,{className:"w-3 h-3 mr-1"}),"Soon"]})]})]})},a.slug)})}):i.jsx("div",{className:"text-center py-24",children:i.jsxs("div",{className:"inline-flex flex-col items-center gap-4 p-10 bg-white/[0.02] rounded-2xl border border-white/10",children:[i.jsx(Ki,{className:"w-12 h-12 text-muted-foreground/40"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-muted-foreground text-lg font-medium",children:e?"No agents found":"No agents available"}),i.jsx("p",{className:"text-muted-foreground/60 text-sm",children:e?"Try adjusting your search":"Please check back later"})]})]})})]})},It="https://jocpxkmlukhfmvcxuayv.supabase.co/storage/v1/object/public/avatar-uploads/reference-photos",zT=[{id:"imran-khan",name:"Imran Khan",title:"Former Prime Minister",popular:!0,available:!0},{id:"donald-trump",name:"Donald Trump",title:"45th US President",available:!0,referencePhotos:[`${It}/DonaldTrump/Donald Trump (1).png`,`${It}/DonaldTrump/Donald Trump (1).webp`,`${It}/DonaldTrump/Donald Trump (2).png`,`${It}/DonaldTrump/Donald Trump (2).webp`,`${It}/DonaldTrump/Donald Trump (3).png`]},{id:"elon-musk",name:"Elon Musk",title:"Tech Entrepreneur",available:!0,referencePhotos:[`${It}/Elon-Musk/Elon Musk (1).jpg`,`${It}/Elon-Musk/Elon Musk (2).jpg`,`${It}/Elon-Musk/Elon Musk (3).jpg`,`${It}/Elon-Musk/Elon Musk (4).jpg`,`${It}/Elon-Musk/Elon Musk (5).jpg`,`${It}/Elon-Musk/Elon Musk (6).jpg`]},{id:"barack-obama",name:"Barack Obama",title:"44th US President",available:!0,referencePhotos:[`${It}/Barack-Obama/Barack Obama (1).jpg`,`${It}/Barack-Obama/Barack Obama (2).jpg`,`${It}/Barack-Obama/Barack Obama (3).jpg`,`${It}/Barack-Obama/Barack Obama (4).jpg`]},{id:"lionel-messi",name:"Lionel Messi",title:"Football Legend",available:!0,referencePhotos:[`${It}/Lionel-Messi/messi.jpg`]},{id:"cristiano-ronaldo",name:"Cristiano Ronaldo",title:"Football Legend",available:!0}],iH=({onSelectLeader:e,onCreateCustom:t})=>i.jsxs("div",{className:"space-y-6 pb-8 animate-fade-in",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("h1",{className:"text-xl sm:text-2xl font-bold text-foreground",children:"AI Photography"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Get an AI-generated photo of yourself with a leader"})]}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:zT.map(r=>i.jsxs(ae,{className:`relative p-4 text-center cursor-pointer transition-all border-border/50 bg-card hover:border-primary/30 hover:shadow-md active:scale-[0.97] ${r.available?"":"opacity-50 pointer-events-none"}`,onClick:()=>r.available&&e(r),children:[r.popular&&i.jsxs(xe,{className:"absolute -top-2 left-1/2 -translate-x-1/2 text-[9px] px-2 py-0.5 bg-primary text-primary-foreground",children:[i.jsx(wo,{className:"w-2.5 h-2.5 mr-0.5"})," Popular"]}),i.jsx("div",{className:"w-14 h-14 mx-auto rounded-full bg-primary/10 flex items-center justify-center mb-2.5",children:i.jsx(an,{className:"w-6 h-6 text-primary"})}),i.jsx("h3",{className:"font-semibold text-sm leading-tight text-foreground",children:r.name}),i.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:r.title})]},r.id))}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Create Your Own"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Create a custom leader with your own name, role, and reference photos"}),i.jsx(ae,{className:"p-5 cursor-pointer border-dashed border-2 border-border/50 hover:border-primary/40 hover:bg-primary/5 transition-all active:scale-[0.98]",onClick:t,children:i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:"w-14 h-14 roun
612ded-full bg-primary/10 flex items-center justify-center shrink-0",children:i.jsx(R4,{className:"w-6 h-6 text-primary"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold text-sm text-foreground",children:"Custom Leader"}),i.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Provide a name, role & reference photos"})]})]})})]})]});function GT(){const{user:e,session:t,refreshUserMeta:r}=Tt(),[n,s]=p.useState({isUploading:!1,isGenerating:!1,isPolling:!1,generationId:null,taskId:null,resultUrl:null,error:null,status:null});p.useEffect(()=>{if(!n.generationId||!n.isPolling)return;const c=setInterval(async()=>{const{data:u,error:d}=await Y.from("image_generations").select("status, result_urls, error_message").eq("id",n.generationId).single();if(!d)if(u.status==="completed"||u.status==="success"){const h=u.result_urls;s(f=>({...f,isPolling:!1,isGenerating:!1,resultUrl:(h==null?void 0:h[0])||null,status:"completed"})),r(),Te.success("Your avatar photo has been generated!")}else u.status==="failed"?(s(h=>({...h,isPolling:!1,isGenerating:!1,error:u.error_message||"Generation failed",status:"failed"})),r(),Te.error(u.error_message||"Generation failed")):s(h=>({...h,status:u.status}))},5e3);return()=>clearInterval(c)},[n.generationId,n.isPolling,r]);const a=p.useCallback(async c=>{if(!e)return Te.error("Please log in first"),null;s(u=>({...u,isUploading:!0,error:null}));try{const u=c.name.split(".").pop()||"jpg",d=`${e.id}/${Date.now()}.${u}`,{error:h}=await Y.storage.from("avatar-uploads").upload(d,c,{upsert:!0});if(h)throw new Error(h.message);const{data:{publicUrl:f}}=Y.storage.from("avatar-uploads").getPublicUrl(d);return s(m=>({...m,isUploading:!1})),f}catch(u){return s(d=>({...d,isUploading:!1,error:u.message})),Te.error("Failed to upload photo"),null}},[e]),o=p.useCallback(async(c,u,d,h)=>{if(!(t!=null&&t.access_token)){Te.error("Please log in first");return}s(f=>({...f,isGenerating:!0,error:null,resultUrl:null,status:"analyzing"}));try{const f=await fetch("https://jocpxkmlukhfmvcxuayv.supabase.co/functions/v1/avatar-generate",{method:"POST",headers:{Authorization:`Bearer ${t.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({user_photo_url:c,leader_id:u,leader_name:d,prompt:h||void 0})}),m=await f.json();if(!f.ok)throw new Error(m.error||"Generation failed");s(w=>({...w,generationId:m.generation_id,taskId:m.task_id,isPolling:!0,status:"processing"})),Te.info(`Generating your photo with ${d}...`)}catch(f){s(m=>({...m,isGenerating:!1,error:f.message,status:"failed"})),Te.error(f.message||"Failed to start generation")}},[t]),l=p.useCallback(()=>{s({isUploading:!1,isGenerating:!1,isPolling:!1,generationId:null,taskId:null,resultUrl:null,error:null,status:null})},[]);return{...n,uploadPhoto:a,generate:o,reset:l}}const aH=({onBack:e,onSubmit:t})=>{const[r,n]=p.useState(""),[s,a]=p.useState(""),[o,l]=p.useState([]),[c,u]=p.useState([]),[d,h]=p.useState(!1),f=p.useRef(null),{uploadPhoto:m}=GT(),w=async b=>{const v=Array.from(b.target.files||[]);if(v.length===0)return;if(o.length+v.length>3){Te.error("Maximum 3 reference photos allowed");return}h(!0);const x=[],j=[];for(const N of v){const S=new FileReader,_=await new Promise(P=>{S.onload=C=>{var D;return P((D=C.target)==null?void 0:D.result)},S.readAsDataURL(N)}),k=await m(N);k&&(x.push({file:N,preview:_}),j.push(k))}l(N=>[...N,...x]),u(N=>[...N,...j]),h(!1),f.current&&(f.current.value="")},g=b=>{l(v=>v.filter((x,j)=>j!==b)),u(v=>v.filter((x,j)=>j!==b))},y=()=>{if(!r.trim()){Te.error("Leader name is required");return}if(!s.trim()){Te.error("Leader role is required");return}if(c.length===0){Te.error("At least 1 reference photo is required");return}const b={id:`custom-${Date.now()}`,name:r.trim(),title:s.trim(),available:!0};t(b,c)};return i.jsxs("div",{className:"space-y-5 pb-8 animate-fade-in",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(B,{variant:"ghost",size:"icon",onClick:e,className:"shrink-0 rounded-xl",children:i.jsx(iv,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-lg sm:text-xl font-bold text-foreground",children:"Create Custom Leader"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Provide details and reference photos"})]})]}),i.jsxs(ae,{className:"border-border/50 bg-card p-4 space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"leader-name",className:"text-sm font-medium text-foreground",children:"Name"}),i.jsx(tt,{id:"leader-name",placeholder:"e.g. Nelson Mandela",value:r,onChange:b=>n(b.target.value),className:"rounded-xl"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"leader-role",className:"text-sm font-medium text-foreground",children:"Role / Title"}),i.jsx(tt,{id:"leader-role",placeholder:"e.g. Former President of South Africa",value:s,onChange:b=>a(b.target.value),className:"rounded-xl"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-sm font-medium text-foreground",children:"Reference Photos (1-3)"}),i.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Upload clear photos of the person for best results"}),i.jsx("input",{ref:f,type:"file",accept:"image/*",multiple:!0,onChange:w,className:"hidden"}),i.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.map((b,v)=>i.jsxs("div",{className:"relative w-20 h-20 rounded-xl overflow-hidden border border-border/50 group",children:[i.jsx("img",{src:b.preview,alt:`Ref ${v+1}`,className:"w-full h-full object-cover"}),i.jsx("button",{onClick:()=>g(v),className:"absolute top-0.5 right-0.5 bg-destructive text-destructive-foreground rounded-full p-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:i.jsx(on,{className:"w-3 h-3"})})]},v)),o.length<3&&i.jsx("button",{onClick:()=>{var b;return(b=f.current)==null?void 0:b.click()},disabled:d,className:"w-20 h-20 rounded-xl border-2 border-dashed border-border/50 flex flex-col items-center justify-center gap-1 hover:border-primary/40 hover:bg-primary/5 transition-all cursor-pointer",children:d?i.jsx(Ye,{className:"w-5 h-5 text-primary animate-spin"}):i.jsxs(i.Fragment,{children:[i.jsx(O_,{className:"w-4 h-4 text-muted-foreground
612/50"}),i.jsx("span",{className:"text-[9px] text-muted-foreground/50",children:"Add"})]})})]})]})]}),i.jsxs(B,{size:"lg",className:"w-full gap-2 rounded-xl py-5 active:scale-[0.98] transition-transform",onClick:y,disabled:!r.trim()||!s.trim()||c.length===0||d,children:[i.jsx(gt,{className:"w-4 h-4"})," Continue to Generate"]})]})},oH=({leader:e,referenceUrls:t,onBack:r})=>{const[n,s]=p.useState(null),[a,o]=p.useState(null),[l,c]=p.useState(""),u=p.useRef(null),{isUploading:d,isGenerating:h,resultUrl:f,error:m,status:w,uploadPhoto:g,generate:y,reset:b}=GT(),v=async _=>{var D;const k=(D=_.target.files)==null?void 0:D[0];if(!k)return;const P=new FileReader;P.onload=I=>{var V;return o((V=I.target)==null?void 0:V.result)},P.readAsDataURL(k);const C=await g(k);C&&s(C)},x=()=>{if(!n)return;const _=t!=null&&t.length?`[REFERENCE_PHOTOS:${t.join(",")}] ${l||""}`:l||void 0;y(n,e.id,e.name,_)},j=()=>{b(),s(null),o(null),c(""),u.current&&(u.current.value="")},N=async()=>{if(f)try{const k=await(await fetch(f)).blob(),P=URL.createObjectURL(k),C=document.createElement("a");C.href=P,C.download=`photo-with-${e.name.replace(/\s+/g,"-").toLowerCase()}.png`,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(P)}catch{window.open(f,"_blank")}},S=()=>{switch(w){case"analyzing":return"Analyzing your photoâ¦";case"processing":return`Generating with ${e.name}â¦`;case"pending":return"Preparingâ¦";case"completed":return"Photo generated!";case"failed":return"Generation failed";default:return"Processingâ¦"}};return i.jsxs("div",{className:"space-y-5 pb-8 animate-fade-in",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(B,{variant:"ghost",size:"icon",onClick:()=>{r(),j()},className:"shrink-0 rounded-xl",children:i.jsx(iv,{className:"w-5 h-5"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsxs("h1",{className:"text-lg sm:text-xl font-bold text-foreground truncate",children:["Photo with ",e.name]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"4 credits per generation"})]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs(ae,{className:"border-border/50 bg-card p-4 space-y-3",children:[i.jsxs("h2",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[i.jsx(Pn,{className:"w-4 h-4 text-primary"})," Upload Your Photo"]}),i.jsx("input",{ref:u,type:"file",accept:"image/*",onChange:v,className:"hidden"}),a?i.jsxs("div",{className:"relative group",children:[i.jsx("img",{src:a,alt:"Your photo",className:"w-full max-h-60 object-contain rounded-xl border border-border/50"}),i.jsx(B,{variant:"secondary",size:"sm",className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity text-xs rounded-lg",onClick:()=>{var _;return(_=u.current)==null?void 0:_.click()},disabled:h,children:"Change"})]}):i.jsxs("button",{onClick:()=>{var _;return(_=u.current)==null?void 0:_.click()},disabled:d,className:"w-full border-2 border-dashed border-border/50 rounded-xl p-8 flex flex-col items-center gap-2 hover:border-primary/40 hover:bg-primary/5 transition-all cursor-pointer active:scale-[0.98]",children:[d?i.jsx(Ye,{className:"w-8 h-8 text-primary animate-spin"}):i.jsx(gt,{className:"w-8 h-8 text-muted-foreground/30"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:d?"Uploadingâ¦":"Tap to upload"}),i.jsx("span",{className:"text-[10px] text-muted-foreground/50",children:"JPG, PNG, WEBP"})]})]}),i.jsxs(ae,{className:"border-border/50 bg-card p-4 space-y-2",children:[i.jsxs("h2",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[i.jsx(Pt,{className:"w-4 h-4 text-primary"})," Instructions (Optional)"]}),i.jsx(In,{placeholder:"e.g. Standing together in a gardenâ¦",value:l,onChange:_=>c(_.target.value),rows:2,disabled:h,className:"bg-muted/20 border-border/50 resize-none text-sm rounded-xl"})]}),i.jsx(B,{size:"lg",className:"w-full gap-2 rounded-xl py-5 active:scale-[0.98] transition-transform",onClick:x,disabled:!n||h||d,children:h?i.jsxs(i.Fragment,{children:[i.jsx(Ye,{className:"w-4 h-4 animate-spin"}),S()]}):i.jsxs(i.Fragment,{children:[i.jsx(an,{className:"w-4 h-4"}),"Generate (4 Credits)"]})}),m&&i.jsx("div",{className:"p-3 rounded-xl bg-destructive/10 border border-destructive/30 text-destructive text-sm",children:m})]}),i.jsx(ae,{className:"border-border/50 bg-card p-4 min-h-[280px] flex flex-col items-center justify-center rounded-xl",children:f?i.jsxs("div",{className:"space-y-3 w-full",children:[i.jsx("img",{src:f,alt:`Photo with ${e.name}`,className:"w-full rounded-xl border border-border/50"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(B,{onClick:N,className:"flex-1 gap-2 rounded-xl",children:[i.jsx(_n,{className:"w-4 h-4"})," Download"]}),i.jsxs(B,{variant:"outline",className:"gap-2 rounded-xl",onClick:j,children:[i.jsx(av,{className:"w-4 h-4"})," New"]})]})]}):h?i.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[i.jsxs("div",{className:"relative",children:[i.jsx(Ye,{className:"w-12 h-12 text-primary animate-spin"}),i.jsx(Pt,{className:"w-4 h-4 text-primary absolute -top-1 -right-1 animate-pulse"})]}),i.jsx("p",{className:"text-foreground font-medium text-sm",children:S()}
vendor: 4,330 bytes, line 612
612),i.jsx("p",{className:"text-muted-foreground/60 text-xs",children:"Usually 30-60 seconds"})]}):i.jsxs("div",{className:"flex flex-col items-center gap-2 text-center p-6",children:[i.jsx(an,{className:"w-12 h-12 text-muted-foreground/15"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Result appears here"}),i.jsx("p",{className:"text-[10px] text-muted-foreground/50",children:"Upload a photo and generate"})]})})]})]})},lH=()=>{const[e,t]=p.useState("grid"),[r,n]=p.useState(null),[s,a]=p.useState([]),o=u=>{n(u),a(u.referencePhotos||[]),t("generate")},l=(u,d)=>{n(u),a(d),t("generate")},c=()=>{e==="generate"&&(r!=null&&r.id.startsWith("custom-"))?t("custom"):t("grid"),n(null)};return e==="custom"?i.jsx(aH,{onBack:()=>t("grid"),onSubmit:l}):e==="generate"&&r?i.jsx(oH,{leader:r,referenceUrls:s.length>0?s:void 0,onBack:c}):i.jsx(iH,{onSelectLeader:o,onCreateCustom:()=>t("custom")})};var Dm="rovingFocusGroup.onEntryFocus",cH={bubbles:!1,cancelable:!0},Zc="RovingFocusGroup",[rx,WT,uH]=Ah(Zc),[dH,df]=Kt(Zc,[uH]),[hH,fH]=dH(Zc),qT=p.forwardRef((e,t)=>i.jsx(rx.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(rx.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(mH,{...e,ref:t})})}));qT.displayName=Zc;var mH=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,f=p.useRef(null),m=je(t,f),w=Jc(a),[g,y]=sn({prop:o,defaultProp:l??null,onChange:c,caller:Zc}),[b,v]=p.useState(!1),x=gr(u),j=WT(r),N=p.useRef(!1),[S,_]=p.useState(0);return p.useEffect(()=>{const k=f.current;if(k)return k.addEventListener(Dm,x),()=>k.removeEventListener(Dm,x)},[x]),i.jsx(hH,{scope:r,orientation:n,dir:w,loop:s,currentTabStopId:g,onItemFocus:p.useCallback(k=>y(k),[y]),onItemShiftTab:p.useCallback(()=>v(!0),[]),onFocusableItemAdd:p.useCallback(()=>_(k=>k+1),[]),onFocusableItemRemove:p.useCallback(()=>_(k=>k-1),[]),children:i.jsx(ue.div,{tabIndex:b||S===0?-1:0,"data-orientation":n,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:oe(e.onMouseDown,()=>{N.current=!0}),onFocus:oe(e.onFocus,k=>{const P=!N.current;if(k.target===k.currentTarget&&P&&!b){const C=new CustomEvent(Dm,cH);if(k.currentTarget.dispatchEvent(C),!C.defaultPrevented){const D=j().filter($=>$.focusable),I=D.find($=>$.active),V=D.find($=>$.id===g),R=[I,V,...D].filter(Boolean).map($=>$.ref.current);YT(R,d)}}N.current=!1}),onBlur:oe(e.onBlur,()=>v(!1))})})}),HT="RovingFocusGroupItem",KT=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:a,children:o,...l}=e,c=Hn(),u=a||c,d=fH(HT,r),h=d.currentTabStopId===u,f=WT(r),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:g}=d;return p.useEffect(()=>{if(n)return m(),()=>w()},[n,m,w]),i.jsx(rx.ItemSlot,{scope:r,id:u,focusable:n,active:s,children:i.jsx(ue.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:oe(e.onMouseDown,y=>{n?d.onItemFocus(u):y.preventDefault()}),onFocus:oe(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:oe(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=xH(y,d.orientation,d.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=f().filter(j=>j.focusable).map(j=>j.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const j=x.indexOf(y.currentTarget);x=d.loop?vH(x,j+1):x.slice(j+1)}setTimeout(()=>YT(x))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:g!=null}):o})})});KT.displayName=HT;var pH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function xH(e,t,r){const n=gH(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return pH[n]}function YT(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function vH(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var QT=qT,JT=KT,Ay="Radio",[yH,XT]=Kt(Ay),[bH,wH]=yH(Ay),ZT=p.forwardRef((e,t)=>
612{const{__scopeRadio:r,name:n,checked:s=!1,required:a,disabled:o,value:l="on",onCheck:c,form:u,...d}=e,[h,f]=p.useState(null),m=je(t,y=>f(y)),w=p.useRef(!1),g=h?u||!!h.closest("form"):!0;return i.jsxs(bH,{scope:r,checked:s,disabled:o,children:[i.jsx(ue.button,{type:"button",role:"radio","aria-checked":s,"data-state":nA(s),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:m,onClick:oe(e.onClick,y=>{s||c==null||c(),g&&(w.current=y.isPropagationStopped(),w.current||y.stopPropagation())})}),g&&i.jsx(rA,{control:h,bubbles:!w.current,name:n,value:l,checked:s,required:a,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});ZT.displayName=Ay;var eA="RadioIndicator",tA=p.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...s}=e,a=wH(eA,r);return i.jsx(ss,{present:n||a.checked,children:i.jsx(ue.span,{"data-state":nA(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t})})});tA.displayName=eA;var jH="RadioBubbleInput",rA=p.forwardRef(({__scopeRadio:e,control:t,checked:r,bubbles:n=!0,...s},a)=>{const o=p.useRef(null),l=je(o,a),c=Xc(r),u=Bc(t);return p.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==r&&m){const w=new Event("click",{bubbles:n});m.call(d,r),d.dispatchEvent(w)}},[c,r,n]),i.jsx(ue.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});rA.displayName=jH;function nA(e){return e?"checked":"unchecked"}var NH=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],hf="RadioGroup",[SH,vK]=Kt(hf,[df,XT]),sA=df(),iA=XT(),[_H,kH]=SH(hf),aA=p.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:s,value:a,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:h,...f}=e,m=sA(r),w=Jc(u),[g,y]=sn({prop:a,defaultProp:s??null,onChange:h,caller:hf});return i.jsx(_H,{scope:r,name:n,required:o,disabled:l,value:g,onValueChange:y,children:i.jsx(QT,{asChild:!0,...m,orientation:c,dir:w,loop:d,children:i.jsx(ue.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:w,...f,ref:t})})})});aA.displayName=hf;var oA="RadioGroupItem",lA=p.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...s}=e,a=kH(oA,r),o=a.disabled||n,l=sA(r),c=iA(r),u=p.useRef(null),d=je(t,u),h=a.value===s.value,f=p.useRef(!1);return p.useEffect(()=>{const m=g=>{NH.includes(g.key)&&(f.current=!0)},w=()=>f.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",w),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",w)}},[]),i.jsx(JT,{asChild:!0,...l,focusable:!o,active:h,children:i.jsx(ZT,{disabled:o,required:a.required,checked:h,...c,...s,name:a.name,ref:d,onCheck:()=>a.onValueChange(s.value),onKeyDown:oe(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:oe(s.onFocus,()=>{var m;f.current&&((m=u.current)==null||m.click())})})})});lA.displayName=oA;var CH="RadioGroupIndicator",cA=p.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,s=iA(r);return i.jsx(tA,{...s,...n,ref:t})});cA.displayName=CH;var uA=aA,dA=lA,EH=cA;const hA=p.forwardRef(({className:e,...t},r)=>i.jsx(uA,{className:J("grid gap-2",e),...t,ref:r}));hA.displayName=uA.displayName;const fA=p.forwardRef(({className:e,...t},r)=>i.jsx(dA,{ref:r,className:J("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(EH,{className:"flex items-center justify-center",children:i.jsx(i4,{className:"h-2.5 w-2.5 fill-current text-current"})})}));fA.displayName=dA.displayName;function PH(e){p.useEffect(()=>{const t=r=>{if(e)return r.preventDefault(),r.returnValue="A video is still generating. Leaving won't stop the process, but you may miss the result. Continue?",r.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[e])}function TH({models:e,modelGroup:t}){var V,U;const{userMeta:r}=Tt(),[n,s]=p.useState(!1),[a,o]=p.useState(((V=e[0])==null?void 0:V.id)||""),[l,c]=p.useState(""),[u,d]=p.useState({}),[h,f]=p.useState({}),[m,w]=p.useState(""),g=p.useRef({});PH(n);const y=e.find(R=>R.id===a)||e[0];if(!y)return null;const{input_rules:b,generation_types:v,pricing_credits:x,webhook_url:j,webhook_secret:N}=y;!l&&v&&v.length>0&&c(v[0]),p.useEffect(()=>{var M,Z;const R=b,$={},F=Array.isArray(R.aspect_ratio)?R.aspect_ratio:null,T=Array.isArray(R.n_frames)?R.n_frames:null,O=Array.isArray(R.size_modes)?R.size_modes:null,H=Array.isArray(R.mode)?R.mode:null,re=Array.isArray(R.ratio)?R.ratio:Array.isArray(R.resolution)?R.resolution:null,Q=Array.isArray(R.models)?R.models:null,q=Array.isArray(R.durations)?R.durations:Array.isArray(R.duration)?R.duration:null;F&&!u.aspect_ratio&&($.aspect_ratio=F[0]),T&&!u.n_frames&&($.n_frames=T[0]),O&&!u.size_mode&&($.size_mode=O[0]),H&&!u.mode&&($.mode=H[0]),re&&!u.ratio&&($.ratio=re[0]),Q&&!u.model&&($.model=Q[0]),q&&!u.duration&&($.duration=q[0]),t==="hailuo-2-3"&&(u.quality||($.quality="Standard"),!u.duration&&((M=R.durations)!=null&&M[0])&&($.duration=R.durations[0]),!u.ratio&&((Z=R.ratio)!=null&&Z[0])&&($.ratio=R.ratio[0])),Object.keys($).length>0&&d(z=>({...z,...$}))},[a,b,t]),p.useEffect(()=>{var O;const R=b,$=u.ratio==="1080P",F=u.duration==="10s"||u.duration==="10",T=(O=R.constraints)==null?void 0:O["1080P_max_duration"];$&&F&&T&&(console.log("Hailuo constraint triggered: switching to 6s for 1080P"),d(H=>({...H,duration:"6s"})))},[u.ratio,u.duration,b]);const S=async(R,$)=>{var H;const F=(H=$.target.files)==null?void 0:H[0];if(!F)return;const T=b[R],O=(T==null?void 0:T.accept)||"";if(O&&!F.type.match(O.replace("*",".*"))){Ue({title:"Invalid file type",description:`Please upload a file matching: ${O}`,variant:"destructive"});return}if(F.size>50*1024*1024){Ue({title:"File too large",description:"Please upload a file smaller than 50MB",variant:"destructive"});return}f(re=>({...re,[R]:F})),Ue({title:"File uploaded",description:`${F.name} is ready for generation`})},_=R=>{f($=>{const F={...$};return delete F[R],F}),g.current[R]&&(g.current[R].value="")},P=(()=>
612{if(!x||Object.keys(x).length===0)return 0;if(typeof x=="number")return x;if(u.size_mode&&u.n_frames){const F=u.size_mode.toLowerCase(),T=String(u.n_frames).replace(/[^0-9]/g,""),O=`${F}_${T}`;if(x[O])return x[O];const H=`${F}_${T}s`;if(x[H])return x[H]}if(u.n_frames&&!u.size_mode){const F=String(u.n_frames).replace(/[^0-9]/g,"");if(x[F])return x[F];const T=`${F}s`;if(x[T])return x[T];if(x[u.n_frames])return x[u.n_frames]}if(t==="hailuo-2-3"&&u.duration&&u.ratio){const F=u.duration.toLowerCase(),T=u.ratio.toLowerCase(),O=`${F}_${T}`;if(console.log("[Hailuo Pricing]",{duration:F,resolution:T,key:O,pricing_credits:x,selectedModelId:a,calculated:x[O]}),x[O])return x[O]}const R=y.display_name.toLowerCase();if(R.includes("pro")&&x.pro)return x.pro;if(R.includes("standard")&&x.standard)return x.standard;if(u.model){const F=u.model.toLowerCase();if(F.includes("fast")&&x.fast)return x.fast;if(F.includes("quality")&&x.quality)return x.quality}const $=Object.values(x);return $.length>0?$[0]:0})(),C=()=>{var $;const R=b;return R.prompt_required&&!(($=u.prompt)!=null&&$.trim())?(Ue({title:"Prompt required",description:"Please enter a prompt for your video",variant:"destructive"}),!1):R.image_required&&!h.image?(Ue({title:"Image required",description:"Please upload an image to continue",variant:"destructive"}),!1):R.video_required&&!h.video?(Ue({title:"Video required",description:"Please upload a video to continue",variant:"destructive"}),!1):R.aspect_ratio&&!u.aspect_ratio?(Ue({title:"Aspect ratio required",description:"Please select an aspect ratio",variant:"destructive"}),!1):R.n_frames&&!u.n_frames?(Ue({title:"Duration required",description:"Please select a duration",variant:"destructive"}),!1):R.size_modes&&!u.size_mode?(Ue({title:"Size required",description:"Please select a size mode",variant:"destructive"}),!1):R.mode&&!u.mode?(Ue({title:"Mode required",description:"Please select a mode",variant:"destructive"}),!1):R.models&&!u.model?(Ue({title:"Model variant required",description:"Please select a model variant",variant:"destructive"}),!1):!0},D=async()=>{var R,$;if(C()){if(!r||(r.credits||0)<P){Ue({title:"Insufficient credits",description:`You need ${P} credits. Please top up your account.`,variant:"destructive"});return}try{s(!0),w("");const{data:{user:F},error:T}=await Y.auth.getUser();if(T||!F)throw new Error("Not authenticated");const{data:O,error:H}=await Y.rpc("create_generation_job",{p_user_id:F.id,p_model_id:a,p_input_params:{...u,generation_type:l},p_cost:P,p_use_credits:!0});if(H)throw H.message.includes("INSUFFICIENT_FUNDS")?new Error("Insufficient credits. Please top up your account."):H;const re=(R=O[0])==null?void 0:R.job_id,Q={job_id:re,model_id:a,prompt:u.prompt,generation_type:l};if(u.aspect_ratio&&(Q.aspect_ratio=u.aspect_ratio),u.n_frames&&(Q.n_frames=u.n_frames),u.duration&&(Q.duration=u.duration),u.size_mode&&(Q.size_mode=u.size_mode),u.mode&&(Q.mode=u.mode),u.model&&(Q.model=u.model),u.ratio&&(Q.resolution=u.ratio),u.remove_watermark!==void 0&&(Q.remove_watermark=u.remove_watermark),u.enable_translation!==void 0&&(Q.enable_translation=u.enable_translation),u.seed&&(Q.seeds=parseInt(u.seed)),h.image){const L=h.image.name.split(".").pop(),G=`${re}_${Date.now()}.${L}`,te=`${F.id}/${G}`,{error:he}=await Y.storage.from("video-generation-images").upload(te,h.image,{contentType:h.image.type,upsert:!1});if(he)throw new Error(`Failed to upload image: ${he.message}`);const{data:{publicUrl:Le}}=Y.storage.from("video-generation-images").getPublicUrl(te);Q.image_url=Le}const{data:q}=await Y.auth.getSession(),M=($=q==null?void 0:q.session)==null?void 0:$.access_token;if(!M){Ue({title:"Authentication Error",description:"Please log in again to generate videos.",variant:"destructive"}),s(!1);return}const z=await fetch("https://jocpxkmlukhfmvcxuayv.supabase.co/functions/v1/kie-video-generate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${M}`},body:JSON.stringify(Q)});if(!z.ok){const L=await z.json().catch(()=>({}));if(Q.image_url){const G=Q.image_url.split("/video-generation-images/")[1];G&&await Y.storage.from("video-generation-images").remove([G])}throw await Y.rpc("refund_generation_job",{p_job_id:re,p_reason:L.error||"Generation request failed"}),new Error(L.error||"Failed to initiate video generation")}const A=await z.json();Ue({title:"Generation started",description:'Check "My Videos" for progress.'});const ee=Y.channel(`job_${re}`).on("postgres_changes",{event:"UPDATE",schema:"public",table:"video_generations",filter:`id=eq.${re}`},L=>{const{new:G}=L;G.status==="completed"&&G.video_url?(w(G.video_url),s(!1),Ue({title:"Video generation complete",description:"Your video has been generated successfully!"}),ee.unsubscribe()):G.status==="failed"&&(s(!1),Ue({title:"Generation failed",description:G.error_message||"Video generation failed",variant:"destructive"}),ee.unsubscribe())}).subscribe()}catch(F){console.error("Error generating video:",F),Ue({title:"Generation failed",description:F instanceof Error?F.message:"Failed to generate video",variant:"destructive"}),s(!1)}}},I=()=>{var re,Q,q,M,Z;const R=b,$=[],F=((re=R.prompt)==null?void 0:re.required)!==!1;$.push(i.jsxs("div",{className:"space-y-3",children:[i.jsxs(le,{className:"text-base font-medium",children:["Prompt ",F&&i.jsx("span",{className:"text-destructive",children:"*"}),i.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["(",(u.prompt||"").length,"/5000)"]})]}),i.jsx(In,{value:u.prompt||"",onChange:z=>{const A=z.target.value;A.length>5e3||d(ee=>({...ee,prompt:A}))},placeholder:"Describe your video...",className:"min-h-[120px] bg-white/[0.03] border-white/10",maxLength:5e3})]},"prompt"));const T=R.image_required||((Q=R.image)==null?void 0:Q.required)||(l==null?void 0:l.includes("image"));if(T){const z=h.image;$.push(i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs(le,{className:"text-base font-medium",children:["Image ",T&&i.jsx("span",{className:"text-destructive",children:"*"})]}),z?i.jsx("div",{className:"relative border border-white/10 rounded-lg p-4 bg-white/[0.02]",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm truncate flex-1",children:h.image.name}
612),i.jsx(B,{type:"button",variant:"ghost",size:"sm",onClick:()=>_("image"),className:"ml-2",children:i.jsx(on,{className:"w-4 h-4"})})]})}):i.jsxs("div",{onClick:()=>{var A;return(A=g.current.image)==null?void 0:A.click()},className:"border-2 border-dashed border-white/10 rounded-lg p-8 text-center cursor-pointer hover:border-primary/50 transition-colors",children:[i.jsx(Pn,{className:"w-8 h-8 mx-auto mb-3 text-muted-foreground"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to upload image"}),i.jsx("input",{ref:A=>g.current.image=A,type:"file",accept:"image/*",onChange:A=>S("image",A),className:"hidden"})]})]}),((q=y==null?void 0:y.showcase)==null?void 0:q.image_input_1)&&((M=y==null?void 0:y.showcase)==null?void 0:M.image_input_2)&&i.jsxs("div",{className:"space-y-3",children:[i.jsx(le,{className:"text-sm text-muted-foreground",children:"Demo Examples"}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Start Frame"}),i.jsx("img",{src:y.showcase.image_input_1,alt:"Demo start frame",className:"w-full h-auto rounded-lg border border-border"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"End Frame"}),i.jsx("img",{src:y.showcase.image_input_2,alt:"Demo end frame",className:"w-full h-auto rounded-lg border border-border"})]})]})]})]},"image"))}if(R.video_required){const z=h.video;$.push(i.jsxs("div",{className:"space-y-3",children:[i.jsxs(le,{className:"text-base font-medium",children:["Video ",i.jsx("span",{className:"text-destructive",children:"*"})]}),z?i.jsx("div",{className:"relative border border-white/10 rounded-lg p-4 bg-white/[0.02]",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm truncate flex-1",children:h.video.name}),i.jsx(B,{type:"button",variant:"ghost",size:"sm",onClick:()=>_("video"),className:"ml-2",children:i.jsx(on,{className:"w-4 h-4"})})]})}):i.jsxs("div",{onClick:()=>{var A;return(A=g.current.video)==null?void 0:A.click()},className:"border-2 border-dashed border-white/10 rounded-lg p-8 text-center cursor-pointer hover:border-primary/50 transition-colors",children:[i.jsx(Pn,{className:"w-8 h-8 mx-auto mb-3 text-muted-foreground"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to upload video"}),i.jsx("input",{ref:A=>g.current.video=A,type:"file",accept:"video/*",onChange:A=>S("video",A),className:"hidden"})]})]},"video"))}R.aspect_ratio&&Array.isArray(R.aspect_ratio)&&$.push(i.jsxs("div",{className:"space-y-3",children:[i.jsxs(le,{className:"text-base font-medium",children:["Aspect Ratio ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx("div",{className:"grid grid-cols-3 gap-3",children:R.aspect_ratio.map(z=>i.jsx(B,{type:"button",variant:u.aspect_ratio===z?"default":"outline",onClick:()=>d(A=>({...A,aspect_ratio:z})),className:"h-12",children:z},z))})]},"aspect_ratio")),R.n_frames&&Array.isArray(R.n_frames)&&$.push(i.jsxs("div",{className:"space-y-3",children:[i.jsxs(le,{className:"text-base font-medium",children:["Duration ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx("div",{className:"grid grid-cols-3 gap-3",children:R.n_frames.map(z=>i.jsx(B,{type:"button",variant:u.n_frames===z?"default":"outline",onClick:()=>d(A=>({...A,n_frames:z})),className:"h-12",children:z},z))})]},"n_frames")),R.size_modes&&Array.isArray(R.size_modes)&&$.push(i.jsxs("div",{className:"space-y-3",children:[i.jsxs(le,{className:"text-base font-medium",children:["Size ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx("div",{className:"grid grid-cols-2 gap-3",children:R.size_modes.map(z=>i.jsx(B,{type:"button",variant:u.size_mode===z?"default":"outline",onClick:()=>d(A=>({...A,size_mode:z})),className:"h-12 capitalize",children:z},z))})]},"size_mode")),R.mode&&Array.isArray(R.mode)&&$.push(i.jsxs("div",{className:"space-y-3",children:[i.jsxs(le,{className:"text-base font-medium",children:["Mode ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx("div",{className:"grid grid-cols-3 gap-3",children:R.mode.map(z=>
612i.jsx(B,{type:"button",variant:u.mode===z?"default":"outline",onClick:()=>d(A=>({...A,mode:z})),className:"h-12 capitalize",children:z},z))})]},"mode"));const O=Array.isArray(R.ratio)?R.ratio:Array.isArray(R.resolution)?R.resolution:null;O&&$.push(i.jsxs("div",{className:"space-y-3",children:[i.jsxs(le,{className:"text-base font-medium",children:["Resolution ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx("div",{className:"grid grid-cols-3 gap-3",children:O.map(z=>i.jsx(B,{type:"button",variant:u.ratio===z?"default":"outline",onClick:()=>{var ee;const A={ratio:z};z==="1080P"&&(u.duration==="10s"||u.duration==="10")&&((ee=R.constraints)!=null&&ee["1080P_max_duration"])&&(A.duration="6s"),d(L=>({...L,...A}))},className:"h-12",children:z},z))})]},"ratio")),R.models&&Array.isArray(R.models)&&$.push(i.jsxs("div",{className:"space-y-3",children:[i.jsxs(le,{className:"text-base font-medium",children:["Model Variant ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsxs(St,{value:u.model||"",onValueChange:z=>d(A=>({...A,model:z})),children:[i.jsx(vt,{className:"bg-white/[0.03] border-white/10",children:i.jsx(_t,{placeholder:"Select model variant"})}),i.jsx(yt,{children:R.models.map(z=>i.jsx(Ie,{value:z,children:z},z))})]})]},"model"));const H=Array.isArray(R.durations)?R.durations:Array.isArray(R.duration)?R.duration:null;if(H){const z=u.ratio==="1080P",A=(Z=R.constraints)==null?void 0:Z["1080P_max_duration"];$.push(i.jsxs("div",{className:"space-y-3",children:[i.jsxs(le,{className:"text-base font-medium",children:["Duration ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx("div",{className:"grid grid-cols-3 gap-3",children:H.map(ee=>z&&(ee==="10s"||ee==="10")&&A?null:i.jsx(B,{type:"button",variant:u.duration===ee?"default":"outline",onClick:()=>d(te=>({...te,duration:ee})),className:"h-12",children:ee},ee))}),z&&A&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"Note: 10-second videos are not supported for 1080P resolution"})]},"duration"))}if(t==="hailuo-2-3"){const z=a==="hailuo-2.3-standard",A=a==="hailuo-2.3-pro";$.push(i.jsxs("div",{className:"space-y-3",children:[i.jsxs(le,{className:"text-base font-medium",children:["Quality ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx(B,{type:"button",variant:z?"default":"outline",onClick:()=>o("hailuo-2.3-standard"),className:"h-12",children:"Standard"}),i.jsx(B,{type:"button",variant:A?"default":"outline",onClick:()=>o("hailuo-2.3-pro"),className:"h-12",children:"Pro"})]})]},"quality"))}return $};return i.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[i.jsx(ae,{className:"p-8 bg-white/[0.02] border-white/10",children:i.jsxs("div",{className:"space-y-6",children:[v&&v.length>1&&i.jsxs("div",{className:"space-y-3",children:[i.jsx(le,{className:"text-base font-medium",children:"Generation Type"}),i.jsx(hA,{value:l,onValueChange:c,children:v.map(R=>i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(fA,{value:R,id:R}),i.jsx(le,{htmlFor:R,className:"capitalize cursor-pointer",children:R.replace("-"," ")})]},R))})]}),I(),i.jsx(B,{onClick:D,disabled:n||!r||(r.credits||0)<P,className:"w-full h-12 text-base font-medium",children:n?i.jsx(Ye,{className:"w-5 h-5 animate-spin"}):i.jsxs(i.Fragment,{children:[i.jsx(Lr,{className:"w-5 h-5 mr-2"}),"Generate ⢠",P," Credits"]})}),r&&i.jsxs("p",{className:"text-sm text-muted-foreground text-center",children:["Your balance: ",r.credits||0," credits"]})]})}),i.jsx(ae,{className:"p-8 bg-white/[0.02] border-white/10",children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"Preview"}),i.jsx("div",{className:"aspect-video bg-black/20 rounded-lg flex items-center justify-center overflow-hidden",children:n?i.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center p-8 space-y-4",children:i.jsx(Ye,{className:"w-12 h-12 animate-spin text-primary"})}):m?i.jsx("video",{src:m,controls:!0,className:"w-full h-full object-contain"}):(U=y==null?void 0:y.showcase)!=null&&U.demo_video?y.showcase.demo_video.includes("youtube.com")||y.showcase.demo_video.includes("youtu.be")?i.jsx("iframe",{src:y.showcase.demo_video,title:"Demo Video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full"}):i.jsx("video",{src:y.showcase.demo_video,controls:!0,autoPlay:!0,loop:!0,muted:!0,className:"w-full h-full object-contain"}):i.jsx("p",{className:"text-muted-foreground",children:"Generated video will appear here"})})]})})]})}function AH(){const{slug:e}=Gc(),t=Ce(),[r,n]=p.useState([]),[s,a]=p.useState(!0);p.useEffect(()=>{o()},[e]);const o=async()=>{try{if(a(!0),!e){t("/models");return}const{data:d,error:h}=await Y.from("ai_models").select("*").eq("model_group",e).eq("enabled",!0).order("price",{ascending:!0});if(h)throw h;const f=(d||[]).map(m=>({...m,resolution_supported:Array.isArray(m.resolution_supported)?m.resolution_supported:JSON.parse(m.resolution_supported),durations_supp
612orted:Array.isArray(m.durations_supported)?m.durations_supported:JSON.parse(m.durations_supported),api_metadata:typeof m.api_metadata=="object"&&m.api_metadata!==null?m.api_metadata:JSON.parse(m.api_metadata),generation_types:Array.isArray(m.generation_types)?m.generation_types:[],input_rules:typeof m.input_rules=="object"&&m.input_rules!==null?m.input_rules:{},pricing_credits:typeof m.pricing_credits=="object"&&m.pricing_credits!==null?m.pricing_credits:{}}));if(f.length===0){t("/models");return}n(f)}catch(d){console.error("Error fetching models:",d),t("/models")}finally{a(!1)}},l=()=>({"hailuo-2-3":"Hailuo 2.3","sora-2":"Sora 2","sora-2-pro":"Sora 2 Pro","grok-imagine":"Grok Imagine","veo-3":"Veo 3","veo-3-1":"Veo 3.1"})[e||""]||"AI Model",c=()=>r.length>0?r[0].provider:{"hailuo-2-3":"Hailuo","sora-2":"OpenAI","sora-2-pro":"OpenAI","grok-imagine":"xAI","veo-3":"Google DeepMind","veo-3-1":"Google DeepMind"}[e||""]||"AI Provider",u=()=>r.length>0&&r[0].description?r[0].description:{"hailuo-2-3":"MiniMax Hailuo 2.3 â cinematic image-to-video AI model.","sora-2":"Sora 2 â text-to-video & image-to-video model","sora-2-pro":"Sora 2 Pro â high quality advanced video model","grok-imagine":"Grok Imagine â text-to-video & image-to-video multimodal model","veo-3":"Google Veo 3 â cinematic high-fidelity video generation","veo-3-1":"Google Veo 3.1 â cinematic high-fidelity video generation"}[e||""]||"Professional AI video generation";return s?i.jsxs("div",{className:"space-y-8 animate-fade-in pb-8",children:[i.jsx(Oe,{className:"h-12 w-64"}),i.jsx(Oe,{className:"h-24 w-full"}),i.jsx(Oe,{className:"h-96 w-full"})]}):r.length===0?i.jsx("div",{className:"text-center py-16",children:i.jsx("p",{className:"text-muted-foreground text-lg",children:"No models found"})}):i.jsxs("div",{className:"space-y-8 animate-fade-in pb-8",children:[i.jsxs("div",{className:"space-y-6",children:[i.jsxs(B,{variant:"ghost",onClick:()=>t("/models"),className:"mb-4",children:[i.jsx(rn,{className:"w-4 h-4 mr-2"}),"Back to Models"]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"flex items-center gap-3",children:i.jsx("h1",{className:"text-5xl font-bold bg-gradient-to-r from-foreground via-primary to-accent bg-clip-text text-transparent",children:l()})}),i.jsxs("p",{className:"text-lg text-muted-foreground/80",children:[c()," ⢠",u()]})]})]}),i.jsx(TH,{models:r,modelGroup:e||""})]})}const Vu=10,RH=()=>{const e=Ce(),{toast:t}=un(),[r,n]=p.useState(""),[s,a]=p.useState(!1),[o,l]=p.useState(null),c=async()=>{var u,d;if(!r.trim()){t({title:"Video URL required",description:"Please enter a Sora video URL",variant:"destructive"});return}a(!0),l(null);try{const{data:{user:h},error:f}=await Y.auth.getUser();if(f||!h){t({title:"Authentication required",description:"Please log in to use this feature",variant:"destructive"}),e("/auth");return}const{data:m}=await Y.from("users_meta").select("whatsapp_number, display_name").eq("user_id",h.id).single(),{data:w,error:g}=await Y.rpc("validate_generation_funds",{p_user_id:h.id,p_model_id:"sora-watermark-remover",p_input_params:{video_url:r},p_cost:Vu,p_use_credits:!0});if(g)throw new Error(g.message);if(!w||!((u=w[0])!=null&&u.has_sufficient_funds)){t({title:"Insufficient credits",description:`You need ${Vu} credits for this operation`,variant:"destructive"});return}const y=w[0].job_id,b=new AbortController,v=setTimeout(()=>b.abort(),18e4);try{const x=await Y.functions.invoke("video-generation-proxy",{body:{webhook_url:"https://nouman.evalinfo.com/webhook/4b83c93c-b121-45bf-94fc-e829c434a6d4",webhook_payload:{job_id:y,generation_id:y,user_id:h.id,user_email:h.email,user_phone:(m==null?void 0:m.whatsapp_number)||"",user_name:(m==null?void 0:m.display_name)||((d=h.email)==null?void 0:d.split("@")[0])||"",model:"sora-watermark-remover",image_url:r,type:"watermark_removal"}}});if(clearTimeout(v),x.error)throw new Error(x.error.message||"Failed to process video");const j=x.data,N=Array.isArray(j)?j[0]:j;if(N!=null&&N["Final URL"]||N!=null&&N.video_url){const S=N["Final URL"]||N.video_url;l(S),await Y.rpc("complete_generation_payment",{p_job_id:y}),t({title:"Watermark removed!",description:"Your video has been processed successfully"})}else throw new Error("No output URL received")}
612catch(x){throw clearTimeout(v),x instanceof Error&&x.name==="AbortError"?new Error("Request timed out after 3 minutes"):x}}catch(h){console.error("Watermark removal error:",h),t({title:"Processing failed",description:h instanceof Error?h.message:"An error occurred",variant:"destructive"})}finally{a(!1)}};return i.jsxs("div",{className:"space-y-8 animate-fade-in pb-8",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs(B,{variant:"ghost",size:"sm",onClick:()=>e("/ai-agents"),className:"gap-2 text-muted-foreground hover:text-foreground",children:[i.jsx(rn,{className:"w-4 h-4"}),"Back to AI Agents"]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:"p-3 rounded-xl bg-primary/10",children:i.jsx(Lr,{className:"w-8 h-8 text-primary"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground",children:"Sora 2 Watermark Remover"}),i.jsxs(xe,{className:"bg-primary/20 text-primary border-primary/30",children:[Vu," Credits"]})]}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Remove watermarks from Sora-generated videos instantly"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[i.jsx(ae,{className:"p-6 border-white/10 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"videoUrl",className:"text-foreground",children:"Sora Video URL"}),i.jsx(tt,{id:"videoUrl",type:"url",placeholder:"https://cdn.openai.com/sora/...",value:r,onChange:u=>n(u.target.value),className:"bg-white/[0.03] border-white/10 focus:border-primary/50",disabled:s}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter the direct URL of your Sora-generated video"})]}),i.jsx(B,{onClick:c,disabled:s||!r.trim(),className:"w-full gap-2",size:"lg",children:s?i.jsxs(i.Fragment,{children:[i.jsx(Ye,{className:"w-4 h-4 animate-spin"}),"Processing..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Lr,{className:"w-4 h-4"}),"Remove Watermark ⢠",Vu," Credits"]})})]})}),i.jsx(ae,{className:"p-6 border-white/10 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Result"}),o?i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"aspect-video rounded-lg overflow-hidden bg-black/50",children:i.jsx("video",{src:o,controls:!0,className:"w-full h-full object-contain"})}),i.jsxs(B,{variant:"outline",className:"w-full gap-2",onClick:()=>window.open(o,"_blank"),children:[i.jsx(Hs,{className:"w-4 h-4"}),"Open in New Tab"]})]}):i.jsx("div",{className:"aspect-video rounded-lg bg-white/[0.02] border border-white/10 flex items-center justify-center",children:i.jsxs("div",{className:"text-center space-y-2",children:[i.jsx($t,{className:"w-12 h-12 text-muted-foreground/40 mx-auto"}),i.jsx("p",{className:"text-muted-foreground/60 text-sm",children:s?"Processing your video...":"Your processed video will appear here"})]})})]})})]})]})},Qj=4,IH=["Corporate","Creative","Casual","LinkedIn"],OH=()=>{const e=Ce(),{toast:t}=un(),{user:r,session:n,refreshUserMeta:s}=Tt(),[a,o]=p.useState("LinkedIn"),[l,c]=p.useState(null),[u,d]=p.useState(null),[h,f]=p.useState(!1),[m,w]=p.useState(!1),[g,y]=p.useState(null),[b,v]=p.useState(null),[x,j]=p.useState(null),N=k=>{var C;const P=(C=k.target.files)==null?void 0:C[0];P&&(c(P),d(URL.createObjectURL(P)))};p.useEffect(()=>{if(!g||!m)return;const k=setInterval(async()=>{const{data:P}=await Y.from("image_generations").select("status, result_urls, error_message").eq("id",g).single();if(P)if(P.status==="completed"||P.status==="success"){const C=P.result_urls;v((C==null?void 0:C[0])||null),w(!1),f(!1),j("completed"),s(),t({title:"Headshot generated!",description:"Your professional headshot is ready."})}else P.status==="failed"?(w(!1),f(!1),j("failed"),t({title:"Generation failed",description:P.error_message||"Please try again",variant:"destructive"})):j(P.status)},5e3);return()=>clearInterval(k)},[g,m,s,t]);const S=async()=>
612{if(!l){t({title:"Photo required",description:"Please upload your photo",variant:"destructive"});return}if(!r||!(n!=null&&n.access_token)){t({title:"Login required",variant:"destructive"}),e("/auth");return}f(!0),v(null),j("uploading");try{const k=l.name.split(".").pop()||"jpg",P=`${r.id}/${Date.now()}.${k}`,{error:C}=await Y.storage.from("avatar-uploads").upload(P,l,{upsert:!0});if(C)throw new Error(C.message);const{data:{publicUrl:D}}=Y.storage.from("avatar-uploads").getPublicUrl(P);j("generating");const I=await fetch("https://jocpxkmlukhfmvcxuayv.supabase.co/functions/v1/headshot-generate",{method:"POST",headers:{Authorization:`Bearer ${n.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({user_photo_url:D,style:a})}),V=await I.json();if(!I.ok)throw new Error(V.error||"Generation failed");y(V.generation_id),w(!0),j("processing")}catch(k){f(!1),t({title:"Error",description:k instanceof Error?k.message:"An error occurred",variant:"destructive"})}},_=()=>{c(null),d(null),v(null),y(null),w(!1),f(!1),j(null)};return i.jsxs("div",{className:"space-y-8 animate-fade-in pb-8",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs(B,{variant:"ghost",size:"sm",onClick:()=>e("/image-models"),className:"gap-2 text-muted-foreground hover:text-foreground",children:[i.jsx(rn,{className:"w-4 h-4"})," Back to Image Models"]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:"p-3 rounded-xl bg-primary/10",children:i.jsx(an,{className:"w-8 h-8 text-primary"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground",children:"AI Passport & LinkedIn Headshot"}),i.jsxs(xe,{className:"bg-primary/20 text-primary border-primary/30",children:[Qj," Credits"]})]}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Upload your photo, choose a style, and get a professional headshot instantly"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[i.jsx(ae,{className:"p-6 border-border/50 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-foreground",children:"Upload Your Photo"}),i.jsxs("label",{className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-border/50 rounded-lg cursor-pointer hover:border-primary/50 transition-colors bg-muted/20",children:[u?i.jsx("img",{src:u,alt:"Preview",className:"w-full h-full object-contain rounded-lg"}):i.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[i.jsx(Pn,{className:"w-8 h-8"}),i.jsx("span",{className:"text-sm",children:"Click to upload photo"})]}),i.jsx("input",{type:"file",accept:"image/*",onChange:N,className:"hidden",disabled:h})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-foreground",children:"Choose Style"}),i.jsx("div",{className:"grid grid-cols-2 gap-3",children:IH.map(k=>i.jsx("button",{onClick:()=>o(k),disabled:h,className:`p-3 rounded-lg border text-sm font-medium transition-all ${a===k?"border-primary bg-primary/10 text-primary":"border-border/50 bg-muted/20 text-muted-foreground hover:border-primary/30"}`,children:k},k))})]}),i.jsx(B,{onClick:S,disabled:h||!l,className:"w-full gap-2",size:"lg",children:h?i.jsxs(i.Fragment,{children:[i.jsx(Ye,{className:"w-4 h-4 animate-spin"}),x==="uploading"?"Uploading...":x==="generating"?"Analyzing...":"Generating..."]}):i.jsxs(i.Fragment,{children:[i.jsx(an,{className:"w-4 h-4"}),"Generate Headshot ⢠",Qj," Credits"]})})]})}),i.jsx(ae,{className:"p-6 border-border/50 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Result"}),b&&i.jsxs(B,{variant:"ghost",size:"sm",onClick:_,children:[i.jsx(Xn,{className:"w-4 h-4 mr-1"})," New"]})]}),b?i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"aspect-square rounded-lg overflow-hidden bg-muted/20",children:i.jsx("img",{src:b,alt:"Generated headshot",className:"w-full h-full object-contain"})}),i.jsxs(B,{variant:"outline",className:"w-full gap-2",onClick:()=>window.open(b,"_blank"),children:[i.jsx(Hs,{className:"w-4 h-4"})," Open Full Size"]})]}):i.jsx("div",{className:"aspect-square rounded-lg bg-muted/10 border border-border/50 flex items-center justify-center",children:i.jsxs("div",{className:"text-center space-y-2",children:[i.jsx(gt,{className:"w-12 h-12 text-muted-foreground
612/40 mx-auto"}),i.jsx("p",{className:"text-muted-foreground/60 text-sm",children:h?"Generating your headshot...":"Your headshot will appear here"})]})})]})})]})]})},Jj=4,MH=()=>{const e=Ce(),{toast:t}=un(),{user:r,session:n,refreshUserMeta:s}=Tt(),[a,o]=p.useState(null),[l,c]=p.useState(null),[u,d]=p.useState(""),[h,f]=p.useState(!1),[m,w]=p.useState(!1),[g,y]=p.useState(null),[b,v]=p.useState(null),[x,j]=p.useState(null),N=k=>{var C;const P=(C=k.target.files)==null?void 0:C[0];P&&(o(P),c(URL.createObjectURL(P)))};p.useEffect(()=>{if(!g||!m)return;const k=setInterval(async()=>{const{data:P}=await Y.from("image_generations").select("status, result_urls, error_message").eq("id",g).single();if(P)if(P.status==="completed"||P.status==="success"){const C=P.result_urls;v((C==null?void 0:C[0])||null),w(!1),f(!1),j("completed"),s(),t({title:"Product image ready!",description:"Your professional product photo is ready."})}else P.status==="failed"?(w(!1),f(!1),j("failed"),t({title:"Generation failed",description:P.error_message||"Please try again",variant:"destructive"})):j(P.status)},5e3);return()=>clearInterval(k)},[g,m,s,t]);const S=async()=>{if(!a){t({title:"Photo required",description:"Please upload a product photo",variant:"destructive"});return}if(!r||!(n!=null&&n.access_token)){t({title:"Login required",variant:"destructive"}),e("/auth");return}f(!0),v(null),j("uploading");try{const k=a.name.split(".").pop()||"jpg",P=`${r.id}/${Date.now()}.${k}`,{error:C}=await Y.storage.from("avatar-uploads").upload(P,a,{upsert:!0});if(C)throw new Error(C.message);const{data:{publicUrl:D}}=Y.storage.from("avatar-uploads").getPublicUrl(P);j("generating");const I=await fetch("https://jocpxkmlukhfmvcxuayv.supabase.co/functions/v1/ghost-mannequin-generate",{method:"POST",headers:{Authorization:`Bearer ${n.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({product_photo_url:D,product_description:u})}),V=await I.json();if(!I.ok)throw new Error(V.error||"Generation failed");y(V.generation_id),w(!0),j("processing")}catch(k){f(!1),t({title:"Error",description:k instanceof Error?k.message:"An error occurred",variant:"destructive"})}},_=()=>{o(null),c(null),d(""),v(null),y(null),w(!1),f(!1),j(null)};return i.jsxs("div",{className:"space-y-8 animate-fade-in pb-8",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs(B,{variant:"ghost",size:"sm",onClick:()=>e("/image-models"),className:"gap-2 text-muted-foreground hover:text-foreground",children:[i.jsx(rn,{className:"w-4 h-4"})," Back to Image Models"]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:"p-3 rounded-xl bg-primary/10",children:i.jsx(qn,{className:"w-8 h-8 text-primary"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground",children:"AI Ghost Mannequin"}),i.jsxs(xe,{className:"bg-primary/20 text-primary border-primary/30",children:[Jj," Credits"]})]}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Transform product photos into clean, professional e-commerce images"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[i.jsx(ae,{className:"p-6 border-border/50 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-foreground",children:"Upload Product Photo"}),i.jsxs("label",{className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-border/50 rounded-lg cursor-pointer hover:border-primary/50 transition-colors bg-muted/20",children:[l?i.jsx("img",{src:l,alt:"Preview",className:"w-full h-full object-contain rounded-lg"}):i.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[i.jsx(Pn,{className:"w-8 h-8"}),i.jsx("span",{className:"text-sm",children:"Click to upload product photo"})]}),i.jsx("input",{type:"file",accept:"image/*",onChange:N,className:"hidden",disabled:h})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-foreground",children:"Product Description (Optional)"}),i.jsx(In,{placeholder:"e.g., Black leather jacket, men's size M...",value:u,onChange:k=>d(k.target.value),className:"bg-muted/20 border-border/50",rows:3,disabled:h})]}),i.jsx(B,{onClick:S,disabled:h||!a,className:"w-full gap-2",size:"lg",children:h?i.jsxs(i.Fragment,{children:[i.jsx(Ye,{className:"w-4 h-4 animate-spin"}),x==="uploading"?"Uploading...":"Enhancing..."]}
612):i.jsxs(i.Fragment,{children:[i.jsx(qn,{className:"w-4 h-4"}),"Enhance Product ⢠",Jj," Credits"]})})]})}),i.jsx(ae,{className:"p-6 border-border/50 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Result"}),b&&i.jsxs(B,{variant:"ghost",size:"sm",onClick:_,children:[i.jsx(Xn,{className:"w-4 h-4 mr-1"})," New"]})]}),b?i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"aspect-square rounded-lg overflow-hidden bg-muted/20",children:i.jsx("img",{src:b,alt:"Enhanced product",className:"w-full h-full object-contain"})}),i.jsxs(B,{variant:"outline",className:"w-full gap-2",onClick:()=>window.open(b,"_blank"),children:[i.jsx(Hs,{className:"w-4 h-4"})," Open Full Size"]})]}):i.jsx("div",{className:"aspect-square rounded-lg bg-muted/10 border border-border/50 flex items-center justify-center",children:i.jsxs("div",{className:"text-center space-y-2",children:[i.jsx(gt,{className:"w-12 h-12 text-muted-foreground/40 mx-auto"}),i.jsx("p",{className:"text-muted-foreground/60 text-sm",children:h?"Enhancing your product photo...":"Your enhanced photo will appear here"})]})})]})})]})]})},Xj=8,DH=["Action","Horror","Sci-Fi","Drama","Comedy","Thriller","Fantasy","Romance"],LH=()=>{const e=Ce(),{toast:t}=un(),{user:r,session:n,refreshUserMeta:s}=Tt(),[a,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(null),[h,f]=p.useState(null),[m,w]=p.useState(!1),[g,y]=p.useState(!1),[b,v]=p.useState(null),[x,j]=p.useState(null),[N,S]=p.useState(null),_=C=>{var I;const D=(I=C.target.files)==null?void 0:I[0];D&&(d(D),f(URL.createObjectURL(D)))};p.useEffect(()=>{if(!b||!g)return;const C=setInterval(async()=>{const{data:D}=await Y.from("video_generations").select("status, video_url, error_message").eq("id",b).single();D&&(D.status==="completed"||D.status==="success"?(j(D.video_url),y(!1),w(!1),S("completed"),s(),t({title:"Trailer ready!",description:"Your movie trailer has been generated."})):D.status==="failed"||D.status==="refunded"?(y(!1),w(!1),S("failed"),t({title:"Generation failed",description:D.error_message||"Please try again",variant:"destructive"})):S(D.status))},5e3);return()=>clearInterval(C)},[b,g,s,t]);const k=async()=>{if(!a.trim()){t({title:"Prompt required",description:"Describe your movie concept",variant:"destructive"});return}if(!r||!(n!=null&&n.access_token)){t({title:"Login required",variant:"destructive"}),e("/auth");return}w(!0),j(null),S("preparing");try{let C="";if(u){S("uploading");const V=u.name.split(".").pop()||"jpg",U=`${r.id}/${Date.now()}.${V}`,{error:R}=await Y.storage.from("video-generation-images").upload(U,u,{upsert:!0});if(R)throw new Error(R.message);const{data:{publicUrl:$}}=Y.storage.from("video-generation-images").getPublicUrl(U);C=$}S("generating");const D=await fetch("https://jocpxkmlukhfmvcxuayv.supabase.co/functions/v1/movie-trailer-generate",{method:"POST",headers:{Authorization:`Bearer ${n.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({prompt:a,genre:l,image_url:C||void 0})}),I=await D.json();if(!D.ok)throw new Error(I.error||"Generation failed");v(I.job_id),y(!0),S("processing")}catch(C){w(!1),t({title:"Error",description:C instanceof Error?C.message:"An error occurred",variant:"destructive"})}},P=()=>{o(""),c(""),d(null),f(null),j(null),v(null),y(!1),w(!1),S(null)};return i.jsxs("div",{className:"space-y-8 animate-fade-in pb-8",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs(B,{variant:"ghost",size:"sm",onClick:()=>e("/ai-agents"),className:"gap-2 text-muted-foreground hover:text-foreground",children:[i.jsx(rn,{className:"w-4 h-4"})," Back to AI Agents"]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:"p-3 rounded-xl bg-primary/10",children:i.jsx(ic,{className:"w-8 h-8 text-primary"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground",children:"AI Fake Movie Trailer"}),i.jsxs(xe,{className:"bg-primary/20 text-primary border-primary/30",children:[Xj," Credits"]})]}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Create cinematic AI-generated fake mov
612ie trailers from your imagination"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[i.jsx(ae,{className:"p-6 border-border/50 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-foreground",children:"Movie Concept *"}),i.jsx(In,{placeholder:"Describe your movie concept... e.g., A sci-fi thriller about time-traveling archaeologists who discover that ancient civilizations had advanced AI technology...",value:a,onChange:C=>o(C.target.value),className:"bg-muted/20 border-border/50 min-h-[120px]",disabled:m})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-foreground",children:"Genre"}),i.jsxs(St,{value:l,onValueChange:c,disabled:m,children:[i.jsx(vt,{className:"bg-muted/20 border-border/50",children:i.jsx(_t,{placeholder:"Select a genre"})}),i.jsx(yt,{children:DH.map(C=>i.jsx(Ie,{value:C,children:C},C))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-foreground",children:"Reference Image (Optional)"}),i.jsxs("label",{className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-border/50 rounded-lg cursor-pointer hover:border-primary/50 transition-colors bg-muted/20",children:[h?i.jsx("img",{src:h,alt:"Preview",className:"w-full h-full object-contain rounded-lg"}):i.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[i.jsx(Pn,{className:"w-6 h-6"}),i.jsx("span",{className:"text-xs",children:"Upload reference image"})]}),i.jsx("input",{type:"file",accept:"image/*",onChange:_,className:"hidden",disabled:m})]})]}),i.jsx(B,{onClick:k,disabled:m||!a.trim(),className:"w-full gap-2",size:"lg",children:m?i.jsxs(i.Fragment,{children:[i.jsx(Ye,{className:"w-4 h-4 animate-spin"}),N==="uploading"?"Uploading...":N==="generating"?"Creating concept...":"Generating trailer..."]}):i.jsxs(i.Fragment,{children:[i.jsx(ic,{className:"w-4 h-4"}),"Generate Trailer ⢠",Xj," Credits"]})})]})}),i.jsx(ae,{className:"p-6 border-border/50 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Result"}),x&&i.jsxs(B,{variant:"ghost",size:"sm",onClick:P,children:[i.jsx(Xn,{className:"w-4 h-4 mr-1"})," New"]})]}),x?i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"aspect-video rounded-lg overflow-hidden bg-muted/20",children:i.jsx("video",{src:x,controls:!0,className:"w-full h-full object-contain"})}),i.jsxs(B,{variant:"outline",className:"w-full gap-2",onClick:()=>window.open(x,"_blank"),children:[i.jsx(Hs,{className:"w-4 h-4"})," Open in New Tab"]})]}):i.jsx("div",{className:"aspect-video rounded-lg bg-muted/10 border border-border/50 flex items-center justify-center",children:i.jsxs("div",{className:"text-center space-y-2",children:[i.jsx($t,{className:"w-12 h-12 text-muted-foreground/40 mx-auto"}),i.jsx("p",{className:"text-muted-foreground/60 text-sm",children:m?"Creating your movie trailer...":"Your trailer will appear here"})]})})]})})]})]})},Zj=8,$H=["Premium","Energetic","Minimal","Techy","Luxury","Playful"],FH=()=>{const e=Ce(),{toast:t}=un(),{user:r,session:n,refreshUserMeta:s}=Tt(),[a,o]=p.useState(""),[l,c]=p.useState("Premium"),[u,d]=p.useState(null),[h,f]=p.useState(null),[m,w]=p.useState(!1),[g,y]=p.useState(!1),[b,v]=p.useState(null),[x,j]=p.useState(null),[N,S]=p.useState(null),_=C=>{var I;const D=(I=C.target.files)==null?void 0:I[0];D&&(d(D),f(URL.createObjectURL(D)))};p.useEffect(()=>{if(!b||!g)return;const C=setInterval(async()=>{const{data:D}=await Y.from("video_generations").select("status, video_url, error_message").eq("id",b).single();D&&(D.status==="completed"||D.status==="success"?(j(D.video_url),y(!1),w(!1),S("completed"),s(),t({title:"Teaser ready!",description:"Your product launch teaser is ready."})):D.status==="failed"||D.status==="refunded"?(y(!1),w(!1),S("failed"),t({title:"Generation failed",description:D.error_message||"Please try again",variant:"destructive"})):S(D.status))},5e3);return()=>clearInterval(C)},[b,g,s,t]);const k=async()=>
612{if(!a.trim()){t({title:"Description required",description:"Describe your product",variant:"destructive"});return}if(!r||!(n!=null&&n.access_token)){t({title:"Login required",variant:"destructive"}),e("/auth");return}w(!0),j(null),S("preparing");try{let C="";if(u){S("uploading");const V=u.name.split(".").pop()||"jpg",U=`${r.id}/${Date.now()}.${V}`,{error:R}=await Y.storage.from("video-generation-images").upload(U,u,{upsert:!0});if(R)throw new Error(R.message);const{data:{publicUrl:$}}=Y.storage.from("video-generation-images").getPublicUrl(U);C=$}S("generating");const D=await fetch("https://jocpxkmlukhfmvcxuayv.supabase.co/functions/v1/product-teaser-generate",{method:"POST",headers:{Authorization:`Bearer ${n.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({prompt:a,tone:l,image_url:C||void 0})}),I=await D.json();if(!D.ok)throw new Error(I.error||"Generation failed");v(I.job_id),y(!0),S("processing")}catch(C){w(!1),t({title:"Error",description:C instanceof Error?C.message:"An error occurred",variant:"destructive"})}},P=()=>{o(""),c("Premium"),d(null),f(null),j(null),v(null),y(!1),w(!1),S(null)};return i.jsxs("div",{className:"space-y-8 animate-fade-in pb-8",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs(B,{variant:"ghost",size:"sm",onClick:()=>e("/ai-agents"),className:"gap-2 text-muted-foreground hover:text-foreground",children:[i.jsx(rn,{className:"w-4 h-4"})," Back to AI Agents"]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:"p-3 rounded-xl bg-primary/10",children:i.jsx(Bd,{className:"w-8 h-8 text-primary"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground",children:"AI Product Launch Teaser"}),i.jsxs(xe,{className:"bg-primary/20 text-primary border-primary/30",children:[Zj," Credits"]})]}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Generate professional product launch teaser videos with AI"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[i.jsx(ae,{className:"p-6 border-border/50 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-foreground",children:"Product Description *"}),i.jsx(In,{placeholder:"Describe your product... e.g., A revolutionary wireless noise-canceling headphone with 60-hour battery life, premium build quality, and spatial audio support...",value:a,onChange:C=>o(C.target.value),className:"bg-muted/20 border-border/50 min-h-[120px]",disabled:m})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-foreground",children:"Tone"}),i.jsxs(St,{value:l,onValueChange:c,disabled:m,children:[i.jsx(vt,{className:"bg-muted/20 border-border/50",children:i.jsx(_t,{})}),i.jsx(yt,{children:$H.map(C=>i.jsx(Ie,{value:C,children:C},C))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-foreground",children:"Product Image (Optional)"}),i.jsxs("label",{className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-border/50 rounded-lg cursor-pointer hover:border-primary/50 transition-colors bg-muted/20",children:[h?i.jsx("img",{src:h,alt:"Preview",className:"w-full h-full object-contain rounded-lg"}):i.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[i.jsx(Pn,{className:"w-6 h-6"}),i.jsx("span",{className:"text-xs",children:"Upload product image"})]}),i.jsx("input",{type:"file",accept:"image/*",onChange:_,className:"hidden",disabled:m})]})]}),i.jsx(B,{onClick:k,disabled:m||!a.trim(),className:"w-full gap-2",size:"lg",children:m?i.jsxs(i.Fragment,{children:[i.jsx(Ye,{className:"w-4 h-4 animate-spin"}),N==="uploading"?"Uploading...":N==="generating"?"Creating concept...":"Generating teaser..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Bd,{className:"w-4 h-4"}),"Generate Teaser ⢠",Zj," Credits"]})})]})}),i.jsx(ae,{className:"p-6 border-border/50 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Result"}),x&&i.jsxs(B,{variant:"ghost",size:"sm",onClick:P,children:[i.jsx(Xn,{className:"w-4 h-4 mr-1"})," New"]})]}),x?i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"aspect-video rounded-lg overflow-hidden bg-muted/20",children:i.jsx("video",{src:x,controls:!0,className:"w-full h-full object-contain"})}),i.jsxs(B,{variant:"outline",className:"w-full gap-2",onClick:()=>window.open(x,"_blank"),children:[i.jsx(Hs,{className:"w-4 h-4"})," Open in New Tab"]})]}):i.jsx("div",{className:"aspect-video rounded-lg bg-muted/10 border border-border/50 flex items-center justify-center",children:i.jsxs("div",{className:"text-center space-y-2",children:[i.jsx($t,{className:"w-12 h-12 text-muted-foreground
612/40 mx-auto"}),i.jsx("p",{className:"text-muted-foreground/60 text-sm",children:m?"Creating your product teaser...":"Your teaser will appear here"})]})})]})})]})]})},e1=10,UH=[{value:"casual",label:"Casual & Authentic",description:"Everyday creator vibe, iPhone aesthetic"},{value:"lifestyle",label:"Lifestyle",description:"Aspirational but still relatable"},{value:"unboxing",label:"Unboxing / First Reaction",description:"Fresh out the box, genuine reactions"},{value:"testimonial",label:"Testimonial",description:"Personal recommendation style"},{value:"tutorial",label:"How-to / Tutorial",description:"Quick tips, showing product in use"},{value:"asmr",label:"ASMR / Satisfying",description:"Close-up textures, sounds, satisfying visuals"},{value:"before-after",label:"Before / After",description:"Transformation reveal, dramatic comparison"},{value:"day-in-life",label:"Day in My Life",description:"Product woven into a daily routine"},{value:"grwm",label:"Get Ready With Me",description:"Getting ready while featuring the product"},{value:"storytime",label:"Storytime",description:"Casual storytelling while using product"}],VH=[{title:"Skincare routine UGC",style:"Day in My Life",url:"https://file.aiquickdraw.com/static/ugc-sample-skincare.mp4",thumbnail:"https://file.aiquickdraw.com/static/ugc-thumb-skincare.jpg"},{title:"Headphones unboxing",style:"Unboxing",url:"https://file.aiquickdraw.com/static/ugc-sample-headphones.mp4",thumbnail:"https://file.aiquickdraw.com/static/ugc-thumb-headphones.jpg"},{title:"Coffee brand casual",style:"Casual & Authentic",url:"https://file.aiquickdraw.com/static/ugc-sample-coffee.mp4",thumbnail:"https://file.aiquickdraw.com/static/ugc-thumb-coffee.jpg"}],Lm=[{key:"uploading",label:"Uploading image..."},{key:"analyzing",label:"Analyzing product..."},{key:"generating",label:"Building UGC scene prompt..."},{key:"processing",label:"Generating video..."}],BH=()=>{var D;const e=Ce(),{toast:t}=un(),{user:r,session:n,refreshUserMeta:s}=Tt(),[a,o]=p.useState(""),[l,c]=p.useState("casual"),[u,d]=p.useState(null),[h,f]=p.useState(null),[m,w]=p.useState(!1),[g,y]=p.useState(!1),[b,v]=p.useState(null),[x,j]=p.useState(null),[N,S]=p.useState(null),_=I=>{var U;const V=(U=I.target.files)==null?void 0:U[0];V&&(d(V),f(URL.createObjectURL(V)))};p.useEffect(()=>{if(!b||!g)return;const I=setInterval(async()=>{const{data:V}=await Y.from("video_generations").select("status, video_url, error_message").eq("id",b).single();V&&(V.status==="completed"||V.status==="success"?(j(V.video_url),y(!1),w(!1),S("completed"),s(),t({title:"UGC Ad ready! ð",description:"Your UGC-style ad video has been generated."})):V.status==="failed"||V.status==="refunded"?(y(!1),w(!1),S("failed"),t({title:"Generation failed",description:V.error_message||"Please try again",variant:"destructive"})):S(V.status))},5e3);return()=>clearInterval(I)},[b,g,s,t]);const k=async()=>{if(!u){t({title:"Product image required",description:"Please upload a product image",variant:"destructive"});return}if(!r||!(n!=null&&n.access_token)){t({title:"Login required",variant:"destructive"}),e("/auth");return}w(!0),j(null),S("uploading");try{const I=u.name.split(".").pop()||"jpg",V=`${r.id}/ugc-${Date.now()}.${I}`,{error:U}=await Y.storage.from("video-generation-images").upload(V,u,{upsert:!0});if(U)throw new Error(U.message);const{data:{publicUrl:R}}=Y.storage.from("video-generation-images").getPublicUrl(V);S("analyzing");const $=await fetch("https://jocpxkmlukhfmvcxuayv.supabase.co/functions/v1/ugc-ad-generate",{method:"POST",headers:{Authorization:`Bearer ${n.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({prompt:a.trim()||void 0,image_url:R,style:l})}),F=await $.json();if(!$.ok)throw new Error(F.error||"Generation failed");v(F.job_id),y(!0),S("processing")}catch(I){w(!1),t({title:"Error",description:I instanceof Error?I.message:"An error occurred",variant:"destructive"})}},P=()=>{o(""),c("casual"),d(null),f(null),j(null),v(null),y(!1),w(!1),S(null)},C=Lm.findIndex(I=>I.key===N);return i.jsxs("div",{className:"space-y-8 animate-fade-in pb-8",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs(B,{variant:"ghost",size:"sm",onClick:()=>e("/ai-agents"),className:"gap-2 text-muted-foreground hover:text-foreground",children:[i.jsx(rn,{className:"w-4 h-4"})," Back to AI Agents"]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:"p-3 rounded-xl bg-primary/10",children:i.jsx(qn,{
612className:"w-8 h-8 text-primary"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground",children:"UGC Ad Generator"}),i.jsxs(xe,{className:"bg-primary/20 text-primary border-primary/30",children:[e1," Credits"]})]}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Upload a product image â AI analyzes it â generates authentic UGC-style video ads"})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[{icon:Pn,step:"1",title:"Upload Product Image",desc:"Add your product photo"},{icon:Pt,step:"2",title:"AI Analyzes & Scripts",desc:"Generates a UGC scene prompt"},{icon:$t,step:"3",title:"Video Generated",desc:"Authentic, relatable ad video"}].map(({icon:I,step:V,title:U,desc:R})=>i.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl bg-card/30 border border-border/40",children:[i.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-bold",children:V}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:U}),i.jsx("p",{className:"text-xs text-muted-foreground",children:R})]})]},V))}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[i.jsx(Lh,{className:"w-4 h-4 text-primary"})," Example Outputs"]}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:VH.map(I=>i.jsxs("div",{className:"group relative rounded-xl overflow-hidden border border-border/40 bg-card/30 hover:border-primary/50 transition-all",children:[i.jsx("div",{className:"aspect-[9/16] bg-muted/20",children:i.jsx("video",{src:I.url,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-cover",onMouseEnter:V=>V.target.play(),onMouseLeave:V=>{const U=V.target;U.pause(),U.currentTime=0}})}),i.jsxs("div",{className:"absolute bottom-0 inset-x-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-3",children:[i.jsx("p",{className:"text-xs font-medium text-white",children:I.title}),i.jsx("p",{className:"text-[10px] text-white/60",children:I.style})]})]},I.title))})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[i.jsx(ae,{className:"p-6 border-border/50 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs(le,{className:"text-foreground",children:["Product Image ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsxs("label",{className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-border/50 rounded-lg cursor-pointer hover:border-primary/50 transition-colors bg-muted/20 overflow-hidden",children:[h?i.jsx("img",{src:h,alt:"Product preview",className:"w-full h-full object-contain rounded-lg"}):i.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[i.jsx(qn,{className:"w-10 h-10 opacity-40"}),i.jsx("span",{className:"text-sm font-medium",children:"Click to upload product image"}),i.jsx("span",{className:"text-xs opacity-60",children:"PNG, JPG, WEBP up to 20MB"})]}),i.jsx("input",{type:"file",accept:"image/*",onChange:_,className:"hidden",disabled:m})]}),h&&i.jsx("button",{onClick:()=>{d(null),f(null)},className:"text-xs text-muted-foreground hover:text-foreground underline",disabled:m,children:"Remove image"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{className:"text-foreground",children:"UGC Style"}),i.jsxs(St,{value:l,onValueChange:c,disabled:m,children:[i.jsx(vt,{className:"bg-muted/20 border-border/50",children:i.jsx(_t,{})}),i.jsx(yt,{children:UH.map(I=>i.jsx(Ie,{value:I.value,children:i.jsxs("div",{children:[i.jsx("span",{className:"font-medium",children:I.label}),i.jsxs("span",{className:"text-muted-foreground ml-2 text-xs",children:["â ",I.description]})]})},I.value))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(le,{className:"text-foreground",children:["Additional Instructions"," ",i.jsx("span",{className:"text-muted-foreground text-xs",children:"(Optional)"})]}),i.jsx(In,{placeholder:"e.g. Show a 25-year-old woman using this in a morning routine... or focus on the packaging close-up...",value:a,onChange:I=>o(I.target.value),className:"bg-muted/20 border-border/50 min-h-[100px] resize-none",disabled:m})]}),i.jsx(B,{onClick:k,disabled:m||!u,className:"w-full gap-2",size:"lg",children:m?i.jsxs(i.Fragment,{children:[i.jsx(Ye,{className:"w-4 h-4 animate-spin"}),((D=Lm.find(I=>I.key===N))==null?void 0:D.label)||"Processing..."]}
612):i.jsxs(i.Fragment,{children:[i.jsx(qn,{className:"w-4 h-4"}),"Generate UGC Ad ⢠",e1," Credits"]})}),m&&i.jsx("div",{className:"space-y-2 pt-2",children:Lm.map((I,V)=>{const U=C>V,R=C===V;return i.jsxs("div",{className:`flex items-center gap-2 text-xs transition-all ${R?"text-primary":U?"text-muted-foreground":"text-muted-foreground/40"}`,children:[U?i.jsx(Uc,{className:"w-3.5 h-3.5 text-primary"}):R?i.jsx(Ye,{className:"w-3.5 h-3.5 animate-spin"}):i.jsx("div",{className:"w-3.5 h-3.5 rounded-full border border-current"}),I.label]},I.key)})})]})}),i.jsx(ae,{className:"p-6 border-border/50 bg-card/50 backdrop-blur-sm",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Generated UGC Ad"}),x&&i.jsxs(B,{variant:"ghost",size:"sm",onClick:P,children:[i.jsx(Xn,{className:"w-4 h-4 mr-1"})," New Ad"]})]}),x?i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"aspect-[9/16] max-h-[500px] rounded-lg overflow-hidden bg-muted/20 mx-auto max-w-[280px]",children:i.jsx("video",{src:x,controls:!0,className:"w-full h-full object-contain"})}),i.jsxs(B,{variant:"outline",className:"w-full gap-2",onClick:()=>window.open(x,"_blank"),children:[i.jsx(Hs,{className:"w-4 h-4"})," Open Full Size"]})]}):i.jsx("div",{className:"aspect-[9/16] max-h-[500px] rounded-lg bg-muted/10 border border-border/50 flex items-center justify-center mx-auto max-w-[280px]",children:i.jsxs("div",{className:"text-center space-y-3 px-4",children:[i.jsx($t,{className:"w-14 h-14 text-muted-foreground/30 mx-auto"}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"text-muted-foreground/70 text-sm font-medium",children:m?"Creating your UGC ad...":"Your UGC ad will appear here"}),i.jsx("p",{className:"text-muted-foreground/40 text-xs",children:m?"This may take 2â4 minutes":"Upload a product image to get started"})]})]})})]})})]})]})},Ry=p.forwardRef(({className:e,...t},r)=>i.jsx("div",{className:"relative w-full overflow-auto",children:i.jsx("table",{ref:r,className:J("w-full caption-bottom text-sm",e),...t})}));Ry.displayName="Table";const Iy=p.forwardRef(({className:e,...t},r)=>i.jsx("thead",{ref:r,className:J("[&_tr]:border-b",e),...t}));Iy.displayName="TableHeader";const Oy=p.forwardRef(({className:e,...t},r)=>i.jsx("tbody",{ref:r,className:J("[&_tr:last-child]:border-0",e),...t}));Oy.displayName="TableBody";const zH=p.forwardRef(({className:e,...t},r)=>i.jsx("tfoot",{ref:r,className:J("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));zH.displayName="TableFooter";const Nc=p.forwardRef(({className:e,...t},r)=>i.jsx("tr",{ref:r,className:J("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Nc.displayName="TableRow";const lr=p.forwardRef(({className:e,...t},r)=>i.jsx("th",{ref:r,className:J("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));lr.displayName="TableHead";const cr=p.forwardRef(({className:e,...t},r)=>i.jsx("td",{ref:r,className:J("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));cr.displayName="TableCell";const GH=p.forwardRef(({className:e,...t},r)=>i.jsx("caption",{ref:r,className:J("mt-4 text-sm text-muted-foreground",e),...t}));GH.displayName="TableCaption";function mA({videoUrl:e,imageUrl:t,alt:r="Video thumbnail",className:n="",onClick:s,showPlayButton:a=!0}){const[o,l]=p.useState(null),[c,u]=p.useState(!0),[d,h]=p.useState(!1);return p.useRef(null),p.useRef(null),p.useEffect(()=>{if(t){l(t),u(!1);return}if(!e){u(!1),h(!0);return}const f=document.createElement("video");return f.crossOrigin="anonymous",f.muted=!0,f.preload="metadata",f.onloadeddata=()=>{f.currentTime=Math.min(1,f.duration*.1)},f.onseeked=()=>{const m=document.createElement("canvas");m.width=f.videoWidth,m.height=f.videoHeight;const w=m.getContext("2d");if(w){w.drawImage(f,0,0,m.width,m.height);try{const g=m.toDataURL("image/jpeg",.8);l(g)}catch{h(!0)}}u(!1)},f.onerror=()=>{h(!0),u(!1)},f.src=e,()=>{f.src=""}},[e,t]),c?i.jsx(Oe,{className:`aspect-video rounded-lg bg-muted/50 ${n}`}):d||!o?i.jsx("div",{className:`aspect-video rounded-lg bg-muted/30 flex items-center justify-center border border-border/50 ${n}`,onClick:s,children:i.jsxs("div",{className:"text-center",children:[i.jsx(ic,{className:"w-8 h-8 text-muted-foreground
612/50 mx-auto mb-1"}),i.jsx("span",{className:"text-xs text-muted-foreground/50",children:"Video"})]})}):i.jsxs("div",{className:`relative aspect-video rounded-lg overflow-hidden group cursor-pointer ${n}`,onClick:s,children:[i.jsx("img",{src:o,alt:r,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"}),a&&i.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/20 group-hover:bg-black/40 transition-colors",children:i.jsx("div",{className:"w-12 h-12 rounded-full bg-white/90 flex items-center justify-center shadow-lg transform transition-transform group-hover:scale-110",children:i.jsx(Lh,{className:"w-5 h-5 text-foreground fill-foreground ml-0.5"})})})]})}const t1={pending:{icon:xr,label:"Pending",variant:"secondary",color:"text-muted-foreground",progress:5},queued:{icon:xr,label:"Queued",variant:"secondary",color:"text-muted-foreground",progress:10},initializing:{icon:vr,label:"Initializing",variant:"default",color:"text-yellow-500",animate:!0,progress:20},processing:{icon:Ye,label:"Processing",variant:"default",color:"text-blue-500",animate:!0,progress:50},generating:{icon:Pt,label:"Generating",variant:"default",color:"text-purple-500",animate:!0,progress:60},rendering:{icon:$t,label:"Rendering",variant:"default",color:"text-orange-500",animate:!0,progress:80},finalizing:{icon:Ye,label:"Finalizing",variant:"default",color:"text-emerald-500",animate:!0,progress:90},completed:{icon:nc,label:"Completed",variant:"default",color:"text-green-500",progress:100},finished:{icon:nc,label:"Completed",variant:"default",color:"text-green-500",progress:100},failed:{icon:Dh,label:"Failed",variant:"destructive",color:"text-destructive",progress:0},refunded:{icon:Xn,label:"Refunded",variant:"outline",color:"text-muted-foreground",progress:0}};function nx({status:e,createdAt:t,showProgress:r=!1,compact:n=!1}){const[s,a]=p.useState(""),[o,l]=p.useState(0),c=t1[e]||t1.queued,u=c.icon,d=["processing","generating","rendering","initializing","finalizing","queued","pending"].includes(e);return p.useEffect(()=>{if(!t||!d)return;const h=()=>{const m=new Date(t).getTime(),w=Date.now(),g=Math.floor((w-m)/1e3);if(g<60)a(`${g}s`);else{const v=Math.floor(g/60),x=g%60;a(`${v}m ${x}s`)}const y=c.progress||0,b=Math.min(g/300*30,30);l(Math.min(y+b,95))};h();const f=setInterval(h,1e3);return()=>clearInterval(f)},[t,d,c.progress]),n?i.jsxs(xe,{variant:c.variant,className:"gap-1",children:[i.jsx(u,{className:`w-3 h-3 ${c.animate?"animate-spin":""}`}),c.label]}):i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:`p-1.5 rounded-full ${d?"bg-primary/10":c.variant==="destructive"?"bg-destructive/10":"bg-muted"}`,children:i.jsx(u,{className:`w-4 h-4 ${c.color} ${c.animate?"animate-spin":""}`})}),i.jsx("span",{className:`text-sm font-medium ${c.color}`,children:c.label})]}),d&&s&&i.jsx("span",{className:"text-xs text-muted-foreground",children:s})]}),r&&d&&i.jsxs("div",{className:"space-y-1",children:[i.jsx(Cy,{value:o,className:"h-1.5 bg-muted/50"}),i.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:e==="queued"?"Waiting in queue...":"Processing your video..."}),i.jsxs("span",{children:[Math.round(o),"%"]})]})]})]})}const pA=U2,WH=V2,gA=p.forwardRef(({className:e,...t},r)=>i.jsx(Xh,{ref:r,className:J("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}));gA.displayName=Xh.displayName;const My=p.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(WH,{children:[i.jsx(gA,{}),i.jsxs(Zh,{ref:n,className:J("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
612nded-lg",e),...r,children:[t,i.jsxs(B2,{className:"absolute right-4 top-4 rounded-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:[i.jsx(on,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));My.displayName=Zh.displayName;const qH=p.forwardRef(({className:e,...t},r)=>i.jsx(ef,{ref:r,className:J("text-lg font-semibold leading-none tracking-tight",e),...t}));qH.displayName=ef.displayName;const HH=p.forwardRef(({className:e,...t},r)=>i.jsx(tf,{ref:r,className:J("text-sm text-muted-foreground",e),...t}));HH.displayName=tf.displayName;function KH(){const e=Ce(),{user:t,loading:r}=Tt(),[n,s]=p.useState([]),[a,o]=p.useState(!0),[l,c]=p.useState(0),[u,d]=p.useState(null),h=10;p.useEffect(()=>{if(!r&&!t){e("/auth");return}if(t){f();const g=Y.channel("video-updates").on("postgres_changes",{event:"*",schema:"public",table:"video_generations",filter:`user_id=eq.${t.id}`},()=>{f()}).subscribe();return()=>{Y.removeChannel(g)}}},[t,r,e]);const f=async()=>{if(t)try{o(!0);const{data:g,error:y}=await Y.from("video_generations").select("*").eq("user_id",t.id).order("created_at",{ascending:!1}).range(l*h,(l+1)*h-1);if(y)throw y;s(g||[])}catch(g){console.error("Error fetching videos:",g)}finally{o(!1)}},m=g=>{navigator.clipboard.writeText(g),Ue({title:"Copied",description:"Task ID copied to clipboard"})},w=g=>{const y=g.model_id.replace(/_/g,"-");e(`/models/${y}`,{state:{retryParams:g.input_params}})};return r?i.jsx("div",{className:"min-h-screen flex items-center justify-center",children:"Loading..."}):i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("nav",{className:"border-b border-border/50 backdrop-blur-sm bg-background/80 sticky top-0 z-50"}),i.jsx("div",{className:"container mx-auto px-4 py-12",children:i.jsxs("div",{className:"max-w-7xl mx-auto space-y-8",children:[i.jsxs("div",{className:"text-center space-y-2",children:[i.jsx("h1",{className:"text-4xl font-bold",children:"My Videos"}),i.jsx("p",{className:"text-muted-foreground",children:"Generation History"})]}),i.jsxs(ae,{className:"shadow-card",children:[i.jsx(ot,{children:i.jsx(lt,{children:"Video Generation History"})}),i.jsx(be,{children:a?i.jsx("div",{className:"space-y-4",children:[...Array(5)].map((g,y)=>i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx(Oe,{className:"h-16 w-28 rounded"}),i.jsxs("div",{className:"space-y-2 flex-1",children:[i.jsx(Oe,{className:"h-4 w-full"}),i.jsx(Oe,{className:"h-3 w-2/3"})]})]},y))}):n.length===0?i.jsxs("div",{className:"text-center py-12",children:[i.jsx("p",{className:"text-muted-foreground",children:"No videos generated yet."}),i.jsx(B,{onClick:()=>e("/models"),className:"mt-4",children:"Generate Your First Video"})]}):i.jsxs("div",{className:"overflow-x-auto",children:[i.jsxs(Ry,{children:[i.jsx(Iy,{children:i.jsxs(Nc,{children:[i.jsx(lr,{className:"w-32",children:"Preview"}),i.jsx(lr,{children:"Model & Details"}),i.jsx(lr,{children:"Status"}),i.jsx(lr,{children:"Credits"}),i.jsx(lr,{children:"Task ID"}),i.jsx(lr,{className:"text-right",children:"Actions"})]})}),i.jsx(Oy,{children:n.map(g=>{var k,P,C;const y=g.input_params||{},b=y.generation_type||"text_to_video",v=y.model||y.variant||"",x=g.provider_response||{},j=x["Final URL"]||x.Final_URL||x.video_url||x.result_url,N=g.video_url||j||null,S=g.status==="processing"&&N?"completed":g.status,_=y.image_url||((k=y.image_urls)==null?void 0:k[0]);return i.jsxs(Nc,{children:[i.jsx(cr,{children:N?i.jsx(mA,{videoUrl:N,imageUrl:_,className:"w-28",onClick:()=>d(g)}):i.jsx("div",{className:"w-28 aspect-video rounded-lg bg-muted/30 flex items-center justify-center",children:i.jsx(nx,{status:S,createdAt:g.created_at,compact:!0})})}),i.jsx(cr,{children:i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"font-medium",children:g.model_id}),v&&i.jsx("div",{className:"text-xs text-muted-foreground",children:v}),i.jsx(xe,{variant:"outline",className:"text-xs",children:b.replace(/_/g," ")}),i.jsxs("div",{className:"text-sm text-muted-foreground truncate max-w-xs",title:y.prompt,children:[((P=y.prompt)==null?void 0:P.substring(0,60))||"N/A",((C=y.prompt)==null?void 0:C.length)>60&&"..."]}),i.jsxs("div",{className:"text-xs text-muted-foreground space-x-2",children:[y.aspect_ratio&&i.jsxs("span",{children:["⢠",y.aspect_ratio]}),y.duration&&i.jsxs("span",{children:["⢠",y.duration,"s"]}),y.resolution&&i.jsxs("span",{children:["⢠",y.resolution]})]})]})}),i.jsxs(cr,{children:[i.jsx(nx,{status:S,createdAt:g.created_at,
612showProgress:["queued","processing","generating","rendering"].includes(S)}),g.error_message&&i.jsx("p",{className:"text-xs text-destructive mt-1 max-w-xs truncate",title:g.error_message,children:g.error_message})]}),i.jsx(cr,{children:i.jsxs("div",{className:"text-sm font-medium",children:[g.credits_used||g.cost," credits"]})}),i.jsx(cr,{children:g.task_id?i.jsxs(B,{variant:"ghost",size:"sm",onClick:()=>m(g.task_id),className:"h-auto p-1 text-xs font-mono",children:[g.task_id.substring(0,8),"...",i.jsx(Dn,{className:"ml-1 h-3 w-3"})]}):i.jsx("span",{className:"text-xs text-muted-foreground",children:"â"})}),i.jsx(cr,{className:"text-right",children:i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[N&&i.jsxs(i.Fragment,{children:[i.jsx(B,{size:"sm",variant:"ghost",onClick:()=>d(g),children:i.jsx(Lh,{className:"h-4 w-4"})}),i.jsx(B,{size:"sm",variant:"outline",asChild:!0,children:i.jsx("a",{href:N,download:!0,children:i.jsx(_n,{className:"h-4 w-4"})})})]}),i.jsx(B,{size:"sm",variant:"ghost",onClick:()=>w(g),title:"Retry with same parameters",children:i.jsx(av,{className:"h-4 w-4"})})]})})]},g.id)})})]}),i.jsxs("div",{className:"flex items-center justify-between mt-4",children:[i.jsx(B,{variant:"outline",size:"sm",onClick:()=>c(g=>Math.max(0,g-1)),disabled:l===0,children:"Previous"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",l+1]}),i.jsx(B,{variant:"outline",size:"sm",onClick:()=>c(g=>g+1),disabled:n.length<h,children:"Next"})]})]})})]})]})}),i.jsx(pA,{open:!!u,onOpenChange:()=>d(null),children:i.jsx(My,{className:"max-w-4xl p-0 bg-black/95 border-white/10",children:u&&(()=>{var v;const g=u.provider_response||{},y=g["Final URL"]||g.Final_URL||g.video_url||g.result_url,b=u.video_url||y;return i.jsxs("div",{className:"relative",children:[i.jsx("video",{src:b,controls:!0,autoPlay:!0,className:"w-full aspect-video rounded-lg"}),i.jsxs("div",{className:"p-4 space-y-2",children:[i.jsx("h3",{className:"font-medium text-white",children:u.model_id}),i.jsx("p",{className:"text-sm text-white/70 line-clamp-2",children:(v=u.input_params)==null?void 0:v.prompt}),i.jsx("div",{className:"flex gap-2",children:i.jsx(B,{size:"sm",asChild:!0,children:i.jsxs("a",{href:b,download:!0,children:[i.jsx(_n,{className:"h-4 w-4 mr-2"}),"Download"]})})})]})]})})()})})]})}var ff="Checkbox",[YH,yK]=Kt(ff),[QH,Dy]=YH(ff);function JH(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:s,disabled:a,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:h}=e,[f,m]=sn({prop:r,defaultProp:s??!1,onChange:c,caller:ff}),[w,g]=p.useState(null),[y,b]=p.useState(null),v=p.useRef(!1),x=w?!!o||!!w.closest("form"):!0,j={checked:f,disabled:a,setChecked:m,control:w,setControl:g,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:v,required:u,defaultChecked:zs(s)?!1:s,isFormControl:x,bubbleInput:y,setBubbleInput:b};return i.jsx(QH,{scope:t,...j,children:XH(h)?h(j):n})}var xA="CheckboxTrigger",vA=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},s)=>{const{control:a,value:o,disabled:l,checked:c,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:f,isFormControl:m,bubbleInput:w}=Dy(xA,e),g=je(s,d),y=p.useRef(c);return p.useEffect(()=>{const b=a==null?void 0:a.form;if(b){const v=()=>h(y.current);return b.addEventListener("reset",v),()=>b.removeEventListener("reset",v)}},[a,h]),i.jsx(ue.button,{type:"button",role:"checkbox","aria-checked":zs(c)?"mixed":c,"aria-required":u,"data-state":NA(c),"data-disabled":l?"":void 0,disabled:l,value:o,...n,ref:g,onKeyDown:oe(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:oe(r,b=>{h(v=>zs(v)?!0:!v),w&&m&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});vA.displayName=xA;var Ly=p.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:s,defaultChecked:a,required:o,disabled:l,value:c,onCheckedChange:u,form:d,...h}=e;return i.jsx(JH,{__scopeCheckbox:r,checked:s,defaultChecked:a,disabled:l,required:o,onCheckedChange:u,name:n,form:d,value:c,internal_do_not_use_render:({isFormControl:f})=>i.jsxs(i.Fragment,{children:[i.jsx(vA,{...h,ref:t,__scopeCheckbox:r}),f&&i.jsx(jA,{__scopeCheckbox:r})]})})});Ly.displayName=ff;var yA="CheckboxIndicator",bA=p.forwardRef((e,t)=>
612{const{__scopeCheckbox:r,forceMount:n,...s}=e,a=Dy(yA,r);return i.jsx(ss,{present:n||zs(a.checked)||a.checked===!0,children:i.jsx(ue.span,{"data-state":NA(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});bA.displayName=yA;var wA="CheckboxBubbleInput",jA=p.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:s,checked:a,defaultChecked:o,required:l,disabled:c,name:u,value:d,form:h,bubbleInput:f,setBubbleInput:m}=Dy(wA,e),w=je(r,m),g=Xc(a),y=Bc(n);p.useEffect(()=>{const v=f;if(!v)return;const x=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(x,"checked").set,S=!s.current;if(g!==a&&N){const _=new Event("click",{bubbles:S});v.indeterminate=zs(a),N.call(v,zs(a)?!1:a),v.dispatchEvent(_)}},[f,g,a,s]);const b=p.useRef(zs(a)?!1:a);return i.jsx(ue.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??b.current,required:l,disabled:c,name:u,value:d,form:h,...t,tabIndex:-1,ref:w,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});jA.displayName=wA;function XH(e){return typeof e=="function"}function zs(e){return e==="indeterminate"}function NA(e){return zs(e)?"indeterminate":e?"checked":"unchecked"}const SA=p.forwardRef(({className:e,...t},r)=>i.jsx(Ly,{ref:r,className:J("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:i.jsx(bA,{className:J("flex items-center justify-center text-current"),children:i.jsx(qs,{className:"h-4 w-4"})})}));SA.displayName=Ly.displayName;var mf="Tabs",[ZH,bK]=Kt(mf,[df]),_A=df(),[e9,$y]=ZH(mf),kA=p.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=Jc(l),[h,f]=sn({prop:n,onChange:s,defaultProp:a??"",caller:mf});return i.jsx(e9,{scope:r,baseId:Hn(),value:h,onValueChange:f,orientation:o,dir:d,activationMode:c,children:i.jsx(ue.div,{dir:d,"data-orientation":o,...u,ref:t})})});kA.displayName=mf;var CA="TabsList",EA=p.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,a=$y(CA,r),o=_A(r);return i.jsx(QT,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:n,children:i.jsx(ue.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:t})})});EA.displayName=CA;var PA="TabsTrigger",TA=p.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...a}=e,o=$y(PA,r),l=_A(r),c=IA(o.baseId,n),u=OA(o.baseId,n),d=n===o.value;return i.jsx(JT,{asChild:!0,...l,focusable:!s,active:d,children:i.jsx(ue.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...a,ref:t,onMouseDown:oe(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?o.onValueChange(n):h.preventDefault()}),onKeyDown:oe(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(n)}),onFocus:oe(e.onFocus,()=>{const h=o.activationMode!=="manual";!d&&!s&&h&&o.onValueChange(n)})})})});TA.displayName=PA;var AA="TabsContent",RA=p.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:a,...o}=e,l=$y(AA,r),c=IA(l.baseId,n),u=OA(l.baseId,n),d=n===l.value,h=p.useRef(d);return p.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),i.jsx(ss,{present:s||d,children:({present:f})=>i.jsx(ue.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:f&&a})})});RA.displayName=AA;function IA(e,t){return`${e}-trigger-${t}`}function OA(e,t){return`${e}-content-${t}`}var t9=kA,MA=EA,DA=TA,LA=RA;const $A=t9,Fy=p.forwardRef(({className:e,...t},r)=>i.jsx(MA,{ref:r,className:J("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Fy.displayName=MA.displayName;const Sc=p.forwardRef(({className:e,...t},r)=>i.jsx(DA,{ref:r,className:J("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}));Sc.displayName=DA.displayName;const _c=p.forwardRef(({className:e,...t},r)=>i.jsx(LA,{ref:r,className:J("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));_c.displayName=LA.displayName;function fn(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 ea(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const FA=6048e5,r9=864e5;let n9={};function pf(){return n9}function kc(e,t){var l,c,u,d;const r=pf(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,s=fn(e),a=s.getDay(),o=(a<n?7:0)+a-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function fh(e){return kc(e,{weekStartsOn:1}
vendor: 19,120 bytes, line 612
612)}function UA(e){const t=fn(e),r=t.getFullYear(),n=ea(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=fh(n),a=ea(e,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=fh(a);return t.getTime()>=s.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function r1(e){const t=fn(e);return t.setHours(0,0,0,0),t}function n1(e){const t=fn(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function s9(e,t){const r=r1(e),n=r1(t),s=+r-n1(r),a=+n-n1(n);return Math.round((s-a)/r9)}function i9(e){const t=UA(e),r=ea(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),fh(r)}function a9(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function o9(e){if(!a9(e)&&typeof e!="number")return!1;const t=fn(e);return!isNaN(Number(t))}function l9(e){const t=fn(e),r=ea(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}const c9={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"}},u9=(e,t,r)=>{let n;const s=c9[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function $m(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const d9={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},h9={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},f9={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},m9={date:$m({formats:d9,defaultWidth:"full"}),time:$m({formats:h9,defaultWidth:"full"}),dateTime:$m({formats:f9,defaultWidth:"full"})},p9={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},g9=(e,t,r,n)=>p9[e];function cl(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;s=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[l]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return s[a]}}const x9={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},v9={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},y9={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"]},b9={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","Friday","Saturday"]},w9={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"}},N9=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},S9={ordinalNumber:N9,era:cl({values:x9,defaultWidth:"wide"}),quarter:cl({values:v9,defaultWidth:"wide",argumentCallback:e=>e-1}),month:cl({values:y9,defaultWidth:"wide"}),day:cl({values:b9,defaultWidth:"wide"}),dayPeriod:cl({values:w9,defaultWidth:"wide",formattingValues:j9,defaultFormattingWidth:"wide"})};function ul(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(s);if(!a)return null;const o=a[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?k9(l,h=>h.test(o)):_9(l,h=>h.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;const d=t.slice(o.length);return{value:u,rest:d}}}function _9(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function k9(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function C9(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=r.valueCallback?r.valueCallback(o):o;const l=t.slice(s.length);return{value:o,rest:l}}}const E9=/^(\d+)(th|st|nd|rd)?/i,P9=/\d+/i,T9={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},A9={any:[/^b/i,/^(a|c)/i]},R9={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},I9={any:[/1/i,/2/i,/3/i,/4/i]},O9={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},M9={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]},D9={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},L9={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]},$9={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},F9={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}},U9={ordinalNumber:C9({matchPattern:E9,parsePattern:P9,valueCallback:e=>parseInt(e,10)}),era:ul({matchPatterns:T9,defaultMatchWidth:"wide",parsePatterns:A9,defaultParseWidth:"any"}),quarter:ul({matchPatterns:R9,defaultMatchWidth:"wide",parsePatterns:I9,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ul({matchPatterns:O9,defaultMatchWidth:"wide",parsePatterns:M9,defaultParseWidth:"any"}),day:ul({matchPatterns:D9,defaultMatchWidth:"wide",parsePatterns:L9,defaultParseWidth:"any"}),dayPeriod:ul({matchPatterns:$9,defaultMatchWidth:"any",parsePatterns:F9,defaultParseWidth:"any"})},V9={code:"en-US",formatDistance:u9,formatLong:m9,formatRelative:g9,localize:S9,match:U9,options:{weekStartsOn:0,firstWeekContainsDate:1}};function B9(e){const t=fn(e);return s9(t,l9(t))+1}function z9(e){const t=fn(e),r=+fh(t)-+i9(t);return Math.round(r/FA)+1}function VA(e,t){var d,h,f,m;const r=fn(e),n=r.getFullYear(),s=pf(),a=(t==null?void 0:t.firstWeekContainsDate)??((h=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(f=s.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,o=ea(e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const l=kc(o,t),c=ea(e,0);c.setFullYear(n,0,a),c.setHours(0,0,0,0);const u=kc(c,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=u.getTime()?n:n-1}function G9(e,t){var l,c,u,d;const r=pf(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,s=VA(e,t),a=ea(e,0);return a.setFullYear(s,0,n),a.setHours(0,0,0,0),kc(a,t)}function W9(e,t){const r=fn(e),n=+kc(r,t)-+G9(r,t);return Math.round(n/FA)+1}function Pe(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const fs={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Pe(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Pe(r+1,2)},d(e,t){return Pe(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Pe(e.getHours()%12||12,t.length)},H(e,t){return Pe(e.getHours(),t.length)},m(e,t){return Pe(e.getMinutes(),t.length)},s(e,t){return Pe(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return Pe(s,t.length)}},ba={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},s1={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return fs.y(e,t)},Y:function(e,t,r,n){const s=VA(e,n),a=s>0?s:1-s;if(t==="YY"){const o=a%100;return Pe(o,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):Pe(a,t.length)},R:function(e,t){const r=UA(e);return Pe(r,t.length)},u:function(e,t){const r=e.getFullYear();return Pe(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Pe(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Pe(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return fs.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Pe(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=W9(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):Pe(s,t.length)},I:function(e,t,r){const n=z9(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Pe(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):fs.d(e,t)},D:function(e,t,r){const n=B9(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Pe(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),a=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Pe(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),a=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Pe(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return Pe(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=ba.noon:n===0?s=ba.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=ba.evening:n>=12?s=ba.afternoon:n>=4?s=ba.morning:s=ba.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return fs.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):fs.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Pe(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Pe(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):fs.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):fs.s(e,t)},S:function(e,t){return fs.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return a1(n);case"XXXX":case"XX":return yi(n);case"XXXXX":case"XXX":default:return yi(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return a1(n);case"xxxx":case"xx":return yi(n);case"xxxxx":case"xxx":default:return yi(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+i1(n,":");case"OOOO":default:return"GMT"+yi(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+i1(n,":");case"zzzz":default:return"GMT"+yi(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return Pe(n,t.length)},T:function(e,t,r){const n=e.getTime();return Pe(n,t.length)}};function i1(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),a=n%60;return a===0?r+String(s):r+String(s)+t+Pe(a,2)}function a1(e,t){return e%60===0?(e>0?"-":"+")+Pe(Math.abs(e)/60,2):yi(e,t)}function yi(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Pe(Math.trunc(n/60),2),a=Pe(n%60,2);return r+s+t+a}const o1=(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"})}},BA=(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"})}},q9=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return o1(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",o1(n,t)).replace("{{time}}",BA(s,t))},H9={p:BA,P:q9},K9=/^D+$/,Y9=/^Y+$/,Q9=["D","DD","YY","YYYY"];function J9(e){return K9.test(e)}function X9(e){return Y9.test(e)}function Z9(e,t,r){const n=e7(e,t,r);if(console.warn(n),Q9.includes(e))throw new RangeError(n)}function e7(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const t7=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,r7=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,n7=/^'([^]*?)'?$/,s7=/''/g,i7=/[a-zA-Z]/;function Cc(e,t,r){var d,h,f,m;const n=pf(),s=n.locale??V9,a=n.firstWeekContainsDate??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((m=(f=n.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??0,l=fn(e);if(!o9(l))throw new RangeError("Invalid time value");let c=t.match(r7).map(w=>{const g=w[0];if(g==="p"||g==="P"){const y=H9[g];return y(w,s.formatLong)}return w}).join("").match(t7).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const g=w[0];if(g==="'")return{isToken:!1,value:a7(w)};if(s1[g])return{isToken:!0,value:w};
612if(g.match(i7))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:w}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const u={firstWeekContainsDate:a,weekStartsOn:o,locale:s};return c.map(w=>{if(!w.isToken)return w.value;const g=w.value;(X9(g)||J9(g))&&Z9(g,t,String(e));const y=s1[g[0]];return y(l,g,s.localize,u)}).join("")}function a7(e){const t=e.match(n7);return t?t[1].replace(s7,"'"):e}function o7({userId:e}){const t=Ce(),[r,n]=p.useState([]),[s,a]=p.useState(!0),[o,l]=p.useState(null);p.useEffect(()=>{c();const m=Y.channel("video-gallery-updates").on("postgres_changes",{event:"*",schema:"public",table:"video_generations",filter:`user_id=eq.${e}`},()=>{c()}).subscribe();return()=>{Y.removeChannel(m)}},[e]);const c=async()=>{try{a(!0);const{data:m,error:w}=await Y.from("video_generations").select("*").eq("user_id",e).order("created_at",{ascending:!1}).limit(100);if(w)throw w;n(m||[])}catch(m){console.error("Error fetching videos:",m)}finally{a(!1)}},u=m=>{const w=m.provider_response||{};return m.video_url||w["Final URL"]||w.Final_URL||w.video_url||w.result_url||null},d=m=>{const w=m.model_id.replace(/_/g,"-");t(`/models/${w}`,{state:{retryParams:m.input_params}})},h=r.filter(m=>{const w=u(m);return w&&(m.status==="completed"||m.status==="processing"&&w)}),f=r.filter(m=>!u(m)&&!["completed","failed"].includes(m.status));return s?i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:Array.from({length:8}).map((m,w)=>i.jsx(Oe,{className:"aspect-video rounded-lg"},w))}):r.length===0?i.jsx(ae,{className:"border-border/50 bg-card/50",children:i.jsxs(be,{className:"py-16 text-center",children:[i.jsx($t,{className:"h-16 w-16 mx-auto mb-4 text-muted-foreground/50"}),i.jsx("h3",{className:"text-lg font-medium mb-2",children:"No videos yet"}),i.jsx("p",{className:"text-muted-foreground mb-4",children:"Generate your first video to see it here"}),i.jsx(B,{onClick:()=>t("/models"),children:"Generate Videos"})]})}):i.jsxs("div",{className:"space-y-6",children:[h.length>0&&i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:h.map(m=>{var y;const w=u(m),g=m.input_params||{};return i.jsxs(ae,{className:"group overflow-hidden border-border/50 bg-card/50 hover:border-primary/50 transition-all cursor-pointer",onClick:()=>l(m),children:[i.jsx(mA,{videoUrl:w,imageUrl:g.image_url||((y=g.image_urls)==null?void 0:y[0]),className:"w-full"}),i.jsxs(be,{className:"p-2 space-y-1",children:[i.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1",children:g.prompt||"N/A"}),i.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:Cc(new Date(m.created_at),"MMM d")}),i.jsxs("span",{children:[m.credits_used||m.cost," credits"]})]})]})]},m.id)})}),f.length>0&&i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-lg font-semibold",children:"In Progress"}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:f.map(m=>{const w=m.input_params||{};return i.jsx(ae,{className:"border-border/50 bg-card/50",children:i.jsxs(be,{className:"p-4",children:[i.jsxs("div",{className:"flex items-start justify-between mb-2",children:[i.jsx(nx,{status:m.status,createdAt:m.created_at}),i.jsx(xe,{variant:"outline",className:"text-xs",children:m.model_id})]}),i.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:w.prompt||"N/A"}),i.jsxs("div",{className:"mt-2 flex items-center justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:Cc(new Date(m.created_at),"MMM d, h:mm a")}),i.jsxs("span",{children:[m.credits_used||m.cost," credits"]})]})]})},m.id)})})]}),i.jsx(pA,{open:!!o,onOpenChange:()=>l(null),children:i.jsx(My,{className:"max-w-4xl p-0 bg-black/95 border-white/10",children:o&&(()=>{var w;const m=u(o);return i.jsxs("div",{className:"relative",children:[i.jsx("video",{src:m,controls:!0,autoPlay:!0,className:"w-full aspect-video rounded-lg"}),i.jsxs("div",{className:"p-4 space-y-2",children:[i.jsx("h3",{className:"font-medium text-white",children:o.model_id}),i.jsx("p",{className:"text-sm text-white/70 line-clamp-2",children:(w=o.input_params)==null?void 0:w.prompt}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(B,{size:"sm",asChild:!0,children:i.jsxs("a",{href:m,download:!0,children:[i.jsx(_n,{className:"h-4 w-4 mr-2"}),"Download"]})}),i.jsxs(B,{size:"sm",variant:"outline",onClick:()=>d(o),children:[i.jsx(av,{className:"h-4 w-4 mr-2"}),"Retry"]})]})]})]})})()})})]})}const l1={pending:{label:"Pending",icon:xr,color:"bg-muted text-muted-foreground"},waiting:{label:"Waiting",icon:xr,color:"bg-yellow-500/20 text-yellow-500"},queuing:{label:"In Queue",icon:Ye,color:"bg-blue-500/20 text-blue-500"},generating:{label:"Generating",icon:Pt,color:"bg-purple-500/20 text-purple-500"},completed:{label:"Completed",icon:nc,color:"bg-green-500/20 text-green-500"},failed:{label:"Failed",icon:Dh,color:"bg-destructive/20 text-destructive"}},Fm={"nano-banana":"Nano Banana","nano-banana-edit":"Nano Banana Edit","nano-banana-pro":"Nano Banana Pro","seedream-v4-text-to-image":"Seedream V4","seedream-v4-edit":"Seedream V4 Edit","flux-kontext-pro":"Flux Kontext Pro","flux-kontext-max":"Flux Kontext Max","4o-image":"GPT-4o Image","recraft-crisp-upscale":"Recraft Upscale","topaz-image-upscale":"Topaz Upscale","recraft-remove-background":"Backgroun
612d Removal"};function l7(){const{toast:e}=un(),[t,r]=p.useState([]),[n,s]=p.useState([]),[a,o]=p.useState(!0),[l,c]=p.useState(""),[u,d]=p.useState("all"),[h,f]=p.useState("all"),[m,w]=p.useState("all"),[g,y]=p.useState(null),[b,v]=p.useState(!1),[x,j]=p.useState(new Set),[N,S]=p.useState(!1),[_,k]=p.useState("images"),[P,C]=p.useState(null);p.useEffect(()=>{Y.auth.getUser().then(({data:{user:M}})=>{M&&C(M.id)})},[]),p.useEffect(()=>{D(),I();const M=Y.channel("image-gallery").on("postgres_changes",{event:"*",schema:"public",table:"image_generations"},Z=>{Z.eventType==="INSERT"?r(z=>[Z.new,...z]):Z.eventType==="UPDATE"&&r(z=>z.map(A=>A.id===Z.new.id?Z.new:A))}).subscribe();return()=>{Y.removeChannel(M)}},[]);const D=async()=>{try{const{data:{user:M}}=await Y.auth.getUser();if(!M)return;const{data:Z,error:z}=await Y.from("image_generations").select("*").eq("user_id",M.id).order("created_at",{ascending:!1}).limit(100);if(z)throw z;r(Z||[])}catch(M){console.error("Error fetching generations:",M),e({title:"Error",description:"Failed to load images",variant:"destructive"})}finally{o(!1)}},I=async()=>{try{const{data:{user:M}}=await Y.auth.getUser();if(!M)return;const{data:Z,error:z}=await Y.from("image_favorites").select("*").eq("user_id",M.id);if(z)throw z;s(Z||[])}catch(M){console.error("Error fetching favorites:",M)}},V=async(M,Z,z)=>{try{const{data:{user:A}}=await Y.auth.getUser();if(!A)return;const ee=n.find(L=>L.image_generation_id===M&&L.image_index===z);if(ee){const{error:L}=await Y.from("image_favorites").delete().eq("id",ee.id);if(L)throw L;s(G=>G.filter(te=>te.id!==ee.id)),e({title:"Removed from favorites"})}else{const{data:L,error:G}=await Y.from("image_favorites").insert({user_id:A.id,image_generation_id:M,image_url:Z,image_index:z}).select().single();if(G)throw G;s(te=>[...te,L]),e({title:"Added to favorites"})}}catch(A){console.error("Error toggling favorite:",A),e({title:"Error",description:"Failed to update favorite",variant:"destructive"})}},U=(M,Z)=>n.some(z=>z.image_generation_id===M&&z.image_index===Z),R=async(M,Z)=>{try{const A=await(await fetch(M)).blob(),ee=URL.createObjectURL(A),L=document.createElement("a");L.href=ee,L.download=`image-${Date.now()}-${Z+1}.png`,document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(ee)}catch(z){console.error("Error downloading image:",z),e({title:"Download failed",description:"Failed to download image",variant:"destructive"})}},$=async()=>{if(x.size!==0){S(!0),e({title:"Starting download",description:`Downloading ${x.size} images...`});try{const M=Array.from(x);for(let Z=0;Z<M.length;Z++)await R(M[Z],Z),Z<M.length-1&&await new Promise(z=>setTimeout(z,300));e({title:"Download complete",description:`Successfully downloaded ${M.length} images`}),v(!1),j(new Set)}catch{e({title:"Download failed",description:"Some images failed to download",variant:"destructive"})}finally{S(!1)}}},F=M=>{j(Z=>{const z=new Set(Z);return z.has(M)?z.delete(M):z.add(M),z})},T=()=>{const M=q.map(Z=>Z.url);j(new Set(M))},O=()=>{j(new Set)},H=M=>{const Z=l1[M]||l1.pending,z=Z.icon;return i.jsxs(xe,{className:`${Z.color} gap-1`,children:[i.jsx(z,{className:`h-3 w-3 ${M==="queuing"||M==="generating"?"animate-spin":""}`}),Z.label]})},re=[...new Set(t.map(M=>M.model_id))],Q=t.filter(M=>{const Z=!l||M.prompt.toLowerCase().includes(l.toLowerCase())||M.model_id.toLowerCase().includes(l.toLowerCase()),z=u==="all"||M.status===u,A=h==="all"||M.model_id===h;return Z&&z&&A});let q=Q.filter(M=>M.status==="completed"&&M.result_urls&&M.result_urls.length>0).flatMap(M=>M.result_urls.map((Z,z)=>({url:Z,generation:M,index:z})));return m==="favorites"&&(q=q.filter(M=>U(M.generation.id,M.index))),i.jsxs("div",{className:"min-h-screen p-6 space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"p-3 rounded-xl bg-gradient-to-br from-pink-500 to-rose-500",children:i.jsx(gt,{className:"h-6 w-6 text-white"})}),i.jsx("div",{children:i.jsx("h1",{className:"text-2xl font-bold",children:"Gallery"})})]}),_==="images"&&i.jsx("div",{className:"flex gap-2",children:b?i.jsxs(i.Fragment,{children:[i.jsxs(B,{variant:"outline",onClick:()=>{v(!1),O()},children:[i.jsx(on,{className:"h-4 w-4 mr-2"}),"Cancel"]}),i.jsxs(B,{variant:"outline",onClick:T,children:[i.jsx(k4,{className:"h-4 w-4 mr-2"}),"Select All"]}),i.jsxs(B,{onClick:$,disabled:x.size===0||N,children:[N?i.jsx(Ye,{className:"h-4 w-4 mr-2 animate-spin"}):i.jsx(_n,{className:"h-4 w-4 mr-2"}),"Download (",x.size,")"]})]}):i.jsxs(i.Fragment,{children:[i.jsxs(B,{variant:"outline",onClick:()=>v(!0),children:[i.jsx(C4,{className:"h-4 w-4 mr-2"}),"Select"]}),i.jsxs(B,{variant:"outline",onClick:D,children:[i.jsx(Xn,{className:"h-4 w-4 mr-2"}),"Refresh"]})]})})]}),i.jsxs($A,{value:_,onValueChange:k,children:[i.jsxs(Fy,{children:[i.jsxs(Sc,{value:"images",className:"gap-2",children:[i.jsx(gt,{className:"h-4 w-4"}),"Images"]}),i.jsxs(Sc,{value:"videos",className:"gap-2",children:[i.jsx($t,{className:"h-4 w-4"}),"Videos"]})]}),i.jsxs(_c,{value:"images",className:"space-y-6 mt-4",children:[i.jsx(ae,{className:"border-border/50 bg-card/50 backdrop-blur",children:i.jsx(be,{className:"p-4",children:i.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[i.jsxs("div",{className:"flex-1 relative",children:[i.jsx(Ki,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(tt,{placeholder:"Search by prompt or model...",value:l,onCh
612ange:M=>c(M.target.value),className:"pl-10"})]}),i.jsxs("div",{className:"flex gap-2 flex-wrap",children:[i.jsxs(St,{value:m,onValueChange:w,children:[i.jsxs(vt,{className:"w-[130px]",children:[i.jsx(Ud,{className:"h-4 w-4 mr-2"}),i.jsx(_t,{placeholder:"View"})]}),i.jsxs(yt,{children:[i.jsx(Ie,{value:"all",children:"All Images"}),i.jsx(Ie,{value:"favorites",children:"Favorites"})]})]}),i.jsxs(St,{value:u,onValueChange:d,children:[i.jsxs(vt,{className:"w-[140px]",children:[i.jsx(u4,{className:"h-4 w-4 mr-2"}),i.jsx(_t,{placeholder:"Status"})]}),i.jsxs(yt,{children:[i.jsx(Ie,{value:"all",children:"All Status"}),i.jsx(Ie,{value:"completed",children:"Completed"}),i.jsx(Ie,{value:"generating",children:"Generating"}),i.jsx(Ie,{value:"pending",children:"Pending"}),i.jsx(Ie,{value:"failed",children:"Failed"})]})]}),i.jsxs(St,{value:h,onValueChange:f,children:[i.jsx(vt,{className:"w-[180px]",children:i.jsx(_t,{placeholder:"Model"})}),i.jsxs(yt,{children:[i.jsx(Ie,{value:"all",children:"All Models"}),re.map(M=>i.jsx(Ie,{value:M,children:Fm[M]||M},M))]})]})]})]})})}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[i.jsx(ae,{className:"border-border/50 bg-card/50",children:i.jsxs(be,{className:"p-4",children:[i.jsx("div",{className:"text-2xl font-bold",children:t.length}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Generations"})]})}),i.jsx(ae,{className:"border-border/50 bg-card/50",children:i.jsxs(be,{className:"p-4",children:[i.jsx("div",{className:"text-2xl font-bold text-green-500",children:t.filter(M=>M.status==="completed").length}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Completed"})]})}),i.jsx(ae,{className:"border-border/50 bg-card/50",children:i.jsxs(be,{className:"p-4",children:[i.jsx("div",{className:"text-2xl font-bold text-purple-500",children:t.filter(M=>M.status==="generating"||M.status==="queuing").length}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"In Progress"})]})}),i.jsx(ae,{className:"border-border/50 bg-card/50",children:i.jsxs(be,{className:"p-4",children:[i.jsx("div",{className:"text-2xl font-bold",children:q.length}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Images"})]})}),i.jsx(ae,{className:"border-border/50 bg-card/50",children:i.jsxs(be,{className:"p-4",children:[i.jsx("div",{className:"text-2xl font-bold text-pink-500",children:n.length}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Favorites"})]})})]}),a?i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:Array.from({length:10}).map((M,Z)=>i.jsx(Oe,{className:"aspect-square rounded-lg"},Z))}):q.length===0?i.jsx(ae,{className:"border-border/50 bg-card/50",children:i.jsxs(be,{className:"py-16 text-center",children:[i.jsx(gt,{className:"h-16 w-16 mx-auto mb-4 text-muted-foreground/50"}),i.jsx("h3",{className:"text-lg font-medium mb-2",children:"No images yet"}),i.jsx("p",{className:"text-muted-foreground mb-4",children:m==="favorites"?"You haven't added any favorites yet":u!=="all"||h!=="all"||l?"No images match your filters":"Generate your first image to see it here"}),i.jsx(B,{asChild:!0,children:i.jsx("a",{href:"/image-generation",children:"Generate Images"})})]})}):i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:q.map(({url:M,generation:Z,index:z})=>i.jsxs(ae,{className:`group overflow-hidden border-border/50 bg-card/50 hover:border-primary/50 transition-all cursor-pointer ${b&&x.has(M)?"ring-2 ring-primary":""}`,onClick:()=>b?F(M):y(M),children:[i.jsxs("div",{className:"aspect-square relative overflow-hidden",children:[b&&i.jsx("div",{className:"absolute top-2 left-2 z-10",children:i.jsx(SA,{checked:x.has(M),onCheckedChange:()=>F(M),onClick:A=>A.stopPropagation()})}),i.jsx("img",{src:M,alt:Z.prompt,className:"w-full h-full object-cover transition-transform group-hover:scale-105",loading:"lazy"}),i.jsx("button",{className:`absolute top-2 right-2 z-10 p-1.5 rounded-full transition-all ${U(Z.id,z)?"bg-pink-500 text-white":"bg-black/50 text-white opacity-0 group-hover:opacity-100"}`,onClick:A=>{A.stopPropagation(),V(Z.id,M,z)},children:i.jsx(Ud,{className:`h-4 w-4 ${U(Z.id,z)?"fill-current":""}`})}),i.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-trans
612parent to-transparent opacity-0 group-hover:opacity-100 transition-opacity",children:i.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-3",children:[i.jsx("p",{className:"text-white text-xs line-clamp-2 mb-2",children:Z.prompt}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(xe,{variant:"secondary",className:"text-xs",children:Fm[Z.model_id]||Z.model_id}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx(B,{size:"icon",variant:"ghost",className:"h-7 w-7 text-white hover:bg-white/20",onClick:A=>{A.stopPropagation(),R(M,z)},children:i.jsx(_n,{className:"h-4 w-4"})}),i.jsx(B,{size:"icon",variant:"ghost",className:"h-7 w-7 text-white hover:bg-white/20",onClick:A=>{A.stopPropagation(),window.open(M,"_blank")},children:i.jsx(Hs,{className:"h-4 w-4"})})]})]})]})})]}),i.jsx(be,{className:"p-2",children:i.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Mh,{className:"h-3 w-3"}),Cc(new Date(Z.created_at),"MMM d")]}),i.jsxs("span",{children:[Z.cost," credits"]})]})})]},`${Z.id}-${z}`))}),Q.filter(M=>M.status!=="completed"&&M.status!=="failed").length>0&&i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-lg font-semibold",children:"In Progress"}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Q.filter(M=>M.status!=="completed"&&M.status!=="failed").map(M=>i.jsx(ae,{className:"border-border/50 bg-card/50",children:i.jsxs(be,{className:"p-4",children:[i.jsxs("div",{className:"flex items-start justify-between mb-2",children:[H(M.status),i.jsx(xe,{variant:"outline",className:"text-xs",children:Fm[M.model_id]||M.model_id})]}),i.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:M.prompt}),i.jsxs("div",{className:"mt-2 flex items-center justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:Cc(new Date(M.created_at),"MMM d, h:mm a")}),i.jsxs("span",{children:[M.cost," credits"]})]})]})},M.id))})]}),g&&i.jsx("div",{className:"fixed inset-0 z-50 bg-black/90 flex items-center justify-center p-4",onClick:()=>y(null),children:i.jsxs("div",{className:"relative max-w-4xl max-h-[90vh]",children:[i.jsx("img",{src:g,alt:"Full size",className:"max-w-full max-h-[90vh] object-contain rounded-lg"}),i.jsxs("div",{className:"absolute top-4 right-4 flex gap-2",children:[i.jsxs(B,{size:"sm",variant:"secondary",onClick:M=>{M.stopPropagation(),R(g,0)},children:[i.jsx(_n,{className:"h-4 w-4 mr-2"}),"Download"]}),i.jsxs(B,{size:"sm",variant:"secondary",onClick:M=>{M.stopPropagation(),window.open(g,"_blank")},children:[i.jsx(Hs,{className:"h-4 w-4 mr-2"}),"Open"]})]})]})})]}),i.jsx(_c,{value:"videos",className:"mt-4",children:P&&i.jsx(o7,{userId:P})})]})]})}function c7(){const[e]=Sv(),t=Ce(),{toast:r}=un(),[n,s]=p.useState(!0),[a,o]=p.useState(null);return p.useEffect(()=>{(async()=>{const c=e.get("session_id");if(!c){r({title:"Error",description:"No session ID found",variant:"destructive"}),t("/profile");return}try{const{data:u,error:d}=await Y.functions.invoke("verify-credit-payment",{body:{session_id:c}});if(d)throw d;o(u.credits),r({title:"Success!",description:`${u.credits} credits have been added to your account`})}catch(u){console.error("Error verifying payment:",u),r({title:"Error",description:u instanceof Error?u.message:"Failed to verify payment",variant:"destructive"})}finally{s(!1)}})()},[e,t,r]),n?i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:i.jsx("div",{className:"container mx-auto py-16 px-4 max-w-2xl",children:i.jsx(ae,{children:i.jsxs(be,{className:"flex flex-col items-center justify-center py-16",children:[i.jsx(Ye,{className:"w-16 h-16 text-primary animate-spin mb-4"}),i.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Processing Payment"}),i.jsx("p",{className:"text-muted-foreground",children:"Please wait while we verify your payment..."})]})})})}):i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:i.jsx("div",{className:"container mx-auto py-16 px-4 max-w-2xl",children:i.jsxs(ae,{children:[i.jsxs(ot,{className:"text-center",children:[i.jsx("div",{className:"flex justify-center mb-4",children:i.jsx(Uc,{className:"w-20 h-20 text-green-500"})}),i.jsx(lt,{className:"text-3xl",children:"Payment Successful!"}),i.jsx($r,{children:"Your credits have been added to your account"})]}),i.jsxs(be,{className:"space-y-6",children:[a&&i.jsxs("div",{className:"bg-primary/10 rounded-lg p-6 text-center",children:[i.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Credits Added"}),i.jsx("p",{className:"text-4xl font-bold text-primary",children:a.toLocaleStr
612ing()})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(B,{onClick:()=>t("/dashboard"),className:"w-full",children:"Go to Dashboard"}),i.jsx(B,{onClick:()=>t("/models"),variant:"outline",className:"w-full",children:"Start Generating Videos"})]})]})]})})})}function u7(){const[e]=Sv(),t=Ce(),r=e.get("reason")||"Unknown error occurred",n=s=>({"0001":"Transaction declined","0002":"Insufficient balance","0003":"Invalid merchant account","0004":"Transaction timeout",9999:"System error"})[s]||s;return i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:i.jsx("div",{className:"container mx-auto py-16 px-4 max-w-2xl",children:i.jsxs(ae,{className:"border-destructive",children:[i.jsxs(ot,{className:"text-center",children:[i.jsx("div",{className:"flex justify-center mb-4",children:i.jsx(Dh,{className:"w-20 h-20 text-destructive"})}),i.jsx(lt,{className:"text-3xl",children:"Payment Failed"}),i.jsx($r,{children:"Unfortunately, your payment could not be processed"})]}),i.jsxs(be,{className:"space-y-6",children:[i.jsxs("div",{className:"bg-destructive/10 border border-destructive/20 rounded-lg p-6 text-center",children:[i.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Error Reason"}),i.jsx("p",{className:"text-lg font-semibold text-destructive",children:n(r)})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(B,{onClick:()=>t("/profile"),className:"w-full",variant:"default",children:"Try Again"}),i.jsx(B,{onClick:()=>t("/dashboard"),variant:"outline",className:"w-full",children:"Back to Dashboard"})]}),i.jsx("div",{className:"text-center text-sm text-muted-foreground",children:i.jsx("p",{children:"If you continue to experience issues, please contact support."})})]})]})})})}function d7(){const e=Ce(),{user:t}=Tt(),[r,n]=p.useState([]),[s,a]=p.useState(!0);p.useEffect(()=>{if(!t){e("/auth");return}o()},[t]);const o=async()=>{try{const{data:u,error:d}=await Y.from("payments").select("*").eq("user_id",t==null?void 0:t.id).order("created_at",{ascending:!1});if(d)throw d;n(u||[])}catch(u){console.error("Error fetching payments:",u)}finally{a(!1)}},l=u=>{const d={completed:"default",pending:"secondary",failed:"destructive",refunded:"outline"};return i.jsx(xe,{variant:d[u]||"secondary",children:u})},c=u=>({stripe:"Credit Card",manual:"Manual Payment"})[u]||u;return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("nav",{className:"border-b border-border/50 backdrop-blur-sm bg-background/80 sticky top-0 z-50",children:i.jsx("div",{className:"container mx-auto px-4 py-4",children:i.jsxs(B,{variant:"ghost",onClick:()=>e("/profile"),children:[i.jsx(rn,{className:"mr-2 h-4 w-4"}),"Back to Profile"]})})}),i.jsx("div",{className:"container mx-auto px-4 py-12",children:i.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("h1",{className:"text-4xl font-bold",children:"Transaction History"}),i.jsx("p",{className:"text-muted-foreground",children:"View all your credit purchases and payments"})]}),i.jsxs(B,{variant:"outline",children:[i.jsx(_n,{className:"mr-2 h-4 w-4"}),"Export"]})]}),i.jsxs(ae,{className:"shadow-card",children:[i.jsxs(ot,{children:[i.jsx(lt,{children:"All Transactions"}),i.jsx($r,{children:"Complete history of your credit purchases and payments"})]}),i.jsx(be,{children:s?i.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Loading transactions..."}):r.length===0?i.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No transactions found. Purchase credits to get started!"}):i.jsx("div",{className:"rounded-md border",children:i.jsxs(Ry,{children:[i.jsx(Iy,{children:i.jsxs(Nc,{children:[i.jsx(lr,{children:"Date"}),i.jsx(lr,{children:"Type"}),i.jsx(lr,{children:"Payment Method"}),i.jsx(lr,{children:"Credits"}),i.jsx(lr,{children:"Amount"}),i.jsx(lr,{children:"Status"})]})}),i.jsx(Oy,{children:r.map(u=>{var d,h,f;return i.jsxs(Nc,{children:[i.jsx(cr,{className:"font-medium",children:Cc(new Date(u.created_at),"MMM dd, yyyy HH:mm")}
612),i.jsx(cr,{className:"capitalize",children:((d=u.type)==null?void 0:d.replace("_"," "))||"Purchase"}),i.jsx(cr,{children:c(u.payment_method)}),i.jsx(cr,{children:(h=u.metadata)!=null&&h.credits?i.jsxs("span",{className:"text-primary font-semibold",children:["+",u.metadata.credits.toLocaleString()]}):"-"}),i.jsxs(cr,{className:"font-semibold",children:[u.currency," ",(f=u.amount)==null?void 0:f.toFixed(2)]}),i.jsx(cr,{children:l(u.status)})]},u.id)})})]})})})]})]})})]})}const c1={USD:{symbol:"$",label:"USD",rate:1},INR:{symbol:"â¹",label:"INR",rate:85},AED:{symbol:"د.Ø¥",label:"AED",rate:3.67},PKR:{symbol:"Rs",label:"PKR",rate:278}},h7=[{id:"small",name:"Starter",credits:500,basePrice:5,description:"Try out the platform",popular:!1},{id:"medium",name:"Value",credits:1e3,basePrice:10,description:"Best for regular creators",popular:!0},{id:"large",name:"Power",credits:2500,basePrice:25,description:"For heavy creators",popular:!1}],wa={hidden:{opacity:0,y:16},visible:e=>({opacity:1,y:0,transition:{delay:e*.06,duration:.35,ease:[0,0,.2,1]}})},f7=()=>{const{user:e,userMeta:t,refreshUserMeta:r}=Tt(),{toast:n}=un(),[s,a]=p.useState((t==null?void 0:t.display_name)||""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,h]=p.useState(null),[f,m]=p.useState("USD");p.useEffect(()=>{t&&(a(t.display_name||""),l(t.whatsapp_number||""))},[t]);const w=async v=>{if(v.preventDefault(),!!e){u(!0);try{const{error:x}=await Y.from("users_meta").update({display_name:s,whatsapp_number:o}).eq("user_id",e.id);if(x)throw x;r(),Te.success("Profile updated")}catch(x){Te.error(x.message||"Update failed")}finally{u(!1)}}},g=v=>{const x=c1[f],j=Math.round(v*x.rate);return`${x.symbol}${j.toLocaleString()}`},y=async v=>{try{h(v);const{data:{session:x}}=await Y.auth.getSession();if(!x){n({title:"Sign in required",variant:"destructive"});return}const{data:j,error:N}=await Y.functions.invoke("create-credit-checkout",{body:{package_type:v,currency:f.toLowerCase()}});if(N)throw N;j!=null&&j.url&&window.open(j.url,"_blank")}catch(x){n({title:"Error",description:x instanceof Error?x.message:"Checkout failed",variant:"destructive"})}finally{h(null)}},b=()=>{var v;return s?s.split(" ").map(x=>x[0]).join("").toUpperCase().slice(0,2):((v=e==null?void 0:e.email)==null?void 0:v.slice(0,2).toUpperCase())||"U"};return i.jsx("div",{className:"max-w-4xl space-y-6",children:i.jsxs($A,{defaultValue:"profile",className:"w-full",children:[i.jsxs(Fy,{className:"bg-muted/50",children:[i.jsxs(Sc,{value:"profile",className:"gap-2",children:[i.jsx(D_,{className:"h-4 w-4"})," Profile"]}),i.jsxs(Sc,{value:"credits",className:"gap-2",children:[i.jsx(o4,{className:"h-4 w-4"})," Buy Credits"]})]}),i.jsxs(_c,{value:"profile",className:"space-y-5 mt-5",children:[i.jsx(se.div,{initial:"hidden",animate:"visible",custom:0,variants:wa,children:i.jsxs(ae,{className:"border-border/50 overflow-hidden",children:[i.jsx("div",{className:"h-24 bg-gradient-to-r from-primary/20 via-primary/10 to-transparent"}),i.jsxs(be,{className:"relative px-6 pb-6",children:[i.jsx(Lv,{className:"h-20 w-20 border-4 border-background -mt-12 shadow-lg",children:i.jsx($v,{className:"bg-primary text-primary-foreground text-xl font-bold",children:b()})}),i.jsxs("div",{className:"mt-3",children:[i.jsx("h2",{className:"text-xl font-bold text-foreground",children:s||"User"}),i.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[i.jsx(R_,{className:"w-3.5 h-3.5"})," ",e==null?void 0:e.email]})]}),i.jsxs("div",{className:"flex flex-wrap gap-2 mt-3",children:[i.jsxs(xe,{variant:"outline",className:"gap-1 text-xs",children:[i.jsx(Fd,{className:"w-3 h-3"}),(t==null?void 0:t.subscription_status)==="active"?"Pro":"Free"]}),i.jsxs(xe,{variant:t!=null&&t.suspended?"destructive":"secondary",className:"text-xs",children:[i.jsx(Ks,{className:"w-3 h-3 mr-1"}),t!=null&&t.suspended?"Suspended":"Active"]}),(t==null?void 0:t.created_at)&&i.jsxs(xe,{variant:"outline",className:"gap-1 text-xs text-muted-foreground",children:[i.jsx(Mh,{className:"w-3 h-3"}),"Joined ",new Date(t.created_at).toLocaleDateString("en-US",{month:"short",year:"numeric"})]})]})]})]})}),i.jsx(se.div,{initial:"hidden",animate:"visible",custom:1,variants:wa,children:i.jsxs(ae,{className:"border-border/50",children:[i.jsx(ot,{children:i.jsx(lt,{className:"text-base",children:"Edit Profile"})}),i.jsx(be,{children:i.jsxs("form",{onSubmit:w,className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"displayName",children:"Display Name"}),i.jsx(tt,{id:"displayName",value:s,onChange:v=>a(v.target.value),placeholder:"Your name"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"email",children:"Email"}),i.jsx(tt,{id:"email",value:(e==null?void 0:e.email)||"",disabled:!0,className:"bg-muted/30"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"whatsapp",children:"WhatsApp Number"}),i.jsxs("div",{className:"flex items-center gap-2 border border-input rounded-md px-3",children:[i.jsx(j4,{className:"h-4 w-4 text-muted-foreground shrink-0"}),i.jsx(tt,{id:"whatsapp",value:o,onChange:v=>l(v.target.value),placeholder:"+1234567890",type:"tel",className:"border-0 focus-visible:ring-0 focus-visible:ring-offset-0"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Include country code"})]}
612),i.jsx(B,{type:"submit",disabled:c,className:"w-full sm:w-auto",children:c?"Savingâ¦":"Save Changes"})]})})]})}),i.jsx(se.div,{initial:"hidden",animate:"visible",custom:2,variants:wa,children:i.jsxs(ae,{className:"border-border/50",children:[i.jsxs(ot,{children:[i.jsx(lt,{className:"text-base",children:"Notification Preferences"}),i.jsx($r,{children:"WhatsApp notifications you receive"})]}),i.jsx(be,{className:"space-y-4",children:[{id:"paymentReceipts",label:"Payment Receipts",desc:"Instant receipts for payments"},{id:"creditUpdates",label:"Credit Updates",desc:"When credits are added"},{id:"lowBalance",label:"Low Balance Alert",desc:"When credits run low"},{id:"securityAlerts",label:"Login Alerts",desc:"New device logins"}].map(v=>i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:v.id,className:"text-sm cursor-pointer",children:v.label}),i.jsx("p",{className:"text-xs text-muted-foreground",children:v.desc})]}),i.jsx(Fl,{id:v.id,defaultChecked:!0})]},v.id))})]})})]}),i.jsxs(_c,{value:"credits",className:"space-y-5 mt-5",children:[i.jsxs(se.div,{initial:"hidden",animate:"visible",custom:0,variants:wa,className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Buy Credits"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a pack and currency"})]}),i.jsxs(St,{value:f,onValueChange:m,children:[i.jsx(vt,{className:"w-28",children:i.jsx(_t,{})}),i.jsx(yt,{children:Object.entries(c1).map(([v,x])=>i.jsxs(Ie,{value:v,children:[x.symbol," ",x.label]},v))})]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5",children:h7.map((v,x)=>i.jsx(se.div,{initial:"hidden",animate:"visible",custom:x+1,variants:wa,children:i.jsxs(ae,{className:`relative h-full flex flex-col border-border/50 transition-shadow hover:shadow-lg ${v.popular?"border-primary ring-1 ring-primary/20":""}`,children:[v.popular&&i.jsxs(xe,{className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-primary text-primary-foreground shadow-sm",children:[i.jsx(Pt,{className:"w-3 h-3 mr-1"})," Best Value"]}),i.jsxs(ot,{className:"pb-2",children:[i.jsx(lt,{className:"text-lg",children:v.name}),i.jsx($r,{children:v.description})]}),i.jsxs(be,{className:"flex-1 flex flex-col justify-between gap-5",children:[i.jsxs("div",{className:"text-center py-2",children:[i.jsx("div",{className:"text-4xl font-extrabold text-primary",children:g(v.basePrice)}),i.jsxs("div",{className:"text-sm text-muted-foreground mt-1",children:[v.credits.toLocaleString()," credits"]}),f!=="USD"&&i.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:["â $",v.basePrice," USD"]})]}),i.jsx("ul",{className:"space-y-2 text-sm",children:[`${v.credits.toLocaleString()} generation credits`,"Never expires","All models access","Priority support"].map(j=>i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(qs,{className:"w-4 h-4 text-primary shrink-0"}),i.jsx("span",{className:"text-foreground",children:j})]},j))}),i.jsx(B,{onClick:()=>y(v.id),disabled:d!==null,variant:v.popular?"default":"outline",className:"w-full",children:d===v.id?"Processingâ¦":`Purchase · ${g(v.basePrice)}`})]})]})},v.id))}),i.jsx(se.div,{initial:"hidden",animate:"visible",custom:4,variants:wa,children:i.jsx(ae,{className:"bg-muted/30 border-border/50",children:i.jsxs(be,{className:"p-5",children:[i.jsx("h3",{className:"font-semibold text-foreground mb-3",children:"Why Buy Credits?"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:["Credits never expire","Access all AI models","Secure Stripe payments","Instant delivery"].map(v=>i.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[i.jsx(qs,{className:"w-4 h-4 text-primary mt-0.5 shrink-0"}),i.jsx("span",{className:"text-foreground",children:v})]},v))})]})})})]})]})})},mi={hidden:{opacity:0,y:16},visible:e=>({opacity:1,y:0,transition:{delay:e*.06,duration:.4,ease:[.16,1,.3,1]}})},Um=[{tier:"Free",minCredits:50,rpm:10,color:"text-muted-foreground"},{tier:"Standard",minCredits:500,rpm:30,color:"text-blue-500"},{tier:"Pro",minCredits:2e3,rpm:60,color:"text-violet-500"}],sr="https://jocpxkmlukhfmvcxuayv.supabase.co/functions/v1",m7=()=>{const{models:e}=Ey(),{user:t,userMeta:r}=Tt(),[n,s]=p.useState([]);p.useState({});const[a,o]=p.useState(""),[l,c]=p.useState(!1),[u,d]=p.useState(null),h=(r==null?void 0:r.credits)??0,f=h>=50,m=Um.slice().reverse().find(x=>h>=x.minCredits)||Um[0];p.useEffect(()=>{t&&w()},[t]);const w=async()=>{const{data:x}=await Y.from("api_keys").select("*").eq("user_id",t.id).order("created_at",{ascending:!1});s(x||[])},g=async()=>
612{if(!f){Ue({title:"Insufficient credits",description:"You need at least 50 credits for API access.",variant:"destructive"});return}c(!0);try{const x=`mrg_${crypto.randomUUID().replace(/-/g,"")}`,j=new TextEncoder,N=await crypto.subtle.digest("SHA-256",j.encode(x)),_=Array.from(new Uint8Array(N)).map(D=>D.toString(16).padStart(2,"0")).join(""),k=h>=2e3?"pro":h>=500?"standard":"free",P=h>=2e3?60:h>=500?30:10,{error:C}=await Y.from("api_keys").insert({user_id:t.id,key_hash:_,key_prefix:x.slice(0,12),name:a||"Default",tier:k,rate_limit_per_min:P});if(C)throw C;Ue({title:"API Key Created",description:`Your key: ${x} â Copy it now, it won't be shown again!`}),await navigator.clipboard.writeText(x),Ue({title:"Copied to clipboard!"}),o(""),w()}catch(x){Ue({title:"Error",description:x.message,variant:"destructive"})}finally{c(!1)}},y=async x=>{await Y.from("api_keys").delete().eq("id",x),w(),Ue({title:"Key deleted"})},b=x=>{navigator.clipboard.writeText(x),Ue({title:"Copied to clipboard"})},v=e.reduce((x,j)=>{const N=j.model_group||j.id;return x[N]||(x[N]=[]),x[N].push(j),x},{});return i.jsxs("div",{className:"space-y-8 pb-12 max-w-4xl",children:[i.jsx(se.div,{custom:0,variants:mi,initial:"hidden",animate:"visible",className:"space-y-2",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center",children:i.jsx(sc,{className:"w-5 h-5 text-primary"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"API Documentation"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Integrate video generation into your apps"})]})]})}),i.jsx(se.div,{custom:1,variants:mi,initial:"hidden",animate:"visible",children:i.jsxs(ae,{className:"border-border/50",children:[i.jsx(ot,{className:"pb-3",children:i.jsxs(lt,{className:"text-base flex items-center gap-2",children:[i.jsx(Ks,{className:"w-4 h-4 text-primary"})," Access Requirements"]})}),i.jsxs(be,{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[f?i.jsx(Uc,{className:"w-5 h-5 text-emerald-500 shrink-0"}):i.jsx(M_,{className:"w-5 h-5 text-amber-500 shrink-0"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:f?"API access enabled":"Minimum 50 credits required"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["You have ",i.jsx("strong",{children:h})," credits. ",!f&&"Top up to unlock API access."]})]})]}),i.jsx("div",{className:"border border-border/50 rounded-xl overflow-hidden",children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-muted/30 dark:bg-muted/10",children:[i.jsx("th",{className:"text-left px-4 py-2.5 font-medium text-muted-foreground",children:"Tier"}),i.jsx("th",{className:"text-left px-4 py-2.5 font-medium text-muted-foreground",children:"Min Credits"}),i.jsx("th",{className:"text-left px-4 py-2.5 font-medium text-muted-foreground",children:"Rate Limit"})]})}),i.jsx("tbody",{children:Um.map(x=>i.jsxs("tr",{className:`border-t border-border/30 ${m.tier===x.tier?"bg-primary/5":""}`,children:[i.jsxs("td",{className:`px-4 py-2.5 font-medium ${x.color}`,children:[x.tier," ",m.tier===x.tier&&i.jsx(xe,{className:"ml-2 text-[9px] bg-primary/10 text-primary border-0",children:"Current"})]}),i.jsx("td",{className:"px-4 py-2.5 text-foreground",children:x.minCredits}),i.jsxs("td",{className:"px-4 py-2.5 text-foreground",children:[x.rpm," req/min"]})]},x.tier))})]})})]})]})}),i.jsx(se.div,{custom:2,variants:mi,initial:"hidden",animate:"visible",children:i.jsxs(ae,{className:"border-border/50",children:[i.jsx(ot,{className:"pb-3",children:i.jsxs(lt,{className:"text-base flex items-center gap-2",children:[i.jsx(f4,{className:"w-4 h-4 text-primary"})," Your API Keys"]})}),i.jsx(be,{className:"space-y-4",children:f?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx(tt,{placeholder:"Key name (optional)",value:a,onChange:x=>o(x.target.value),className:"flex-1 h-10 bg-background border-border/40 rounded-xl"}),i.jsxs(B,{onClick:g,disabled:l,className:"gap-2 rounded-xl",children:[i.jsx(O_,{className:"w-4 h-4"})," Create Key"]})]}),n.length>0?i.jsx("div",{className:"space-y-2",children:n.map(x=>i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm font-medium text-foreground",children:x.name}),i.jsx(xe,{variant:"outline",className:"text-[10px]",children:x.tier})]}),i.jsxs("p",{className:"text-xs text-muted-foreground font-mono",children:[x.key_prefix,"â¢â¢â¢â¢â¢â¢â¢â¢"]})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("span",{className:"text-[10px] text-muted-foreground mr-2",children:[x.rate_limit_per_min," rpm"]}),i.jsx(B,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>y(x.id),children:i.jsx(T4,{className:"w-3.5 h-3.5 text-destructive"})})]})]},x.id))}):i.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No API keys yet. Create one to get started."})]}):i.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-xl bg-amber-500/5 border border-amber-500/20",children:[i.jsx(A_,{className:"w-5 h-5 text-amber-500 shrink-0"}),i.jsx("p",{className:"text-sm text-foreground",children:"You need at least 50 credits to create API keys."})]})})]})}),i.jsx(se.div,{custom:3,variants:mi,initial:"hidden",animate:"visible",children:i.jsxs(ae,{className:"border-border/50",children:[i.jsx(ot,{className:"pb-3",children:i.jsxs(lt,{className:"text-base flex items-center gap-2",children:[i.jsx(gb,{className:"w-4 h-4 text-primary"})," Quick Start"]})}),i.jsxs(be,{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Authentication"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Include your API key in the ",i.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted/30 dark:bg-muted/20 text-xs font-mono",children:"Authorization"})," header:"]}),i.jsxs("div",{className:"relative group",children:[i.jsx("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground",children:"Authorization: Bearer YOUR_API_KEY"}),i.jsx("button",{className:"absolute top-2 right-2 p-1.5 rounded-lg bg-background/80 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>b("Authorization: Bearer YOUR_API_KEY"),children:i.jsx(Dn,{className:"w-3.5 h-3.5 text-muted-foreground"})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Base URL"}),i.jsxs("div",{className:"relative group",children:[i.jsxs("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground",children:[sr,"/api-generate"]}),i.jsx("button",{className:"absolute top-2 right-2 p-1.5 rounded-lg bg-background/80 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>b(`${sr}/api-generate`),children:i.jsx(Dn,{className:"w-3.5 h-3.5 text-muted-foreground"})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Response Format (Video)"}),i.jsx("div",{className:"relative group",children:i.jsx("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground",children:`{ 613 "success": true, 614 "type": "video", 615 "job_id": "uuid", 616 "status": "queued", 617 "credits_used": 100, 618 "estimated_time": "30-120s" 619}`})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Response Format (Image)"}),i.jsx("div",{className:"relative group",children:i.jsx("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground",children:`{ 620 "success": true, 621 "type": "image", 622 "job_id": "uuid", 623 "task_id": "kie-task-id", 624 "status": "processing", 625 "credits_used": 4, 626 "cost": 4, 627 "estimated_time": "10-60s" 628}`})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Image Generation Example"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use the same ",i.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted/30 dark:bg-muted/20 text-xs font-mono",children:"api-generate"})," endpoint with an image model ID:"]}),i.jsxs("div",{className:"relative group",children:[i.jsx("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground whitespace-pre-wrap",children:`curl -X POST "${sr}/api-generate" \\ 629 -H "Authorization: Bearer YOUR_API_KEY" \\ 630 -H "Content-Type: application/json" \\ 631 -d '{ 632 "model_id": "nano-banana", 633 "prompt": "A cute cat wearing sunglasses", 634 "image_size": "1:1", 635 "output_format": "png" 636 }'`}),i.jsx("button",{className:"absolute top-2 right-2 p-1.5 rounded-lg bg-background/80 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>b(`curl -X POST "${sr}/api-generate" \\ 637 -H "Authorization: Bearer YOUR_API_KEY" \\ 638 -H "Content-Type: application/json" \\ 639 -d '{ 640 "model_id": "nano-banana", 641 "prompt": "A cute cat wearing sunglasses", 642 "image_size": "1:1", 643 "output_format": "png" 644 }'`),children:i.jsx(Dn,{className:"w-3.5 h-3.5 text-muted-foreground"})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Supported Image Models"}),i.jsx("div",{className:"border border-border/50 rounded-xl overflow-hidden",children:i.jsxs("table",{className:"w-full text-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-muted/30 dark:bg-muted/10",children:[i.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"model_id"}),i.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Cost"}),i.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Needs Image"})]})}),i.jsx("tbody",{children:[["nano-banana","4 credits","No"],["nano-banana-edit","4 credits","Yes"],["nano-banana-pro","18-24 credits","Optional"],["4o-image","18-50 credits","Optional"],["flux-kontext-pro","15 credits","No"],["flux-kontext-max","20 credits","Yes"],["grok-imagine-text-to-image","10 credits","No"],["seedream-v4-text-to-image","10-20 credits","No"],["seedream-v4-edit","12-24 credits","Yes"],["recraft-crisp-upscale","8 credits","Yes"],["recraft-remove-background","4 credits","Yes"],["topaz-image-upscale","4-12 credits","Yes"]].map(([x,j,N])=>i.jsxs("tr",{className:"border-t border-border/20",children:[i.jsx("td",{className:"px-3 py-2 font-mono text-foreground",children:x}),i.jsx("td",{className:"px-3 py-2 text-foreground",children:j}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:N})]},x))})]})})]})]})]})}),i.jsxs(se.div,{custom:4,variants:mi,initial:"hidden",animate:"visible",className:"space-y-4",children:[i.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[i.jsx(vr,{className:"w-5 h-5 text-primary"})," Models & cURL Examples"]}),Object.entries(v).map(([x,j])=>{var C,D;const N=j[0],S=u===x,_=Object.entries(N.pricing_credits||{}
644),k=_.length>0?Math.min(..._.map(([,I])=>I)):N.price,P=`curl -X POST "${sr}/api-generate" \\ 645 -H "Authorization: Bearer YOUR_API_KEY" \\ 646 -H "Content-Type: application/json" \\ 647 -d '{ 648 "model_id": "${N.id}", 649 "prompt": "A cinematic shot of a golden sunset over the ocean", 650 "resolution": "${((C=N.resolution_supported)==null?void 0:C[0])||"720p"}", 651 "duration": "${((D=N.durations_supported)==null?void 0:D[0])||"5"}s" 652 }'`;return i.jsxs(ae,{className:"border-border/50 overflow-hidden",children:[i.jsxs("button",{className:"w-full text-left p-4 flex items-center justify-between hover:bg-muted/10 transition-colors",onClick:()=>d(S?null:x),children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:i.jsx(sc,{className:"w-4 h-4 text-primary"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:N.display_name}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[N.provider," · from ",k," credits"]})]})]}),i.jsxs(xe,{variant:"outline",className:"text-[10px]",children:[j.length," variant",j.length>1?"s":""]})]}),S&&i.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-border/30 pt-3",children:[j.length>1&&i.jsx("div",{className:"border border-border/30 rounded-xl overflow-hidden",children:i.jsxs("table",{className:"w-full text-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-muted/20 dark:bg-muted/10",children:[i.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Model ID"}),i.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Price"}),i.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Resolutions"})]})}),i.jsx("tbody",{children:j.map(I=>i.jsxs("tr",{className:"border-t border-border/20",children:[i.jsx("td",{className:"px-3 py-2 font-mono text-foreground",children:I.id}),i.jsxs("td",{className:"px-3 py-2 text-foreground",children:[I.price," credits"]}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:(I.resolution_supported||[]).join(", ")})]},I.id))})]})}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"cURL Example"}),i.jsxs("button",{onClick:()=>b(P),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[i.jsx(Dn,{className:"w-3 h-3"})," Copy"]})]}),i.jsx("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground whitespace-pre-wrap",children:P})]})]})]},x)})]}),i.jsx(se.div,{custom:5,variants:mi,initial:"hidden",animate:"visible",children:i.jsxs(ae,{className:"border-border/50",children:[i.jsx(ot,{className:"pb-3",children:i.jsxs(lt,{className:"text-base flex items-center gap-2",children:[i.jsx(gb,{className:"w-4 h-4 text-primary"})," Get Media (Videos & Images)"]})}),i.jsxs(be,{className:"space-y-4",children:[i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Retrieve your generated media using the ",i.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted/30 dark:bg-muted/20 text-xs font-mono",children:"api-get-media"})," endpoint. Supports both videos and images."]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Get video by job ID"}),i.jsxs("button",{onClick:()=>b(`curl -X GET "${sr}/api-get-media?job_id=YOUR_JOB_ID&type=video" \\ 653 -H "Authorization: Bearer YOUR_API_KEY"`),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[i.jsx(Dn,{className:"w-3 h-3"})," Copy"]})]}),i.jsx("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground whitespace-pre-wrap",children:`curl -X GET "${sr}
653/api-get-media?job_id=YOUR_JOB_ID&type=video" \\ 654 -H "Authorization: Bearer YOUR_API_KEY"`})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Get image by job ID"}),i.jsxs("button",{onClick:()=>b(`curl -X GET "${sr}/api-get-media?job_id=YOUR_JOB_ID&type=image" \\ 655 -H "Authorization: Bearer YOUR_API_KEY"`),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[i.jsx(Dn,{className:"w-3 h-3"})," Copy"]})]}),i.jsx("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground whitespace-pre-wrap",children:`curl -X GET "${sr}/api-get-media?job_id=YOUR_JOB_ID&type=image" \\ 656 -H "Authorization: Bearer YOUR_API_KEY"`})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"List all videos (paginated)"}),i.jsxs("button",{onClick:()=>b(`curl -X GET "${sr}/api-get-media?type=video&limit=20&offset=0" \\ 657 -H "Authorization: Bearer YOUR_API_KEY"`),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[i.jsx(Dn,{className:"w-3 h-3"})," Copy"]})]}),i.jsx("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground whitespace-pre-wrap",children:`curl -X GET "${sr}/api-get-media?type=video&limit=20&offset=0" \\ 658 -H "Authorization: Bearer YOUR_API_KEY"`})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"List all images (paginated)"}),i.jsxs("button",{onClick:()=>b(`curl -X GET "${sr}/api-get-media?type=image&limit=20&offset=0" \\ 659 -H "Authorization: Bearer YOUR_API_KEY"`),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[i.jsx(Dn,{className:"w-3 h-3"})," Copy"]})]}),i.jsx("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground whitespace-pre-wrap",children:`curl -X GET "${sr}/api-get-media?type=image&limit=20&offset=0" \\ 660 -H "Authorization: Bearer YOUR_API_KEY"`})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Response (single video)"}),i.jsx("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground whitespace-pre-wrap",children:`{ 661 "success": true, 662 "type": "video", 663 "data": { 664 "id": "uuid", 665 "status": "completed", 666 "model_id": "kling-v2", 667 "video_url": "https://...", 668 "created_at": "2026-03-04T...", 669 "finished_at": "2026-03-04T...", 670 "credits_used": 100, 671 "cost": 100 672 } 673}`})]}),i.jsx("div",{className:"border border-border/30 rounded-xl overflow-hidden",children:i.jsxs("table",{className:"w-full text-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-muted/20 dark:bg-muted/10",children:[i.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Parameter"}),i.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Type"}),i.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Description"})]})}),i.jsxs("tbody",{children:[i.jsxs("tr",{className:"border-t border-border/20",children:[i.jsx("td",{className:"px-3 py-2 font-mono text-foreground",children:"job_id"}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:"string"}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:"Optional. Get a single generation by ID"})]}),i.jsxs("tr",{className:"border-t border-border/20",children:[i.jsx("td",{className:"px-3 py-2 font-mono text-foreground",children:"type"}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:"string"}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:'"video" (default) or "image"'})]}),i.jsxs("tr",{className:"border-t border-border/20",children:[i.jsx("td",{className:"px-3 py-2 font-mono text-foreground",children:"limit"}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:"number"}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:"Max results (1-100, default 20)"})]}),i.jsxs("tr",{className:"border-t border-border/20",children:[i.jsx("td",{className:"px-3 py-2 font-mono text-foreground",children:"offset"}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:"number"}),i.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:"Pagination offset (default 0)"})]})]})]})})]})]})}),i.jsx(se.div,{custom:6,variants:mi,initial:"hidden",animate:"visible",children:i.jsxs(ae,{className:"border-border/50",children:[i.jsx(ot,{className:"pb-3",children:i.jsxs(lt,{className:"text-base flex items-center gap-2",children:[i.jsx(Ks,{className:"w-4 h-4 text-primary"})," Rate Limiting"]})}),i.jsxs(be,{className:"space-y-3",children:[i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Rate limits are enforced per API key based on your tier. Exceeding the limit returns ",i.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted/30 dark:bg-muted/20 text-xs font-mono",children:"429 Too Many Requests"}),"."]}),i.jsx("div",{className:"relative group",children:i.jsx("pre",{className:"p-4 rounded-xl bg-muted/20 dark:bg-muted/10 border border-border/30 text-xs font-mono overflow-x-auto text-foreground",children:`// Response headers include: 674X-RateLimit-Limit: 30 675X-RateLimit-Remaining: 29 676X-RateLimit-Reset: 1709312400 677 678// On rate limit exceeded: 679{ 680 "error": "rate_limit_exceeded", 681 "message": "Too many requests. Try again in 42 seconds.", 682 "retry_after": 42 683}`})})]})]})})]})};function p7(){var d;const{id:e}=Gc(),t=Ce(),{user:r,loading:n}=Tt(),s=zT.find(h=>h.id===e);if(!s)return i.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-background text-foreground space-y-4",children:[i.jsx("h1",{className:"text-2xl font-bold",children:"Leader not found"}),i.jsx(B,{onClick:()=>t("/"),children:"Go Home"})]});const a=()=>{t(r?"/avatars":"/auth?redirect=/avatars")},o=`Get an AI Photo with ${s.name} | MyReelGen`,l=`Create a hyper-realistic AI-generated photo of yourself with ${s.name}, ${s.title}. Upload your selfie and get professional studio-quality results in seconds.`,c=`https://myreelgenai.lovable.app/avatar/${s.id}`,u=((d=s.referencePhotos)==null?void 0:d[0])||"https://myreelgenai.lovable.app/og-image.png";return i.jsxs(i.Fragment,{children:[i.jsxs(ev,{children:[i.jsx("title",{children:o}),i.jsx("meta",{name:"description",content:l}),i.jsx("link",{rel:"canonical",href:c}),i.jsx("meta",{property:"og:title",content:o}),i.jsx("meta",{property:"og:description",content:l}),i.jsx("meta",{property:"og:url",content:c}),i.jsx("meta",{property:"og:image",content:u}),i.jsx("meta",{property:"og:type",content:"website"}),i.jsx("meta",{property:"og:site_name",content:"MyReelGen"}),i.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),i.jsx("meta",{name:"twitter:title",content:o}),i.jsx("meta",{name:"twitter:description",content:l}),i.jsx("meta",{name:"twitter:image",content:u}),i.jsx("meta",{name:"keywords",content:`AI photo, ${s.name}, photo generator, AI photography, celebrity photo, ${s.title}`}),i.jsx("meta",{name:"robots",content:"index, follow"})]}),i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-xl sticky top-0 z-50",children:i.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[i.jsxs(ye,{to:"/",className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:i.jsx(vr,{className:"w-4 h-4 text-primary"})}),i.jsx("span",{className:"font-bold text-lg text-foreground",children:"MyReelGen"})]}),i.jsx("div",{className:"flex gap-2",children:r?i.jsx(B,{variant:"outline",size:"sm",onClick:()=>
683t("/dashboard"),children:"Dashboard"}):i.jsx(B,{variant:"outline",size:"sm",onClick:()=>t("/auth"),children:"Sign In"})})]})}),i.jsxs("div",{className:"container mx-auto px-4 py-12 lg:py-20",children:[i.jsxs(se.div,{className:"max-w-4xl mx-auto text-center space-y-6",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},children:[i.jsxs(se.div,{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-primary/10 text-primary text-sm font-medium",initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.1},children:[i.jsx(wo,{className:"w-4 h-4"})," AI Photography Studio"]}),i.jsxs("h1",{className:"text-3xl md:text-5xl lg:text-6xl font-bold tracking-tight text-foreground leading-tight",children:["Get an AI Photo with",i.jsx("span",{className:"block text-primary mt-2",children:s.name})]}),i.jsxs("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto leading-relaxed",children:["Upload your selfie and let our AI create a hyper-realistic photograph of you alongside the ",i.jsx("strong",{children:s.title}),"."]}),i.jsx(se.div,{className:"pt-4",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},children:i.jsxs(B,{size:"lg",className:"text-lg h-14 px-8 rounded-2xl shadow-lg shadow-primary/20 hover:shadow-primary/40 transition-all group",onClick:a,children:[i.jsx(an,{className:"w-5 h-5 mr-2"}),"Generate Your Photo",i.jsx(Lt,{className:"w-5 h-5 ml-2 group-hover:translate-x-1 transition-transform"})]})}),s.referencePhotos&&s.referencePhotos.length>0&&i.jsxs(se.div,{className:"pt-12",initial:{opacity:0}
683,animate:{opacity:1},transition:{delay:.5},children:[i.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-4 uppercase tracking-widest",children:"Powered by Premium AI"}),i.jsx("div",{className:"flex flex-wrap justify-center gap-3",children:s.referencePhotos.slice(0,3).map((h,f)=>i.jsx(se.div,{className:"w-24 h-24 sm:w-32 sm:h-32 rounded-2xl overflow-hidden border-2 border-border shadow-lg",initial:{opacity:0,scale:.8,rotate:-5+f*5},animate:{opacity:1,scale:1,rotate:-3+f*3},transition:{delay:.6+f*.1},whileHover:{scale:1.05,rotate:0},children:i.jsx("img",{src:h,alt:`${s.name} reference`,className:"w-full h-full object-cover",loading:"lazy"})},f))})]})]}),i.jsx(se.div,{className:"grid sm:grid-cols-3 gap-4 pt-16 max-w-4xl mx-auto",initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{delay:.7},children:[{icon:gt,title:"Studio Quality",desc:"Professional lighting and ultra-high resolution output."},{icon:wo,title:"Hyper-Realistic",desc:"Perfect blending with matching skin tones and shadows."},{icon:nc,title:"Instant Delivery",desc:"Get your photos in seconds, ready to share."}].map((h,f)=>i.jsxs(se.div,{className:"p-5 rounded-2xl bg-card border border-border/50 space-y-3",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.8+f*.1},children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center",children:i.jsx(h.icon,{className:"w-5 h-5 text-primary"})}),i.jsx("h3",{className:"font-semibold text-foreground",children:h.title}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:h.desc})]},h.title))})]}),i.jsx("footer",{className:"border-t border-border/50 py-6",children:i.jsxs("div",{className:"container mx-auto px-4 text-center text-sm text-muted-foreground",children:["© ",new Date().getFullYear()," MyReelGen. All rights reserved."]})})]})]})}const g7=()=>{const[e,t]=p.useState(null),[r,n]=p.useState(!1);p.useEffect(()=>{window.matchMedia("(display-mode: standalone)").matches&&n(!0);const a=o=>{o.preventDefault(),t(o)};return window.addEventListener("beforeinstallprompt",a),window.addEventListener("appinstalled",()=>{n(!0),t(null)}),()=>{window.removeEventListener("beforeinstallprompt",a)}},[]);const s=async()=>{if(e){e.prompt();const{outcome:a}=await e.userChoice;a==="accepted"&&t(null)}else alert(`To install the app on your device: 684 685iOS: Tap the Share button and select 'Add to Home Screen'. 686Android: Tap the menu button and select 'Install app'.`)};return i.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4 bg-background",children:[i.jsx(ev,{children:i.jsx("title",{children:"Install App | MyReelGen"})}),i.jsxs(ae,{className:"max-w-md w-full border-border/50 bg-background/50 backdrop-blur-sm",children:[i.jsxs(ot,{className:"text-center",children:[i.jsx("div",{className:"mx-auto bg-primary/10 p-4 rounded-full w-20 h-20 flex items-center justify-center mb-4",children:i.jsx(_4,{className:"w-10 h-10 text-primary"})}),i.jsx(lt,{className:"text-2xl",children:"Install MyReelGen"}),i.jsx($r,{children:r?"The app is already installed on your device. You can launch it from your home screen.":"Install our app on your device for a faster, full-screen experience and easy access from your home screen."})]}),i.jsx(be,{className:"flex justify-center",children:i.jsxs(B,{onClick:s,className:"w-full sm:w-auto",size:"lg",disabled:r,children:[i.jsx(_n,{className:"mr-2 h-5 w-5"}),r?"Already Installed":"Install App"]})})]})]})},x7=()=>{const e=dn();return p.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:i.jsxs("div",{className:"text-center",children:[i.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),i.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),i.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})};function v7(){return i.jsxs("div",{className:"p-8",children:[i.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Admin Dashboard"}),i.jsx("p",{className:"text-muted-foreground mt-2",children:"Welcome to the new admin panel."})]})}const u1=[{label:"Features",href:"/features"},{label:"Pricing",href:"/pricing"},{label:"Blog",href:"/blog"},{label:"About",href:"/about"},{label:"Contact",href:"/contact"}],y7=[{title:"Product",links:[{label:"Features",href:"/features"},{label:"Pricing",href:"/pricing"},{label:"API Docs",href:"/api-docs"},{label:"Changelog",href:"/changelog"}]},{title:"Company",links:[{label:"About Us",href:"/about"},{label:"Blog",href:"/blog"},{label:"Contact",href:"/contact"},{label:"Customers",href:"/customers"}]},{title:"Use Cases",links:[{label:"E-commerce",href:"/use-cases/ecommerce"},{label:"Marketing",href:"/use-cases/marketing"},{label:"Real Estate",href:"/use-cases/real-estate"},{label:"All Use Cases",href:"/use-cases"}]},{title:"Compare",links:[{label:"vs RunwayML",href:"/compare/runwayml"},{label:"vs Pika",href:"/compare/pika"},{label:"vs Synthesia",href:"/compare/synthesia"},{label:"All Comparisons",href:"/compare"}]},{title:"Legal",links:[{label:"Privacy Policy",href:"/privacy"},{label:"Terms of Service",href:"/terms"},{label:"Cookie Policy",href:"/cookies"},{label:"Acceptable Use",href:"/acceptable-use"}]},{title:"Trust",links:[{label:"Security",href:"/security"},{label:"Status",href:"/status"},{label:"GDPR",href:"/gdpr"}]}];function rt({children:e}){const t=Ce(),[r,n]=p.useState(!1);return i.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[i.jsxs("header",{className:"fixed top-0 inset-x-0 z-50 bg-background/70 backdrop-blur-xl border-b border-border/30",children:[i.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between px-4 sm:px-6 h-16",children:[i.jsxs("div",{className:"flex items-center gap-6",children:[i.jsxs(ye,{to:"/",className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-primary/10 flex items-center justify-center",children:i.jsx("img",{src:gc,alt:"MyReelGen",className:"w-5 h-5 object-contain"})}),i.jsx("span",{className:"text-lg font-bold tracking-tight",children:"MyReelGen"})]}),i.jsx("nav",{className:"hidden md:flex items-center gap-1",children:u1.map(s=>i.jsx(ye,{to:s.href,className:"px-3 py-2 text-sm text-muted-foreground hover:text-foreground transition-colors rounded-lg hover:bg-muted/50",children:s.label},s.href))})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Mv,{}),i.jsx(B,{variant:"ghost",size:"sm",onClick:()=>t("/auth"),className:"hidden sm:inline-flex",children:"Sign In"}),i.jsxs(B,{size:"sm",onClick:()=>t("/auth"),className:"hidden sm:inline-flex rounded-full px-5",children:["Get Started ",i.jsx(Lt,{className:"w-3.5 h-3.5 ml-1"})]}),i.jsx("button",{onClick:()=>n(!r),className:"md:hidden p-2 rounded-lg hover:bg-muted/50 transition-colors","aria-label":"Toggle menu",children:r?i.jsx(on,{className:"w-5 h-5"}):i.jsx(x4,{className:"w-5 h-5"})})]})]}),r&&i.jsx("div",{className:"md:hidden border-t border-border/30 bg-background/95 backdrop-blur-xl",children:i.jsxs("nav",{className:"max-w-6xl mx-auto px-4 py-4 space-y-1",children:[u1.map(s=>i.jsx(ye,{to:s.href,onClick:()=>n(!1),className:"block px-3 py-3 text-sm text-muted-foreground hover:text-foreground rounded-lg hover:bg-muted/50 transition-colors",children:s.label},s.href)),i.jsxs("div",{className:"pt-3 flex flex-col gap-2",children:[i.jsx(B,{variant:"outline",onClick:()=>{t("/auth"),n(!1)},className:"w-full",children:"Sign In"}),i.jsxs(B,{onClick:()=>{t("/auth"),n(!1)},className:"w-full rounded-full",children:["Get Started ",i.jsx(Lt,{className:"w-3.5 h-3.5 ml-1"})]})]})]})})]}),i.jsx("main",{className:"pt-16",children:e}),i.jsx("footer",{className:"border-t border-border/20 bg-card/30",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 py-12 sm:py-16",children:[i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-7 gap-8",children:[i.jsxs("div",{className:"col-span-2",children:[i.jsxs(ye,{to:"/",className:"flex items-center gap-2 mb-4",children:[i.jsx("img",{src:gc,alt:"MyReelGen",className:"w-5 h-5 object-contain"}),i.jsx("span",{className:"font-bold text-foreground",children:"MyReelGen"})]}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed max-w-xs",children:"Create stunning AI videos, images, and avatars with the world's best models."})]}),y7.map(s=>i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:s.title}),i.jsx("ul",{className:"space-y-2",children:s.links.map(a=>i.jsx("li",{children:i.jsx(ye,{to:a.href,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:a.label})},a.href))})]},s.title))]}),i.jsxs("div",{className:"mt-10 pt-6 border-t border-border/20 flex flex-col sm:flex-row items-center justify-between gap-4 text-sm text-muted-foreground",children:[i.jsxs("p",{children:["© ",new Date().getFullYear()," MyReelGen. All rights reserved."]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(ye,{to:"/privacy",className:"hover:text-foreground transition-colors",children:"Privacy"}),i.jsx(ye,{to:"/terms",className:"hover:text-foreground transition-colors",children:"Terms"}),i.jsx(ye,{to:"/cookies",className:"hover:text-foreground transition-colors",children:"Cookies"})]})]})]})})]})}function nt({title:e,description:t,canonical:r,ogImage:n="https://myreelgenai.lovable.app/favicon.png",ogType:s="website",structuredData:a,noindex:o=!1}){const l=e.includes("MyReelGen")?e:`${e} | MyReelGen`,u=r?`https://myreelgenai.lovable.app${r}`:void 0;return i.jsxs(ev,{children:[i.jsx("title",{children:l}),i.jsx("meta",{name:"description",content:t}),o&&i.jsx("meta",{name:"robots",content:"noindex,nofollow"}),u&&i.jsx("link",{rel:"canonical",href:u}),i.jsx("meta",{property:"og:title",content:l}),i.jsx("meta",{property:"og:description",content:t}),i.jsx("meta",{property:"og:type",content:s}),i.jsx("meta",{property:"og:image",content:n}),u&&i.jsx("meta",{property:"og:url",content:u}),i.jsx("meta",{property:"og:site_name",content:"MyReelGen"}),i.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),i.jsx("meta",{name:"twitter:title",content:l}),i.jsx("meta",{name:"twitter:description",content:t}),i.jsx("meta",{name:"twitter:image",content:n}),a&&i.jsx("script",{type:"application/ld+json",children:JSON.stringify(a)})]})}const zA=[{name:"Starter",description:"Perfect for trying out AI generation",price:{monthly:0,annual:0},credits:"5 daily credits",icon:vr,features:["5 free credits daily","Access to standard models","720p video resolution","Community support","Basic image generation"],cta:"Get Started Free",popular:!1},{name:"Creator",description:"For content creators and freelancers",price:{monthly:29,annual:24},credits:"500 credits/month",icon:wo,features:["500 credits per month","All AI models including Sora 2","1080p video resolution","Priority queue","API access","Email support","Image & video generation"],cta:"Start Creating",popular:!0},{name:"Business",description:"For teams and agencies",price:{monthly:99,annual:79},credits:"2,000 credits/month",icon:Fd,features:["2,000 credits per month","All premium models","4K video resolution","Dedicated queue","Full API access","Priority support","Team management","Custom webhooks","White-label options"],cta:"Contact Sales",popular:!1}],b7=[{q:"What are credits?",a:"Credits are the currency used to generate content. Different models and resolutions cost different amounts of credits. Video generation typically costs 4-8 credits, while image generation costs 2-4 credits."},{q:"Can I upgrade or downgrade my plan?",a:"Yes! You can change your plan at any time. When upgrading, you'll get immediate access to the new features. When downgrading, the change takes effect at the end of your billing cycle."},{q:"Do unused credits roll over?",a:"Monthly credits expire at the end of each billing period. Daily free credits refresh every 24 hours."},{q:"What payment methods do you accept?",a:"We accept credit cards, debit cards, and local payment methods including Easypaisa and bank transfers for PKR payments."},{q:"Is there a free trial?",a:"Yes! Every account gets 5 free credits daily, so you can try all our AI models without any commitment."},{q:"Can I get a refund?",a:"We offer refunds within 7 days of purchase if you haven't used more than 10% of your credits. Contact support for assistance."}],w7={"@context":"https://schema.org","@type":"Product",name:"MyReelGen AI",description:"AI-powered video, image, and avatar generation platform",offers:zA.map(e=>({"@type":"Offer",name:e.name,price:e.price.monthly,priceCurrency:"USD",description:e.description}))};function j7(){const e=Ce(),[t,r]=p.useState(!1);return i.jsxs(rt,{children:[i.jsx(nt,{title:"Pricing â AI Video & Image Generation Plans",description:"Choose the perfect plan for AI video, image, and avatar generation. Start free with 5 daily credits or upgrade for premium models and higher limits.",canonical:"/pricing",structuredData:w7}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-6xl mx-auto",children:[i.jsxs(se.div,{initial:{opacity:0,y:20}
686,animate:{opacity:1,y:0},className:"text-center mb-14",children:[i.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Simple, transparent pricing"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-xl mx-auto mb-8",children:"Start free, scale as you grow. No hidden fees."}),i.jsxs("div",{className:"inline-flex items-center gap-3 p-1 rounded-full border border-border/50 bg-card/50",children:[i.jsx("button",{onClick:()=>r(!1),className:`px-4 py-2 rounded-full text-sm font-medium transition-all ${t?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"}`,children:"Monthly"}),i.jsxs("button",{onClick:()=>r(!0),className:`px-4 py-2 rounded-full text-sm font-medium transition-all ${t?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:["Annual ",i.jsx(xe,{variant:"secondary",className:"ml-1 text-xs",children:"Save 20%"})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:zA.map((n,s)=>i.jsxs(se.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{delay:s*.1},className:`relative p-8 rounded-2xl border transition-all ${n.popular?"border-primary/50 bg-card shadow-lg scale-[1.02]":"border-border/40 bg-card/50 hover:border-primary/20"}`,children:[n.popular&&i.jsx(xe,{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:"Most Popular"}),i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center",children:i.jsx(n.icon,{className:"w-5 h-5 text-primary"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-lg",children:n.name}),i.jsx("p",{className:"text-xs text-muted-foreground",children:n.description})]})]}),i.jsxs("div",{className:"mb-6",children:[i.jsxs("span",{className:"text-4xl font-bold",children:["$",t?n.price.annual:n.price.monthly]}),i.jsx("span",{className:"text-muted-foreground",children:"/mo"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:n.credits})]}),i.jsx(B,{onClick:()=>e("/auth"),className:"w-full rounded-full mb-6",variant:n.popular?"default":"outline",children:n.cta}),i.jsx("ul",{className:"space-y-3",children:n.features.map(a=>i.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[i.jsx(qs,{className:"w-4 h-4 text-primary mt-0.5 shrink-0"}),i.jsx("span",{children:a})]},a))})]},n.name))})]})}),i.jsx("section",{className:"py-20 px-4 border-t border-border/20",children:i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx("h2",{className:"text-3xl font-bold text-center mb-12",children:"Frequently Asked Questions"}),i.jsx("div",{className:"space-y-4",children:b7.map(n=>i.jsxs("details",{className:"group p-5 rounded-xl border border-border/40 bg-card/50",children:[i.jsxs("summary",{className:"flex items-center justify-between cursor-pointer font-medium",children:[n.q,i.jsx(s4,{className:"w-4 h-4 text-muted-foreground group-open:text-primary transition-colors"})]}),i.jsx("p",{className:"mt-3 text-sm text-muted-foreground leading-relaxed",children:n.a})]},n.q))})]})})]})}const N7=[{icon:$t,title:"AI Video Generation",description:"Generate cinematic videos from text or images using Sora 2, Hailuo, Veo 3.1, Seedance, and more. Support for multiple resolutions up to 4K.",features:["Text-to-vi
686deo","Image-to-video","Multiple durations","4K resolution"]},{icon:gt,title:"AI Image Generation",description:"Create stunning images with Flux, GPT-Image, and other cutting-edge models. Perfect for marketing, social media, and creative projects.",features:["Text-to-image","Image editing","Style transfer","Batch generation"]},{icon:an,title:"AI Avatars",description:"Create lifelike talking avatars from a single photo. Perfect for presentations, customer support, and personalized content.",features:["Photo-to-avatar","Natural expressions","Multiple languages","Custom voices"]},{icon:Lr,title:"AI Agents",description:"Specialized tools for specific tasks: headshot generation, ghost mannequin product photos, movie trailers, and product teasers.",features:["AI Headshots","Ghost Mannequin","Movie Trailers","Product Teasers"]},{icon:Vd,title:"Audio Generation",description:"Generate music, sound effects, and voiceovers with AI. Perfect for video soundtracks and podcast production.",features:["Music generation","Sound effects","Voice synthesis","Audio editing"]},{icon:ic,title:"Sora Watermark Remover",description:"Clean up AI-generated videos by removing watermarks while preserving quality. Works with any video source.",features:["Auto detection","Quality preservation","Batch processing","Multiple formats"]}],S7=[{icon:vr,title:"Lightning Fast",desc:"Optimized inference with smart queuing â results in seconds"},{icon:Ks,title:"Enterprise Security",desc:"SOC 2 compliant, encrypted data, secure API endpoints"},{icon:sc,title:"Developer API",desc:"RESTful API with SDKs, webhooks, and comprehensive documentation"},{icon:E_,title:"Multi-Currency",desc:"Pay in USD, PKR, INR, or AED with local payment methods"},{icon:r4,title:"Usage Analytics",desc:"Track spending, monitor usage, and optimize your workflow"},{icon:m4,title:"Team Management",desc:"Invite team members, manage roles, and share resources"}],_7={"@context":"https://schema.org","@type":"SoftwareApplication",name:"MyReelGen AI",applicationCategory:"MultimediaApplication",description:"AI-powered video, image, and avatar generation platform with premium models",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"}};function k7(){const e=Ce();return i.jsxs(rt,{children:[i.jsx(nt,{title:"Features â AI Video, Image & Avatar Generation",description:"Explore MyReelGen's AI capabilities: video generation with Sora 2, image creation, talking avatars, specialized AI agents, and developer APIs.",canonical:"/features",structuredData:_7}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[i.jsx(se.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-4xl sm:text-5xl font-bold mb-5",children:"One platform, every AI creative tool"}),i.jsx(se.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"text-lg text-muted-foreground max-w-2xl mx-auto mb-8",children:"Access the world's best AI models for video, image, avatar, and audio generation â all in one place."}),i.jsxs(B,{size:"lg",onClick:()=>e("/auth"),className:"rounded-full px-8",children:["Start Creating Free ",i.jsx(Lt,{className:"w-4 h-4 ml-2"})]})]})}),i.jsx("section",{className:"py-16 px-4",children:i.jsx("div",{className:"max-w-6xl mx-auto space-y-12",children:N7.map((t,r)=>i.jsxs(se.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:r*.05},className:`flex flex-col md:flex-row gap-8 items-center ${r%2===1?"md:flex-row-reverse":""}`,children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center mb-4",children:i.jsx(t.icon,{className:"w-6 h-6 text-primary"})}),i.jsx("h3",{className:"text-2xl font-bold mb-3",children:t.title}),i.jsx("p",{className:"text-muted-foreground mb-4 leading-relaxed",children:t.description}),i.jsx("div",{className:"flex flex-wrap gap-2",children:t.features.map(n=>i.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-medium border border-border/50 bg-card/50",children:n},n))})]}),i.jsx("div",{className:"flex-1 w-full h-48 rounded-2xl bg-gradient-to-br from-primary/5 to-primary/10 border border-border/30 flex items-center justify-center",children:i.jsx(t.icon,{className:"w-16 h-16 text-primary/20"})})]},t.title))})}),i.jsx("section",{className:"py-20 px-4 border-t border-border/20",children:i.jsxs("div",{className:"max-w-6xl mx-auto",children:[i.jsx("h2",{className:"text-3xl font-bold text-center mb-12",children:"Built for professionals"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:S7.map(t=>i.jsxs("div",{className:"p-6 rounded-xl border border-border/40 bg-card/50",children:[i.jsx(t.icon,{className:"w-8 h-8 text-primary mb-3"}),i.jsx("h3",{className:"font-semibold mb-2",children:t.title}),i.jsx("p",{className:"text-sm text-muted-foreground",children:t.desc})]},t.title))})]})}),i.jsx("section",{className:"py-20 px-4",children:i.jsxs("div",{className:"max-w-3xl mx-auto text-center p-12 rounded-3xl border border-border/40 bg-card/50",children:[i.jsx("h2",{className:"text-3xl font-bold mb-4",children:"Ready to start creating?"}),i.jsx("p",{className:"text-muted-foreground mb-8",children:"Get 5 free credits daily â no credit card required."}),i.jsx(B,{size:"lg",onClick:()=>e("/auth"),className:"rounded-full px-10",children:"Get Started Free"})]})})]})}const C7=[{icon:P4,title:"Mission-Driven",desc:"Making premium AI accessible to creators everywhere, regardless of budget or location."},{icon:Ud,title:"Creator-First",desc:"Every feature we build starts with a real creator need. We listen, iterate, and ship fast."},{icon:Bd,title:"Innovation",desc:"We integrate the newest AI models within days of release, so you're always on the cutting edge."},{icon:I4,title:"Global Community",desc:"Creators from 50+ countries use MyReelGen daily. We support multi-currency and local payments."}],E7=[{year:"2024",event:"MyReelGen founded â launched with 3 video models"},{year:"2024",event:"Reached 1,000 creators on the platform"},{year:"2025",event:"Added image generation, avatars, and AI agents"},{year:"2025",event:"Surpassed 2,000+ active creators worldwide"}],P7={"@context":"https://schema.org","@type":"Organization",name:"MyReelGen",description:"AI-powered content creation platform for videos, images, and avatars",url:"https://myreelgenai.lovable.app",logo:"https://myreelgenai.lovable.app/favicon.png"};function T7(){return i.jsxs(rt,{children:[i.jsx(nt,{title:"About Us â Our Mission & Story",description:"Learn about MyReelGen's mission to democratize AI content creation. We make premium AI models accessible to creators worldwide.",canonical:"/about",structuredData:P7}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[i.jsx(se.h1,{initial:{opacity:0,y:20}
686,animate:{opacity:1,y:0},className:"text-4xl sm:text-5xl font-bold mb-5",children:"Democratizing AI for creators"}),i.jsx(se.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"We believe every creator deserves access to the world's most powerful AI tools â without needing enterprise budgets or technical expertise."})]})}),i.jsx("section",{className:"py-16 px-4",children:i.jsxs("div",{className:"max-w-6xl mx-auto",children:[i.jsx("h2",{className:"text-3xl font-bold text-center mb-12",children:"Our values"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:C7.map(e=>i.jsxs("div",{className:"p-6 rounded-2xl border border-border/40 bg-card/50 text-center",children:[i.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center mx-auto mb-4",children:i.jsx(e.icon,{className:"w-6 h-6 text-primary"})}),i.jsx("h3",{className:"font-semibold mb-2",children:e.title}),i.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc})]},e.title))})]})}),i.jsx("section",{className:"py-16 px-4 border-t border-border/20",children:i.jsxs("div",{className:"max-w-2xl mx-auto",children:[i.jsx("h2",{className:"text-3xl font-bold text-center mb-12",children:"Our journey"}),i.jsx("div",{className:"space-y-6",children:E7.map((e,t)=>i.jsxs(se.div,{initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},className:"flex gap-4",children:[i.jsx("div",{className:"shrink-0 w-16 text-sm font-bold text-primary",children:e.year}),i.jsxs("div",{className:"pb-6 border-l border-border/50 pl-6 relative",children:[i.jsx("div",{className:"absolute left-0 top-1.5 w-2 h-2 rounded-full bg-primary -translate-x-1"}),i.jsx("p",{className:"text-muted-foreground",children:e.event})]})]},t))})]})})]})}const A7=[{icon:R_,title:"Email",desc:"[email protected]",sub:"We respond within 24 hours"},{icon:v4,title:"Live Chat",desc:"Available in dashboard",sub:"Instant help for logged-in users"},{icon:xr,title:"Business Hours",desc:"MonâFri, 9 AM â 6 PM PST",sub:"Weekend support via email"}];function R7(){const[e,t]=p.useState(!1),r=n=>{n.preventDefault(),t(!0),setTimeout(()=>{t(!1),Te.success("Message sent! We'll get back to you within 24 hours."),n.target.reset()},1e3)};return i.jsxs(rt,{children:[i.jsx(nt,{title:"Contact Us â Get in Touch",description:"Have questions about MyReelGen? Reach out via email, live chat, or our contact form. We respond within 24 hours.",canonical:"/contact"}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-6xl mx-auto",children:[i.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center mb-14",children:[i.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Get in touch"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-xl mx-auto",children:"We'd love to hear from you. Drop us a line and we'll get back to you promptly."})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-16",children:A7.map(n=>i.jsxs("div",{className:"p-6 rounded-2xl border border-border/40 bg-card/50 text-center",children:[i.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center mx-auto mb-4",children:i.jsx(n.icon,{className:"w-5 h-5 text-primary"})}),i.jsx("h3",{className:"font-semibold mb-1",children:n.title}),i.jsx("p",{className:"text-sm font-medium",children:n.desc}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n.sub})]},n.title))}),i.jsx("div",{className:"max-w-xl mx-auto",children:i.jsxs("form",{onSubmit:r,className:"space-y-5 p-8 rounded-2xl border border-border/40 bg-card/50",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"name",children:"Name"}),i.jsx(tt,{id:"name",name:"name",required:!0,placeholder:"Your name",className:"mt-1.5"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"email",children:"Email"}),i.jsx(tt,{id:"email",name:"email",type:"email",required:!0,placeholder:"[email protected]",className:"mt-1.5"})]})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"subject",children:"Subject"}),i.jsx(tt,{id:"subject",name:"subject",required:!0,placeholder:"How can we help?",className:"mt-1.5"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"message",children:"Message"}),i.jsx(In,{id:"message",name:"message",required:!0,rows:5,placeholder:"Tell us more...",className:"mt-1.5"})]}
686),i.jsx(B,{type:"submit",className:"w-full rounded-full",disabled:e,children:e?"Sending...":"Send Message"})]})})]})})]})}const I7=[{slug:"sora-2-vs-veo-3",title:"Sora 2 vs Veo 3.1: Which AI Video Model Should You Use?",excerpt:"A detailed comparison of OpenAI's Sora 2 and Google's Veo 3.1 for video generation â quality, speed, pricing, and use cases.",date:"2026-03-05",readTime:"8 min read",category:"Comparison"},{slug:"ai-video-marketing-guide",title:"The Complete Guide to AI Video for Marketing in 2026",excerpt:"Learn how brands are using AI-generated video for social media, ads, and product launches â with real examples and best practices.",date:"2026-02-28",readTime:"12 min read",category:"Guide"},{slug:"ai-headshots-for-linkedin",title:"How to Generate Professional AI Headshots for LinkedIn",excerpt:"Step-by-step guide to creating polished, professional headshots using our AI Headshot Generator â no studio required.",date:"2026-02-20",readTime:"5 min read",category:"Tutorial"},{slug:"ghost-mannequin-ecommerce",title:"AI Ghost Mannequin: Revolutionizing E-commerce Product Photography",excerpt:"How our AI Ghost Mannequin tool helps e-commerce brands create clean, professional product photos without physical mannequins.",date:"2026-02-15",readTime:"6 min read",category:"Use Case"},{slug:"multi-currency-ai-pricing",title:"Making AI Accessible: Multi-Currency Pricing for Global Creators",excerpt:"Why we support PKR, INR, AED, and USD â and how local pricing helps creators in emerging markets access premium AI tools.",date:"2026-02-10",readTime:"4 min read",category:"Company"},{slug:"api-integration-guide",title:"Integrating MyReelGen API into Your App: Developer Guide",excerpt:"Complete walkthrough of our REST API â authentication, endpoints, webhooks, and code examples in Python, Node.js, and curl.",date:"2026-02-05",readTime:"10 min read",category:"Developer"}];function O7(){return i.jsxs(rt,{children:[i.jsx(nt,{title:"Blog â AI Video & Image Generation Insights",description:"Guides, tutorials, and insights on AI video generation, image creation, and content automation. Learn from the MyReelGen team.",canonical:"/blog"}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center mb-14",children:[i.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Blog"}),i.jsx("p",{className:"text-lg text-muted-foreground",children:"Insights, tutorials, and updates from the MyReelGen team"})]}),i.jsx("div",{className:"space-y-6",children:I7.map((e,t)=>i.jsx(se.article,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:t*.05},children:i.jsxs(ye,{to:`/blog/${e.slug}`,className:"group block p-6 rounded-2xl border border-border/40 bg-card/50 hover:border-primary/20 hover:shadow-lg transition-all",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx(xe,{variant:"secondary",className:"text-xs",children:e.category}),i.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[i.jsx(Mh,{className:"w-3 h-3"}),new Date(e.date).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]}),i.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[i.jsx(xr,{className:"w-3 h-3"}),e.readTime]})]}),i.jsx("h2",{className:"text-xl font-bold mb-2 group-hover:text-primary transition-colors",children:e.title}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-3",children:e.excerpt}),i.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-primary font-medium",children:["Read more ",i.jsx(Lt,{className:"w-3.5 h-3.5"})]})]})},e.slug))})]})})]})}const M7=[{date:"2026-03-09",version:"2.5",changes:[{type:"new",text:"AI Ghost Mannequin agent for product photography"},{type:"new",text:"AI Movie Trailer generator"},{type:"new",text:"AI Product Launch Teaser"},{type:"improved",text:"Offline fallback pages for PWA"}]},{date:"2026-03-01",version:"2.4",changes:[{type:"new",text:"AI Headshot Generator for LinkedIn & passport photos"},{type:"new",text:"Sora Watermark Remover agent"},{type:"improved",text:"Dashboard chat with streaming responses"},{type:"fix",text:"Video generation status polling reliability"}]}
686,{date:"2026-02-15",version:"2.3",changes:[{type:"new",text:"Audio generation models (music & SFX)"},{type:"new",text:"Image favorites and gallery"},{type:"improved",text:"Credit system with multi-currency support"},{type:"fix",text:"Mobile bottom navigation layout"}]},{date:"2026-02-01",version:"2.2",changes:[{type:"new",text:"Avatar generation from photos"},{type:"new",text:"API documentation and key management"},{type:"improved",text:"Model playground with dynamic forms"}]},{date:"2026-01-15",version:"2.1",changes:[{type:"new",text:"Image generation with multiple AI models"},{type:"new",text:"WhatsApp notifications for generation completion"},{type:"improved",text:"Dark mode refinements"}]}],d1={new:{label:"New",variant:"default"},improved:{label:"Improved",variant:"secondary"},fix:{label:"Fix",variant:"outline"}};function D7(){return i.jsxs(rt,{children:[i.jsx(nt,{title:"Changelog â What's New",description:"Stay up to date with MyReelGen's latest features, improvements, and fixes. See what's new in AI video and image generation.",canonical:"/changelog"}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center mb-14",children:[i.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Changelog"}),i.jsx("p",{className:"text-lg text-muted-foreground",children:"What's new and improved"})]}),i.jsx("div",{className:"space-y-10",children:M7.map((e,t)=>i.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:t*.05},className:"relative pl-8 border-l-2 border-border/40",children:[i.jsx("div",{className:"absolute left-0 top-0 w-4 h-4 rounded-full bg-primary -translate-x-[9px]"}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsxs(xe,{variant:"outline",children:["v",e.version]}),i.jsx("span",{className:"text-sm text-muted-foreground",children:new Date(e.date).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})})]}),i.jsx("ul",{className:"space-y-2",children:e.changes.map((r,n)=>i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx(xe,{variant:d1[r.type].variant,className:"text-xs shrink-0 mt-0.5",children:d1[r.type].label}),i.jsx("span",{className:"text-sm",children:r.text})]},n))})]},e.version))})]})})]})}const L7=[{name:"Sarah Chen",role:"Content Creator",quote:"MyReelGen cut my video production time from days to minutes. The quality of Sora 2 outputs is indistinguishable from professional footage.",rating:5},{name:"Ahmed Hassan",role:"E-commerce Owner",quote:"The Ghost Mannequin tool saved us thousands on product photography. We can now shoot our entire catalog with AI in an afternoon.",rating:5},{name:"Maria Garcia",role:"Marketing Director",quote:"We use MyReelGen's API to generate social media content at scale. The multi-currency pricing makes it affordable for our Pakistan-based team.",rating:5},{name:"James Wilson",role:"Freelance Filmmaker",quote:"The AI Movie Trailer generator is insane. I use it to create pitch trailers for my clients before any actual filming begins.",rating:5},{name:"Priya Sharma",role:"HR Manager",quote:"Our entire team uses the AI Headshot Generator for professional LinkedIn photos. It's faster and cheaper than booking a photographer.",rating:4},{name:"David Kim",role:"App Developer",quote:"The API is well-documented and reliable. We integrated AI video generation into our app in under a day. Webhooks work flawlessly.",rating:5}],$7=[{value:"2,000+",label:"Active Creators"},{value:"50+",label:"Countries"},{value:"500K+",label:"Videos Generated"},{value:"99.9%",label:"Uptime"}];function F7(){const e=Ce();return i.jsxs(rt,{children:[i.jsx(nt,{title:"Customers â Trusted by 2,000+ Creators",description:"See how creators, marketers, and developers use MyReelGen to produce AI-generated videos, images, and avatars at scale.",canonical:"/customers"}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-6xl mx-auto",children:[i.jsxs(se.div,{initial:{opacity:0,y:20}
686,animate:{opacity:1,y:0},className:"text-center mb-14",children:[i.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Loved by creators worldwide"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-xl mx-auto",children:"From solo creators to enterprise teams, hear what our customers say."})]}),i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6 mb-16",children:$7.map(t=>i.jsxs("div",{className:"text-center p-6 rounded-2xl border border-border/40 bg-card/50",children:[i.jsx("div",{className:"text-3xl font-bold text-primary mb-1",children:t.value}),i.jsx("div",{className:"text-sm text-muted-foreground",children:t.label})]},t.label))}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:L7.map((t,r)=>i.jsxs(se.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:r*.05},className:"p-6 rounded-2xl border border-border/40 bg-card/50",children:[i.jsx(N4,{className:"w-8 h-8 text-primary/20 mb-3"}),i.jsxs("p",{className:"text-sm leading-relaxed mb-4",children:['"',t.quote,'"']}),i.jsx("div",{className:"flex items-center gap-1 mb-2",children:Array.from({length:t.rating}).map((n,s)=>i.jsx(wo,{className:"w-3.5 h-3.5 fill-primary text-primary"},s))}),i.jsx("div",{className:"font-semibold text-sm",children:t.name}),i.jsx("div",{className:"text-xs text-muted-foreground",children:t.role})]},t.name))}),i.jsx("div",{className:"text-center mt-16",children:i.jsxs(B,{size:"lg",onClick:()=>e("/auth"),className:"rounded-full px-10",children:["Join 2,000+ Creators ",i.jsx(Lt,{className:"w-4 h-4 ml-2"})]})})]})})]})}const U7=[{icon:A_,title:"Encryption",desc:"All data encrypted in transit (TLS 1.3) and at rest (AES-256). API keys are hashed and never stored in plain text."},{icon:Ks,title:"Authentication",desc:"Secure authentication with email verification, rate limiting, and trusted device management."},{icon:l4,title:"Access Control",desc:"Row-level security policies ensure users can only access their own data. Admin actions are fully audited."},{icon:S4,title:"Infrastructure",desc:"Hosted on enterprise-grade cloud infrastructure with automatic failover, DDoS protection, and 99.9% uptime SLA."},{icon:c4,title:"Compliance",desc:"GDPR compliant with data processing agreements available. Regular security audits and penetration testing."},{icon:M_,title:"Incident Response",desc:"24/7 monitoring with automated anomaly detection. Security incidents are investigated and disclosed within 72 hours."}];function V7(){return i.jsxs(rt,{children:[i.jsx(nt,{title:"Security â How We Protect Your Data",description:"Learn about MyReelGen's security practices: encryption, access control, compliance, and infrastructure security.",canonical:"/security"}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center mb-14",children:[i.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center mx-auto mb-6",children:i.jsx(Ks,{className:"w-8 h-8 text-primary"})}),i.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Security at MyReelGen"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"We take the security of your data and generated content seriously. Here's how we protect you."})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:U7.map((e,t)=>i.jsxs(se.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:t*.05},className:"p-6 rounded-2xl border border-border/40 bg-card/50",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center mb-4",children:i.jsx(e.icon,{className:"w-5 h-5 text-primary"})}),i.jsx("h3",{className:"font-semibold text-lg mb-2",children:e.title}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e.desc})]},e.title))}),i.jsxs("div",{className:"mt-16 p-8 rounded-2xl border border-border/40 bg-card/50 text-center",children:[i.jsx("h2",{className:"text-xl font-bold mb-3",children:"Report a Vulnerability"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Found a security issue? We appreciate responsible disclosure. Contact our security team."}),i.jsx("p",{className:"text-sm font-medium text-primary",children:"[email protected]"})]})]})})]})}const h1=[{name:"Web Application",status:"operational"},{name:"Video Generation API",status:"operational"},{name:"Image Generation API",status:"operational"},{name:"Avatar Generation",status:"operational"},{name:"Audio Generation",status:"operational"},{name:"Authentication",status:"operational"},{name:"Payment Processing",status:"operational"},{name:"Webhooks",status:"operational"}],B7={operational:{icon:Uc,label:"Operational",color:"text-green-500"},degraded:{icon:$d,label:"Degraded",color:"text-yellow-500"},outage:{icon:$d,label:"Outage",color:"text-destructive"},maintenance:{icon:xr,label:"Maintenance",color:"text-blue-500"}};function z7(){const e=h1.every(t=>t.status==="operational");return i.jsxs(rt,{children:[i.jsx(nt,{title:"Status â System Uptime & Health",description:"Check the current status of MyReelGen services including API, video generation, image generation, and payment systems.",canonical:"/status",noindex:!0}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsxs(se.div,{initial:{opacity:0,y:20}
686,animate:{opacity:1,y:0},className:"text-center mb-10",children:[i.jsx("h1",{className:"text-4xl font-bold mb-4",children:"System Status"}),e?i.jsxs(xe,{className:"bg-green-500/10 text-green-500 border-green-500/20 text-base px-4 py-2",children:[i.jsx(Uc,{className:"w-4 h-4 mr-2"})," All Systems Operational"]}):i.jsxs(xe,{variant:"destructive",className:"text-base px-4 py-2",children:[i.jsx($d,{className:"w-4 h-4 mr-2"})," Issues Detected"]})]}),i.jsx("div",{className:"space-y-2",children:h1.map(t=>{const r=B7[t.status],n=r.icon;return i.jsxs("div",{className:"flex items-center justify-between p-4 rounded-xl border border-border/40 bg-card/50",children:[i.jsx("span",{className:"font-medium text-sm",children:t.name}),i.jsxs("span",{className:`flex items-center gap-1.5 text-sm ${r.color}`,children:[i.jsx(n,{className:"w-4 h-4"}),r.label]})]},t.name)})}),i.jsxs("div",{className:"mt-10 text-center text-sm text-muted-foreground",children:[i.jsxs("p",{children:["Last checked: ",new Date().toLocaleString()]}),i.jsxs("p",{className:"mt-1",children:["For urgent issues, email ",i.jsx("strong",{children:"[email protected]"})]})]})]})})]})}function G7(){return i.jsxs(rt,{children:[i.jsx(nt,{title:"Privacy Policy",description:"Learn how MyReelGen collects, uses, and protects your personal data. We are committed to safeguarding your privacy.",canonical:"/privacy"}),i.jsxs("article",{className:"py-20 px-4 max-w-3xl mx-auto prose prose-neutral dark:prose-invert",children:[i.jsx("h1",{children:"Privacy Policy"}),i.jsx("p",{className:"text-muted-foreground",children:"Last updated: March 9, 2026"}),i.jsx("h2",{children:"1. Information We Collect"}),i.jsx("p",{children:"We collect information you provide directly: account details (name, email), payment information, and content you generate using our platform. We also collect usage data including IP addresses, browser type, device information, and interaction patterns."}),i.jsx("h2",{children:"2. How We Use Your Information"}),i.jsxs("ul",{children:[i.jsx("li",{children:"Provide, maintain, and improve our AI generation services"}),i.jsx("li",{children:"Process payments and manage your account"}),i.jsx("li",{children:"Send transactional communications and support responses"}),i.jsx("li",{children:"Analyze usage patterns to improve our platform"}),i.jsx("li",{children:"Detect and prevent fraud, abuse, and security incidents"})]}),i.jsx("h2",{children:"3. Data Sharing"}),i.jsx("p",{children:"We do not sell your personal data. We share data only with: payment processors (to handle transactions), AI model providers (to generate content), and cloud infrastructure providers (to host our services). All third parties are bound by data processing agreements."}),i.jsx("h2",{children:"4. Data Retention"}),i.jsx("p",{children:"Account data is retained while your account is active. Generated content is stored for 90 days by default. You may delete your account and associated data at any time through your profile settings."}),i.jsx("h2",{children:"5. Your Rights"}),i.jsx("p",{children:"You have the right to access, correct, delete, or export your personal data. You may also object to processing or request data portability. Contact us at [email protected] to exercise these rights."}),i.jsx("h2",{children:"6. Security"}),i.jsx("p",{children:"We implement industry-standard security measures including encryption in transit (TLS 1.3), encryption at rest, and regular security audits. Access to personal data is restricted to authorized personnel only."}),i.jsx("h2",{children:"7. Cookies"}),i.jsxs("p",{children:["We use essential cookies for authentication and functionality. See our ",i.jsx("a",{href:"/cookies",children:"Cookie Policy"})," for details."]}),i.jsx("h2",{children:"8. International Transfers"}),i.jsx("p",{children:"Your data may be processed in countries other than your own. We ensure adequate safeguards are in place for all international data transfers, including Standard Contractual Clauses where applicable."}),i.jsx("h2",{children:"9. Children's Privacy"}),i.jsx("p",{children:"Our services are not directed to individuals under 16. We do not knowingly collect personal information from children."}),i.jsx("h2",{children:"10. Changes to This Policy"}),i.jsx("p",{children:"We may update this policy from time to time. We will notify you of material changes via email or in-app notification."}),i.jsx("h2",{children:"Contact"}),i.jsxs("p",{children:["For privacy inquiries, email us at ",i.jsx("strong",{children:"[email protected]"})," or visit our ",i.jsx("a",{href:"/contact",children:"Contact page"}),"."]})]})]})}function W7(){return i.jsxs(rt,{children:[i.jsx(nt,{title:"Terms of Service",description:"Read MyReelGen's Terms of Service. By using our AI generation platform, you agree to these terms.",canonical:"/terms"}),i.jsxs("article",{className:"py-20 px-4 max-w-3xl mx-auto prose prose-neutral dark:prose-invert",children:[i.jsx("h1",{children:"Terms of Service"}),i.jsx("p",{className:"text-muted-foreground",children:"Last updated: March 9, 2026"}),i.jsx("h2",{children:"1. Acceptance of Terms"}),i.jsx("p",{children:'By accessing or using MyReelGen ("the Service"), you agree to be bound by these Terms of Service. If you do not agree, do not use the Service.'}),i.jsx("h2",{children:"2. Account Registration"}),i.jsx("p",{children:"You must provide accurate, complete information when creating an account. You are responsible for maintaining the confidentiality of your credentials and for all activity under your account."}),i.jsx("h2",{children:"3. Use of Service"}),i.jsxs("p",{children:["You may use the Service to generate AI content (videos, images, avatars, audio) for personal or commercial purposes, subject to our ",i.jsx("a",{href:"/acceptable-use",children:"Acceptable Use Policy"}),". You retain ownership of content you create using the Service."]}),i.jsx("h2",{children:"4. Credits and Payments"}),i.jsxs("ul",{children:[i.jsx("li",{children:"Credits are purchased or earned and used to generate content"}),i.jsx("li",{children:"Prices are listed in your selected currency and include applicable taxes"}),i.jsx("li",{children:"Unused monthly credits expire at the end of each billing period"}),i.jsx("li",{children:"Refunds are available within 7 days if less than 10% of credits are used"})]}),i.jsx("h2",{children:"5. Content Guidelines"}),i.jsx("p",{children:"You may not use the Service to generate content that is illegal, harmful, deceptive, or violates the rights of others. We reserve the right to remove content and suspend accounts that violate these guidelines."}),i.jsx("h2",{children:"6. Intellectual Property"}),i.jsx("p",{children:"You own the content you generate. MyReelGen retains rights to the platform, models, and technology. You grant us a limited license to process your inputs solely for the purpose of generating your requested content."}),i.jsx("h2",{children:"7. API Usage"}),i.jsx("p",{children:"API access is subject to rate limits based on your plan. You must not share API keys or use them to build competing services. We may throttle or suspend API access for abuse."}),i.jsx("h2",{children:"8. Service Availability"}),i.jsx("p",{children:"We strive for high availability but do not guarantee uninterrupted service. We are not liable for downtime, generation failures, or losses arising from service interruptions."}),i.jsx("h2",{children:"9. Limitation of Liability"}),i.jsx("p",{children:"To the maximum extent permitted by law, MyReelGen's liability is limited to the amount you paid in the 12 months preceding the claim. We are not liable for indirect, incidental, or consequential damages."}),i.jsx("h2",{children:"10. Termination"}),i.jsx("p",{children:"Either party may terminate at any time. Upon termination, your access to the Service ceases, and generated content may be deleted after 30 days."}),i.jsx("h2",{children:"11. Governing Law"}),i.jsx("p",{children:"These terms are governed by the laws of the State of Delaware, USA, without regard to conflicts of law principles."}),i.jsx("h2",{children:"12. Changes"}),i.jsx("p",{children:"We may modify these terms at any time. Continued use after changes constitutes acceptance. Material changes will be communicated via email."}),i.jsx("h2",{children:"Contact"}),i.jsxs("p",{children:["Questions? Email ",i.jsx("strong",{children:"[email protected]"})," or visit our ",i.jsx("a",{href:"/contact",children:"Contact page"}),"."]})]})]})}function q7(){return i.jsxs(rt,{children:[i.jsx(nt,{title:"Cookie Policy",description:"Understand how MyReelGen uses cookies and similar technologies on our platform.",canonical:"/cookies"}),i.jsxs("article",{className:"py-20 px-4 max-w-3xl mx-auto prose prose-neutral dark:prose-invert",children:[i.jsx("h1",{children:"Cookie Policy"}),i.jsx("p",{className:"text-muted-foreground",children:"Last updated: March 9, 2026"}),i.jsx("h2",{children:"What Are Cookies?"}),i.jsx("p",{children:"Cookies are small text files stored on your device when you visit a website. They help us provide a better experience by remembering your preferences and understanding how you use our platform."}),i.jsx("h2",{children:"Cookies We Use"}),i.jsx("h3",{children:"Essential Cookies"}),i.jsx("p",{children:"Required for the platform to function. These handle authentication, session management, and security. Cannot be disabled."}),i.jsx("h3",{children:"Functional Cookies"}),i.jsx("p",{children:"Remember your preferences such as theme (light/dark mode), language, and display settings."}
686),i.jsx("h3",{children:"Analytics Cookies"}),i.jsx("p",{children:"Help us understand usage patterns to improve the platform. Data is aggregated and anonymized."}),i.jsx("h2",{children:"Managing Cookies"}),i.jsx("p",{children:"You can control cookies through your browser settings. Disabling essential cookies may prevent the platform from functioning correctly."}),i.jsx("h2",{children:"Third-Party Cookies"}),i.jsx("p",{children:"We use minimal third-party services. Payment processors may set their own cookies during checkout. These are governed by their respective privacy policies."}),i.jsx("h2",{children:"Updates"}),i.jsx("p",{children:"We may update this policy as our use of cookies evolves. Check this page periodically for changes."}),i.jsx("h2",{children:"Contact"}),i.jsxs("p",{children:["Questions about cookies? Email ",i.jsx("strong",{children:"[email protected]"}),"."]})]})]})}function H7(){return i.jsxs(rt,{children:[i.jsx(nt,{title:"Acceptable Use Policy",description:"Understand the acceptable use guidelines for MyReelGen's AI generation platform.",canonical:"/acceptable-use"}),i.jsxs("article",{className:"py-20 px-4 max-w-3xl mx-auto prose prose-neutral dark:prose-invert",children:[i.jsx("h1",{children:"Acceptable Use Policy"}),i.jsx("p",{className:"text-muted-foreground",children:"Last updated: March 9, 2026"}),i.jsx("h2",{children:"Purpose"}),i.jsx("p",{children:"This policy defines acceptable and prohibited uses of the MyReelGen platform. Violation may result in account suspension or termination."}),i.jsx("h2",{children:"Prohibited Uses"}),i.jsxs("p",{children:["You may ",i.jsx("strong",{children:"not"})," use MyReelGen to:"]}),i.jsxs("ul",{children:[i.jsx("li",{children:"Generate illegal content or content that violates any applicable law"}),i.jsx("li",{children:"Create deepfakes, non-consensual intimate imagery, or impersonation content"}),i.jsx("li",{children:"Produce content promoting violence, terrorism, or hate speech"}),i.jsx("li",{children:"Generate content involving the exploitation of minors"}),i.jsx("li",{children:"Create spam, phishing, or fraudulent materials"}),i.jsx("li",{children:"Circumvent usage limits, rate limits, or security measures"}),i.jsx("li",{children:"Resell API access without authorization"}),i.jsx("li",{children:"Reverse engineer or extract AI model weights"})]}),i.jsx("h2",{children:"Responsible AI Use"}),i.jsx("p",{children:"We encourage responsible use of AI-generated content. When sharing AI-generated media, we recommend disclosing that it was created using AI tools."}),i.jsx("h2",{children:"Monitoring & Enforcement"}),i.jsx("p",{children:"We may monitor usage patterns to detect violations. We employ automated systems and manual review for enforcement. Violations are handled on a case-by-case basis and may result in warnings, temporary suspension, or permanent termination."}),i.jsx("h2",{children:"Reporting Violations"}),i.jsxs("p",{children:["If you encounter content or behavior that violates this policy, report it to ",i.jsx("strong",{children:"[email protected]"}),"."]}),i.jsx("h2",{children:"Changes"}),i.jsx("p",{children:"We may update this policy. Material changes will be communicated via email or in-app notification."})]})]})}function K7(){return i.jsxs(rt,{children:[i.jsx(nt,{title:"GDPR & Data Processing",description:"MyReelGen's GDPR compliance information and Data Processing Agreement for EU users.",canonical:"/gdpr"}),i.jsxs("article",{className:"py-20 px-4 max-w-3xl mx-auto prose prose-neutral dark:prose-invert",children:[i.jsx("h1",{children:"GDPR & Data Processing Agreement"}),i.jsx("p",{className:"text-muted-foreground",children:"Last updated: March 9, 2026"}),i.jsx("h2",{children:"Our Commitment to GDPR"}),i.jsx("p",{children:"MyReelGen is committed to complying with the EU General Data Protection Regulation (GDPR). This page outlines how we handle data for users in the European Economic Area (EEA)."}),i.jsx("h2",{children:"Legal Basis for Processing"}),i.jsxs("ul",{children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Contract performance:"})," Processing necessary to provide our AI generation services"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Legitimate interest:"})," Analytics, fraud prevention, platform improvement"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Consent:"})," Marketing communications, optional cookies"]}
686),i.jsxs("li",{children:[i.jsx("strong",{children:"Legal obligation:"})," Tax and financial records retention"]})]}),i.jsx("h2",{children:"Your Rights Under GDPR"}),i.jsxs("ul",{children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Right of access:"})," Request a copy of your personal data"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Right to rectification:"})," Correct inaccurate data"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Right to erasure:"})," Request deletion of your data"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Right to restriction:"})," Limit how we process your data"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Right to data portability:"})," Export your data in a machine-readable format"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Right to object:"})," Object to processing based on legitimate interest"]})]}),i.jsx("h2",{children:"Data Processing Agreement (DPA)"}),i.jsxs("p",{children:["For business customers requiring a formal DPA, please contact us at ",i.jsx("strong",{children:"[email protected]"}),". Our standard DPA includes:"]}),i.jsxs("ul",{children:[i.jsx("li",{children:"Standard Contractual Clauses (SCCs) for international transfers"}),i.jsx("li",{children:"Sub-processor list and notification procedures"}),i.jsx("li",{children:"Data breach notification within 72 hours"}),i.jsx("li",{children:"Data deletion upon contract termination"})]}),i.jsx("h2",{children:"Sub-Processors"}),i.jsx("p",{children:"We use the following categories of sub-processors:"}),i.jsxs("ul",{children:[i.jsx("li",{children:"Cloud infrastructure providers (data hosting)"}),i.jsx("li",{children:"AI model providers (content generation)"}),i.jsx("li",{children:"Payment processors (transaction handling)"}),i.jsx("li",{children:"Analytics providers (anonymized usage data)"})]}),i.jsx("h2",{children:"Data Protection Officer"}
686),i.jsxs("p",{children:["For GDPR inquiries, contact our DPO at ",i.jsx("strong",{children:"[email protected]"}),"."]}),i.jsx("h2",{children:"Supervisory Authority"}),i.jsx("p",{children:"You have the right to lodge a complaint with your local data protection authority if you believe your rights have been violated."})]})]})}const fd={"sora-2-vs-veo-3":{title:"Sora 2 vs Veo 3.1: Which AI Video Model Should You Use?",excerpt:"A detailed comparison of OpenAI's Sora 2 and Google's Veo 3.1 for video generation.",date:"2026-03-05",readTime:"8 min read",category:"Comparison",content:["The AI video generation landscape has evolved rapidly in 2026, with OpenAI's Sora 2 and Google's Veo 3.1 emerging as the two dominant models. Both offer stunning cinematic quality, but they excel in different areas.",`## Quality & Realism 687 688Sora 2 produces incredibly photorealistic footage with natural lighting and physics. It excels at complex scenes with multiple subjects and maintains temporal consistency across longer clips. Veo 3.1, on the other hand, offers superior color grading and cinematic composition out of the box.`,`## Speed & Efficiency 689 690Veo 3.1 is generally faster for standard 5-second clips, completing generation in 30-60 seconds. Sora 2 takes slightly longer (45-90 seconds) but produces more detailed output. For batch processing, Veo 3.1's speed advantage becomes significant.`,`## Use Cases 691 692**Choose Sora 2 for:** Product demos, realistic human scenes, complex narratives, and when maximum realism matters. 693 694**Choose Veo 3.1 for:** Social media content, fast turnaround projects, artistic/stylized videos, and when you need consistent brand aesthetics.`,`## Pricing on MyReelGen 695 696Both models are available on MyReelGen. Sora 2 costs 8 credits per generation, while Veo 3.1 costs 6 credits. With our Starter plan, you get 5 free daily credits to try both.`,`## Our Recommendation 697 698For most creators, we recommend starting with Veo 3.1 for its speed and versatility, then using Sora 2 when you need that extra level of realism. MyReelGen lets you seamlessly switch between both models without separate subscriptions.`]},"ai-video-marketing-guide":{title:"The Complete Guide to AI Video for Marketing in 2026",excerpt:"Learn how brands are using AI-generated video for social media, ads, and product launches.",date:"2026-02-28",readTime:"12 min read",category:"Guide",content:["AI video generation has transformed marketing workflows. What once required studios, actors, and weeks of production can now be accomplished in minutes. Here's how leading brands are leveraging this technology.",`## The State of AI Video in Marketing 699 700In 2026, over 40% of social media video ads involve some form of AI generation. From product visualizations to personalized video messages, the applications are vast and growing.`,`## Top Use Cases 701 702**Product Launches:** Generate cinematic product reveal videos without physical prototyping. Upload a product image and let AI create a stunning launch teaser. 703 704**Social Media Content:** Create platform-specific video content at scale â vertical for TikTok/Reels, landscape for YouTube, square for feeds. 705 706**A/B Testing:** Generate multiple video variations instantly to test messaging, visuals, and CTAs without reshooting.`,`## Best Practices 707 7081. **Start with a clear prompt:** Detailed descriptions produce better results. Include mood, lighting, camera angles, and pacing. 7092. **Use reference images:** Upload product photos or mood boards to guide the AI. 7103. **Iterate quickly:** Generate 3-5 variations and pick the best. Credits are cheap compared to traditional production. 7114. **Add human touch:** AI-generated content works best when combined with human editing, voiceover, and brand elements.`,`## ROI Comparison 712 713Traditional video production: $5,000-$50,000 per video. 714AI-generated video on MyReelGen: $2-$10 per video (4-8 credits). 715 716That's a 500-5,000x cost reduction with turnaround times measured in minutes instead of weeks.`,`## Getting Started 717 718Sign up for MyReelGen's free tier with 5 daily credits. Try our AI Product Teaser agent for an automated workflow, or use the Video Models page for full creative control.`]},"ai-headshots-for-linkedin":{title:"How to Generate Professional AI Headshots for LinkedIn",excerpt:"Step-by-step guide to creating polished, professional headshots using our AI Headshot Generator.",date:"2026-02-20",readTime:"5 min read",category:"Tutorial",content:["A professional headshot can make or break your LinkedIn profile. Studies show profiles with professional photos get 14x more views. But studio sessions are expensive and time-consuming. Here's how to create studio-quality headshots with AI.",`## What You Need 719 720Just one clear photo of yourself â a selfie works fine. Our AI Headshot Generator handles the rest: background, lighting, professional styling, and post-processing.`,`## Step-by-Step Guide 721 7221. Navigate to the AI Headshot Generator in your MyReelGen dashboard 7232. Upload a clear, front-facing photo (natural lighting works best)
7243. Choose your style: Corporate, Creative, or Casual 7254. Select background preference: Studio, Office, or Outdoor 7265. Click Generate â results appear in about 30 seconds`,`## Tips for Best Results 727 728- Use a photo with even lighting on your face 729- Face the camera directly or at a slight angle 730- Avoid heavy makeup or accessories that might confuse the AI 731- Try multiple styles â you get different results each time 732- Each generation costs just 4 credits`,`## Before & After 733 734Our users consistently report that AI-generated headshots perform better than their original photos on LinkedIn, with increased profile views and connection requests.`]},"ghost-mannequin-ecommerce":{title:"AI Ghost Mannequin: Revolutionizing E-commerce Product Photography",excerpt:"How our AI Ghost Mannequin tool helps e-commerce brands create clean, professional product photos.",date:"2026-02-15",readTime:"6 min read",category:"Use Case",content:["The ghost mannequin effect â where clothing appears to float in 3D without a visible model or mannequin â is the gold standard for e-commerce product photography. Traditionally, this requires specialized photography equipment and hours of post-production. AI changes everything.",`## How It Works 735 736Our AI Ghost Mannequin agent uses advanced image understanding to: 7371. Analyze your product photo (on a mannequin, flat-lay, or model) 7382. Remove the mannequin/model while preserving the garment's shape 7393. Reconstruct hidden areas (neckline, sleeves) for a clean 3D effect 7404. Apply professional lighting and shadow`,`## Benefits for E-commerce 741 742- **Speed:** Process hundreds of products per day vs. 20-30 with traditional methods 743- **Cost:** $0.50-$1 per image vs. $15-$50 for professional retouching 744- **Consistency:** Every product gets the same professional treatment 745- **Scalability:** Perfect for large catalogs and seasonal refreshes`,`## Supported Input Types 746 747- Clothing on mannequins (best results) 748- Flat-lay product photos 749- Clothing on models (AI removes the model) 750- Simple product photos on any background`,`## Getting Started 751 752Upload any product photo to the Ghost Mannequin agent in your dashboard. Results are generated in seconds at just 4 credits per image. Try it with your entire catalog using our API for batch processing.`]},"multi-currency-ai-pricing":{title:"Making AI Accessible: Multi-Currency Pricing for Global Creators",excerpt:"Why we support PKR, INR, AED, and USD â and how local pricing helps creators in emerging markets.",date:"2026-02-10",readTime:"4 min read",category:"Company",content:["At MyReelGen, we believe AI creative tools should be accessible to everyone, regardless of where they live. That's why we've built multi-currency support from day one.",`## The Problem 753 754Most AI platforms price exclusively in USD, which creates a significant barrier for creators in emerging markets. A $30/month subscription that feels reasonable in the US can represent a substantial portion of monthly income in Pakistan, India, or the Middle East.`,`## Our Approach 755 756We support local payment methods and currencies: 757- **PKR** via Easypaisa and bank transfer 758- **USD** via credit/debit cards 759- **Pay-as-you-go** credit system that lets you spend what you can afford 760 761Our free tier provides 5 daily credits â enough to create meaningful content without any payment.`,`## Impact 762 763Since launching local pricing, we've seen: 764- 3x increase in creators from South Asia 765- 60% higher engagement from emerging market users 766- A thriving community of creators who previously couldn't access AI tools`,`## What's Next 767 768We're expanding to support more currencies and local payment methods. Our mission remains the same: make the world's best AI models accessible to every creator, everywhere.`]},"api-integration-guide":{title:"Integrating MyReelGen API into Your App: Developer Guide",excerpt:"Complete walkthrough of our REST API â authentication, endpoints, webhooks, and code examples.",date:"2026-02-05",readTime:"10 min read",category:"Developer",content:["MyReelGen's API lets you integrate AI video and image generation directly into your applications. This guide covers everything you need to get started.","## Authentication\n\nAll API requests require an API key passed in the `Authorization` header:\n\n```\nAuthorization: Bearer mrg_your_api_key_here\n```\n\nGenerate API keys from your Dashboard â Profile â API Keys section.",`## Core Endpoints 769 770**POST /api/generate** â Start a new generation 771\`\`\`json 772{ 773 "model": "sora-2-pro", 774 "prompt": "A golden retriever running on a beach at sunset", 775 "duration": 5, 776 "resolution": "1080p" 777} 778\`\`\` 779 780**GET /api/media/:id** â Check generation status and retrieve results`,`## Webhooks 781 782Configure webhook URLs to receive real-time notifications when generations complete. This is more efficient than polling for long-running video generations. 783 784\`\`\`json 785{ 786 "event": "generation.completed", 787 "data": { 788 "id": "gen_abc123", 789 "status": "completed", 790 "video_url": "https://..." 791 } 792} 793\`\`\``,`## Rate Limits 794 795Free tier: 10 requests/minute 796Creator plan: 60 requests/minute 797Business plan: 300 requests/minute 798 799Rate limit headers are included in every response.`,`## SDKs & Examples 800 801We provide official SDKs for Python, Node.js, and Go. Check our API Docs page for interactive examples and a full endpoint reference.`]}},Bu=Object.keys(fd);function Y7(){const{slug:e}=Gc(),t=e?fd[e]:void 0;if(!t)return i.jsxs(rt,{children:[i.jsx(nt,{title:"Post Not Found",description:"The blog post you're looking for doesn't exist.",noindex:!0}),i.jsxs("section",{className:"py-28 px-4 text-center",children:[i.jsx("h1",{className:"text-3xl font-bold mb-4",children:"Post not found"}),i.jsx("p",{className:"text-muted-foreground mb-6",children:"The article you're looking for doesn't exist."}),i.jsx(B,{asChild:!0,variant:"outline",className:"rounded-full",children:i.jsxs(ye,{to:"/blog",children:[i.jsx(rn,{className:"w-4 h-4 mr-2"})," Back to Blog"]})})]})]});const r=Bu.indexOf(e),n=r>
8010?Bu[r-1]:null,s=r<Bu.length-1?Bu[r+1]:null;return i.jsxs(rt,{children:[i.jsx(nt,{title:t.title,description:t.excerpt,canonical:`/blog/${e}`,ogType:"article",structuredData:{"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,description:t.excerpt,datePublished:t.date,author:{"@type":"Organization",name:"MyReelGen"}}}),i.jsx("article",{className:"py-20 sm:py-28 px-4",children:i.jsx("div",{className:"max-w-3xl mx-auto",children:i.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[i.jsxs(ye,{to:"/blog",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-8 transition-colors",children:[i.jsx(rn,{className:"w-3.5 h-3.5"})," Back to Blog"]}),i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx(xe,{variant:"secondary",children:t.category}),i.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[i.jsx(Mh,{className:"w-3 h-3"}),new Date(t.date).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]}),i.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[i.jsx(xr,{className:"w-3 h-3"})," ",t.readTime]})]}),i.jsx("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold mb-8 leading-tight",children:t.title}),i.jsx("div",{className:"prose prose-lg dark:prose-invert max-w-none",children:t.content.map((a,o)=>{const l=a.split(/\n\n/);return i.jsx("div",{className:"mb-8",children:l.map((c,u)=>{if(c.startsWith("## "))return i.jsx("h2",{className:"text-2xl font-bold mt-10 mb-4",children:c.replace("## ","")},u);if(c.startsWith("```")){const h=c.replace(/```\w*\n?/,"").replace(/```$/,"");return i.jsx("pre",{className:"p-4 rounded-xl bg-muted/50 border border-border/40 overflow-x-auto text-sm font-mono my-4",children:i.jsx("code",{children:h})},u)}const d=c.split(` 802`);return i.jsx("div",{className:"mb-4",children:d.map((h,f)=>h.startsWith("- ")||h.match(/^\d+\./)?i.jsx("li",{className:"ml-4 text-muted-foreground leading-relaxed",children:f1(h.replace(/^[-\d.]+\s*/,""))},f):i.jsx("p",{className:"text-muted-foreground leading-relaxed",children:f1(h)},f))},u)})},o)})}),i.jsxs("div",{className:"mt-16 pt-8 border-t border-border/20 flex flex-col sm:flex-row justify-between gap-4",children:[n?i.jsxs(ye,{to:`/blog/${n}`,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[i.jsx(rn,{className:"w-4 h-4"}),i.jsx("span",{className:"line-clamp-1",children:fd[n].title})]}):i.jsx("div",{}),s&&i.jsxs(ye,{to:`/blog/${s}`,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors sm:text-right",children:[i.jsx("span",{className:"line-clamp-1",children:fd[s].title}),i.jsx(Lt,{className:"w-4 h-4"})]})]})]})})})]})}function f1(e){return e.split(/(\*\*[^*]+\*\*)/g).map((r,n)=>r.startsWith("**")&&r.endsWith("**")?i.jsx("strong",{className:"text-foreground font-semibold",children:r.slice(2,-2)},n):i.jsx("span",{children:r},n))}const GA={ecommerce:{title:"E-Commerce",headline:"AI-Powered Product Visuals That Sell",description:"Generate stunning product photos, ghost mannequin images, and video ads without a studio. Scale your catalog visuals 100x faster.",seoTitle:"AI Video & Image Generation for E-Commerce",seoDesc:"Create professional product photos, ghost mannequin images, and video ads with AI. Scale your e-commerce visual content 100x faster with MyReelGen.",icon:qn,painPoints:["Product photography is expensive and slow","Mannequin removal costs $15-50 per image","Video ads require production budgets","Seasonal refreshes take weeks"],solutions:[{title:"Ghost Mannequin AI",desc:"Remove mannequins instantly from product photos. Professional 3D effect at $0.50/image."},{title:"Product Video Ads",desc:"Generate cinematic product reveal videos from a single photo. Perfect for social media ads."},{title:"Catalog at Scale",desc:"Process hundreds of products per day via API. Consistent quality across your entire catalog."},{title:"A/B Testing",desc:"Generate multiple visual variations instantly to test which images convert better."}],stats:[{value:"100x",label:"Faster than studios"},{value:"$0.50",label:"Per product image"},{value:"30s",label:"Average generation"},{value:"500+",label:"E-commerce users"}],cta:"Start Creating Product Visuals"},marketing:{title:"Marketing & Advertising",headline:"Create Scroll-Stopping Video Ads in Minutes",description:"Generate professional video ads, social content, and campaign visuals at a fraction of traditional production costs.",seoTitle:"AI Video Generation for Marketing & Advertising",seoDesc:"Create professional video ads, social media content, and campaign visuals with AI. 500x cheaper than traditional video production. Try MyReelGen free.",icon:g4,painPoints:["Video production costs $5,000-$50,000 per video","Creative turnaround takes weeks","Can't afford to test multiple variations","Platform-specific formats multiply the work"],solutions:[{title:"AI Video Ads",desc:"Generate cinematic ads with Sora 2 and Veo 3.1. From concept to final video in minutes."},{title:"Multi-Format Output",desc:"Create vertical, square, and landscape versions from a single prompt. Native for every platform."},{title:"Rapid Iteration",desc:"Generate 10 variations for the cost of one traditional video. A/B test everything."}
802,{title:"Brand Consistency",desc:"Use reference images and detailed prompts to maintain brand aesthetics across all content."}],stats:[{value:"500x",label:"Cost reduction"},{value:"2min",label:"Concept to video"},{value:"10x",label:"More variations"},{value:"40%",label:"Higher engagement"}],cta:"Start Creating Video Ads"},"real-estate":{title:"Real Estate",headline:"AI Virtual Tours & Property Visuals",description:"Transform property listings with AI-generated walkthroughs, staging visuals, and promotional videos that attract more buyers.",seoTitle:"AI Video & Image Generation for Real Estate",seoDesc:"Create virtual property tours, AI-staged interiors, and promotional videos for real estate listings. Attract more buyers with MyReelGen AI.",icon:t4,painPoints:["Professional photography for every listing is expensive","Virtual staging costs $100-300 per room","Video tours require videographers","Empty properties don't show well"],solutions:[{title:"AI Virtual Staging",desc:"Transform empty rooms into beautifully furnished spaces. Multiple design styles per room."},{title:"Property Video Tours",desc:"Generate cinematic walkthrough-style videos from property photos. Perfect for listings."},{title:"Aerial & Lifestyle",desc:"Create aerial views and lifestyle imagery that showcase the property's potential."},{title:"Social Content",desc:"Generate attention-grabbing listing videos optimized for Instagram, TikTok, and Facebook."}],stats:[{value:"3x",label:"More listing views"},{value:"$5",label:"Per staged room"},{value:"24hr",label:"Listing turnaround"},{value:"200+",label:"Real estate agents"}],cta:"Start Creating Property Visuals"}},Q7=Object.entries(GA).map(([e,t])=>({slug:e,...t}));function m1(){const{industry:e}=Gc(),t=Ce();if(!e)return i.jsxs(rt,{children:[i.jsx(nt,{title:"Use Cases â AI Video & Image Generation by Industry",description:"See how e-commerce, marketing, and real estate professionals use MyReelGen AI to create stunning visual content faster and cheaper.",canonical:"/use-cases"}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center mb-14",children:[i.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Built for Every Industry"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-xl mx-auto",children:"See how professionals across industries use AI to create stunning visual content."})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:Q7.map((s,a)=>i.jsx(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:a*.1},children:i.jsxs(ye,{to:`/use-cases/${s.slug}`,className:"block p-8 rounded-2xl border border-border/40 bg-card/50 hover:border-primary/30 hover:shadow-lg transition-all group",children:[i.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center mb-4 group-hover:bg-primary/15 transition-colors",children:i.jsx(s.icon,{className:"w-6 h-6 text-primary"})}),i.jsx("h2",{className:"text-xl font-bold mb-2",children:s.title}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-4",children:s.description}),i.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-primary font-medium",children:["Learn more ",i.jsx(Lt,{className:"w-3.5 h-3.5"})]})]})},s.slug))})]})})]});const r=GA[e];if(!r)return i.jsxs(rt,{children:[i.jsx(nt,{title:"Use Case Not Found",description:"This use case page doesn't exist.",noindex:!0}),i.jsxs("section",{className:"py-28 px-4 text-center",children:[i.jsx("h1",{className:"text-3xl font-bold mb-4",children:"Use case not found"}),i.jsx(B,{asChild:!0,variant:"outline",className:"rounded-full",children:i.jsx(ye,{to:"/use-cases",children:"View all use cases"})})]})]});const n=r.icon;return i.jsxs(rt,{children:[i.jsx(nt,{title:r.seoTitle,description:r.seoDesc,canonical:`/use-cases/${e}`}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsx("div",{className:"max-w-4xl mx-auto text-center",children:i.jsxs(se.div,{initial:{opacity:0,y:20}
802,animate:{opacity:1,y:0},children:[i.jsxs(xe,{variant:"secondary",className:"mb-4",children:[i.jsx(n,{className:"w-3.5 h-3.5 mr-1"})," ",r.title]}),i.jsx("h1",{className:"text-4xl sm:text-5xl lg:text-6xl font-bold mb-6 leading-tight",children:r.headline}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto mb-8",children:r.description}),i.jsxs(B,{size:"lg",onClick:()=>t("/auth"),className:"rounded-full px-8 h-12 gap-2",children:[r.cta," ",i.jsx(Lt,{className:"w-4 h-4"})]})]})})}),i.jsx("section",{className:"py-12 border-y border-border/20",children:i.jsx("div",{className:"max-w-4xl mx-auto px-4 grid grid-cols-2 md:grid-cols-4 gap-6 text-center",children:r.stats.map(s=>i.jsxs("div",{children:[i.jsx("div",{className:"text-3xl font-bold text-primary",children:s.value}),i.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:s.label})]},s.label))})}),i.jsx("section",{className:"py-20 px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"text-3xl font-bold text-center mb-10",children:"The Problem"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:r.painPoints.map(s=>i.jsx("div",{className:"p-5 rounded-xl border border-destructive/20 bg-destructive/5 text-sm",children:s},s))})]})}),i.jsx("section",{className:"py-20 px-4 bg-card/30",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"text-3xl font-bold text-center mb-10",children:"How MyReelGen Solves It"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:r.solutions.map(s=>i.jsxs("div",{className:"p-6 rounded-2xl border border-border/40 bg-background",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(qs,{className:"w-5 h-5 text-primary"}),i.jsx("h3",{className:"font-bold",children:s.title})]}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.desc})]},s.title))})]})}),i.jsx("section",{className:"py-20 px-4",children:i.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[i.jsxs("h2",{className:"text-3xl font-bold mb-4",children:["Ready to transform your ",r.title.toLowerCase()," visual
802s?"]}),i.jsx("p",{className:"text-muted-foreground mb-8",children:"Start free with 5 daily credits. No credit card required."}),i.jsxs(B,{size:"lg",onClick:()=>t("/auth"),className:"rounded-full px-10 h-12 gap-2",children:["Get Started Free ",i.jsx(Lt,{className:"w-4 h-4"})]})]})})]})}const WA={runwayml:{name:"RunwayML",tagline:"More models, better pricing, same quality",seoTitle:"MyReelGen vs RunwayML â AI Video Generation Comparison 2026",seoDesc:"Compare MyReelGen vs RunwayML for AI video generation. See features, pricing, model access, and why creators choose MyReelGen.",features:{"Sora 2 Access":{us:!0,them:!1},"Veo 3.1 Access":{us:!0,them:!1},"Hailuo 2.3":{us:!0,them:!1},"Gen-3 Alpha":{us:!1,them:!0},"Image Generation":{us:!0,them:!0},"AI Avatars":{us:!0,them:!1},"Ghost Mannequin":{us:!0,them:!1},"AI Headshots":{us:!0,them:!1},"API Access":{us:!0,them:!0},"Free Tier":{us:"5 daily credits",them:"Limited trial"},"Starting Price":{us:"$29/mo",them:"$15/mo"},"4K Video":{us:!0,them:!0},"Multi-Currency":{us:"USD, PKR, INR",them:"USD only"},"Webhook Support":{us:!0,them:!0},"Team Management":{us:!0,them:!0}},whyUs:["Access to 15+ AI models from OpenAI, Google, ByteDance, and more â not locked into one provider","AI-powered agents (headshots, ghost mannequin, movie trailers) for specialized workflows","Multi-currency support with local payment methods for global accessibility","Credit-based pricing that's flexible â pay only for what you generate","Free tier with 5 daily credits â no credit card required to start"]},pika:{name:"Pika",tagline:"Enterprise features at creator-friendly prices",seoTitle:"MyReelGen vs Pika â AI Video Generation Comparison 2026",seoDesc:"Compare MyReelGen vs Pika for AI video generation. Multi-model access, specialized AI agents, and flexible pricing. See the full comparison.",features:{"Sora 2 Access":{us:!0,them:!1},"Veo 3.1 Access":{us:!0,them:!1},"Pika Model":{us:!1,them:!0},"Image Generation":{us:!0,them:"Limited"},"AI Avatars":{us:!0,them:!1},"Ghost Mannequin":{us:!0,them:!1},"AI Headshots":{us:!0,them:!1},"Movie Trailer Agent":{us:!0,them:!1},"API Access":{us:!0,them:"Enterprise only"},"Free Tier":{us:"5 daily credits",them:"Limited trial"},"Starting Price":{us:"$29/mo",them:"$10/mo"},"4K Video":{us:!0,them:!1},"Multi-Currency":{us:"USD, PKR, INR",them:"USD only"},"Webhook Support":{us:!0,them:!1},"Audio Generation":{us:!0,them:!1}},whyUs:["15+ premium AI models including Sora 2, Veo 3.1, Hailuo â not limited to one model","Specialized AI agents automate complex workflows like headshots and product photography","Full API with webhooks for production integrations â available on all paid plans","4K video output for professional-grade content","Local payment support for creators worldwide"]},synthesia:{name:"Synthesia",tagline:"Real AI generation, not just talking heads",seoTitle:"MyReelGen vs Synthesia â AI Video Platform Comparison 2026",seoDesc:"Compare MyReelGen vs Synthesia. MyReelGen offers full AI video generation with Sora 2 & Veo 3.1, while Synthesia focuses on avatar-based videos.",features:{"AI Video Generation":{us:!0,them:!1},"Talking Head Avatars":{us:!0,them:!0},"Sora 2 / Veo 3.1":{us:!0,them:!1},"Image Generation":{us:!0,them:!1},"AI Headshots":{us:!0,them:!1},"Ghost Mannequin":{us:!0,them:!1},"Custom Avatar Upload":{us:!0,them:!0},"Script-to-Video":{us:!0,them:!0},"API Access":{us:!0,them:!0},"Free Tier":{us:"5 daily credits",them:"Demo only"},"Starting Price":{us:"$29/mo",them:"$29/mo"},"Multi-Currency":{us:"USD, PKR, INR",them:"USD, EUR"},"4K Output":{us:!0,them:!1},"Audio Generation":{us:!0,them:!1},"Cinematic Video":{us:!0,them:!1}},whyUs:["Full cinematic AI video generation â not limited to avatar-based talking head videos","Access to world-class models (Sora 2, Veo 3.1, Hailuo) for any creative vision","AI image generation, headsh
802ots, and ghost mannequin â a complete creative platform","Significantly lower cost for similar or better output quality","Free tier lets you test everything before committing"]}},J7=Object.entries(WA).map(([e,t])=>({slug:e,...t}));function p1({value:e}){return e===!0?i.jsx(qs,{className:"w-5 h-5 text-primary mx-auto"}):e===!1?i.jsx(on,{className:"w-5 h-5 text-muted-foreground/40 mx-auto"}):i.jsx("span",{className:"text-sm text-center block",children:e})}function g1(){const{competitor:e}=Gc(),t=Ce();if(!e)return i.jsxs(rt,{children:[i.jsx(nt,{title:"Compare MyReelGen â AI Video Generation Platform Comparisons",description:"See how MyReelGen compares to RunwayML, Pika, Synthesia, and other AI video platforms. Feature-by-feature comparisons.",canonical:"/compare"}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center mb-14",children:[i.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"How We Compare"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-xl mx-auto",children:"See why creators choose MyReelGen over other AI video platforms."})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-6",children:J7.map((s,a)=>i.jsx(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:a*.1},children:i.jsxs(ye,{to:`/compare/${s.slug}`,className:"block p-6 rounded-2xl border border-border/40 bg-card/50 hover:border-primary/30 hover:shadow-lg transition-all group text-center",children:[i.jsxs("h2",{className:"text-xl font-bold mb-2",children:["MyReelGen vs ",s.name]}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s.tagline}),i.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-primary font-medium",children:["See comparison ",i.jsx(Lt,{className:"w-3.5 h-3.5"})]})]})},s.slug))})]})})]});const r=WA[e];if(!r)return i.jsxs(rt,{children:[i.jsx(nt,{title:"Comparison Not Found",description:"This comparison page doesn't exist.",noindex:!0}),i.jsxs("section",{className:"py-28 px-4 text-center",children:[i.jsx("h1",{className:"text-3xl font-bold mb-4",children:"Comparison not found"}),i.jsx(B,{asChild:!0,variant:"outline",className:"rounded-full",children:i.jsx(ye,{to:"/compare",children:"View all comparisons"})})]})]});const n=Object.entries(r.features);return i.jsxs(rt,{children:[i.jsx(nt,{title:r.seoTitle,description:r.seoDesc,canonical:`/compare/${e}`,structuredData:{"@context":"https://schema.org","@type":"WebPage",name:r.seoTitle,description:r.seoDesc}}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsx("div",{className:"max-w-4xl mx-auto text-center",children:i.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[i.jsx(xe,{variant:"secondary",className:"mb-4",children:"Comparison"}),i.jsxs("h1",{className:"text-3xl sm:text-5xl font-bold mb-4",children:["MyReelGen vs ",r.name]}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-xl mx-auto mb-8",children:r.tagline}),i.jsxs(B,{size:"lg",onClick:()=>t("/auth"),className:"rounded-full px-8 h-12 gap-2",children:["Try MyReelGen Free ",i.jsx(Lt,{className:"w-4 h-4"})]})]})})}),i.jsx("section",{className:"py-16 px-4",children:i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx("h2",{className:"text-2xl font-bold text-center mb-8",children:"Feature Comparison"}),i.jsxs("div",{className:"rounded-2xl border border-border/40 overflow-hidden",children:[i.jsxs("div",{className:"grid grid-cols-3 bg-card/80 border-b border-border/40 p-4 text-sm font-semibold",children:[i.jsx("div",{children:"Feature"}),i.jsx("div",{className:"text-center text-primary",children:"MyReelGen"}),i.jsx("div",{className:"text-center",children:r.name})]}),n.map(([s,a],o)=>i.jsxs("div",{className:`grid grid-cols-3 p-4 text-sm items-center ${o%2===0?"bg-background":"bg-card/30"}`,children:[i.jsx("div",{className:"font-medium",children:s}),i.jsx("div",{className:"text-center",children:i.jsx(p1,{value:a.us})}),i.jsx("div",{className:"text-center",children:i.jsx(p1,{value:a.them})})]},s))]})]})}),i.jsx("section",{className:"py-16 px-4",children:i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx("h2",{className:"text-2xl font-bold text-center mb-8",children:"Why Choose MyReelGen"}),i.jsx("div",{className:"space-y-4",children:r.whyUs.map(s=>i.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl border border-border/40 bg-card/50",children:[i.jsx(qs,{className:"w-5 h-5 text-primary mt-0.5 shrink-0"}),i.jsx("span",{className:"text-sm leading-relaxed",children:s})]},s))})]})}),i.jsx("section",{className:"py-20 px-4",children:i.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[i.jsxs("h2",{className:"text-3xl font-bold mb-4",children:["Ready to switch from ",r.n
802ame,"?"]}),i.jsx("p",{className:"text-muted-foreground mb-8",children:"Start free with 5 daily credits. No credit card required."}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-3",children:[i.jsxs(B,{size:"lg",onClick:()=>t("/auth"),className:"rounded-full px-8 h-12 gap-2",children:["Get Started Free ",i.jsx(Lt,{className:"w-4 h-4"})]}),i.jsx(B,{size:"lg",variant:"outline",onClick:()=>t("/pricing"),className:"rounded-full px-8 h-12",children:"View Pricing"})]})]})})]})}const X7=new X3,Z7=()=>i.jsx(nL,{client:X7,children:i.jsx(pL,{defaultTheme:"dark",storageKey:"myreelgen-theme",children:i.jsxs(kk,{children:[i.jsx(pD,{}),i.jsx(HD,{}),i.jsxs(g$,{children:[i.jsx(j$,{}),i.jsxs(o$,{children:[i.jsx(me,{path:"/",element:i.jsx(jW,{})}),i.jsx(me,{path:"/auth",element:i.jsx(DW,{})}),i.jsx(me,{path:"/install",element:i.jsx(g7,{})}),i.jsx(me,{path:"/avatar/:id",element:i.jsx(p7,{})}),i.jsx(me,{path:"/pricing",element:i.jsx(j7,{})}),i.jsx(me,{path:"/features",element:i.jsx(k7,{})}),i.jsx(me,{path:"/about",element:i.jsx(T7,{})}),i.jsx(me,{path:"/contact",element:i.jsx(R7,{})}),i.jsx(me,{path:"/blog",element:i.jsx(O7,{})}),i.jsx(me,{path:"/blog/:slug",element:i.jsx(Y7,{})}),i.jsx(me,{path:"/changelog",element:i.jsx(D7,{})}),i.jsx(me,{path:"/customers",element:i.jsx(F7,{})}),i.jsx(me,{path:"/security",element:i.jsx(V7,{})}),i.jsx(me,{path:"/status",element:i.jsx(z7,{})}),i.jsx(me,{path:"/use-cases",element:i.jsx(m1,{})}),i.jsx(me,{path:"/use-cases/:industry",element:i.jsx(m1,{})}),i.jsx(me,{path:"/compare",element:i.jsx(g1,{})}),i.jsx(me,{path:"/compare/:competitor",element:i.jsx(g1,{})}),i.jsx(me,{path:"/privacy",element:i.jsx(G7,{})}),i.jsx(me,{path:"/terms",element:i.jsx(W7,{})}),i.jsx(me,{path:"/cookies",element:i.jsx(q7,{})}),i.jsx(me,{path:"/acceptable-use",element:i.jsx(H7,{})}),i.jsx(me,{path:"/gdpr",element:i.jsx(K7,{})}),i.jsxs(me,{element:i.jsx(gW,{}),children:[i.jsx(me,{path:"/dashboard",element:i.jsx(WW,{})}),i.jsx(me,{path:"/models",element:i.jsx(QW,{})}),i.jsx(me,{path:"/image-models",element:i.jsx(tq,{})}),i.jsx(me,{path:"/image-generation",element:i.jsx(Iq,{})}),i.jsx(me,{path:"/ai-agents",element:i.jsx(sH,{})}),i.jsx(me,{path:"/audio-models",element:i.jsx(nH,{})}),i.jsx(me,{path:"/avatars",element:i.jsx(lH,{})}),i.jsx(me,{path:"/model/:slug",element:i.jsx(AH,{})}),i.jsx(me,{path:"/agent/sora-watermark-remover",element:i.jsx(RH,{})}),i.jsx(me,{path:"/agent/ai-headshot",element:i.jsx(OH,{})}),i.jsx(me,{path:"/agent/ghost-mannequin",element:i.jsx(MH,{})}),i.jsx(me,{path:"/agent/movie-trailer",element:i.jsx(LH,{})}),i.jsx(me,{path:"/agent/product-teaser",element:i.jsx(FH,{})}),i.jsx(me,{path:"/agent/ugc-ad-generator",element:i.jsx(BH,{})}),i.jsx(me,{path:"/videos",element:i.jsx(KH,{})}),i.jsx(me,{path:"/images",element:i.jsx(l7,{})}),i.jsx(me,{path:"/transactions",element:i.jsx(d7,{})}),i.jsx(me,{path:"/profile",element:i.jsx(f7,{})}),i.jsx(me,{path:"/api-docs",element:i.jsx(m7,{})})]}),i.jsx(me,{path:"/billing/success",element:i.jsx(c7,{})}),i.jsx(me,{path:"/billing/failed",element:i.jsx(u7,{})}),i.jsx(me,{element:i.jsx(yW,{}),children:i.jsx(me,{path:"/admin",element:i.jsx(v7,{})})}),i.jsx(me,{path:"*",element:i.jsx(x7,{})})]})]})]})})});US(document.getElementById("root")).render(i.jsx(W.StrictMode,{children:i.jsx(HS,{children:i.jsx(Z7,{})})}));
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.