vendor: 6,122 bytes, lines 1-9
1var jv=e=>{throw TypeError(e)};var hh=(e,t,r)=>t.has(e)||jv("Cannot "+r);var V=(e,t,r)=>(hh(e,t,"read from private field"),r?r.call(e):t.get(e)),Le=(e,t,r)=>t.has(e)?jv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ne=(e,t,r,n)=>(hh(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Pt=(e,t,r)=>(hh(e,t,"access private method"),r);var Yl=(e,t,r,n)=>({set _(a){Ne(e,t,a,r)},get _(){return V(e,t,n)}});function hC(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();function Z0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y0={exports:{}},Xu={},X0={exports:{}},Re={};/** 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 Al=Symbol.for("react.element"),fC=Symbol.for("react.portal"),mC=Symbol.for("react.fragment"),pC=Symbol.for("react.strict_mode"),gC=Symbol.for("react.profiler"),vC=Symbol.for("react.provider"),xC=Symbol.for("react.context"),yC=Symbol.for("react.forward_ref"),wC=Symbol.for("react.suspense"),bC=Symbol.for("react.memo"),jC=Symbol.for("react.lazy"),_v=Symbol.iterator;function _C(e){return e===null||typeof e!="object"?null:(e=_v&&e[_v]||e["@@iterator"],typeof e=="function"?e:null)}var ew={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},tw=Object.assign,rw={};function Ji(e,t,r){this.props=e,this.context=t,this.refs=rw,this.updater=r||ew}Ji.prototype.isReactComponent={};Ji.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")};Ji.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function nw(){}nw.prototype=Ji.prototype;function sp(e,t,r){this.props=e,this.context=t,this.refs=rw,this.updater=r||ew}var ap=sp.prototype=new nw;ap.constructor=sp;tw(ap,Ji.prototype);ap.isPureReactComponent=!0;var Nv=Array.isArray,sw=Object.prototype.hasOwnProperty,ip={current:null},aw={key:!0,ref:!0,__self:!0,__source:!0};function iw(e,t,r){var n,a={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)sw.call(t,n)&&!aw.hasOwnProperty(n)&&(a[n]=t[n]);var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)a[n]===void 0&&(a[n]=l[n]);return{$$typeof:Al,type:e,key:i,ref:o,props:a,_owner:ip.current}}function NC(e,t){return{$$typeof:Al,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function op(e){return typeof e=="object"&&e!==null&&e.$$typeof===Al}function SC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Sv=/\/+/g;function fh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?SC(""+e.key):t.toString(36)}function $c(e,t,r,n,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Al:case fC:o=!0}}if(o)return o=e,a=a(o),e=n===""?"."+fh(o,0):n,Nv(a)?(r="",e!=null&&(r=e.replace(Sv,"$&/")+"/"),$c(a,t,r,"",function(u){return u})):a!=null&&(op(a)&&(a=NC(a,r+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(Sv,"$&/")+"/")+e)),t.push(a)),1;if(o=0,n=n===""?".":n+":",Nv(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+fh(i,l);o+=$c(i,t,r,c,a)}else if(c=_C(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+fh(i,l++),o+=$c(i,t,r,c,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Xl(e,t,r){if(e==null)return e;var n=[],a=0;return $c(e,n,"","",function(i){return t.call(r,i,a++)}),n}function kC(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 Ht={current:null},Dc={transition:null},CC={ReactCurrentDispatcher:Ht,ReactCurrentBatchConfig:Dc,ReactCurrentOwner:ip};function ow(){throw Error("act(...) is not supported in production builds of React.")}Re.Children={map:Xl,forEach:function(e,t,r){Xl(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Xl(e,function(){t++}),t},toArray:function(e){return Xl(e,function(t){return t})||[]},only:function(e){if(!op(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Re.Component=Ji;Re.Fragment=mC;Re.Profiler=gC;Re.PureComponent=sp;Re.StrictMode=pC;Re.Suspense=wC;
vendor: 6,746 bytes, lines 9-25
9Re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=CC;Re.act=ow;Re.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=tw({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=ip.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)sw.call(t,c)&&!aw.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:Al,type:e.type,key:a,ref:i,props:n,_owner:o}};Re.createContext=function(e){return e={$$typeof:xC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:vC,_context:e},e.Consumer=e};Re.createElement=iw;Re.createFactory=function(e){var t=iw.bind(null,e);return t.type=e,t};Re.createRef=function(){return{current:null}};Re.forwardRef=function(e){return{$$typeof:yC,render:e}};Re.isValidElement=op;Re.lazy=function(e){return{$$typeof:jC,_payload:{_status:-1,_result:e},_init:kC}};Re.memo=function(e,t){return{$$typeof:bC,type:e,compare:t===void 0?null:t}};Re.startTransition=function(e){var t=Dc.transition;Dc.transition={};try{e()}finally{Dc.transition=t}};Re.unstable_act=ow;Re.useCallback=function(e,t){return Ht.current.useCallback(e,t)};Re.useContext=function(e){return Ht.current.useContext(e)};Re.useDebugValue=function(){};Re.useDeferredValue=function(e){return Ht.current.useDeferredValue(e)};Re.useEffect=function(e,t){return Ht.current.useEffect(e,t)};Re.useId=function(){return Ht.current.useId()};Re.useImperativeHandle=function(e,t,r){return Ht.current.useImperativeHandle(e,t,r)};Re.useInsertionEffect=function(e,t){return Ht.current.useInsertionEffect(e,t)};Re.useLayoutEffect=function(e,t){return Ht.current.useLayoutEffect(e,t)};Re.useMemo=function(e,t){return Ht.current.useMemo(e,t)};Re.useReducer=function(e,t,r){return Ht.current.useReducer(e,t,r)};Re.useRef=function(e){return Ht.current.useRef(e)};Re.useState=function(e){return Ht.current.useState(e)};Re.useSyncExternalStore=function(e,t,r){return Ht.current.useSyncExternalStore(e,t,r)};Re.useTransition=function(){return Ht.current.useTransition()};Re.version="18.3.1";X0.exports=Re;var h=X0.exports;const J=Z0(h),lp=hC({__proto__:null,default:J},[h]);/** 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 EC=h,TC=Symbol.for("react.element"),RC=Symbol.for("react.fragment"),AC=Object.prototype.hasOwnProperty,PC=EC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,OC={key:!0,ref:!0,__self:!0,__source:!0};function lw(e,t,r){var n,a={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)AC.call(t,n)&&!OC.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:TC,type:e,key:i,ref:o,props:a,_owner:PC.current}}Xu.Fragment=RC;Xu.jsx=lw;Xu.jsxs=lw;Y0.exports=Xu;var s=Y0.exports,cw={exports:{}},hr={},uw={exports:{}},dw={};/** 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(O,k){var L=O.length;O.push(k);e:for(;0<L;){var $=L-1>>>1,H=O[$];if(0<a(H,k))O[$]=k,O[L]=H,L=$;else break e}}function r(O){return O.length===0?null:O[0]}function n(O){if(O.length===0)return null;var k=O[0],L=O.pop();if(L!==k){O[0]=L;e:for(var $=0,H=O.length,te=H>>>1;$<te;){var ne=2*($+1)-1,Te=O[ne],Be=ne+1,re=O[Be];if(0>a(Te,L))Be<H&&0>a(re,Te)?(O[$]=re,O[Be]=L,$=Be):(O[$]=Te,O[ne]=L,$=ne);else if(Be<H&&0>a(re,L))O[$]=re,O[Be]=L,$=Be;else break e}}return k}function a(O,k){var L=O.sortIndex-k.sortIndex;return L!==0?L:O.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,m=3,p=!1,b=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(O){for(var k=r(u);k!==null;){if(k.callback===null)n(u);else if(k.startTime<=O)n(u),k.sortIndex=k.expirationTime,t(c,k);else break;k=r(u)}}function j(O){if(v=!1,y(O),!b)if(r(c)!==null)b=!0,B(_);else{var k=r(u);k!==null&&K(j,k.startTime-O)}}function _(O,k){b=!1,v&&(v=!1,w(E),E=-1),p=!0;var L=m;try{for(y(k),f=r(c);f!==null&&(!(f.expirationTime>k)||O&&!A());){var $=f.callback;if(typeof $=="function"){f.callback=null,m=f.priorityLevel;var H=$(f.expirationTime<=k);k=e.unstable_now(),typeof H=="function"?f.callback=H:f===r(c)&&n(c),y(k)}else n(c);f=r(c)}if(f!==null)var te=!0;else{var ne=r(u);ne!==null&&K(j,ne.startTime-k),te=!1}return te}finally{f=null,m=L,p=!1}}var S=!1,N=null,E=-1,R=5,I=-1;function A(){return!(e.unstable_now()-I<R)}function C(){if(N!==null){var O=e.unstable_now();I=O;var k=!0;try{k=N(!0,O)}finally{k?F():(S=!1,N=null)}}else S=!1}var F;if(typeof g=="function")F=function(){g(C)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,z=D.port2;D.port1.onmessage=C,F=function(){z.postMessage(null)}}else F=function(){x(C,0)};function B(O){N=O,S||(S=!0,F())}function K(O,k){E=x(function(){O(e.unstable_now())},k)}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(O){O.callback=null},e.unstable_continueExecution=function(){b||p||(b=!0,B(_))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(O){switch(m){case 1:case 2:case 3:var k=3;break;default:k=m}var L=m;m=k;try{return O()}finally{m=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,k){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var L=m;m=O;
vendor: 4,897 bytes, lines 25-33
25try{return k()}finally{m=L}},e.unstable_scheduleCallback=function(O,k,L){var $=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?$+L:$):L=$,O){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=L+H,O={id:d++,callback:k,priorityLevel:O,startTime:L,expirationTime:H,sortIndex:-1},L>$?(O.sortIndex=L,t(u,O),r(c)===null&&O===r(u)&&(v?(w(E),E=-1):v=!0,K(j,L-$))):(O.sortIndex=H,t(c,O),b||p||(b=!0,B(_))),O},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(O){var k=m;return function(){var L=m;m=k;try{return O.apply(this,arguments)}finally{m=L}}}})(dw);uw.exports=dw;var IC=uw.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 LC=h,lr=IC;function Z(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 hw=new Set,Ko={};function Ca(e,t){Ri(e,t),Ri(e+"Capture",t)}function Ri(e,t){for(Ko[e]=t,e=0;e<t.length;e++)hw.add(t[e])}var Fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xf=Object.prototype.hasOwnProperty,$C=/^[: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]*$/,kv={},Cv={};function DC(e){return xf.call(Cv,e)?!0:xf.call(kv,e)?!1:$C.test(e)?Cv[e]=!0:(kv[e]=!0,!1)}function MC(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 FC(e,t,r,n){if(t===null||typeof t>"u"||MC(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 Wt(e,t,r,n,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Rt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Rt[e]=new Wt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Rt[t]=new Wt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Rt[e]=new Wt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Rt[e]=new Wt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Rt[e]=new Wt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Rt[e]=new Wt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Rt[e]=new Wt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Rt[e]=new Wt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Rt[e]=new Wt(e,5,!1,e.toLowerCase(),null,!1,!1)});var cp=/[\-:]([a-z])/g;function up(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode
33-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(cp,up);Rt[t]=new Wt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(cp,up);Rt[t]=new Wt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(cp,up);Rt[t]=new Wt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Rt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!1,!1)});Rt.xlinkHref=new Wt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Rt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!0,!0)});function dp(e,t,r,n){var a=Rt.hasOwnProperty(t)?Rt[t]:null;(a!==null?a.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(FC(t,r,a,n)&&(r=null),n||a===null?DC(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,n=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Gn=LC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ec=Symbol.for("react.element"),Ga=Symbol.for("react.portal"),Ja=Symbol.for("react.fragment"),hp=Symbol.for("react.strict_mode"),yf=Symbol.for("react.profiler"),fw=Symbol.for("react.provider"),mw=Symbol.for("react.context"),fp=Symbol.for("react.forward_ref"),wf=Symbol.for("react.suspense"),bf=Symbol.for("react.suspense_list"),mp=Symbol.for("react.memo"),is=Symbol.for("react.lazy"),pw=Symbol.for("react.offscreen"),Ev=Symbol.iterator;function mo(e){return e===null||typeof e!="object"?null:(e=Ev&&e[Ev]||e["@@iterator"],typeof e=="function"?e:null)}var tt=Object.assign,mh;function ko(e){if(mh===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);mh=t&&t[1]||""}return` 34`+mh+e}var ph=!1;function gh(e,t){if(!e||ph)return"";ph=!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()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var a=u.stack.split(` 35`),i=n.stack.split(` 36`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=` 37`+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{ph=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ko(e):""}function zC(e){switch(e.tag){case 5:return ko(e.type);case 16:return ko("Lazy");case 13:return ko("Suspense");case 19:return ko("SuspenseList");case 0:case 2:case 15:return e=gh(e.type,!1),e;case 11:return e=gh(e.type.render,!1),e;case 1:return e=gh(e.type,!0),e;default:return""}}function jf(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 Ja:return"Fragment";case Ga:return"Portal";case yf:return"Profiler";case hp:return"StrictMode";case wf:return"Suspense";case bf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case mw:return(e.displayName||"Context")+".Consumer";case fw:return(e._context.displayName||"Context")+".Provider";case fp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mp:return t=e.displayName||null,t!==null?t:jf(e.type)||"Memo";case is:t=e._payload,e=e._init;try{return jf(e(t))}catch{}}return null}function UC(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 jf(t);case 8:return t===hp?"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 Ps(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function BC(e){var t=gw(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 a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.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 tc(e){e._valueTracker||(e._valueTracker=BC(e))}function vw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=gw(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function tu(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 _f(e,t){var r=t.checked;return tt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Tv(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ps(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 xw(e,t){t=t.checked,t!=null&&dp(e,"checked",t,!1)}function Nf(e,t){xw(e,t);var r=Ps(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")?Sf(e,t.type,r):t.hasOwnProperty("defaultValue")&&Sf(e,t.type,Ps(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rv(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 Sf(e,t,r){(t!=="number"||tu(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Co=Array.isArray;function oi(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Ps(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function kf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Z(91));return tt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Av(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Z(92));if(Co(r)){if(1<r.length)throw Error(Z(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Ps(r)}}function yw(e,t){var r=Ps(t.value),n=Ps(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 Pv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ww(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 Cf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ww(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var rc,bw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(rc=rc||document.createElement("div"),rc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=rc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Go(e,t){if(t){var r=e.firstChild;
vendor: 7,358 bytes, line 37
37if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Lo={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},VC=["Webkit","ms","Moz","O"];Object.keys(Lo).forEach(function(e){VC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Lo[t]=Lo[e]})});function jw(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Lo.hasOwnProperty(e)&&Lo[e]?(""+t).trim():t+"px"}function _w(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=jw(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var qC=tt({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 Ef(e,t){if(t){if(qC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Z(62))}}function Tf(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 Rf=null;function pp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Af=null,li=null,ci=null;function Ov(e){if(e=Il(e)){if(typeof Af!="function")throw Error(Z(280));var t=e.stateNode;t&&(t=sd(t),Af(e.stateNode,e.type,t))}}function Nw(e){li?ci?ci.push(e):ci=[e]:li=e}function Sw(){if(li){var e=li,t=ci;if(ci=li=null,Ov(e),t)for(e=0;e<t.length;e++)Ov(t[e])}}function kw(e,t){return e(t)}function Cw(){}var vh=!1;function Ew(e,t,r){if(vh)return e(t,r);vh=!0;try{return kw(e,t,r)}finally{vh=!1,(li!==null||ci!==null)&&(Cw(),Sw())}}function Jo(e,t){var r=e.stateNode;if(r===null)return null;var n=sd(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(Z(231,t,typeof r));return r}var Pf=!1;if(Fn)try{var po={};Object.defineProperty(po,"passive",{get:function(){Pf=!0}}),window.addEventListener("test",po,po),window.removeEventListener("test",po,po)}catch{Pf=!1}function HC(e,t,r,n,a,i,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var $o=!1,ru=null,nu=!1,Of=null,WC={onError:function(e){$o=!0,ru=e}};function KC(e,t,r,n,a,i,o,l,c){$o=!1,ru=null,HC.apply(WC,arguments)}function GC(e,t,r,n,a,i,o,l,c){if(KC.apply(this,arguments),$o){if($o){var u=ru;$o=!1,ru=null}else throw Error(Z(198));nu||(nu=!0,Of=u)}}function Ea(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 Tw(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 Iv(e){if(Ea(e)!==e)throw Error(Z(188))}function JC(e){var t=e.alternate;if(!t){if(t=Ea(e),t===null)throw Error(Z(188));return t!==e?null:e}for(var r=e,n=t;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return Iv(a),e;if(i===n)return Iv(a),t;i=i.sibling}throw Error(Z(188))}if(r.return!==n.return)r=a,n=i;else{for(var o=!1,l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o)throw Error(Z(189))}}if(r.alternate!==n)throw Error(Z(190))}if(r.tag!==3)throw Error(Z(188));return r.stateNode.current===r?e:t}function Rw(e){return e=JC(e),e!==null?Aw(e):null}function Aw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Aw(e);if(t!==null)return t;e=e.sibling}return null}var Pw=lr.unstable_scheduleCallback,Lv=lr.unstable_cancelCallback,QC=lr.unstable_shouldYield,ZC=lr.unstable_requestPaint,lt=lr.unstable_now,YC=lr.unstable_getCurrentPriorityLevel,gp=lr.unstable_ImmediatePriority,Ow=lr.unstable_UserBlockingPriority,su=lr.unstable_NormalPriority,XC=lr.unstable_LowPriority,Iw=lr.unstable_IdlePriority,ed=null,dn=null;function e2(e){if(dn&&typeof dn.onCommitFiberRoot=="function")try{dn.onCommitFiberRoot(ed,e,void 0,(e.current.flags&128)===128)}catch{}}var Wr=Math.clz32?Math.clz32:n2,t2=Math.log,r2=Math.LN2;function n2(e){return e>>>=0,e===0?32:31-(t2(e)/r2|0)|0}var nc=64,sc=4194304;function Eo(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 au(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~a;l!==0?n=Eo(l):(i&=o,i!==0&&(n=Eo(i)))}else o=r&~a,o!==0?n=Eo(o):i!==0&&(n=Eo(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&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-Wr(t),a=1<<r,n|=e[r],t&=~a;return n}function s2(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 a2(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Wr(i),l=1<<o,c=a[o];c===-1?(!(l&r)||l&n)&&(a[o]=s2(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function If(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Lw(){var e=nc;return nc<<=1,!(nc&4194240)&&(nc=64),e}function xh(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 2,662 bytes, line 37
37function Pl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Wr(t),e[t]=r}function i2(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 a=31-Wr(r),i=1<<a;t[a]=0,n[a]=-1,e[a]=-1,r&=~i}}function vp(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Wr(r),a=1<<n;a&t|e[n]&t&&(e[n]|=t),r&=~a}}var ze=0;function $w(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Dw,xp,Mw,Fw,zw,Lf=!1,ac=[],js=null,_s=null,Ns=null,Qo=new Map,Zo=new Map,us=[],o2="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 $v(e,t){switch(e){case"focusin":case"focusout":js=null;break;case"dragenter":case"dragleave":_s=null;break;case"mouseover":case"mouseout":Ns=null;break;case"pointerover":case"pointerout":Qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zo.delete(t.pointerId)}}function go(e,t,r,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Il(t),t!==null&&xp(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function l2(e,t,r,n,a){switch(t){case"focusin":return js=go(js,e,t,r,n,a),!0;case"dragenter":return _s=go(_s,e,t,r,n,a),!0;case"mouseover":return Ns=go(Ns,e,t,r,n,a),!0;case"pointerover":var i=a.pointerId;return Qo.set(i,go(Qo.get(i)||null,e,t,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,Zo.set(i,go(Zo.get(i)||null,e,t,r,n,a)),!0}return!1}function Uw(e){var t=ra(e.target);if(t!==null){var r=Ea(t);if(r!==null){if(t=r.tag,t===13){if(t=Tw(r),t!==null){e.blockedOn=t,zw(e.priority,function(){Mw(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 Mc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=$f(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Rf=n,r.target.dispatchEvent(n),Rf=null}else return t=Il(r),t!==null&&xp(t),e.blockedOn=r,!1;t.shift()}return!0}function Dv(e,t,r){Mc(e)&&r.delete(t)}function c2(){Lf=!1,js!==null&&Mc(js)&&(js=null),_s!==null&&Mc(_s)&&(_s=null),Ns!==null&&Mc(Ns)&&(Ns=null),Qo.forEach(Dv),Zo.forEac
vendor: 11,826 bytes, line 37
37h(Dv)}function vo(e,t){e.blockedOn===t&&(e.blockedOn=null,Lf||(Lf=!0,lr.unstable_scheduleCallback(lr.unstable_NormalPriority,c2)))}function Yo(e){function t(a){return vo(a,e)}if(0<ac.length){vo(ac[0],e);for(var r=1;r<ac.length;r++){var n=ac[r];n.blockedOn===e&&(n.blockedOn=null)}}for(js!==null&&vo(js,e),_s!==null&&vo(_s,e),Ns!==null&&vo(Ns,e),Qo.forEach(t),Zo.forEach(t),r=0;r<us.length;r++)n=us[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<us.length&&(r=us[0],r.blockedOn===null);)Uw(r),r.blockedOn===null&&us.shift()}var ui=Gn.ReactCurrentBatchConfig,iu=!0;function u2(e,t,r,n){var a=ze,i=ui.transition;ui.transition=null;try{ze=1,yp(e,t,r,n)}finally{ze=a,ui.transition=i}}function d2(e,t,r,n){var a=ze,i=ui.transition;ui.transition=null;try{ze=4,yp(e,t,r,n)}finally{ze=a,ui.transition=i}}function yp(e,t,r,n){if(iu){var a=$f(e,t,r,n);if(a===null)Eh(e,t,n,ou,r),$v(e,n);else if(l2(a,e,t,r,n))n.stopPropagation();else if($v(e,n),t&4&&-1<o2.indexOf(e)){for(;a!==null;){var i=Il(a);if(i!==null&&Dw(i),i=$f(e,t,r,n),i===null&&Eh(e,t,n,ou,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else Eh(e,t,n,null,r)}}var ou=null;function $f(e,t,r,n){if(ou=null,e=pp(n),e=ra(e),e!==null)if(t=Ea(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Tw(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 ou=e,null}function Bw(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(YC()){case gp:return 1;case Ow:return 4;case su:case XC:return 16;case Iw:return 536870912;default:return 16}default:return 16}}var ys=null,wp=null,Fc=null;function Vw(){if(Fc)return Fc;var e,t=wp,r=t.length,n,a="value"in ys?ys.value:ys.textContent,i=a.length;for(e=0;e<r&&t[e]===a[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===a[i-n];n++);return Fc=a.slice(e,1<n?1-n:void 0)}function zc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ic(){return!0}function Mv(){return!1}function fr(e){function t(r,n,a,i,o){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ic:Mv,this.isPropagationStopped=Mv,this}return tt(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=ic)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ic)},persist:function(){},isPersistent:ic}),t}var Qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bp=fr(Qi),Ol=tt({},Qi,{view:0,detail:0}),h2=fr(Ol),yh,wh,xo,td=tt({},Ol,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jp,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"?(yh=e.screenX-xo.screenX,wh=e.screenY-xo.screenY):wh=yh=0,xo=e),yh)},movementY:function(e){return"movementY"in e?e.movementY:wh}}),Fv=fr(td),f2=tt({},td,{dataTransfer:0}),m2=fr(f2),p2=tt({},Ol,{relatedTarget:0}),bh=fr(p2),g2=tt({},Qi,{animationName:0,elapsedTime:0,pseudoElement:0}),v2=fr(g2),x2=tt({},Qi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),y2=fr(x2),w2=tt({},Qi,{data:0}),zv=fr(w2),b2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j2={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"},_2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function N2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_2[e])?!!t[e]:!1}function jp(){return N2}var S2=tt({},Ol,{key:function(e){if(e.key){var t=b2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?j2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jp,charCode:function(e){return e.type==="keypress"?zc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),k2=fr(S2),C2=tt({},td,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uv=fr(C2),E2=tt({},Ol,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jp}),T2=fr(E2),R2=tt({},Qi,{propertyName:0,elapsedTime:0,pseudoElement:0}),A2=fr(R2),P2=tt({},td,{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}),O2=fr(P2),I2=[9,13,27,32],_p=Fn&&"CompositionEvent"in window,Do=null;Fn&&"documentMode"in document&&(Do=document.documentMode);var L2=Fn&&"TextEvent"in window&&!Do,qw=Fn&&(!_p||Do&&8<Do&&11>=Do),Bv=" ",Vv=!1;function Hw(e,t){switch(e){case"keyup":return I2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ww(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qa=!1;function $2(e,t){switch(e){case"compositionend":return Ww(t);case"keypress":return t.which!==32?null:(Vv=!0,Bv);case"textInput":return e=t.data,e===Bv&&Vv?null:e;default:return null}}function D2(e,t){if(Qa)return e==="compositionend"||!_p&&Hw(e,t)?(e=Vw(),Fc=wp=ys=null,Qa=!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 qw&&t.locale!=="ko"?null:t.data;default:return null}}var M2={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 qv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!M2[e.type]:t==="textarea"}function Kw(e,t,r,n){Nw(n),t=lu(t,"onChange"),0<t.length&&(r=new bp("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Mo=null,Xo=null;function F2(e){sb(e,0)}function rd(e){var t=Xa(e);if(vw(t))return e}function z2(e,t){if(e==="change")return t}var Gw=!1;if(Fn){var jh;if(Fn){var _h="oninput"in document;if(!_h){var Hv=document.createElement("div");Hv.setAttribute("oninput","return;"),_h=typeof Hv.oninput=="function"}jh=_h}else jh=!1;Gw=jh&&(!document.documentMode||9<document.documentMode)}function Wv(){Mo&&(Mo.detachEvent("onpropertychange",Jw),Xo=Mo=null)}function Jw(e){if(e.propertyName==="value"&&rd(Xo)){var t=[];Kw(t,Xo,e,pp(e)),Ew(F2,t)}}function U2(e,t,r){e==="focusin"?(Wv(),Mo=t,Xo=r,Mo.attachEvent("onpropertychange",Jw)):e==="focusout"&&Wv()}function B2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return rd(Xo)}function V2(e,t){if(e==="click")return rd(t)}function q2(e,t){if(e==="input"||e==="change")return rd(t)}function H2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jr=typeof Object.is=="function"?Object.is:H2;function el(e,t){if(Jr(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 a=r[n];if(!xf.call(t,a)||!Jr(e[a],t[a]))return!1}return!0}function Kv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gv(e,t){var r=Kv(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=Kv(r)}}function Qw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zw(){for(var e=window,t=tu();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=tu(e.document)}return t}function Np(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 W2(e){var t=Zw(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Qw(r.ownerDocument.documentElement,r)){if(n!==null&&Np(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 a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=Gv(r,i);var o=Gv(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>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 K2=Fn&&"documentMode"in document&&11>=document.documentMode,Za=null,Df=null,Fo=null,Mf=!1;function Jv(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Mf||Za==null||Za!==tu(n)||(n=Za,"selectionStart"in n&&Np(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,383 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),Fo&&el(Fo,n)||(Fo=n,n=lu(Df,"onSelect"),0<n.length&&(t=new bp("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Za)))}function oc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ya={animationend:oc("Animation","AnimationEnd"),animationiteration:oc("Animation","AnimationIteration"),animationstart:oc("Animation","AnimationStart"),transitionend:oc("Transition","TransitionEnd")},Nh={},Yw={};Fn&&(Yw=document.createElement("div").style,"AnimationEvent"in window||(delete Ya.animationend.animation,delete Ya.animationiteration.animation,delete Ya.animationstart.animation),"TransitionEvent"in window||delete Ya.transitionend.transition);function nd(e){if(Nh[e])return Nh[e];if(!Ya[e])return e;var t=Ya[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Yw)return Nh[e]=t[r];return e}var Xw=nd("animationend"),eb=nd("animationiteration"),tb=nd("animationstart"),rb=nd("transitionend"),nb=new Map,Qv="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 Us(e,t){nb.set(e,t),Ca(t,[e])}for(var Sh=0;Sh<Qv.length;Sh++){var kh=Qv[Sh],G2=kh.toLowerCase(),J2=kh[0].toUpperCase()+kh.slice(1);Us(G2,"on"+J2)}Us(Xw,"onAnimationEnd");Us(eb,"onAnimationIteration");Us(tb,"onAnimationStart");Us("dblclick","onDoubleClick");Us("focusin","onFocus");Us("focusout","onBlur");Us(rb,"onTransitionEnd");Ri("onMouseEnter",["mouseout","mouseover"]);Ri("onMouseLeave",["mouseout","mouseover"]);Ri("onPointerEnter",["pointerout","pointerover"]);Ri("onPointerLeave",["pointerout","pointerover"]);Ca("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ca("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ca("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ca("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ca("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ca("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var To="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(" "),Q2=new Set("cancel close invalid load scroll toggle".split(" ").concat(To));function Zv(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,GC(n,t,void 0,e),e.currentTarget=null}function sb(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],a=n.event;n=n.listeners;e:{var i=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!==i&&a.isPropagationStopped())break e;Zv(a,l,u),i=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;Zv(a,l,u),i=c}}}if(nu)throw e=Of,nu=!1,Of=null,e}function We(e,t){var r=t[Vf];r===void 0&&(r=t[Vf]=new Set);var n=e+"__bubble";r.has(n)||(ab(t,e,2,!1),r.add(n))}function Ch(e,t,r){var n=0;t&&(n|=4),ab(r,e,n,t)}var lc="_reactListening"+Math.random().toString(36).slice(2);function tl(e){if(!e[lc]){e[lc]=!0,hw.forEach(function(r){r!=="selectionchange"&&(Q2.has(r)||Ch(r,!1,e),Ch(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lc]||(t[lc]=!0,Ch("selectionchange",!1,t))}}function ab(e,t,r,n){switch(Bw(t)){case 1:var a=u2;break;case 4:a=d2;break;default:a=yp}r=a.bind(null,t,r,e),a=void 0,!Pf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function Eh(e,t,r,n,a){var i=n;
vendor: 5,521 bytes, lines 37-38
37if(!(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;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=ra(l),o===null)return;if(c=o.tag,c===5||c===6){n=i=o;continue e}l=l.parentNode}}n=n.return}Ew(function(){var u=i,d=pp(r),f=[];e:{var m=nb.get(e);if(m!==void 0){var p=bp,b=e;switch(e){case"keypress":if(zc(r)===0)break e;case"keydown":case"keyup":p=k2;break;case"focusin":b="focus",p=bh;break;case"focusout":b="blur",p=bh;break;case"beforeblur":case"afterblur":p=bh;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":p=Fv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=m2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=T2;break;case Xw:case eb:case tb:p=v2;break;case rb:p=A2;break;case"scroll":p=h2;break;case"wheel":p=O2;break;case"copy":case"cut":case"paste":p=y2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Uv}var v=(t&4)!==0,x=!v&&e==="scroll",w=v?m!==null?m+"Capture":null:m;v=[];for(var g=u,y;g!==null;){y=g;var j=y.stateNode;if(y.tag===5&&j!==null&&(y=j,w!==null&&(j=Jo(g,w),j!=null&&v.push(rl(g,j,y)))),x)break;g=g.return}0<v.length&&(m=new p(m,b,null,r,d),f.push({event:m,listeners:v}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",m&&r!==Rf&&(b=r.relatedTarget||r.fromElement)&&(ra(b)||b[zn]))break e;if((p||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,p?(b=r.relatedTarget||r.toElement,p=u,b=b?ra(b):null,b!==null&&(x=Ea(b),b!==x||b.tag!==5&&b.tag!==6)&&(b=null)):(p=null,b=u),p!==b)){if(v=Fv,j="onMouseLeave",w="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=Uv,j="onPointerLeave",w="onPointerEnter",g="pointer"),x=p==null?m:Xa(p),y=b==null?m:Xa(b),m=new v(j,g+"leave",p,r,d),m.target=x,m.relatedTarget=y,j=null,ra(d)===u&&(v=new v(w,g+"enter",b,r,d),v.target=y,v.relatedTarget=x,j=v),x=j,p&&b)t:{for(v=p,w=b,g=0,y=v;y;y=$a(y))g++;for(y=0,j=w;j;j=$a(j))y++;for(;0<g-y;)v=$a(v),g--;for(;0<y-g;)w=$a(w),y--;for(;g--;){if(v===w||w!==null&&v===w.alternate)break t;v=$a(v),w=$a(w)}v=null}else v=null;p!==null&&Yv(f,m,p,v,!1),b!==null&&x!==null&&Yv(f,x,b,v,!0)}}e:{if(m=u?Xa(u):window,p=m.nodeName&&m.nodeName.toLowerCase(),p==="select"||p==="input"&&m.type==="file")var _=z2;else if(qv(m))if(Gw)_=q2;else{_=B2;var S=U2}else(p=m.nodeName)&&p.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(_=V2);if(_&&(_=_(e,u))){Kw(f,_,r,d);break e}S&&S(e,m,u),e==="focusout"&&(S=m._wrapperState)&&S.controlled&&m.type==="number"&&Sf(m,"number",m.value)}switch(S=u?Xa(u):window,e){case"focusin":(qv(S)||S.contentEditable==="true")&&(Za=S,Df=u,Fo=null);break;case"focusout":Fo=Df=Za=null;break;case"mousedown":Mf=!0;break;case"contextmenu":case"mouseup":case"dragend":Mf=!1,Jv(f,r,d);break;case"selectionchange":if(K2)break;case"keydown":case"keyup":Jv(f,r,d)}var N;if(_p)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Qa?Hw(e,r)&&(E="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(E="onCompositionStart");E&&(qw&&r.locale!=="ko"&&(Qa||E!=="onCompositionStart"?E==="onCompositionEnd"&&Qa&&(N=Vw()):(ys=d,wp="value"in ys?ys.value:ys.textContent,Qa=!0)),S=lu(u,E),0<S.length&&(E=new zv(E,e,null,r,d),f.push({event:E,listeners:S}),N?E.data=N:(N=Ww(r),N!==null&&(E.data=N)))),(N=L2?$2(e,r):D2(e,r))&&(u=lu(u,"onBeforeInput"),0<u.length&&(d=new zv("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:u}),d.data=N))}sb(f,t)})}function rl(e,t,r){return{instance:e,listener:t,currentTarget:r}}function lu(e,t){for(var r=t+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=Jo(e,r),i!=null&&n.unshift(rl(e,i,a)),i=Jo(e,t),i!=null&&n.push(rl(e,i,a))),e=e.return}return n}function $a(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Yv(e,t,r,n,a){for(var i=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,a?(c=Jo(r,i),c!=null&&o.unshift(rl(r,c,l))):a||(c=Jo(r,i),c!=null&&o.push(rl(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var Z2=/\r\n?/g,Y2=/\u0000|\uFFFD/g;function Xv(e){return(typeof e=="string"?e:""+e).replace(Z2,` 38`).replace(Y2,"")}function cc(e,t,r){if(t=Xv(t),Xv(e)!==t&&r)throw Error(Z(425))}function cu(){}var Ff=null,zf=null;function Uf(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 Bf=typeof setTimeout=="function"?setTimeout:void 0,X2=typeof clearTimeout=="function"?clearTimeout:void 0,ex=typeof Promise=="function"?Promise:void 0,eE=typeof queueMicrotask=="function"?queueMicrotask:typeof ex<"u"?function(e){return ex.resolve(null).then(e).catch(tE)}:Bf;function tE(e){setTimeout(function(){throw e})}function Th(e,t){var r=t,n=0;
vendor: 4,827 bytes, line 38
38do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){e.removeChild(a),Yo(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);Yo(t)}function Ss(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 tx(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 Zi=Math.random().toString(36).slice(2),cn="__reactFiber$"+Zi,nl="__reactProps$"+Zi,zn="__reactContainer$"+Zi,Vf="__reactEvents$"+Zi,rE="__reactListeners$"+Zi,nE="__reactHandles$"+Zi;function ra(e){var t=e[cn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[zn]||r[cn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=tx(e);e!==null;){if(r=e[cn])return r;e=tx(e)}return t}e=r,r=e.parentNode}return null}function Il(e){return e=e[cn]||e[zn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xa(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Z(33))}function sd(e){return e[nl]||null}var qf=[],ei=-1;function Bs(e){return{current:e}}function Ge(e){0>ei||(e.current=qf[ei],qf[ei]=null,ei--)}function qe(e,t){ei++,qf[ei]=e.current,e.current=t}var Os={},zt=Bs(Os),Zt=Bs(!1),ma=Os;function Ai(e,t){var r=e.type.contextTypes;if(!r)return Os;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Yt(e){return e=e.childContextTypes,e!=null}function uu(){Ge(Zt),Ge(zt)}function rx(e,t,r){if(zt.current!==Os)throw Error(Z(168));qe(zt,t),qe(Zt,r)}function ib(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(Z(108,UC(e)||"Unknown",a));return tt({},r,n)}function du(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Os,ma=zt.current,qe(zt,e),qe(Zt,Zt.current),!0}function nx(e,t,r){var n=e.stateNode;if(!n)throw Error(Z(169));r?(e=ib(e,t,ma),n.__reactInternalMemoizedMergedChildContext=e,Ge(Zt),Ge(zt),qe(zt,e)):Ge(Zt),qe(Zt,r)}var Pn=null,ad=!1,Rh=!1;function ob(e){Pn===null?Pn=[e]:Pn.push(e)}function sE(e){ad=!0,ob(e)}function Vs(){if(!Rh&&Pn!==null){Rh=!0;var e=0,t=ze;try{var r=Pn;for(ze=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Pn=null,ad=!1}catch(a){throw Pn!==null&&(Pn=Pn.slice(e+1)),Pw(gp,Vs),a}finally{ze=t,Rh=!1}}return null}var ti=[],ri=0,hu=null,fu=0,yr=[],wr=0,pa=null,In=1,Ln="";function Xs(e,t){ti[ri++]=fu,ti[ri++]=hu,hu=e,fu=t}function lb(e,t,r){yr[wr++]=In,yr[wr++]=Ln,yr[wr++]=pa,pa=e;var n=In;e=Ln;var a=32-Wr(n)-1;n&=~(1<<a),r+=1;var i=32-Wr(t)+a;if(30<i){var o=a-a%5;i=(n&(1<<o)-1).toString(32),n>>=o,a-=o,In=1<<32-Wr(t)+a|r<<a|n,Ln=i+e}else In=1<<i|r<<a|n,Ln=e}function Sp(e){e.return!==null&&(Xs(e,1),lb(e,1,0))}function kp(e){for(;e===hu;)hu=ti[--ri],ti[ri]=null,fu=ti[--ri],ti[ri]=null;for(;e===pa;)pa=yr[--wr],yr[wr]=null,Ln=yr[--wr],yr[wr]=null,In=yr[--wr],yr[wr]=null}var ir=null,sr=null,Ze=!1,Vr=null;function cb(e,t){var r=br(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 sx(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,ir=e,sr=Ss(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ir=e,sr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=pa!==null?{id:In,overflow:Ln}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=br(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,ir=e,sr=null,!0):!1;default:return!1}}function Hf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Wf(e){if(Ze){var t=sr;if(t){var r=t;if(!sx(e,t)){if(Hf(e))throw Error(Z(418));t=Ss(r.nextSibling);var n=ir;t&&sx(e,t)?cb(n,r):(e.flags=e.flags&-4097|2,Ze=!1,ir=e)}}else{if(Hf(e))throw Error(Z(418));e.flags=e.flags&-4097|2,Ze=!1,ir=e}}}function ax(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ir=e}function uc(e){if(e!==ir)return!1;if(!Ze)return ax(e),Ze=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Uf(e.type,e.memoizedProps)),t&&(t=sr)){if(Hf(e))throw ub(),Error(Z(418));for(;t;)cb(e,t),t=Ss(t.nextSibling)}if(ax(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){sr=Ss(e.nextSibling);break e}t--}
vendor: 12,387 bytes, line 38
38else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}sr=null}}else sr=ir?Ss(e.stateNode.nextSibling):null;return!0}function ub(){for(var e=sr;e;)e=Ss(e.nextSibling)}function Pi(){sr=ir=null,Ze=!1}function Cp(e){Vr===null?Vr=[e]:Vr.push(e)}var aE=Gn.ReactCurrentBatchConfig;function yo(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(Z(309));var n=r.stateNode}if(!n)throw Error(Z(147,e));var a=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(Z(284));if(!r._owner)throw Error(Z(290,e))}return e}function dc(e,t){throw e=Object.prototype.toString.call(t),Error(Z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ix(e){var t=e._init;return t(e._payload)}function db(e){function t(w,g){if(e){var y=w.deletions;y===null?(w.deletions=[g],w.flags|=16):y.push(g)}}function r(w,g){if(!e)return null;for(;g!==null;)t(w,g),g=g.sibling;return null}function n(w,g){for(w=new Map;g!==null;)g.key!==null?w.set(g.key,g):w.set(g.index,g),g=g.sibling;return w}function a(w,g){return w=Ts(w,g),w.index=0,w.sibling=null,w}function i(w,g,y){return w.index=y,e?(y=w.alternate,y!==null?(y=y.index,y<g?(w.flags|=2,g):y):(w.flags|=2,g)):(w.flags|=1048576,g)}function o(w){return e&&w.alternate===null&&(w.flags|=2),w}function l(w,g,y,j){return g===null||g.tag!==6?(g=Dh(y,w.mode,j),g.return=w,g):(g=a(g,y),g.return=w,g)}function c(w,g,y,j){var _=y.type;return _===Ja?d(w,g,y.props.children,j,y.key):g!==null&&(g.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===is&&ix(_)===g.type)?(j=a(g,y.props),j.ref=yo(w,g,y),j.return=w,j):(j=Kc(y.type,y.key,y.props,null,w.mode,j),j.ref=yo(w,g,y),j.return=w,j)}function u(w,g,y,j){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Mh(y,w.mode,j),g.return=w,g):(g=a(g,y.children||[]),g.return=w,g)}function d(w,g,y,j,_){return g===null||g.tag!==7?(g=fa(y,w.mode,j,_),g.return=w,g):(g=a(g,y),g.return=w,g)}function f(w,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Dh(""+g,w.mode,y),g.return=w,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ec:return y=Kc(g.type,g.key,g.props,null,w.mode,y),y.ref=yo(w,null,g),y.return=w,y;case Ga:return g=Mh(g,w.mode,y),g.return=w,g;case is:var j=g._init;return f(w,j(g._payload),y)}if(Co(g)||mo(g))return g=fa(g,w.mode,y,null),g.return=w,g;dc(w,g)}return null}function m(w,g,y,j){var _=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return _!==null?null:l(w,g,""+y,j);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ec:return y.key===_?c(w,g,y,j):null;case Ga:return y.key===_?u(w,g,y,j):null;case is:return _=y._init,m(w,g,_(y._payload),j)}if(Co(y)||mo(y))return _!==null?null:d(w,g,y,j,null);dc(w,y)}return null}function p(w,g,y,j,_){if(typeof j=="string"&&j!==""||typeof j=="number")return w=w.get(y)||null,l(g,w,""+j,_);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case ec:return w=w.get(j.key===null?y:j.key)||null,c(g,w,j,_);case Ga:return w=w.get(j.key===null?y:j.key)||null,u(g,w,j,_);case is:var S=j._init;return p(w,g,y,S(j._payload),_)}if(Co(j)||mo(j))return w=w.get(y)||null,d(g,w,j,_,null);dc(g,j)}return null}function b(w,g,y,j){for(var _=null,S=null,N=g,E=g=0,R=null;N!==null&&E<y.length;E++){N.index>E?(R=N,N=null):R=N.sibling;var I=m(w,N,y[E],j);if(I===null){N===null&&(N=R);break}e&&N&&I.alternate===null&&t(w,N),g=i(I,g,E),S===null?_=I:S.sibling=I,S=I,N=R}if(E===y.length)return r(w,N),Ze&&Xs(w,E),_;if(N===null){for(;E<y.length;E++)N=f(w,y[E],j),N!==null&&(g=i(N,g,E),S===null?_=N:S.sibling=N,S=N);return Ze&&Xs(w,E),_}for(N=n(w,N);E<y.length;E++)R=p(N,w,E,y[E],j),R!==null&&(e&&R.alternate!==null&&N.delete(R.key===null?E:R.key),g=i(R,g,E),S===null?_=R:S.sibling=R,S=R);return e&&N.forEach(function(A){return t(w,A)}),Ze&&Xs(w,E),_}function v(w,g,y,j){var _=mo(y);if(typeof _!="function")throw Error(Z(150));if(y=_.call(y),y==null)throw Error(Z(151));for(var S=_=null,N=g,E=g=0,R=null,I=y.next();N!==null&&!I.done;E++,I=y.next()){N.index>E?(R=N,N=null):R=N.sibling;var A=m(w,N,I.value,j);if(A===null){N===null&&(N=R);break}e&&N&&A.alternate===null&&t(w,N),g=i(A,g,E),S===null?_=A:S.sibling=A,S=A,N=R}if(I.done)return r(w,N),Ze&&Xs(w,E),_;if(N===null){for(;!I.done;E++,I=y.next())I=f(w,I.value,j),I!==null&&(g=i(I,g,E),S===null?_=I:S.sibling=I,S=I);return Ze&&Xs(w,E),_}for(N=n(w,N);!I.done;E++,I=y.next())I=p(N,w,E,I.value,j),I!==null&&(e&&I.alternate!==null&&N.delete(I.key===null?E:I.key),g=i(I,g,E),S===null?_=I:S.sibling=I,S=I);return e&&N.forEach(function(C){return t(w,C)}),Ze&&Xs(w,E),_}function x(w,g,y,j){if(typeof y=="object"&&y!==null&&y.type===Ja&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ec:e:{for(var _=y.key,S=g;S!==null;){if(S.key===_){if(_=y.type,_===Ja){if(S.tag===7){r(w,S.sibling),g=a(S,y.props.children),g.return=w,w=g;break e}}else if(S.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===is&&ix(_)===S.type){r(w,S.sibling),g=a(S,y.props),g.ref=yo(w,S,y),g.return=w,w=g;break e}r(w,S);break}else t(w,S);S=S.sibling}y.type===Ja?(g=fa(y.props.children,w.mode,j,y.key),g.return=w,w=g):(j=Kc(y.type,y.key,y.props,null,w.mode,j),j.ref=yo(w,g,y),j.return=w,w=j)}return o(w);case Ga:e:{for(S=y.key;g!==null;){if(g.key===S)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){r(w,g.sibling),g=a(g,y.children||[]),g.return=w,w=g;break e}else{r(w,g);break}else t(w,g);g=g.sibling}g=Mh(y,w.mode,j),g.return=w,w=g}return o(w);case is:return S=y._init,x(w,g,S(y._payload),j)}if(Co(y))return b(w,g,y,j);if(mo(y))return v(w,g,y,j);dc(w,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(r(w,g.sibling),g=a(g,y),g.return=w,w=g):(r(w,g),g=Dh(y,w.mode,j),g.return=w,w=g),o(w)):r(w,g)}return x}var Oi=db(!0),hb=db(!1),mu=Bs(null),pu=null,ni=null,Ep=null;function Tp(){Ep=ni=pu=null}function Rp(e){var t=mu.current;Ge(mu),e._currentValue=t}function Kf(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 di(e,t){pu=e,Ep=ni=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qt=!0),e.firstContext=null)}function Nr(e){var t=e._currentValue;if(Ep!==e)if(e={context:e,memoizedValue:t,next:null},ni===null){if(pu===null)throw Error(Z(308));ni=e,pu.dependencies={lanes:0,firstContext:e}}else ni=ni.next=e;return t}var na=null;function Ap(e){na===null?na=[e]:na.push(e)}function fb(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,Ap(t)):(r.next=a.next,a.next=r),t.interleaved=r,Un(e,n)}function Un(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 os=!1;function Pp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mb(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 Dn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ks(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Oe&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Un(e,r)}return a=n.interleaved,a===null?(t.next=t,Ap(n)):(t.next=a.next,a.next=t),n.interleaved=t,Un(e,r)}function Uc(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,vp(e,r)}}function ox(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=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};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,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 gu(e,t,r,n){var a=e.updateQueue;os=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=a.baseState;o=0,d=u=c=null,l=i;do{var m=l.lane,p=l.eventTime;if((n&m)===m){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var b=e,v=l;switch(m=t,p=r,v.tag){case 1:if(b=v.payload,typeof b=="function"){f=b.call(p,f,m);break e}f=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=v.payload,m=typeof b=="function"?b.call(p,f,m):b,m==null)break e;f=tt({},f,m);break e;case 2:os=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=a.effects,m===null?a.effects=[l]:m.push(l))}else p={eventTime:p,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,o|=m;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;m=l,l=m.next,m.next=null,a.lastBaseUpdate=m,a.shared.pending=null}}while(!0);if(d===null&&(c=f),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);va|=o,e.lanes=o,e.memoizedState=f}}function lx(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(Z(191,a));a.call(n)}}}var Ll={},hn=Bs(Ll),sl=Bs(Ll),al=Bs(Ll);function sa(e){if(e===Ll)throw Error(Z(174));return e}function Op(e,t){switch(qe(al,t),qe(sl,e),qe(hn,Ll),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Cf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Cf(t,e)}Ge(hn),qe(hn,t)}function Ii(){Ge(hn),Ge(sl),Ge(al)}function pb(e){sa(al.current);var t=sa(hn.current),r=Cf(t,e.type);t!==r&&(qe(sl,e),qe(hn,r))}function Ip(e){sl.current===e&&(Ge(hn),Ge(sl))}var Ye=Bs(0);function vu(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 Ah=[];function Lp(){for(var e=0;e<Ah.length;e++)Ah[e]._workInProgressVersionPrimary=null;Ah.length=0}var Bc=Gn.ReactCurrentDispatcher,Ph=Gn.ReactCurrentBatchConfig,ga=0,Xe=null,yt=null,St=null,xu=!1,zo=!1,il=0,iE=0;function Ot(){throw Error(Z(321))}function $p(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Jr(e[r],t[r]))return!1;return!0}function Dp(e,t,r,n,a,i){if(ga=i,Xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bc.current=e===null||e.memoizedState===null?uE:dE,e=r(n,a),zo){i=0;do{if(zo=!1,il=0,25<=i)throw Error(Z(301));i+=1,St=yt=null,t.updateQueue=null,Bc.current=hE,e=r(n,a)}while(zo)}if(Bc.current=yu,t=yt!==null&&yt.next!==null,ga=0,St=yt=Xe=null,xu=!1,t)throw Error(Z(300));return e}function Mp(){var e=il!==0;return il=0,e}function rn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?Xe.memoizedState=St=e:St=St.next=e,St}function Sr(){if(yt===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=yt.next;var t=St===null?Xe.memoizedState:St.next;if(t!==null)St=t,yt=e;else{if(e===null)throw Error(Z(310));yt=e,e={memoizedState:yt.memoizedState,baseState:yt.baseState,baseQueue:yt.baseQueue,queue:yt.queue,next:null},St===null?Xe.memoizedState=St=e:St=St.next=e}return St}function ol(e,t){return typeof t=="function"?t(e):t}function Oh(e){var t=Sr(),r=t.queue;if(r===null)throw Error(Z(311));r.lastRenderedReducer=e;
vendor: 5,688 bytes, line 38
38var n=yt,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var l=o=null,c=null,u=i;do{var d=u.lane;if((ga&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 f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,o=n):c=c.next=f,Xe.lanes|=d,va|=d}u=u.next}while(u!==null&&u!==i);c===null?o=n:c.next=l,Jr(n,t.memoizedState)||(Qt=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){a=e;do i=a.lane,Xe.lanes|=i,va|=i,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ih(e){var t=Sr(),r=t.queue;if(r===null)throw Error(Z(311));r.lastRenderedReducer=e;var n=r.dispatch,a=r.pending,i=t.memoizedState;if(a!==null){r.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);Jr(i,t.memoizedState)||(Qt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function gb(){}function vb(e,t){var r=Xe,n=Sr(),a=t(),i=!Jr(n.memoizedState,a);if(i&&(n.memoizedState=a,Qt=!0),n=n.queue,Fp(wb.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||St!==null&&St.memoizedState.tag&1){if(r.flags|=2048,ll(9,yb.bind(null,r,n,a,t),void 0,null),kt===null)throw Error(Z(349));ga&30||xb(r,t,a)}return a}function xb(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Xe.updateQueue,t===null?(t={lastEffect:null,stores:null},Xe.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function yb(e,t,r,n){t.value=r,t.getSnapshot=n,bb(t)&&jb(e)}function wb(e,t,r){return r(function(){bb(t)&&jb(e)})}function bb(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Jr(e,r)}catch{return!0}}function jb(e){var t=Un(e,1);t!==null&&Kr(t,e,1,-1)}function cx(e){var t=rn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:e},t.queue=e,e=e.dispatch=cE.bind(null,Xe,e),[t.memoizedState,e]}function ll(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Xe.updateQueue,t===null?(t={lastEffect:null,stores:null},Xe.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 _b(){return Sr().memoizedState}function Vc(e,t,r,n){var a=rn();Xe.flags|=e,a.memoizedState=ll(1|t,r,void 0,n===void 0?null:n)}function id(e,t,r,n){var a=Sr();n=n===void 0?null:n;var i=void 0;if(yt!==null){var o=yt.memoizedState;if(i=o.destroy,n!==null&&$p(n,o.deps)){a.memoizedState=ll(t,r,i,n);return}}Xe.flags|=e,a.memoizedState=ll(1|t,r,i,n)}function ux(e,t){return Vc(8390656,8,e,t)}function Fp(e,t){return id(2048,8,e,t)}function Nb(e,t){return id(4,2,e,t)}function Sb(e,t){return id(4,4,e,t)}function kb(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 Cb(e,t,r){return r=r!=null?r.concat([e]):null,id(4,4,kb.bind(null,t,e),r)}function zp(){}function Eb(e,t){var r=Sr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&$p(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Tb(e,t){var r=Sr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&$p(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Rb(e,t,r){return ga&21?(Jr(r,t)||(r=Lw(),Xe.lanes|=r,va|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Qt=!0),e.memoizedState=r)}function oE(e,t){var r=ze;ze=r!==0&&4>r?r:4,e(!0);var n=Ph.transition;Ph.transition={};try{e(!1),t()}finally{ze=r,Ph.transition=n}}function Ab(){return Sr().memoizedState}function lE(e,t,r){var n=Es(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Pb(e))Ob(t,r);else if(r=fb(e,t,r,n),r!==null){var a=qt();Kr(r,e,n,a),Ib(r,t,n)}}function cE(e,t,r){var n=Es(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Pb(e))Ob(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,r);if(a.hasEagerState=!0,a.eagerState=l,Jr(l,o)){var c=t.interleaved;c===null?(a.next=a,Ap(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=fb(e,t,a,n),r!==null&&(a=qt(),Kr(r,e,n,a),Ib(r,t,n))}}function Pb(e){var t=e.alternate;return e===Xe||t!==null&&t===Xe}function Ob(e,t){zo=xu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Ib(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,vp(e,r)}}var yu={readContext:Nr,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useInsertionEffect:Ot,useLayoutEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useMutableSource:Ot,useSyncExternalStore:Ot,useId:Ot,unstable_isNewReconciler:!1},uE={readContext:Nr,useCallback:function(e,t){return rn().memoizedState=[e,t===void 0?null:t],e},useContext:Nr,useEffect:ux,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Vc(4194308,4,kb.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Vc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vc(4,2,e,t)},useMemo:function(e,t){var r=rn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=rn();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=lE.bind(null,Xe,e),[n.memoizedState,e]}
vendor: 7,431 bytes, lines 38-40
38,useRef:function(e){var t=rn();return e={current:e},t.memoizedState=e},useState:cx,useDebugValue:zp,useDeferredValue:function(e){return rn().memoizedState=e},useTransition:function(){var e=cx(!1),t=e[0];return e=oE.bind(null,e[1]),rn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Xe,a=rn();if(Ze){if(r===void 0)throw Error(Z(407));r=r()}else{if(r=t(),kt===null)throw Error(Z(349));ga&30||xb(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,ux(wb.bind(null,n,i,e),[e]),n.flags|=2048,ll(9,yb.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=rn(),t=kt.identifierPrefix;if(Ze){var r=Ln,n=In;r=(n&~(1<<32-Wr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=il++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=iE++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},dE={readContext:Nr,useCallback:Eb,useContext:Nr,useEffect:Fp,useImperativeHandle:Cb,useInsertionEffect:Nb,useLayoutEffect:Sb,useMemo:Tb,useReducer:Oh,useRef:_b,useState:function(){return Oh(ol)},useDebugValue:zp,useDeferredValue:function(e){var t=Sr();return Rb(t,yt.memoizedState,e)},useTransition:function(){var e=Oh(ol)[0],t=Sr().memoizedState;return[e,t]},useMutableSource:gb,useSyncExternalStore:vb,useId:Ab,unstable_isNewReconciler:!1},hE={readContext:Nr,useCallback:Eb,useContext:Nr,useEffect:Fp,useImperativeHandle:Cb,useInsertionEffect:Nb,useLayoutEffect:Sb,useMemo:Tb,useReducer:Ih,useRef:_b,useState:function(){return Ih(ol)},useDebugValue:zp,useDeferredValue:function(e){var t=Sr();return yt===null?t.memoizedState=e:Rb(t,yt.memoizedState,e)},useTransition:function(){var e=Ih(ol)[0],t=Sr().memoizedState;return[e,t]},useMutableSource:gb,useSyncExternalStore:vb,useId:Ab,unstable_isNewReconciler:!1};function Dr(e,t){if(e&&e.defaultProps){t=tt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Gf(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:tt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var od={isMounted:function(e){return(e=e._reactInternals)?Ea(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=qt(),a=Es(e),i=Dn(n,a);i.payload=t,r!=null&&(i.callback=r),t=ks(e,i,a),t!==null&&(Kr(t,e,a,n),Uc(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=qt(),a=Es(e),i=Dn(n,a);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=ks(e,i,a),t!==null&&(Kr(t,e,a,n),Uc(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=qt(),n=Es(e),a=Dn(r,n);a.tag=2,t!=null&&(a.callback=t),t=ks(e,a,n),t!==null&&(Kr(t,e,n,r),Uc(t,e,n))}};function dx(e,t,r,n,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,o):t.prototype&&t.prototype.isPureReactComponent?!el(r,n)||!el(a,i):!0}function Lb(e,t,r){var n=!1,a=Os,i=t.contextType;return typeof i=="object"&&i!==null?i=Nr(i):(a=Yt(t)?ma:zt.current,n=t.contextTypes,i=(n=n!=null)?Ai(e,a):Os),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=od,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function hx(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&&od.enqueueReplaceState(t,t.state,null)}function Jf(e,t,r,n){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},Pp(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Nr(i):(i=Yt(t)?ma:zt.current,a.context=Ai(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Gf(e,t,i,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&od.enqueueReplaceState(a,a.state,null),gu(e,r,a,n),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Li(e,t){try{var r="",n=t;do r+=zC(n),n=n.return;while(n);var a=r}catch(i){a=` 39Error generating stack: `+i.message+` 40`+i.stack}return{value:e,source:t,stack:a,digest:null}}function Lh(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Qf(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var fE=typeof WeakMap=="function"?WeakMap:Map;function $b(e,t,r){r=Dn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){bu||(bu=!0,im=n),Qf(e,t)},r}function Db(e,t,r){r=Dn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=t.value;r.payload=function(){return n(a)},r.callback=function(){Qf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Qf(e,t),typeof n!="function"&&(Cs===null?Cs=new Set([this]):Cs.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function fx(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new fE;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(r)||(a.add(r),e=CE.bind(null,e,t,r),t.then(e,e))}function mx(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 px(e,t,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,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=Dn(-1,1),t.tag=2,ks(r,t,1))),r.lanes|=1),e)}var mE=Gn.ReactCurrentOwner,Qt=!1;function Bt(e,t,r,n){t.child=e===null?hb(t,null,r,n):Oi(t,e.child,r,n)}function gx(e,t,r,n,a){r=r.render;var i=t.ref;return di(t,a),n=Dp(e,t,r,n,i,a),r=Mp(),e!==null&&!Qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Bn(e,t,a)):(Ze&&r&&Sp(t),t.flags|=1,Bt(e,t,n,a),t.child)}function vx(e,t,r,n,a){if(e===null){var i=r.type;return typeof i=="function"&&!Gp(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,Mb(e,t,i,n,a)):(e=Kc(r.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:el,r(o,n)&&e.ref===t.ref)return Bn(e,t,a)}return t.flags|=1,e=Ts(i,n),e.ref=t.ref,e.return=t,t.child=e}function Mb(e,t,r,n,a){if(e!==null){var i=e.memoizedProps;if(el(i,n)&&e.ref===t.ref)if(Qt=!1,t.pendingProps=n=i,(e.lanes&a)!==0)e.flags&131072&&(Qt=!0);else return t.lanes=e.lanes,Bn(e,t,a)}return Zf(e,t,r,n,a)}function Fb(e,t,r){var n=t.pendingProps,a=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},qe(ai,tr),tr|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,qe(ai,tr),tr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,qe(ai,tr),tr|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,qe(ai,tr),tr|=n;return Bt(e,t,a,r),t.child}function zb(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}
vendor: 4,711 bytes, line 40
40function Zf(e,t,r,n,a){var i=Yt(r)?ma:zt.current;return i=Ai(t,i),di(t,a),r=Dp(e,t,r,n,i,a),n=Mp(),e!==null&&!Qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Bn(e,t,a)):(Ze&&n&&Sp(t),t.flags|=1,Bt(e,t,r,a),t.child)}function xx(e,t,r,n,a){if(Yt(r)){var i=!0;du(t)}else i=!1;if(di(t,a),t.stateNode===null)qc(e,t),Lb(t,r,n),Jf(t,r,n,a),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=Nr(u):(u=Yt(r)?ma:zt.current,u=Ai(t,u));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==u)&&hx(t,o,n,u),os=!1;var m=t.memoizedState;o.state=m,gu(t,n,o,a),c=t.memoizedState,l!==n||m!==c||Zt.current||os?(typeof d=="function"&&(Gf(t,r,d,n),c=t.memoizedState),(l=os||dx(t,r,l,n,m,c,u))?(f||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,mb(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Dr(t.type,l),o.props=u,f=t.pendingProps,m=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Nr(c):(c=Yt(r)?ma:zt.current,c=Ai(t,c));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||m!==c)&&hx(t,o,n,c),os=!1,m=t.memoizedState,o.state=m,gu(t,n,o,a);var b=t.memoizedState;l!==f||m!==b||Zt.current||os?(typeof p=="function"&&(Gf(t,r,p,n),b=t.memoizedState),(u=os||dx(t,r,u,n,m,b,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,b,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,b,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=b),o.props=n,o.state=b,o.context=c,n=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),n=!1)}return Yf(e,t,r,n,i,a)}function Yf(e,t,r,n,a,i){zb(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return a&&nx(t,r,!1),Bn(e,t,i);n=t.stateNode,mE.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Oi(t,e.child,null,i),t.child=Oi(t,null,l,i)):Bt(e,t,l,i),t.memoizedState=n.state,a&&nx(t,r,!0),t.child}function Ub(e){var t=e.stateNode;t.pendingContext?rx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&rx(e,t.context,!1),Op(e,t.containerInfo)}function yx(e,t,r,n,a){return Pi(),Cp(a),t.flags|=256,Bt(e,t,r,n),t.child}var Xf={dehydrated:null,treeContext:null,retryLane:0};function em(e){return{baseLanes:e,cachePool:null,transitions:null}}function Bb(e,t,r){var n=t.pendingProps,a=Ye.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),qe(Ye,a&1),e===null)return Wf(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,i?(n=t.mode,i=t.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=ud(o,n,0,null),e=fa(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=em(r),t.memoizedState=Xf,e):Up(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return pE(e,t,o,n,l,a,r);if(i){i=n.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&t.child!==a?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Ts(a,c),n.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=Ts(l,i):(i=fa(i,o,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,o=e.child.memoizedState,o=o===null?em(r):{base
vendor: 8,918 bytes, line 40
40Lanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~r,t.memoizedState=Xf,n}return i=e.child,e=i.sibling,n=Ts(i,{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 Up(e,t){return t=ud({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function hc(e,t,r,n){return n!==null&&Cp(n),Oi(t,e.child,null,r),e=Up(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pE(e,t,r,n,a,i,o){if(r)return t.flags&256?(t.flags&=-257,n=Lh(Error(Z(422))),hc(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,a=t.mode,n=ud({mode:"visible",children:n.children},a,0,null),i=fa(i,a,o,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Oi(t,e.child,null,o),t.child.memoizedState=em(o),t.memoizedState=Xf,i);if(!(t.mode&1))return hc(e,t,o,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(Z(419)),n=Lh(i,n,void 0),hc(e,t,o,n)}if(l=(o&e.childLanes)!==0,Qt||l){if(n=kt,n!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Un(e,a),Kr(n,e,a,-1))}return Kp(),n=Lh(Error(Z(421))),hc(e,t,o,n)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=EE.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,sr=Ss(a.nextSibling),ir=t,Ze=!0,Vr=null,e!==null&&(yr[wr++]=In,yr[wr++]=Ln,yr[wr++]=pa,In=e.id,Ln=e.overflow,pa=t),t=Up(t,n.children),t.flags|=4096,t)}function wx(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Kf(e.return,t,r)}function $h(e,t,r,n,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function Vb(e,t,r){var n=t.pendingProps,a=n.revealOrder,i=n.tail;if(Bt(e,t,n.children,r),n=Ye.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&&wx(e,r,t);else if(e.tag===19)wx(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(qe(Ye,n),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&vu(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),$h(t,!1,a,r,i);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&vu(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}$h(t,!0,r,null,i);break;case"together":$h(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Bn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),va|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Z(153));if(t.child!==null){for(e=t.child,r=Ts(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Ts(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function gE(e,t,r){switch(t.tag){case 3:Ub(t),Pi();break;case 5:pb(t);break;case 1:Yt(t.type)&&du(t);break;case 4:Op(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,a=t.memoizedProps.value;qe(mu,n._currentValue),n._currentValue=a;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(qe(Ye,Ye.current&1),t.flags|=128,null):r&t.child.childLanes?Bb(e,t,r):(qe(Ye,Ye.current&1),e=Bn(e,t,r),e!==null?e.sibling:null);qe(Ye,Ye.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Vb(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),qe(Ye,Ye.current),n)break;return null;case 22:case 23:return t.lanes=0,Fb(e,t,r)}return Bn(e,t,r)}var qb,tm,Hb,Wb;qb=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}};tm=function(){};Hb=function(e,t,r,n){var a=e.memoizedProps;if(a!==n){e=t.stateNode,sa(hn.current);var i=null;switch(r){case"input":a=_f(e,a),n=_f(e,n),i=[];break;case"select":a=tt({},a,{value:void 0}),n=tt({},n,{value:void 0}),i=[];break;case"textarea":a=kf(e,a),n=kf(e,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=cu)}Ef(r,n);var o;r=null;for(u in a)if(!n.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ko.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=a!=null?a[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||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ko.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&We("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Wb=function(e,t,r,n){r!==n&&(t.flags|=4)};function wo(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 It(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function vE(e,t,r){var n=t.pendingProps;switch(kp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(t),null;case 1:return Yt(t.type)&&uu(),It(t),null;case 3:return n=t.stateNode,Ii(),Ge(Zt),Ge(zt),Lp(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(uc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vr!==null&&(cm(Vr),Vr=null))),tm(e,t),It(t),null;case 5:Ip(t);var a=sa(al.current);if(r=t.type,e!==null&&t.stateNode!=null)Hb(e,t,r,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(Z(166));return It(t),null}if(e=sa(hn.current),uc(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[cn]=t,n[nl]=i,e=(t.mode&1)!==0,r){case"dialog":We("cancel",n),We("close",n);break;case"iframe":case"object":case"embed":We("load",n);break;case"video":case"audio":for(a=0;a<To.length;a++)We(To[a],n);break;case"source":We("error",n);break;case"img":case"image":case"link":We("error",n),We("load",n);break;case"details":We("toggle",n);break;case"input":Tv(n,i),We("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},We("invalid",n);break;case"textarea":Av(n,i),We("invalid",n)}Ef(r,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&cc(n.textContent,l,e),a=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&cc(n.textContent,l,e),a=["children",""+l]):Ko.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&We("scroll",n)}switch(r){case"input":tc(n),Rv(n,i,!0);break;case"textarea":tc(n),Pv(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=cu)}n=a,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ww(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[cn]=t,e[nl]=n,qb(e,t,!1,!1),t.stateNode=e;e:{switch(o=Tf(r,n),r){case"dialog":We("cancel",e),We("close",e),a=n;break;case"iframe":case"object":case"embed":We("load",e),a=n;break;case"video":case"audio":for(a=0;a<To.length;a++)We(To[a],e);a=n;break;case"source":We("error",e),a=n;break;case"img":case"image":case"link":We("error",e),We("load",e),a=n;break;case"details":We("toggle",e),a=n;break;case"input":Tv(e,n),a=_f(e,n),We("invalid",e);break;case"option":a=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=tt({},n,{value:void 0}),We("invalid",e);break;case"textarea":Av(e,n),a=kf(e,n),We("invalid",e);break;default:a=n}Ef(r,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?_w(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&bw(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Go(e,c):typeof c=="number"&&Go(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ko.hasOwnProperty(i)?c!=null&&i==="onScroll"&&We("scroll",e):c!=null&&dp(e,i,c,o))}switch(r){case"input":tc(e),Rv(e,n,!1);break;case"textarea":tc(e),Pv(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Ps(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?oi(e,!!n.multiple,i,!1):n.defaultValue!=null&&oi(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=cu)}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 It(t),null;case 6:if(e&&t.stateNode!=null)Wb(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Z(166));if(r=sa(al.current),sa(hn.current),uc(t)){if(n=t.stateNode,r=t.memoizedProps,n[cn]=t,(i=n.nodeValue!==r)&&(e=ir,e!==null))switch(e.tag){case 3:cc(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&cc(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[cn]=t,t.stateNode=n}return It(t),null;case 13:if(Ge(Ye),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ze&&sr!==null&&t.mode&1&&!(t.flags&128))ub(),Pi(),t.flags|=98560,i=!1;else if(i=uc(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(Z(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Z(317));i[cn]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;It(t),i=!1}else Vr!==null&&(cm(Vr),Vr=null),i=!0;if(!i)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||Ye.current&1?wt===0&&(wt=3):Kp())),t.updateQueue!==null&&(t.flags|=4),It(t),null);case 4:return Ii(),tm(e,t),e===null&&tl(t.stateNode.containerInfo),It(t),null;case 10:return Rp(t.type._context),It(t),null;case 17:return Yt(t.type)&&uu(),It(t),null;case 19:if(Ge(Ye),i=t.memoizedState,i===null)return It(t),null;if(n=(t.flags&128)!==0,o=i.rendering,o===null)if(n)wo(i,!1);else{if(wt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=vu(e),o!==null){for(t.flags|=128,wo(i,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return qe(Ye,Ye.current&1|2),t.child}e=e.sibling}i.tail!==null&<()>$i&&(t.flags|=128,n=!0,wo(i,!1),t.lanes=4194304)}else{if(!n)if(e=vu(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),wo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ze)return It(t),null}else 2*lt()-i.renderingStartTime>$i&&r!==1073741824&&(t.flags|=128,n=!0,wo(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=lt(),t.sibling=null,r=Ye.current,qe(Ye,n?r&1|2:r&1),t):(It(t),null);case 22:case 23:return Wp(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?tr&1073741824&&(It(t),t.subtreeFlags&6&&(t.flags|=8192)):It(t),null;case 24:return null;case 25:return null}
vendor: 27,087 bytes, line 40
40throw Error(Z(156,t.tag))}function xE(e,t){switch(kp(t),t.tag){case 1:return Yt(t.type)&&uu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ii(),Ge(Zt),Ge(zt),Lp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ip(t),null;case 13:if(Ge(Ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ge(Ye),null;case 4:return Ii(),null;case 10:return Rp(t.type._context),null;case 22:case 23:return Wp(),null;case 24:return null;default:return null}}var fc=!1,Dt=!1,yE=typeof WeakSet=="function"?WeakSet:Set,ue=null;function si(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){at(e,t,n)}else r.current=null}function rm(e,t,r){try{r()}catch(n){at(e,t,n)}}var bx=!1;function wE(e,t){if(Ff=iu,e=Zw(),Np(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 a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,m=null;t:for(;;){for(var p;f!==r||a!==0&&f.nodeType!==3||(l=o+a),f!==i||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)m=f,f=p;for(;;){if(f===e)break t;if(m===r&&++u===a&&(l=o),m===i&&++d===n&&(c=o),(p=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(zf={focusedElem:e,selectionRange:r},iu=!1,ue=t;ue!==null;)if(t=ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ue=e;else for(;ue!==null;){t=ue;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var v=b.memoizedProps,x=b.memoizedState,w=t.stateNode,g=w.getSnapshotBeforeUpdate(t.elementType===t.type?v:Dr(t.type,v),x);w.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Z(163))}}catch(j){at(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,ue=e;break}ue=t.return}return b=bx,bx=!1,b}function Uo(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&rm(t,r,i)}a=a.next}while(a!==n)}}function ld(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 nm(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 Kb(e){var t=e.alternate;t!==null&&(e.alternate=null,Kb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[cn],delete t[nl],delete t[Vf],delete t[rE],delete t[nE])),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 Gb(e){return e.tag===5||e.tag===3||e.tag===4}function jx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gb(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 sm(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=cu));else if(n!==4&&(e=e.child,e!==null))for(sm(e,t,r),e=e.sibling;e!==null;)sm(e,t,r),e=e.sibling}function am(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(am(e,t,r),e=e.sibling;e!==null;)am(e,t,r),e=e.sibling}var Et=null,Br=!1;function ts(e,t,r){for(r=r.child;r!==null;)Jb(e,t,r),r=r.sibling}function Jb(e,t,r){if(dn&&typeof dn.onCommitFiberUnmount=="function")try{dn.onCommitFiberUnmount(ed,r)}catch{}switch(r.tag){case 5:Dt||si(r,t);case 6:var n=Et,a=Br;Et=null,ts(e,t,r),Et=n,Br=a,Et!==null&&(Br?(e=Et,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Et.removeChild(r.stateNode));break;case 18:Et!==null&&(Br?(e=Et,r=r.stateNode,e.nodeType===8?Th(e.parentNode,r):e.nodeType===1&&Th(e,r),Yo(e)):Th(Et,r.stateNode));break;case 4:n=Et,a=Br,Et=r.stateNode.containerInfo,Br=!0,ts(e,t,r),Et=n,Br=a;break;case 0:case 11:case 14:case 15:if(!Dt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&rm(r,t,o),a=a.next}while(a!==n)}ts(e,t,r);break;case 1:if(!Dt&&(si(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){at(r,t,l)}ts(e,t,r);break;case 21:ts(e,t,r);break;case 22:r.mode&1?(Dt=(n=Dt)||r.memoizedState!==null,ts(e,t,r),Dt=n):ts(e,t,r);break;default:ts(e,t,r)}}function _x(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new yE),t.forEach(function(n){var a=TE.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function Pr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Et=l.stateNode,Br=!1;break e;case 3:Et=l.stateNode.containerInfo,Br=!0;break e;case 4:Et=l.stateNode.containerInfo,Br=!0;break e}l=l.return}if(Et===null)throw Error(Z(160));Jb(i,o,a),Et=null,Br=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){at(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Qb(t,e),t=t.sibling}function Qb(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Pr(t,e),tn(e),n&4){try{Uo(3,e,e.return),ld(3,e)}catch(v){at(e,e.return,v)}try{Uo(5,e,e.return)}catch(v){at(e,e.return,v)}}break;case 1:Pr(t,e),tn(e),n&512&&r!==null&&si(r,r.return);break;case 5:if(Pr(t,e),tn(e),n&512&&r!==null&&si(r,r.return),e.flags&32){var a=e.stateNode;try{Go(a,"")}catch(v){at(e,e.return,v)}}if(n&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&xw(a,i),Tf(l,o);var u=Tf(l,i);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?_w(a,f):d==="dangerouslySetInnerHTML"?bw(a,f):d==="children"?Go(a,f):dp(a,d,f,u)}switch(l){case"input":Nf(a,i);break;case"textarea":yw(a,i);break;case"select":var m=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?oi(a,!!i.multiple,p,!1):m!==!!i.multiple&&(i.defaultValue!=null?oi(a,!!i.multiple,i.defaultValue,!0):oi(a,!!i.multiple,i.multiple?[]:"",!1))}a[nl]=i}catch(v){at(e,e.return,v)}}break;case 6:if(Pr(t,e),tn(e),n&4){if(e.stateNode===null)throw Error(Z(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(v){at(e,e.return,v)}}break;case 3:if(Pr(t,e),tn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Yo(t.containerInfo)}catch(v){at(e,e.return,v)}break;case 4:Pr(t,e),tn(e);break;case 13:Pr(t,e),tn(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(qp=lt())),n&4&&_x(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(Dt=(u=Dt)||d,Pr(t,e),Dt=u):Pr(t,e),tn(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ue=e,d=e.child;d!==null;){for(f=ue=d;ue!==null;){switch(m=ue,p=m.child,m.tag){case 0:case 11:case 14:case 15:Uo(4,m,m.return);break;case 1:si(m,m.return);var b=m.stateNode;if(typeof b.componentWillUnmount=="function"){n=m,r=m.return;try{t=n,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(v){at(n,r,v)}}break;case 5:si(m,m.return);break;case 22:if(m.memoizedState!==null){Sx(f);continue}}p!==null?(p.return=m,ue=p):Sx(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=jw("display",o))}catch(v){at(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){at(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Pr(t,e),tn(e),n&4&&_x(e);break;case 21:break;default:Pr(t,e),tn(e)}}function tn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Gb(r)){var n=r;break e}r=r.return}throw Error(Z(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(Go(a,""),n.flags&=-33);var i=jx(e);am(e,i,a);break;case 3:case 4:var o=n.stateNode.containerInfo,l=jx(e);sm(e,l,o);break;default:throw Error(Z(161))}}catch(c){at(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bE(e,t,r){ue=e,Zb(e)}function Zb(e,t,r){for(var n=(e.mode&1)!==0;ue!==null;){var a=ue,i=a.child;if(a.tag===22&&n){var o=a.memoizedState!==null||fc;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Dt;l=fc;var u=Dt;if(fc=o,(Dt=c)&&!u)for(ue=a;ue!==null;)o=ue,c=o.child,o.tag===22&&o.memoizedState!==null?kx(a):c!==null?(c.return=o,ue=c):kx(a);for(;i!==null;)ue=i,Zb(i),i=i.sibling;ue=a,fc=l,Dt=u}Nx(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,ue=i):Nx(e)}}function Nx(e){for(;ue!==null;){var t=ue;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Dt||ld(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Dt)if(r===null)n.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Dr(t.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&lx(t,i,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}lx(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 f=d.dehydrated;f!==null&&Yo(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Z(163))}Dt||t.flags&512&&nm(t)}catch(m){at(t,t.return,m)}}if(t===e){ue=null;break}if(r=t.sibling,r!==null){r.return=t.return,ue=r;break}ue=t.return}}function Sx(e){for(;ue!==null;){var t=ue;if(t===e){ue=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ue=r;break}ue=t.return}}function kx(e){for(;ue!==null;){var t=ue;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ld(4,t)}catch(c){at(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var a=t.return;try{n.componentDidMount()}catch(c){at(t,a,c)}}var i=t.return;try{nm(t)}catch(c){at(t,i,c)}break;case 5:var o=t.return;try{nm(t)}catch(c){at(t,o,c)}}}catch(c){at(t,t.return,c)}if(t===e){ue=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ue=l;break}ue=t.return}}var jE=Math.ceil,wu=Gn.ReactCurrentDispatcher,Bp=Gn.ReactCurrentOwner,jr=Gn.ReactCurrentBatchConfig,Oe=0,kt=null,pt=null,Tt=0,tr=0,ai=Bs(0),wt=0,cl=null,va=0,cd=0,Vp=0,Bo=null,Jt=null,qp=0,$i=1/0,En=null,bu=!1,im=null,Cs=null,mc=!1,ws=null,ju=0,Vo=0,om=null,Hc=-1,Wc=0;function qt(){return Oe&6?lt():Hc!==-1?Hc:Hc=lt()}function Es(e){return e.mode&1?Oe&2&&Tt!==0?Tt&-Tt:aE.transition!==null?(Wc===0&&(Wc=Lw()),Wc):(e=ze,e!==0||(e=window.event,e=e===void 0?16:Bw(e.type)),e):1}function Kr(e,t,r,n){if(50<Vo)throw Vo=0,om=null,Error(Z(185));Pl(e,r,n),(!(Oe&2)||e!==kt)&&(e===kt&&(!(Oe&2)&&(cd|=r),wt===4&&ds(e,Tt)),Xt(e,n),r===1&&Oe===0&&!(t.mode&1)&&($i=lt()+500,ad&&Vs()))}function Xt(e,t){var r=e.callbackNode;a2(e,t);var n=au(e,e===kt?Tt:0);if(n===0)r!==null&&Lv(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Lv(r),t===1)e.tag===0?sE(Cx.bind(null,e)):ob(Cx.bind(null,e)),eE(function(){!(Oe&6)&&Vs()}),r=null;else{switch($w(n)){case 1:r=gp;break;case 4:r=Ow;break;case 16:r=su;break;case 536870912:r=Iw;break;default:r=su}r=aj(r,Yb.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Yb(e,t){if(Hc=-1,Wc=0,Oe&6)throw Error(Z(327));var r=e.callbackNode;if(hi()&&e.callbackNode!==r)return null;var n=au(e,e===kt?Tt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=_u(e,n);else{t=n;var a=Oe;Oe|=2;var i=ej();(kt!==e||Tt!==t)&&(En=null,$i=lt()+500,ha(e,t));do try{SE();break}catch(l){Xb(e,l)}while(!0);Tp(),wu.current=i,Oe=a,pt!==null?t=0:(kt=null,Tt=0,t=wt)}if(t!==0){if(t===2&&(a=If(e),a!==0&&(n=a,t=lm(e,a))),t===1)throw r=cl,ha(e,0),ds(e,n),Xt(e,lt()),r;if(t===6)ds(e,n);else{if(a=e.current.alternate,!(n&30)&&!_E(a)&&(t=_u(e,n),t===2&&(i=If(e),i!==0&&(n=i,t=lm(e,i))),t===1))throw r=cl,ha(e,0),ds(e,n),Xt(e,lt()),r;switch(e.finishedWork=a,e.finishedLanes=n,t){case 0:case 1:throw Error(Z(345));case 2:ea(e,Jt,En);break;case 3:if(ds(e,n),(n&130023424)===n&&(t=qp+500-lt(),10<t)){if(au(e,0)!==0)break;if(a=e.suspendedLanes,(a&n)!==n){qt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Bf(ea.bind(null,e,Jt,En),t);break}ea(e,Jt,En);break;case 4:if(ds(e,n),(n&4194240)===n)break;for(t=e.eventTimes,a=-1;0<n;){var o=31-Wr(n);i=1<<o,o=t[o],o>a&&(a=o),n&=~i}if(n=a,n=lt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*jE(n/1960))-n,10<n){e.timeoutHandle=Bf(ea.bind(null,e,Jt,En),n);break}ea(e,Jt,En);break;case 5:ea(e,Jt,En);break;default:throw Error(Z(329))}}}return Xt(e,lt()),e.callbackNode===r?Yb.bind(null,e):null}function lm(e,t){var r=Bo;return e.current.memoizedState.isDehydrated&&(ha(e,t).flags|=256),e=_u(e,t),e!==2&&(t=Jt,Jt=r,t!==null&&cm(t)),e}function cm(e){Jt===null?Jt=e:Jt.push.apply(Jt,e)}function _E(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 a=r[n],i=a.getSnapshot;a=a.value;try{if(!Jr(i(),a))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 ds(e,t){for(t&=~Vp,t&=~cd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Wr(t),n=1<<r;e[r]=-1,t&=~n}}function Cx(e){if(Oe&6)throw Error(Z(327));hi();var t=au(e,0);if(!(t&1))return Xt(e,lt()),null;var r=_u(e,t);if(e.tag!==0&&r===2){var n=If(e);n!==0&&(t=n,r=lm(e,n))}if(r===1)throw r=cl,ha(e,0),ds(e,t),Xt(e,lt()),r;if(r===6)throw Error(Z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ea(e,Jt,En),Xt(e,lt()),null}function Hp(e,t){var r=Oe;Oe|=1;try{return e(t)}finally{Oe=r,Oe===0&&($i=lt()+500,ad&&Vs())}}function xa(e){ws!==null&&ws.tag===0&&!(Oe&6)&&hi();var t=Oe;Oe|=1;var r=jr.transition,n=ze;try{if(jr.transition=null,ze=1,e)return e()}finally{ze=n,jr.transition=r,Oe=t,!(Oe&6)&&Vs()}}function Wp(){tr=ai.current,Ge(ai)}function ha(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,X2(r)),pt!==null)for(r=pt.return;r!==null;){var n=r;switch(kp(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&uu();break;case 3:Ii(),Ge(Zt),Ge(zt),Lp();break;case 5:Ip(n);break;case 4:Ii();break;case 13:Ge(Ye);break;case 19:Ge(Ye);break;case 10:Rp(n.type._context);break;case 22:case 23:Wp()}r=r.return}if(kt=e,pt=e=Ts(e.current,null),Tt=tr=t,wt=0,cl=null,Vp=cd=va=0,Jt=Bo=null,na!==null){for(t=0;t<na.length;t++)if(r=na[t],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=a,n.next=o}r.pending=n}na=null}return e}function Xb(e,t){do{var r=pt;try{if(Tp(),Bc.current=yu,xu){for(var n=Xe.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}xu=!1}if(ga=0,St=yt=Xe=null,zo=!1,il=0,Bp.current=null,r===null||r.return===null){wt=1,cl=t,pt=null;break}e:{var i=e,o=r.return,l=r,c=t;if(t=Tt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var m=d.alternate;m?(d.updateQueue=m.updateQueue,d.memoizedState=m.memoizedState,d.lanes=m.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=mx(o);if(p!==null){p.flags&=-257,px(p,o,l,i,t),p.mode&1&&fx(i,u,t),t=p,c=u;var b=t.updateQueue;if(b===null){var v=new Set;v.add(c),t.updateQueue=v}else b.add(c);break e}else{if(!(t&1)){fx(i,u,t),Kp();break e}c=Error(Z(426))}}else if(Ze&&l.mode&1){var x=mx(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),px(x,o,l,i,t),Cp(Li(c,l));break e}}i=c=Li(c,l),wt!==4&&(wt=2),Bo===null?Bo=[i]:Bo.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var w=$b(i,c,t);ox(i,w);break e;case 1:l=c;var g=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Cs===null||!Cs.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var j=Db(i,l,t);ox(i,j);break e}}i=i.return}while(i!==null)}rj(r)}catch(_){t=_,pt===r&&r!==null&&(pt=r=r.return);continue}break}while(!0)}function ej(){var e=wu.current;return wu.current=yu,e===null?yu:e}function Kp(){(wt===0||wt===3||wt===2)&&(wt=4),kt===null||!(va&268435455)&&!(cd&268435455)||ds(kt,Tt)}function _u(e,t){var r=Oe;Oe|=2;var n=ej();(kt!==e||Tt!==t)&&(En=null,ha(e,t));do try{NE();break}catch(a){Xb(e,a)}while(!0);if(Tp(),Oe=r,wu.current=n,pt!==null)throw Error(Z(261));return kt=null,Tt=0,wt}function NE(){for(;pt!==null;)tj(pt)}function SE(){for(;pt!==null&&!QC();)tj(pt)}function tj(e){var t=sj(e.alternate,e,tr);e.memoizedProps=e.pendingProps,t===null?rj(e):pt=t,Bp.current=null}function rj(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=xE(r,t),r!==null){r.flags&=32767,pt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{wt=6,pt=null;return}}else if(r=vE(r,t,tr),r!==null){pt=r;return}if(t=t.sibling,t!==null){pt=t;return}pt=t=e}while(t!==null);wt===0&&(wt=5)}function ea(e,t,r){var n=ze,a=jr.transition;try{jr.transition=null,ze=1,kE(e,t,r,n)}finally{jr.transition=a,ze=n}return null}function kE(e,t,r,n){do hi();while(ws!==null);if(Oe&6)throw Error(Z(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Z(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(i2(e,i),e===kt&&(pt=kt=null,Tt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||mc||(mc=!0,aj(su,function(){return hi(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=jr.transition,jr.transition=null;var o=ze;ze=1;var l=Oe;Oe|=4,Bp.current=null,wE(e,r),Qb(r,e),W2(zf),iu=!!Ff,zf=Ff=null,e.current=r,bE(r),ZC(),Oe=l,ze=o,jr.transition=i}else e.current=r;if(mc&&(mc=!1,ws=e,ju=a),i=e.pendingLanes,i===0&&(Cs=null),e2(r.stateNode),Xt(e,lt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(bu)throw bu=!1,e=im,im=null,e;return ju&1&&e.tag!==0&&hi(),i=e.pendingLanes,i&1?e===om?Vo++:(Vo=0,om=e):Vo=0,Vs(),null}function hi(){if(ws!==null){var e=$w(ju),t=jr.transition,r=ze;try{if(jr.transition=null,ze=16>e?16:e,ws===null)var n=!1;else{if(e=ws,ws=null,ju=0,Oe&6)throw Error(Z(331));var a=Oe;for(Oe|=4,ue=e.current;ue!==null;){var i=ue,o=i.child;if(ue.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ue=u;ue!==null;){var d=ue;switch(d.tag){case 0:case 11:case 15:Uo(8,d,i)}var f=d.child;if(f!==null)f.return=d,ue=f;else for(;ue!==null;){d=ue;var m=d.sibling,p=d.return;if(Kb(d),d===u){ue=null;break}if(m!==null){m.return=p,ue=m;break}ue=p}}}var b=i.alternate;if(b!==null){var v=b.child;if(v!==null){b.child=null;do{var x=v.sibling;v.sibling=null,v=x}while(v!==null)}}ue=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,ue=o;else e:for(;ue!==null;){if(i=ue,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Uo(9,i,i.return)}var w=i.sibling;if(w!==null){w.return=i.return,ue=w;break e}ue=i.return}}var g=e.current;for(ue=g;ue!==null;){o=ue;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,ue=y;else e:for(o=g;ue!==null;){if(l=ue,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ld(9,l)}}catch(_){at(l,l.return,_)}if(l===o){ue=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,ue=j;break e}ue=l.return}}if(Oe=a,Vs(),dn&&typeof dn.onPostCommitFiberRoot=="function")try{dn.onPostCommitFiberRoot(ed,e)}catch{}n=!0}return n}finally{ze=r,jr.transition=t}}return!1}function Ex(e,t,r){t=Li(r,t),t=$b(e,t,1),e=ks(e,t,1),t=qt(),e!==null&&(Pl(e,1,t),Xt(e,t))}function at(e,t,r){if(e.tag===3)Ex(e,e,r);else for(;t!==null;){if(t.tag===3){Ex(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Cs===null||!Cs.has(n))){e=Li(r,e),e=Db(t,e,1),t=ks(t,e,1),e=qt(),t!==null&&(Pl(t,1,e),Xt(t,e));break}}t=t.return}}function CE(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=qt(),e.pingedLanes|=e.suspendedLanes&r,kt===e&&(Tt&r)===r&&(wt===4||wt===3&&(Tt&130023424)===Tt&&500>lt()-qp?ha(e,0):Vp|=r),Xt(e,t)}function nj(e,t){t===0&&(e.mode&1?(t=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):t=1);var r=qt();e=Un(e,t),e!==null&&(Pl(e,t,r),Xt(e,r))}function EE(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),nj(e,r)}function TE(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Z(314))}n!==null&&n.delete(t),nj(e,r)}var sj;sj=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Zt.current)Qt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Qt=!1,gE(e,t,r);Qt=!!(e.flags&131072)}else Qt=!1,Ze&&t.flags&1048576&&lb(t,fu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;qc(e,t),e=t.pendingProps;var a=Ai(t,zt.current);di(t,r),a=Dp(null,t,n,e,a,r);var i=Mp();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yt(n)?(i=!0,du(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Pp(t),a.updater=od,t.stateNode=a,a._reactInternals=t,Jf(t,n,e,r),t=Yf(null,t,n,!0,i,r)):(t.tag=0,Ze&&i&&Sp(t),Bt(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(qc(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=AE(n),e=Dr(n,e),a){case 0:t=Zf(null,t,n,e,r);break e;case 1:t=xx(null,t,n,e,r);break e;case 11:t=gx(null,t,n,e,r);break e;case 14:t=vx(null,t,n,Dr(n.type,e),r);break e}throw Error(Z(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Dr(n,a),Zf(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Dr(n,a),xx(e,t,n,a,r);case 3:e:{if(Ub(t),e===null)throw Error(Z(387));n=t.pendingProps,i=t.memoizedState,a=i.element,mb(e,t),gu(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Li(Error(Z(423)),t),t=yx(e,t,n,r,a);break e}else if(n!==a){a=Li(Error(Z(424)),t),t=yx(e,t,n,r,a);break e}else for(sr=Ss(t.stateNode.containerInfo.firstChild),ir=t,Ze=!0,Vr=null,r=hb(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Pi(),n===a){t=Bn(e,t,r);break e}Bt(e,t,n,r)}t=t.child}return t;case 5:return pb(t),e===null&&Wf(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,Uf(n,a)?o=null:i!==null&&Uf(n,i)&&(t.flags|=32),zb(e,t),Bt(e,t,o,r),t.child;case 6:return e===null&&Wf(t),null;case 13:return Bb(e,t,r);case 4:return Op(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Oi(t,null,n,r):Bt(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Dr(n,a),gx(e,t,n,a,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,a=t.pendingProps,i=t.memoizedProps,o=a.value,qe(mu,n._currentValue),n._currentValue=o,i!==null)if(Jr(i.value,o)){if(i.children===a.children&&!Zt.current){t=Bn(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=Dn(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Kf(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(Z(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Kf(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Bt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,di(t,r),a=Nr(a),n=n(a),t.flags|=1,Bt(e,t,n,r),t.child;case 14:return n=t.type,a=Dr(n,t.pendingProps),a=Dr(n.type,a),vx(e,t,n,a,r);case 15:return Mb(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Dr(n,a),qc(e,t),t.tag=1,Yt(n)?(e=!0,du(t)):e=!1,di(t,r),Lb(t,n,a),Jf(t,n,a,r),Yf(null,t,n,!0,e,r);case 19:return Vb(e,t,r);case 22:return Fb(e,t,r)}throw Error(Z(156,t.tag))};function aj(e,t){return Pw(e,t)}function RE(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 br(e,t,r,n){return new RE(e,t,r,n)}function Gp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function AE(e){if(typeof e=="function")return Gp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fp)return 11;if(e===mp)return 14}return 2}function Ts(e,t){var r=e.alternate;return r===null?(r=br(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.depen
vendor: 4,354 bytes, line 40
40dencies,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 Kc(e,t,r,n,a,i){var o=2;if(n=e,typeof e=="function")Gp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ja:return fa(r.children,a,i,t);case hp:o=8,a|=8;break;case yf:return e=br(12,r,t,a|2),e.elementType=yf,e.lanes=i,e;case wf:return e=br(13,r,t,a),e.elementType=wf,e.lanes=i,e;case bf:return e=br(19,r,t,a),e.elementType=bf,e.lanes=i,e;case pw:return ud(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fw:o=10;break e;case mw:o=9;break e;case fp:o=11;break e;case mp:o=14;break e;case is:o=16,n=null;break e}throw Error(Z(130,e==null?e:typeof e,""))}return t=br(o,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function fa(e,t,r,n){return e=br(7,e,n,t),e.lanes=r,e}function ud(e,t,r,n){return e=br(22,e,n,t),e.elementType=pw,e.lanes=r,e.stateNode={isHidden:!1},e}function Dh(e,t,r){return e=br(6,e,null,t),e.lanes=r,e}function Mh(e,t,r){return t=br(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function PE(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xh(0),this.expirationTimes=xh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xh(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Jp(e,t,r,n,a,i,o,l,c){return e=new PE(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=br(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Pp(i),e}function OE(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ga,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function ij(e){if(!e)return Os;e=e._reactInternals;e:{if(Ea(e)!==e||e.tag!==1)throw Error(Z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Z(171))}if(e.tag===1){var r=e.type;if(Yt(r))return ib(e,r,t)}return t}function oj(e,t,r,n,a,i,o,l,c){return e=Jp(r,n,!0,e,a,i,o,l,c),e.context=ij(null),r=e.current,n=qt(),a=Es(r),i=Dn(n,a),i.callback=t??null,ks(r,i,a),e.current.lanes=a,Pl(e,a,n),Xt(e,n),e}function dd(e,t,r,n){var a=t.current,i=qt(),o=Es(a);return r=ij(r),t.context===null?t.context=r:t.pendingContext=r,t=Dn(i,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=ks(a,t,o),e!==null&&(Kr(e,a,o,i),Uc(e,a,o)),o}function Nu(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 Tx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Qp(e,t){Tx(e,t),(e=e.alternate)&&Tx(e,t)}function IE(){return null}var lj=typeof reportError=="function"?reportError:function(e){console.error(e)};function Zp(e){this._internalRoot=e}hd.prototype.render=Zp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Z(409));dd(e,t,null,null)};hd.prototype.unmount=Zp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xa(function(){dd(null,e,null,null)}),t[zn]=null}};function hd(e){this._internalRoot=e}hd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fw();e={blockedOn:null,target:e,priority:t};for(var r=0;r<us.length&&t!==0&&t<us[r].priority;r++);us.splice(r,0,e),r===0&&Uw(e)}};function Yp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function fd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Rx(){}function LE(e,t,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var u=Nu(o);i.call(u)}}var o=oj(t,n,e,0,null,!1,!1,"",Rx);return e._reactRootContainer=o,e[zn]=o.current,tl(e.nodeType===8?e.parentNode:e),xa(),o}for(;
vendor: 5,149 bytes, line 40
40a=e.lastChild;)e.removeChild(a);if(typeof n=="function"){var l=n;n=function(){var u=Nu(c);l.call(u)}}var c=Jp(e,0,!1,null,null,!1,!1,"",Rx);return e._reactRootContainer=c,e[zn]=c.current,tl(e.nodeType===8?e.parentNode:e),xa(function(){dd(t,c,r,n)}),c}function md(e,t,r,n,a){var i=r._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=Nu(o);l.call(c)}}dd(t,o,e,a)}else o=LE(r,t,e,a,n);return Nu(o)}Dw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Eo(t.pendingLanes);r!==0&&(vp(t,r|1),Xt(t,lt()),!(Oe&6)&&($i=lt()+500,Vs()))}break;case 13:xa(function(){var n=Un(e,1);if(n!==null){var a=qt();Kr(n,e,1,a)}}),Qp(e,1)}};xp=function(e){if(e.tag===13){var t=Un(e,134217728);if(t!==null){var r=qt();Kr(t,e,134217728,r)}Qp(e,134217728)}};Mw=function(e){if(e.tag===13){var t=Es(e),r=Un(e,t);if(r!==null){var n=qt();Kr(r,e,t,n)}Qp(e,t)}};Fw=function(){return ze};zw=function(e,t){var r=ze;try{return ze=e,t()}finally{ze=r}};Af=function(e,t,r){switch(t){case"input":if(Nf(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 a=sd(n);if(!a)throw Error(Z(90));vw(n),Nf(n,a)}}}break;case"textarea":yw(e,r);break;case"select":t=r.value,t!=null&&oi(e,!!r.multiple,t,!1)}};kw=Hp;Cw=xa;var $E={usingClientEntryPoint:!1,Events:[Il,Xa,sd,Nw,Sw,Hp]},bo={findFiberByHostInstance:ra,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},DE={bundleType:bo.bundleType,version:bo.version,rendererPackageName:bo.rendererPackageName,rendererConfig:bo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Gn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Rw(e),e===null?null:e.stateNode},findFiberByHostInstance:bo.findFiberByHostInstance||IE,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 pc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pc.isDisabled&&pc.supportsFiber)try{ed=pc.inject(DE),dn=pc}catch{}}hr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$E;hr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yp(t))throw Error(Z(200));return OE(e,t,null,r)};hr.createRoot=function(e,t){if(!Yp(e))throw Error(Z(299));var r=!1,n="",a=lj;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=Jp(e,1,!1,null,null,r,!1,n,a),e[zn]=t.current,tl(e.nodeType===8?e.parentNode:e),new Zp(t)};hr.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(Z(188)):(e=Object.keys(e).join(","),Error(Z(268,e)));return e=Rw(t),e=e===null?null:e.stateNode,e};hr.flushSync=function(e){return xa(e)};hr.hydrate=function(e,t,r){if(!fd(t))throw Error(Z(200));return md(null,e,t,!0,r)};hr.hydrateRoot=function(e,t,r){if(!Yp(e))throw Error(Z(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",o=lj;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=oj(t,null,e,1,r??null,a,!1,i,o),e[zn]=t.current,tl(e),n)for(e=0;e<n.length;e++)r=n[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new hd(t)};hr.render=function(e,t,r){if(!fd(t))throw Error(Z(200));return md(null,e,t,!1,r)};hr.unmountComponentAtNode=function(e){if(!fd(e))throw Error(Z(40));return e._reactRootContainer?(xa(function(){md(null,null,e,!1,function(){e._reactRootContainer=null,e[zn]=null})}),!0):!1};hr.unstable_batchedUpdates=Hp;hr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!fd(r))throw Error(Z(200));if(e==null||e._reactInternals===void 0)throw Error(Z(38));return md(e,t,r,!1,n)};hr.version="18.3.1-next-f1338f8080-20240426";function cj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cj)}catch(e){console.error(e)}}cj(),cw.exports=hr;var Ta=cw.exports;const uj=Z0(Ta);var dj,Ax=Ta;dj=Ax.createRoot,Ax.hydrateRoot;const ME=1,FE=1e6;let Fh=0;function zE(){return Fh=(Fh+1)%Number.MAX_SAFE_INTEGER,Fh.toString()}const zh=new Map,Px=e=>{if(zh.has(e))return;const t=setTimeout(()=>{zh.delete(e),qo({type:"REMOVE_TOAST",toastId:e})},FE);zh.set(e,t)},UE=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ME)};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;
vendor: 12,517 bytes, line 40
40return r?Px(r):e.toasts.forEach(n=>{Px(n.id)}),{...e,toasts:e.toasts.map(n=>n.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)}}},Gc=[];let Jc={toasts:[]};function qo(e){Jc=UE(Jc,e),Gc.forEach(t=>{t(Jc)})}function BE({...e}){const t=zE(),r=a=>qo({type:"UPDATE_TOAST",toast:{...a,id:t}}),n=()=>qo({type:"DISMISS_TOAST",toastId:t});return qo({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||n()}}}),{id:t,dismiss:n,update:r}}function hj(){const[e,t]=h.useState(Jc);return h.useEffect(()=>(Gc.push(t),()=>{const r=Gc.indexOf(t);r>-1&&Gc.splice(r,1)}),[e]),{...e,toast:BE,dismiss:r=>qo({type:"DISMISS_TOAST",toastId:r})}}function ge(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Ox(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fj(...e){return t=>{let r=!1;const n=e.map(a=>{const i=Ox(a,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():Ox(e[a],null)}}}}function Me(...e){return h.useCallback(fj(...e),e)}function VE(e,t){const r=h.createContext(t),n=i=>{const{children:o,...l}=i,c=h.useMemo(()=>l,Object.values(l));return s.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function a(i){const o=h.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,a]}function er(e,t=[]){let r=[];function n(i,o){const l=h.createContext(o),c=r.length;r=[...r,o];const u=f=>{var w;const{scope:m,children:p,...b}=f,v=((w=m==null?void 0:m[e])==null?void 0:w[c])||l,x=h.useMemo(()=>b,Object.values(b));return s.jsx(v.Provider,{value:x,children:p})};u.displayName=i+"Provider";function d(f,m){var v;const p=((v=m==null?void 0:m[e])==null?void 0:v[c])||l,b=h.useContext(p);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const a=()=>{const i=r.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,qE(a,...t)]}function qE(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function Di(e){const t=HE(e),r=h.forwardRef((n,a)=>{const{children:i,...o}=n,l=h.Children.toArray(i),c=l.find(WE);if(c){const u=c.props.children,d=l.map(f=>f===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:f);return s.jsx(t,{...o,ref:a,children:h.isValidElement(u)?h.cloneElement(u,void 0,d):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}var Yi=Di("Slot");function HE(e){const t=h.forwardRef((r,n)=>{const{children:a,...i}=r;if(h.isValidElement(a)){const o=GE(a),l=KE(i,a.props);return a.type!==h.Fragment&&(l.ref=n?fj(n,o):o),h.cloneElement(a,l)}return h.Children.count(a)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mj=Symbol("radix.slottable");function pj(e){const t=({children:r})=>s.jsx(s.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=mj,t}function WE(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mj}function KE(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function GE(e){var n,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function pd(e){const t=e+"CollectionProvider",[r,n]=er(t),[a,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=v=>{const{scope:x,children:w}=v,g=J.useRef(null),y=J.useRef(new Map).current;return s.jsx(a,{scope:x,itemMap:y,collectionRef:g,children:w})};o.displayName=t;const l=e+"CollectionSlot",c=Di(l),u=J.forwardRef((v,x)=>{const{scope:w,children:g}=v,y=i(l,w),j=Me(x,y.collectionRef);return s.jsx(c,{ref:j,children:g})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",m=Di(d),p=J.forwardRef((v,x)=>{const{scope:w,children:g,...y}=v,j=J.useRef(null),_=Me(x,j),S=i(d,w);return J.useEffect(()=>(S.itemMap.set(j,{ref:j,...y}),()=>void S.itemMap.delete(j))),s.jsx(m,{[f]:"",ref:_,children:g})});p.displayName=d;function b(v){const x=i(e+"CollectionConsumer",v);return J.useCallback(()=>{const g=x.collectionRef.current;if(!g)return[];const y=Array.from(g.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((S,N)=>y.indexOf(S.ref.current)-y.indexOf(N.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:u,ItemSlot:p},b,n]}var JE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=JE.reduce((e,t)=>{const r=Di(`Primitive.${t}`),n=h.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function gj(e,t){e&&Ta.flushSync(()=>e.dispatchEvent(t))}function cr(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function QE(e,t=globalThis==null?void 0:globalThis.document){const r=cr(e);h.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ZE="DismissableLayer",um="dismissableLayer.update",YE="dismissableLayer.pointerDownOutside",XE="dismissableLayer.focusOutside",Ix,vj=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$l=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=h.useContext(vj),[d,f]=h.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=h.useState({}),b=Me(t,N=>f(N)),v=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(x),g=d?v.indexOf(d):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,j=g>=w,_=tT(N=>{const E=N.target,R=[...u.branches].some(I=>I.contains(E));!j||R||(a==null||a(N),o==null||o(N),N.defaultPrevented||l==null||l())},m),S=rT(N=>{const E=N.target;[...u.branches].some(I=>I.contains(E))||(i==null||i(N),o==null||o(N),N.defaultPrevented||l==null||l())},m);return QE(N=>{g===u.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},m),h.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ix=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Lx(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ix)}},[d,m,r,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Lx())},[d,u]),h.useEffect(()=>{const N=()=>p({});return document.addEventListener(um,N),()=>document.removeEventListener(um,N)},[]),s.jsx(ve.div,{...c,ref:b,style:{pointerEvents:y?j?"auto":"none":void 0,...e.style},onFocusCapture:ge(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ge(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ge(e.onPointerDownCapture,_.onPointerDownCapture)})});$l.displayName=ZE;var eT="DismissableLayerBranch",xj=h.forwardRef((e,t)=>{const r=h.useContext(vj),n=h.useRef(null),a=Me(t,n);return h.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),s.jsx(ve.div,{...e,ref:a})});xj.displayName=eT;function tT(e,t=globalThis==null?void 0:globalThis.document){const r=cr(e),n=h.useRef(!1),a=h.useRef(()=>{});return h.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){yj(YE,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function rT(e,t=globalThis==null?void 0:globalThis.document){const r=cr(e),n=h.useRef(!1);return h.useEffect(()=>{const a=i=>{i.target&&!n.current&&yj(XE,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Lx(){const e=new CustomEvent(um);document.dispatchEvent(e)}function yj(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?gj(a,i):a.dispatchEvent(i)}var nT=$l,sT=xj,ht=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},aT="Portal",gd=h.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[a,i]=h.useState(!1);ht(()=>i(!0),[]);const o=r||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?uj.createPortal(s.jsx(ve.div,{...n,ref:t}),o):null});gd.displayName=aT;function iT(e,t){return h.useReducer((r,n)=>t[r][n]??r,e)}var qs=e=>{const{present:t,children:r}=e,n=oT(t),a=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),i=Me(n.ref,lT(a));return typeof r=="function"||n.isPresent?h.cloneElement(a,{ref:i}):null};qs.displayName="Presence";function oT(e){const[t,r]=h.useState(),n=h.useRef(null),a=h.useRef(e),i=h.useRef("none"),o=e?"mounted":"unmounted",[l,c]=iT(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=gc(n.current);i.current=l==="mounted"?u:"none"},[l]),ht(()=>{const u=n.current,d=a.current;if(d!==e){const m=i.current,p=gc(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),ht(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const v=gc(n.current).includes(p.animationName);if(p.target===t&&v&&(c("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=p=>{p.target===t&&(i.current=gc(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function gc(e){return(e==null?void 0:e.animationName)||"none"}function lT(e){var n,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var cT=lp[" useInsertionEffect ".trim().toString()]||ht;function Qr({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,i,o]=uT({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:a;{const d=h.useRef(e!==void 0);h.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${n} is changing from ${f?"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=h.useCallback(d=>{var f;if(l){const m=dT(d)?d(e):d;
40m!==e&&((f=o.current)==null||f.call(o,m))}else i(d)},[l,e,i,o]);return[c,u]}function uT({defaultProp:e,onChange:t}){const[r,n]=h.useState(e),a=h.useRef(r),i=h.useRef(t);return cT(()=>{i.current=t},[t]),h.useEffect(()=>{var o;a.current!==r&&((o=i.current)==null||o.call(i,r),a.current=r)},[r,a]),[r,n,i]}function dT(e){return typeof e=="function"}var wj=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"}),hT="VisuallyHidden",vd=h.forwardRef((e,t)=>s.jsx(ve.span,{...e,ref:t,style:{...wj,...e.style}}));vd.displayName=hT;var fT=vd,Xp="ToastProvider",[eg,mT,pT]=pd("Toast"),[bj,$F]=er("Toast",[pT]),[gT,xd]=bj(Xp),jj=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[l,c]=h.useState(null),[u,d]=h.useState(0),f=h.useRef(!1),m=h.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Xp}\`. Expected non-empty \`string\`.`),s.jsx(eg.Provider,{scope:t,children:s.jsx(gT,{scope:t,label:r,duration:n,swipeDirection:a,swipeThreshold:i,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:h.useCallback(()=>d(p=>p+1),[]),onToastRemove:h.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:m,children:o})})};jj.displayName=Xp;var _j="ToastViewport",vT=["F8"],dm="toast.viewportPause",hm="toast.viewportResume",Nj=h.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=vT,label:a="Notifications ({hotkey})",...i}=e,o=xd(_j,r),l=mT(r),c=h.useRef(null),u=h.useRef(null),d=h.useRef(null),f=h.useRef(null),m=Me(t,f,o.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=o.toastCount>0;h.useEffect(()=>{const x=w=>{var y;n.length!==0&&n.every(j=>w[j]||w.code===j)&&((y=f.current)==null||y.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[n]),h.useEffect(()=>{const x=c.current,w=f.current;if(b&&x&&w){const g=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(dm);w.dispatchEvent(S),o.isClosePausedRef.current=!0}},y=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(hm);w.dispatchEvent(S),o.isClosePausedRef.current=!1}},j=S=>{!x.contains(S.relatedTarget)&&y()},_=()=>{x.contains(document.activeElement)||y()};return x.addEventListener("focusin",g),x.addEventListener("focusout",j),x.addEventListener("pointermove",g),x.addEventListener("pointerleave",_),window.addEventListener("blur",g),window.addEventListener("focus",y),()=>{x.removeEventListener("focusin",g),x.removeEventListener("focusout",j),x.removeEventListener("pointermove",g),x.removeEventListener("pointerleave",_),window.removeEventListener("blur",g),window.removeEventListener("focus",y)}}},[b,o.isClosePausedRef]);const v=h.useCallback(({tabbingDirection:x})=>{const g=l().map(y=>{const j=y.ref.current,_=[j,...RT(j)];return x==="forwards"?_:_.reverse()});return(x==="forwards"?g.reverse():g).flat()},[l]);return h.useEffect(()=>{const x=f.current;if(x){const w=g=>{var _,S,N;const y=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!y){const E=document.activeElement,R=g.shiftKey;if(g.target===x&&R){(_=u.current)==null||_.focus();return}const C=v({tabbingDirection:R?"backwards":"forwards"}),F=C.findIndex(D=>D===E);Uh(C.slice(F+1))?g.preventDefault():R?(S=u.current)==null||S.focus():(N=d.current)==null||N.focus()}};return x.addEventListener("keydown",w),()=>x.removeEventListener("keydown",w)}},[l,v]),s.jsxs(sT,{ref:c,role:"region","aria-label":a.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&s.jsx(fm,{ref:u,onFocusFromOutsideViewport:()=>{const x=v({tabbingDirection:"forwards"});Uh(x)}}),s.jsx(eg.Slot,{scope:r,children:s.jsx(ve.ol,{tabIndex:-1,...i,ref:m})}),b&&s.jsx(fm,{ref:d,onFocusFromOutsideViewport:()=>{const x=v({tabbingDirection:"backwards"});Uh(x)}})]})});Nj.displayName=_j;var Sj="ToastFocusProxy",fm=h.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...a}=e,i=xd(Sj,r);return s.jsx(vd,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(l))&&n()}})});fm.displayName=Sj;var Dl="Toast",xT="toast.swipeStart",yT="toast.swipeMove",wT="toast.swipeCancel",bT="toast.swipeEnd",kj=h.forwardRef((e,t)=>
40{const{forceMount:r,open:n,defaultOpen:a,onOpenChange:i,...o}=e,[l,c]=Qr({prop:n,defaultProp:a??!0,onChange:i,caller:Dl});return s.jsx(qs,{present:r||l,children:s.jsx(NT,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:cr(e.onPause),onResume:cr(e.onResume),onSwipeStart:ge(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ge(e.onSwipeMove,u=>{const{x:d,y:f}=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",`${f}px`)}),onSwipeCancel:ge(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:ge(e.onSwipeEnd,u=>{const{x:d,y:f}=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",`${f}px`),c(!1)})})})});kj.displayName=Dl;var[jT,_T]=bj(Dl,{onClose(){}}),NT=h.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:m,onSwipeEnd:p,...b}=e,v=xd(Dl,r),[x,w]=h.useState(null),g=Me(t,D=>w(D)),y=h.useRef(null),j=h.useRef(null),_=a||v.duration,S=h.useRef(0),N=h.useRef(_),E=h.useRef(0),{onToastAdd:R,onToastRemove:I}=v,A=cr(()=>{var z;(x==null?void 0:x.contains(document.activeElement))&&((z=v.viewport)==null||z.focus()),o()}),C=h.useCallback(D=>{!D||D===1/0||(window.clearTimeout(E.current),S.current=new Date().getTime(),E.current=window.setTimeout(A,D))},[A]);h.useEffect(()=>{const D=v.viewport;if(D){const z=()=>{C(N.current),u==null||u()},B=()=>{const K=new Date().getTime()-S.current;N.current=N.current-K,window.clearTimeout(E.current),c==null||c()};return D.addEventListener(dm,B),D.addEventListener(hm,z),()=>{D.removeEventListener(dm,B),D.removeEventListener(hm,z)}}},[v.viewport,_,c,u,C]),h.useEffect(()=>{i&&!v.isClosePausedRef.current&&C(_)},[i,_,v.isClosePausedRef,C]),h.useEffect(()=>(R(),()=>I()),[R,I]);const F=h.useMemo(()=>x?Oj(x):null,[x]);return v.viewport?s.jsxs(s.Fragment,{children:[F&&s.jsx(ST,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),s.jsx(jT,{scope:r,onClose:A,children:Ta.createPortal(s.jsx(eg.ItemSlot,{scope:r,children:s.jsx(nT,{asChild:!0,onEscapeKeyDown:ge(l,()=>{v.isFocusedToastEscapeKeyDownRef.current||A(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":v.swipeDirection,...b,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ge(e.onKeyDown,D=>{D.key==="Escape"&&(l==null||l(D.nativeEvent),D.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,A()))}),onPointerDown:ge(e.onPointerDown,D=>{D.button===0&&(y.current={x:D.clientX,y:D.clientY})}),onPointerMove:ge(e.onPointerMove,D=>{if(!y.current)return;const z=D.clientX-y.current.x,B=D.clientY-y.current.y,K=!!j.current,O=["left","right"].includes(v.swipeDirection),k=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,L=O?k(0,z):0,$=O?0:k(0,B),H=D.pointerType==="touch"?10:2,te={x:L,y:$},ne={originalEvent:D,delta:te};K?(j.current=te,vc(yT,f,ne,{discrete:!1})):$x(te,v.swipeDirection,H)?(j.current=te,vc(xT,d,ne,{discrete:!1}),D.target.setPointerCapture(D.pointerId)):(Math.abs(z)>H||Math.abs(B)>H)&&(y.current=null)}),onPointerUp:ge(e.onPointerUp,D=>{const z=j.current,B=D.target;if(B.hasPointerCapture(D.pointerId)&&B.releasePointerCapture(D.pointerId),j.current=null,y.current=null,z){const K=D.currentTarget,O={originalEvent:D,delta:z};$x(z,v.swipeDirection,v.swipeThreshold)?vc(bT,p,O,{discrete:!0}):vc(wT,m,O,{discrete:!0}),K.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),ST=e=>{const{__scopeToast:t,children:r,...n}=e,a=xd(Dl,t),[i,o]=h.useState(!1),[l,c]=h.useState(!1);return ET(()=>o(!0)),h.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:s.jsx(gd,{asChild:!0,children:s.jsx(vd,{...n,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",r]})})})},kT="ToastTitle",Cj=h.forwardRef((e,t)=>
vendor: 4,864 bytes, lines 40-60
40{const{__scopeToast:r,...n}=e;return s.jsx(ve.div,{...n,ref:t})});Cj.displayName=kT;var CT="ToastDescription",Ej=h.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return s.jsx(ve.div,{...n,ref:t})});Ej.displayName=CT;var Tj="ToastAction",Rj=h.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?s.jsx(Pj,{altText:r,asChild:!0,children:s.jsx(tg,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Tj}\`. Expected non-empty \`string\`.`),null)});Rj.displayName=Tj;var Aj="ToastClose",tg=h.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,a=_T(Aj,r);return s.jsx(Pj,{asChild:!0,children:s.jsx(ve.button,{type:"button",...n,ref:t,onClick:ge(e.onClick,a.onClose)})})});tg.displayName=Aj;var Pj=h.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...a}=e;return s.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:t})});function Oj(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),TT(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...Oj(n))}}),t}function vc(e,t,r,{discrete:n}){const a=r.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?gj(a,i):a.dispatchEvent(i)}var $x=(e,t,r=0)=>{const n=Math.abs(e.x),a=Math.abs(e.y),i=n>a;return t==="left"||t==="right"?i&&n>r:!i&&a>r};function ET(e=()=>{}){const t=cr(e);ht(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function TT(e){return e.nodeType===e.ELEMENT_NODE}function RT(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Uh(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var AT=jj,Ij=Nj,Lj=kj,$j=Cj,Dj=Ej,Mj=Rj,Fj=tg;function zj(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=zj(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Uj(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=zj(e))&&(n&&(n+=" "),n+=t);return n}const Dx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Mx=Uj,Xi=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Mx(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(u=>{const d=r==null?void 0:r[u],f=i==null?void 0:i[u];if(d===null)return null;const m=Dx(d)||Dx(f);return a[u][m]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,m]=d;return m===void 0||(u[f]=m),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:m,...p}=d;return Object.entries(p).every(b=>{let[v,x]=b;return Array.isArray(x)?x.includes({...i,...l}[v]):{...i,...l}[v]===x})?[...u,f,m]:u},[]);return Mx(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 PT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Bj=(...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 OT={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 IT=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...l},c)=>h.createElement("svg",{ref:c,...OT,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Bj("lucide",a),...l},[...o.map(([u,d])=>h.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const ie=(e,t)=>{const r=h.forwardRef(({className:n,...a},i)=>h.createElement(IT,{ref:i,iconNode:t,className:Bj(`lucide-${PT(e)}`,n),...a}
60));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 Mi=ie("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 Mn=ie("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 Mt=ie("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** 76 * @license lucide-react v0.462.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const At=ie("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"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 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 LT=ie("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/** 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 ya=ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 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 rg=ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 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 $T=ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 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 wn=ie("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 106 * @license lucide-react v0.462.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const DT=ie("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/** 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 Vj=ie("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 116 * @license lucide-react v0.462.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const MT=ie("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"}]]);/** 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 FT=ie("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"}]]);/** 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 zT=ie("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** 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 UT=ie("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 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 yd=ie("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"}]]);/** 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 ng=ie("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"}]]);/** 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 eo=ie("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 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 BT=ie("FileUp",[["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:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/** 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 VT=ie("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** 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 qj=ie("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"}]]);/** 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 Hj=ie("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** 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 Fx=ie("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"}]]);/** 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 sg=ie("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"}]]);/** 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 qT=ie("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"}]]);/** 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 Wj=ie("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** 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 HT=ie("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/** 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 WT=ie("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** 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 ag=ie("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"}]]);/** 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 wd=ie("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"}]]);/** 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 KT=ie("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/** 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 Kj=ie("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/** 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 GT=ie("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/** 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 zx=ie("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** 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 le=ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 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 JT=ie("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"}]]);/** 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 QT=ie("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** 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 ig=ie("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"}]]);/** 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 to=ie("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"}]]);/** 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 Ra=ie("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 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 ZT=ie("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"}]]);/** 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 mm=ie("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 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 YT=ie("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** 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 XT=ie("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"}]]);/** 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 eR=ie("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** 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 Ml=ie("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 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 Fl=ie("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"}]]);/** 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 Gj=ie("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}
300],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** 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 mn=ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 306 * @license lucide-react v0.462.0 - ISC 307 * 308 * This source code is licensed under the ISC license. 309 * See the LICENSE file in the root directory of this source tree. 310 */const tR=ie("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/** 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 rR=ie("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 316 * @license lucide-react v0.462.0 - ISC 317 * 318 * This source code is licensed under the ISC license. 319 * See the LICENSE file in the root directory of this source tree. 320 */const og=ie("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:"m3kijz"}],["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"}]]);/** 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 nR=ie("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"}]]);/** 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 sR=ie("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 331 * @license lucide-react v0.462.0 - ISC 332 * 333 * This source code is licensed under the ISC license. 334 * See the LICENSE file in the root directory of this source tree. 335 */const aR=ie("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** 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 kr=ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 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 iR=ie("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 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 Jj=ie("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 351 * @license lucide-react v0.462.0 - ISC 352 * 353 * This source code is licensed under the ISC license. 354 * See the LICENSE file in the root directory of this source tree. 355 */const oR=ie("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 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 ro=ie("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
360y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 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 Ft=ie("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"}]]);/** 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 lR=ie("SquareKanban",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]]);/** 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 lg=ie("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"}]]);/** 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 cg=ie("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]]);/** 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 pm=ie("Tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]]);/** 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 Vn=ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 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 cR=ie("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"}]]);/** 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 uR=ie("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"}]]);/** 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 dR=ie("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]]);/** 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 Qj=ie("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"}]]);/** 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 Zj=ie("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}
vendor: 13,356 bytes, lines 415-430
415],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/** 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 ur=ie("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"}]]);/** 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 hR=ie("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/** 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 zl=ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ug="-",fR=e=>{const t=pR(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(ug);return l[0]===""&&l.length!==1&&l.shift(),Yj(l,t)||mR(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},Yj=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?Yj(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(ug);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Ux=/^\[(.+)\]$/,mR=e=>{if(Ux.test(e)){const t=Ux.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},pR=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return vR(Object.entries(e.classGroups),r).forEach(([i,o])=>{gm(o,n,i,t)}),n},gm=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:Bx(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(gR(a)){gm(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{gm(o,Bx(t,i),r,n)})})},Bx=(e,t)=>{let r=e;return t.split(ug).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},gR=e=>e.isThemeGetter,vR=(e,t)=>t?e.map(([r,n])=>{const a=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[r,a]}):e,xR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},Xj="!",yR=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,a=t[0],i=t.length,o=l=>{const c=[];let u=0,d=0,f;for(let x=0;x<l.length;x++){let w=l[x];if(u===0){if(w===a&&(n||l.slice(x,x+i)===t)){c.push(l.slice(d,x)),d=x+i;continue}if(w==="/"){f=x;continue}}w==="["?u++:w==="]"&&u--}const m=c.length===0?l:l.substring(d),p=m.startsWith(Xj),b=p?m.substring(1):m,v=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:v}};return r?l=>r({className:l,parseClassName:o}):o},wR=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},bR=e=>({cache:xR(e.cacheSize),parseClassName:yR(e),...fR(e)}),jR=/\s+/,_R=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(jR);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}=r(u);let b=!!p,v=n(b?m.substring(0,p):m);if(!v){if(!b){l=u+(l.length>0?" "+l:l);continue}if(v=n(m),!v){l=u+(l.length>0?" "+l:l);continue}b=!1}const x=wR(d).join(":"),w=f?x+Xj:x,g=w+v;if(i.includes(g))continue;i.push(g);const y=a(v,b);for(let j=0;j<y.length;++j){const _=y[j];i.push(w+_)}l=u+(l.length>0?" "+l:l)}return l};function NR(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=e_(t))&&(n&&(n+=" "),n+=r);return n}const e_=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=e_(e[n]))&&(r&&(r+=" "),r+=t);return r};function SR(e,...t){let r,n,a,i=o;function o(c){const u=t.reduce((d,f)=>f(d),e());return r=bR(u),n=r.cache.get,a=r.cache.set,i=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=_R(c,r);return a(c,d),d}return function(){return i(NR.apply(null,arguments))}}const He=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},t_=/^\[(?:([a-z-]+):)?(.+)\]$/i,kR=/^\d+\/\d+$/,CR=new Set(["px","full","screen"]),ER=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TR=/\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$/,RR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,AR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,PR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nn=e=>fi(e)||CR.has(e)||kR.test(e),rs=e=>no(e,"length",zR),fi=e=>!!e&&!Number.isNaN(Number(e)),Bh=e=>no(e,"number",fi),jo=e=>!!e&&Number.isInteger(Number(e)),OR=e=>e.endsWith("%")&&fi(e.slice(0,-1)),Se=e=>t_.test(e),ns=e=>ER.test(e),IR=new Set(["length","size","percentage"]),LR=e=>no(e,IR,r_),$R=e=>no(e,"position",r_),DR=new Set(["image","url"]),MR=e=>no(e,DR,BR),FR=e=>no(e,"",UR),_o=()=>!0,no=(e,t,r)=>{const n=t_.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},zR=e=>TR.test(e)&&!RR.test(e),r_=()=>!1,UR=e=>AR.test(e),BR=e=>PR.test(e),VR=()=>{const e=He("colors"),t=He("spacing"),r=He("blur"),n=He("brightness"),a=He("borderColor"),i=He("borderRadius"),o=He("borderSpacing"),l=He("borderWidth"),c=He("contrast"),u=He("grayscale"),d=He("hueRotate"),f=He("invert"),m=He("gap"),p=He("gradientColorStops"),b=He("gradientColorStopPositions"),v=He("inset"),x=He("margin"),w=He("opacity"),g=He("padding"),y=He("saturate"),j=He("scale"),_=He("sepia"),S=He("skew"),N=He("space"),E=He("translate"),R=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",Se,t],C=()=>[Se,t],F=()=>["",Nn,rs],D=()=>["auto",fi,Se],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],k=()=>["","0",Se],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[fi,Se];return{cacheSize:500,separator:":",theme:{colors:[_o],spacing:[Nn,rs],blur:["none","",ns,Se],brightness:$(),borderColor:[e],borderRadius:["none","","full",ns,Se],borderSpacing:C(),borderWidth:F(),contrast:$(),grayscale:k(),hueRotate:$(),invert:k(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[OR,rs],inset:A(),margin:A(),opacity:$(),padding:C(),saturate:$(),scale:$(),sepia:k(),skew:$(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",Se]}],container:["container"],columns:[{columns:[ns]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"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:[...z(),Se]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",jo,Se]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Se]}],grow:[{grow:k()}],shrink:[{shrink:k()}],order:[{order:["first","last","none",jo,Se]}],"grid-cols":[{"grid-cols":[_o]}],"col-start-end":[{col:["auto",{span:["full",jo,Se]},Se]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[_o]}],"row-start-end":[{row:["auto",{span:[jo,Se]},Se]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Se]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Se,t]}],"min-w":[{"min-w":[Se,t,"min","max","fit"]}],"max-w":[{"max-w":[Se,t,"none","full","min","max","fit","prose",{screen:[ns]},ns]}],h:[{h:[Se,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Se,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Se,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Se,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ns,rs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bh]}],"font-family":[{font:[_o]}],"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",Se]}],"line-clamp":[{"line-clamp":["none",fi,Bh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Nn,Se]}],"list-image":[{"list-image":["none",Se]}],"list-style-type":[{list:["none","disc","decimal",Se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Nn,rs]}],"underline-offset":[{"underline-offset":["auto",Nn,Se]}],"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:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se]}],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",Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),$R]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",LR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},MR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}
vendor: 5,180 bytes, line 430
430],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...B(),"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":[w]}],"divide-style":[{divide:B()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Nn,Se]}],"outline-w":[{outline:[Nn,rs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Nn,rs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ns,FR]}],"shadow-color":[{shadow:[_o]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ns,Se]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[y]}],sepia:[{sepia:[_]}],"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":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"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",Se]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",Se]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",Se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[jo,Se]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"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",Se]}],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",Se]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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 430
430],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",Se]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Nn,rs,Bh]}],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"]}}},qR=SR(VR);function Y(...e){return qR(Uj(e))}const HR=AT,n_=h.forwardRef(({className:e,...t},r)=>s.jsx(Ij,{ref:r,className:Y("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}));n_.displayName=Ij.displayName;const WR=Xi("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"}}),s_=h.forwardRef(({className:e,variant:t,...r},n)=>s.jsx(Lj,{ref:n,className:Y(WR({variant:t}),e),...r}));s_.displayName=Lj.displayName;const KR=h.forwardRef(({className:e,...t},r)=>s.jsx(Mj,{ref:r,className:Y("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}));KR.displayName=Mj.displayName;const a_=h.forwardRef(({className:e,...t},r)=>s.jsx(Fj,{ref:r,className:Y("absolute right-2 top-2 rounded-md p-1 text-foreground
430/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(zl,{className:"h-4 w-4"})}));a_.displayName=Fj.displayName;const i_=h.forwardRef(({className:e,...t},r)=>s.jsx($j,{ref:r,className:Y("text-sm font-semibold",e),...t}));i_.displayName=$j.displayName;const o_=h.forwardRef(({className:e,...t},r)=>s.jsx(Dj,{ref:r,className:Y("text-sm opacity-90",e),...t}));o_.displayName=Dj.displayName;function GR(){const{toasts:e}=hj();return s.jsxs(HR,{children:[e.map(function({id:t,title:r,description:n,action:a,...i}){return s.jsxs(s_,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[r&&s.jsx(i_,{children:r}),n&&s.jsx(o_,{children:n})]}),a,s.jsx(a_,{})]},t)}),s.jsx(n_,{})]})}var Vx=["light","dark"],JR="(prefers-color-scheme: dark)",QR=h.createContext(void 0),ZR={setTheme:e=>{},themes:[]},YR=()=>{var e;return(e=h.useContext(QR))!=null?e:ZR};h.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:a,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let u=i==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(b=>`'${b}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,f=a?Vx.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(b,v=!1,x=!0)=>{let w=o?o[b]:b,g=v?b+"|| ''":`'${w}'`,y="";return a&&x&&!v&&Vx.includes(b)&&(y+=`d.style.colorScheme = '${b}';
430`),r==="class"?v||w?y+=`c.add(${g})`:y+="null":w&&(y+=`d[s](n,${g})`),y},p=e?`!function(){${d}${m(e)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${JR}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${m(o?"x[e]":"e",!0)}}${u?"":"else{"+m(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${m(o?"x[e]":"e",!0)}}else{${m(i,!1,!1)};}${f}}catch(t){}}();`;return h.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var XR=e=>{switch(e){case"success":return rA;case"info":return sA;case"warning":return nA;case"error":return aA;default:return null}},eA=Array(12).fill(0),tA=({visible:e,className:t})=>J.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},J.createElement("div",{className:"sonner-spinner"},eA.map((r,n)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),rA=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.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"})),nA=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},J.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"})),sA=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.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"})),aA=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.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"})),iA=J.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"},J.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),J.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),oA=()=>{let[e,t]=J.useState(document.hidden);return J.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},vm=1,lA=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:vm++,i=this.toasts.find(l=>l.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...e,id:a,title:r}),{...l,...e,id:a,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:a}),a},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)=>
430this.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)=>this.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(),a=r!==void 0,i,o=n.then(async c=>{if(i=["resolve",c],J.isValidElement(c))a=!1,this.create({id:r,type:"default",message:c});else if(uA(c)&&!c.ok){a=!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){a=!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(i=["reject",c],t.error!==void 0){a=!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;a&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>i[0]==="reject"?u(i[1]):c(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||vm++;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}},Gt=new lA,cA=(e,t)=>{let r=(t==null?void 0:t.id)||vm++;return Gt.addToast({title:e,...t,id:r}),r},uA=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",dA=cA,hA=()=>Gt.toasts,fA=()=>Gt.getActiveToasts(),M=Object.assign(dA,{success:Gt.success,info:Gt.info,warning:Gt.warning,error:Gt.error,custom:Gt.custom,message:Gt.message,promise:Gt.promise,dismiss:Gt.dismiss,loading:Gt.loading},{getHistory:hA,getToasts:fA});function mA(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))}mA(`: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;
430left: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}
430: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%);
430--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%)} 431`);function xc(e){return e.label!==void 0}var pA=3,gA="32px",vA="16px",qx=4e3,xA=356,yA=14,wA=20,bA=200;function Or(...e){return e.filter(Boolean).join(" ")}function jA(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var _A=e=>{var t,r,n,a,i,o,l,c,u,d,f;let{invert:m,toast:p,unstyled:b,interacting:v,setHeights:x,visibleToasts:w,heights:g,index:y,toasts:j,expanded:_,removeToast:S,defaultRichColors:N,closeButton:E,style:R,cancelButtonStyle:I,actionButtonStyle:A,className:C="",descriptionClassName:F="",duration:D,position:z,gap:B,loadingIcon:K,expandByDefault:O,classNames:k,icons:L,closeButtonAriaLabel:$="Close toast",pauseWhenPageIsHidden:H}=e,[te,ne]=J.useState(null),[Te,Be]=J.useState(null),[re,Pe]=J.useState(!1),[Fe,Ae]=J.useState(!1),[G,W]=J.useState(!1),[ae,Ce]=J.useState(!1),[ot,Er]=J.useState(!1),[Ks,ho]=J.useState(0),[Pa,gv]=J.useState(0),fo=J.useRef(p.duration||D||qx),vv=J.useRef(null),Gs=J.useRef(null),nC=y===0,sC=y+1<=w,gr=p.type,Oa=p.dism
431issible!==!1,aC=p.className||"",iC=p.descriptionClassName||"",Zl=J.useMemo(()=>g.findIndex(_e=>_e.toastId===p.id)||0,[g,p.id]),oC=J.useMemo(()=>{var _e;return(_e=p.closeButton)!=null?_e:E},[p.closeButton,E]),xv=J.useMemo(()=>p.duration||D||qx,[p.duration,D]),uh=J.useRef(0),Ia=J.useRef(0),yv=J.useRef(0),La=J.useRef(null),[lC,cC]=z.split("-"),wv=J.useMemo(()=>g.reduce((_e,Ue,Je)=>Je>=Zl?_e:_e+Ue.height,0),[g,Zl]),bv=oA(),uC=p.invert||m,dh=gr==="loading";Ia.current=J.useMemo(()=>Zl*B+wv,[Zl,wv]),J.useEffect(()=>{fo.current=xv},[xv]),J.useEffect(()=>{Pe(!0)},[]),J.useEffect(()=>{let _e=Gs.current;if(_e){let Ue=_e.getBoundingClientRect().height;return gv(Ue),x(Je=>[{toastId:p.id,height:Ue,position:p.position},...Je]),()=>x(Je=>Je.filter(Tr=>Tr.toastId!==p.id))}},[x,p.id]),J.useLayoutEffect(()=>{if(!re)return;let _e=Gs.current,Ue=_e.style.height;_e.style.height="auto";let Je=_e.getBoundingClientRect().height;_e.style.height=Ue,gv(Je),x(Tr=>Tr.find(Rr=>Rr.toastId===p.id)?Tr.map(Rr=>Rr.toastId===p.id?{...Rr,height:Je}:Rr):[{toastId:p.id,height:Je,position:p.position},...Tr])},[re,p.title,p.description,x,p.id]);let Yn=J.useCallback(()=>{Ae(!0),ho(Ia.current),x(_e=>_e.filter(Ue=>Ue.toastId!==p.id)),setTimeout(()=>{S(p)},bA)},[p,S,x,Ia]);J.useEffect(()=>{if(p.promise&&gr==="loading"||p.duration===1/0||p.type==="loading")return;let _e;return _||v||H&&bv?(()=>{if(yv.current<uh.current){let Ue=new Date().getTime()-uh.current;fo.current=fo.current-Ue}yv.current=new Date().getTime()})():fo.current!==1/0&&(uh.current=new Date().getTime(),_e=setTimeout(()=>{var Ue;(Ue=p.onAutoClose)==null||Ue.call(p,p),Yn()},fo.current)),()=>clearTimeout(_e)},[_,v,p,gr,H,bv,Yn]),J.useEffect(()=>{p.delete&&Yn()},[Yn,p.delete]);function dC(){var _e,Ue,Je;return L!=null&&L.loading?J.createElement("div",{className:Or(k==null?void 0:k.loader,(_e=p==null?void 0:p.classNames)==null?void 0:_e.loader,"sonner-loader"),"data-visible":gr==="loading"},L.loading):K?J.createElement("div",{className:Or(k==null?void 0:k.loader,(Ue=p==null?void 0:p.classNames)==null?void 0:Ue.loader,"sonner-loader"),"data-visible":gr==="loading"},K):J.createElement(tA,{className:Or(k==null?void 0:k.loader,(Je=p==null?void 0:p.classNames)==null?void 0:Je.loader),visible:gr==="loading"})}return J.createElement("li",{tabIndex:0,ref:Gs,className:Or(C,aC,k==null?void 0:k.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[gr],(r=p==null?void 0:p.classNames)==null?void 0:r[gr]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:N,"data-styled":!(p.jsx||p.unstyled||b),"data-mounted":re,"data-
431promise":!!p.promise,"data-swiped":ot,"data-removed":Fe,"data-visible":sC,"data-y-position":lC,"data-x-position":cC,"data-index":y,"data-front":nC,"data-swiping":G,"data-dismissible":Oa,"data-type":gr,"data-invert":uC,"data-swipe-out":ae,"data-swipe-direction":Te,"data-expanded":!!(_||O&&re),style:{"--index":y,"--toasts-before":y,"--z-index":j.length-y,"--offset":`${Fe?Ks:Ia.current}px`,"--initial-height":O?"auto":`${Pa}px`,...R,...p.style},onDragEnd:()=>{W(!1),ne(null),La.current=null},onPointerDown:_e=>{dh||!Oa||(vv.current=new Date,ho(Ia.current),_e.target.setPointerCapture(_e.pointerId),_e.target.tagName!=="BUTTON"&&(W(!0),La.current={x:_e.clientX,y:_e.clientY}))},onPointerUp:()=>{var _e,Ue,Je,Tr;if(ae||!Oa)return;La.current=null;let Rr=Number(((_e=Gs.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xn=Number(((Ue=Gs.current)==null?void 0:Ue.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Js=new Date().getTime()-((Je=vv.current)==null?void 0:Je.getTime()),Ar=te==="x"?Rr:Xn,es=Math.abs(Ar)/Js;if(Math.abs(Ar)>=wA||es>.11){ho(Ia.current),(Tr=p.onDismiss)==null||Tr.call(p,p),Be(te==="x"?Rr>0?"right":"left":Xn>0?"down":"up"),Yn(),Ce(!0),Er(!1);return}W(!1),ne(null)},onPointerMove:_e=>{var Ue,Je,Tr,Rr;if(!La.current||!Oa||((Ue=window.getSelection())==null?void 0:Ue.toString().length)>0)return;let Xn=_e.clientY-La.current.y,Js=_e.clientX-La.current.x,Ar=(Je=e.swipeDirections)!=null?Je:jA(z);!te&&(Math.abs(Js)>1||Math.abs(Xn)>1)&&ne(Math.abs(Js)>Math.abs(Xn)?"x":"y");let es={x:0,y:0};te==="y"?(Ar.includes("top")||Ar.includes("bottom"))&&(Ar.includes("top")&&Xn<0||Ar.includes("bottom")&&Xn>0)&&(es.y=Xn):te==="x"&&(Ar.includes("left")||Ar.includes("right"))&&(Ar.includes("left")&&Js<0||Ar.includes("right")&&Js>0)&&(es.x=Js),(Math.abs(es.x)>0||Math.abs(es.y)>0)&&Er(!0),(Tr=Gs.current)==null||Tr.style.setProperty("--swipe-amount-x",`${es.x}px`),(Rr=Gs.current)==null||Rr.style.setProperty("--swipe-amount-y",`${es.y}px`)}},oC&&!p.jsx?J.createElement("button",{"aria-label":$,"data-disabled":dh,"data-close-button":!0,onClick:dh||!Oa?()=>{}:()=>{var _e;Yn(),(_e=p.onDismiss)==null||_e.call(p,p)},className:Or(k==null?void 0:k.closeButton,(a=p==null?void 0:p.classNames)==null?void 0:a.closeButton)},(i=L==null?void 0:L.close)!=null?i:iA):null,p.jsx||h.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:J.createElement(J.Fragment,null,gr||p.icon||p.promise?J.createElement("div",{"data-icon":"",className:Or(k==null?void 0:k.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||dC():null,p.type!=="loading"?p.icon||(L==null?void 0:L[gr])||XR(gr):null):null,J.createElement("div",{"data-content":"",className:Or(k==null?void 0:k.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},J.createElement("div",{"data-title":"",className:Or(k==null?void 0:k.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?J.createElement("div",{"data-description":"",className:Or(F,iC,k==null?void 0:k.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),h.isValidElement(p.cancel)?p.cancel:p.cancel&&xc(p.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||I,onClick:_e=>{var Ue,Je;xc(p.cancel)&&Oa&&((Je=(Ue=p.cancel).onClick)==null||Je.call(Ue,_e),Yn())},className:Or(k==null?void 0:k.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,h.isValidElement(p.action)?p.action:p.action&&xc(p.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||A,onClick:_e=>{var Ue,Je;xc(p.action)&&((Je=(Ue=p.action).onClick)==null||Je.call(Ue,_e),!_e.defaultPrevented&&Yn())},className:Or(k==null?void 0:k.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function Hx(){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 NA(e,t){let r={};return[e,t].forEach((n,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",l=i?vA:gA;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 SA=h.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:m,style:p,visibleToasts:b=pA,toastOptions:v,dir:x=Hx(),gap:w=yA,loadingIcon:g,icons:y,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:_}=e,[S,N]=J.useState([]),E=J.useMemo(()=>Array.from(new Set([n].concat(S.filter(H=>H.position).map(H=>H.position)))),[S,n]),[R,I]=J.useState([]),[A,C]=J.useState(!1),[F,D]=J.useState(!1),[z,B]=J.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
431k":"light"),K=J.useRef(null),O=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=J.useRef(null),L=J.useRef(!1),$=J.useCallback(H=>{N(te=>{var ne;return(ne=te.find(Te=>Te.id===H.id))!=null&&ne.delete||Gt.dismiss(H.id),te.filter(({id:Te})=>Te!==H.id)})},[]);return J.useEffect(()=>Gt.subscribe(H=>{if(H.dismiss){N(te=>te.map(ne=>ne.id===H.id?{...ne,delete:!0}:ne));return}setTimeout(()=>{uj.flushSync(()=>{N(te=>{let ne=te.findIndex(Te=>Te.id===H.id);return ne!==-1?[...te.slice(0,ne),{...te[ne],...H},...te.slice(ne+1)]:[H,...te]})})})}),[]),J.useEffect(()=>{if(d!=="system"){B(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;let H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:te})=>{B(te?"dark":"light")})}catch{H.addListener(({matches:ne})=>{try{B(ne?"dark":"light")}catch(Te){console.error(Te)}})}},[d]),J.useEffect(()=>{S.length<=1&&C(!1)},[S]),J.useEffect(()=>{let H=te=>{var ne,Te;a.every(Be=>te[Be]||te.code===Be)&&(C(!0),(ne=K.current)==null||ne.focus()),te.code==="Escape"&&(document.activeElement===K.current||(Te=K.current)!=null&&Te.contains(document.activeElement))&&C(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[a]),J.useEffect(()=>{if(K.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,L.current=!1)}},[K.current]),J.createElement("section",{ref:t,"aria-label":`${j} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((H,te)=>{var ne;let[Te,Be]=H.split("-");return S.length?J.createElement("ol",{key:H,dir:x==="auto"?Hx():x,tabIndex:-1,ref:K,className:l,"data-sonner-toaster":!0,"data-theme":z,"data-y-position":Te,"data-lifted":A&&S.length>1&&!i,"data-x-position":Be,style:{"--front-toast-height":`${((ne=R[0])==null?void 0:ne.height)||0}px`,"--width":`${xA}px`,"--gap":`${w}px`,...p,...NA(c,u)},onBlur:re=>{L.current&&!re.currentTarget.contains(re.relatedTarget)&&(L.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||L.current||(L.current=!0,k.current=re.relatedTarget)},onMouseEnter:()=>C(!0),onMouseMove:()=>C(!0),onMouseLeave:()=>{F||C(!1)},onDragEnd:()=>C(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},S.filter(re=>!re.position&&te===0||re.position===H).map((re,Pe)=>{var Fe,Ae;return J.createElement(_A,{key:re.id,icons:y,index:Pe,toast:re,defaultRichColors:f,duration:(Fe=v==null?void 0:v.duration)!=null?Fe:m,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:r,visibleToasts:b,closeButton:(Ae=v==null?void 0:v.closeButton)!=null?Ae:o,interacting:F,position:H,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:$,toasts:S.filter(G=>G.position==re.position),heights:R.filter(G=>G.position==re.position),setHeights:I,expandByDefault:i,gap:w,loadingIcon:g,expanded:A,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const kA=({...e})=>{const{theme:t="system"}=YR();return s.jsx(SA,{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 CA=lp[" useId ".trim().toString()]||(()=>{}),EA=0;function Gr(e){const[t,r]=h.useState(CA());return ht(()=>{r(n=>n??String(EA++))},[e]),t?`radix-${t}`:""}const TA=["top","right","bottom","left"],Is=Math.min,rr=Math.max,Su=Math.round,yc=Math.floor,Ls=e=>({x:e,y:e}
vendor: 4,474 bytes, line 431
431),RA={left:"right",right:"left",bottom:"top",top:"bottom"},AA={start:"end",end:"start"};function xm(e,t,r){return rr(e,Is(t,r))}function qn(e,t){return typeof e=="function"?e(t):e}function Hn(e){return e.split("-")[0]}function so(e){return e.split("-")[1]}function dg(e){return e==="x"?"y":"x"}function hg(e){return e==="y"?"height":"width"}function $s(e){return["top","bottom"].includes(Hn(e))?"y":"x"}function fg(e){return dg($s(e))}function PA(e,t,r){r===void 0&&(r=!1);const n=so(e),a=fg(e),i=hg(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=ku(o)),[o,ku(o)]}function OA(e){const t=ku(e);return[ym(e),t,ym(t)]}function ym(e){return e.replace(/start|end/g,t=>AA[t])}function IA(e,t,r){const n=["left","right"],a=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return r?t?a:n:t?n:a;case"left":case"right":return t?i:o;default:return[]}}function LA(e,t,r,n){const a=so(e);let i=IA(Hn(e),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(ym)))),i}function ku(e){return e.replace(/left|right|bottom|top/g,t=>RA[t])}function $A(e){return{top:0,right:0,bottom:0,left:0,...e}}function l_(e){return typeof e!="number"?$A(e):{top:e,right:e,bottom:e,left:e}}function Cu(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Wx(e,t,r){let{reference:n,floating:a}=e;const i=$s(t),o=fg(t),l=hg(o),c=Hn(t),u=i==="y",d=n.x+n.width/2-a.width/2,f=n.y+n.height/2-a.height/2,m=n[l]/2-a[l]/2;let p;switch(c){case"top":p={x:d,y:n.y-a.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-a.width,y:f};break;default:p={x:n.x,y:n.y}}switch(so(t)){case"start":p[o]-=m*(r&&u?-1:1);break;case"end":p[o]+=m*(r&&u?-1:1);break}return p}const DA=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:f}=Wx(u,n,c),m=n,p={},b=0;for(let v=0;v<l.length;v++){const{name:x,fn:w}=l[v],{x:g,y,data:j,reset:_}=await w({x:d,y:f,initialPlacement:n,placement:m,strategy:a,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});d=g??d,f=y??f,p={...p,[x]:{...p[x],...j}},_&&b<=50&&(b++,typeof _=="object"&&(_.placement&&(m=_.placement),_.rects&&(u=_.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):_.rects),{x:d,y:f}=Wx(u,m,c)),v=-1)}return{x:d,y:f,placement:m,strategy:a,middlewareData:p}};async function ul(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:m=!1,padding:p=0}=qn(t,e),b=l_(p),x=l[m?f==="floating"?"reference":"floating":f],w=Cu(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(x)))==null||r?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),g=f==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},_=Cu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:c}):g);return{top:(w.top-_.top+b.top)/j.y,bottom:(_.bottom-w.bottom+b.bottom)/j.y,left:(w.left-_.left+b.left)/j.x,right:(_.right-w.right+b.right)/j.x}}const MA=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=qn(e,t)||{};if(u==null)return{};const f=l_(d),m={x:r,y:n},p=fg(a),b=hg(p),v=await o.getDimensions(u),x=p==="y",w=x?"top":"left",g=x?"bottom":"right",y=x?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[p]-m[p]-i.floating[b],_=m[p]-i.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let N=S?S[y]:0;(!N||!await(o.isElement==null?void 0:o.isElement(S)))&&(N=l.floating[y]||i.floating[b]);const E=j/2-_/2,R=N/2-v[b]/2-1,I=Is(f[w],R),A=Is(f[g],R),C=I,F=N-v[b]-A,D=N/2-v[b]/2+E,z=xm(C,D,F),B=!c.arrow&&so(a)!=null&&D!==z&&i.reference[b]/2-(D<C?I:A)-v[b]/2<0,K=B?D<C?D-C:D-
vendor: 4,450 bytes, line 431
431F:0;return{[p]:m[p]+K,data:{[p]:z,centerOffset:D-z-K,...B&&{alignmentOffset:K}},reset:B}}}),FA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:v=!0,...x}=qn(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const w=Hn(a),g=$s(l),y=Hn(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(u.floating)),_=m||(y||!v?[ku(l)]:OA(l)),S=b!=="none";!m&&S&&_.push(...LA(l,v,b,j));const N=[l,..._],E=await ul(t,x),R=[];let I=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&R.push(E[w]),f){const D=PA(a,o,j);R.push(E[D[0]],E[D[1]])}if(I=[...I,{placement:a,overflows:R}],!R.every(D=>D<=0)){var A,C;const D=(((A=i.flip)==null?void 0:A.index)||0)+1,z=N[D];if(z)return{data:{index:D,overflows:I},reset:{placement:z}};let B=(C=I.filter(K=>K.overflows[0]<=0).sort((K,O)=>K.overflows[1]-O.overflows[1])[0])==null?void 0:C.placement;if(!B)switch(p){case"bestFit":{var F;const K=(F=I.filter(O=>{if(S){const k=$s(O.placement);return k===g||k==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(k=>k>0).reduce((k,L)=>k+L,0)]).sort((O,k)=>O[1]-k[1])[0])==null?void 0:F[0];K&&(B=K);break}case"initialPlacement":B=l;break}if(a!==B)return{reset:{placement:B}}}return{}}}};function Kx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Gx(e){return TA.some(t=>e[t]>=0)}const zA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=qn(e,t);switch(n){case"referenceHidden":{const i=await ul(t,{...a,elementContext:"reference"}),o=Kx(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Gx(o)}}}case"escaped":{const i=await ul(t,{...a,altBoundary:!0}),o=Kx(i,r.floating);return{data:{escapedOffsets:o,escaped:Gx(o)}}}default:return{}}}}};async function UA(e,t){const{placement:r,platform:n,elements:a}=e,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=Hn(r),l=so(r),c=$s(r)==="y",u=["left","top"].includes(o)?-1:1,d=i&&c?-1:1,f=qn(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:b}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof b=="number"&&(p=l==="end"?b*-1:b),c?{x:p*d,y:m*u}:{x:m*u,y:p*d}}const BA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await UA(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},VA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:x=>{let{x:w,y:g}=x;return{x:w,y:g}}},...c}=qn(e,t),u={x:r,y:n},d=await ul(t,c),f=$s(Hn(a)),m=dg(f);let p=u[m],b=u[f];if(i){const x=m==="y"?"top":"left",w=m==="y"?"bottom":"right",g=p+d[x],y=p-d[w];p=xm(g,p,y)}if(o){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",g=b+d[x],y=b-d[w];b=xm(g,b,y)}const v=l.fn({...t,[m]:p,[f]:b});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[m]:i,[f]:o}}}}}},qA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=qn(e,t),d={x:r,y:n},f=$s(a),m=dg(f);let p=d[m],b=d[f];const v=qn(l,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const y=m==="y"?"height":"width",j=i.reference[m]-i.floating[y]+x.mainAxis,_=i.reference[m]+i.reference[y]-x.mainAxis;p<j?p=j:p>_&&(p=_)}if(u){var w,g;const y=m==="y"?"width":"height",j=["top","left"].includes(Hn(a)),_=i.reference[f]-i.floating[y]+(j&&((w=o.offset)==null?void 0:w[f])||0)+(j?0:x.crossAxis),S=i.reference[f]+i.reference[y]+(j?0:((g=o.offset)==null?void 0:g[f])||0)-(j?x.crossAxis:0);b<_?b=_:b>S&&(b=S)}return{[m]:p,[f]:b}}}},HA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=qn(e,t),d=await ul(t,u),f=Hn(a),m=so(a),p=$s(a)==="y",{width:b,height:v}=i.floating;let x,w;f==="top"||f==="bottom"?(x=f,w=m===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(w=f,x=m==="end"?"top":"bottom");
vendor: 5,089 bytes, line 431
431const g=v-d.top-d.bottom,y=b-d.left-d.right,j=Is(v-d[x],g),_=Is(b-d[w],y),S=!t.middlewareData.shift;let N=j,E=_;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=y),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=g),S&&!m){const I=rr(d.left,0),A=rr(d.right,0),C=rr(d.top,0),F=rr(d.bottom,0);p?E=b-2*(I!==0||A!==0?I+A:rr(d.left,d.right)):N=v-2*(C!==0||F!==0?C+F:rr(d.top,d.bottom))}await c({...t,availableWidth:E,availableHeight:N});const R=await o.getDimensions(l.floating);return b!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function bd(){return typeof window<"u"}function ao(e){return c_(e)?(e.nodeName||"").toLowerCase():"#document"}function or(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bn(e){var t;return(t=(c_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function c_(e){return bd()?e instanceof Node||e instanceof or(e).Node:!1}function Zr(e){return bd()?e instanceof Element||e instanceof or(e).Element:!1}function pn(e){return bd()?e instanceof HTMLElement||e instanceof or(e).HTMLElement:!1}function Jx(e){return!bd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof or(e).ShadowRoot}function Ul(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Yr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(a)}function WA(e){return["table","td","th"].includes(ao(e))}function jd(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function mg(e){const t=pg(),r=Zr(e)?Yr(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function KA(e){let t=Ds(e);for(;pn(t)&&!Fi(t);){if(mg(t))return t;if(jd(t))return null;t=Ds(t)}return null}function pg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fi(e){return["html","body","#document"].includes(ao(e))}function Yr(e){return or(e).getComputedStyle(e)}function _d(e){return Zr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ds(e){if(ao(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jx(e)&&e.host||bn(e);return Jx(t)?t.host:t}function u_(e){const t=Ds(e);return Fi(t)?e.ownerDocument?e.ownerDocument.body:e.body:pn(t)&&Ul(t)?t:u_(t)}function dl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=u_(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),o=or(a);if(i){const l=wm(o);return t.concat(o,o.visualViewport||[],Ul(a)?a:[],l&&r?dl(l):[])}return t.concat(a,dl(a,[],r))}function wm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function d_(e){const t=Yr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=pn(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,l=Su(r)!==i||Su(n)!==o;return l&&(r=i,n=o),{width:r,height:n,$:l}}function gg(e){return Zr(e)?e:e.contextElement}function mi(e){const t=gg(e);if(!pn(t))return Ls(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:i}=d_(t);let o=(i?Su(r.width):r.width)/n,l=(i?Su(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const GA=Ls(0);function h_(e){const t=or(e);return!pg()||!t.visualViewport?GA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function JA(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==or(e)?!1:t}function wa(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=gg(e);let o=Ls(1);t&&(n?Zr(n)&&(o=mi(n)):o=mi(e));const l=JA(i,r,n)?h_(i):Ls(0);let c=(a.left+l.x)/o.x,u=(a.top+l.y)/o.y,d=a.width/o.x,f=a.height/o.y;if(i){const m=or(i),p=n&&Zr(n)?or(n):n;let b=m,v=wm(b);for(;v&&n&&p!==b;){const x=mi(v),w=v.getBoundingClientRect(),g=Yr(v),y=w.left+(v.clientLeft+parseFloat(g.paddingLeft))*x.x,j=w.top+(v.clientTop+parseFloat(g.paddingTop))*x.y;c*=x.x,u*=x.y,d*=x.x,f*=x.y,c+=y,u+=j,b=or(v),v=wm(b)}}return Cu({width:d,height:f,x:c,y:u})}function QA(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const i=a==="fixed",o=bn(n),l=t?jd(t.floating):!1;if(n===o||l&&i)return r;let c={scrollLeft:0,scrollTop:0},u=Ls(1);const d=Ls(0),f=pn(n);if((f||!f&&!i)&&((ao(n)!=="body"||Ul(o))&&(c=_d(n)),pn(n))){const m=wa(n);u=mi(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x,y:r.y*u.y-c.scrollTop*u.y+d.y}}function ZA(e){return Array.from(e.getClientRects())}function bm(e,t){const r=_d(e).scrollLeft;return t?t.left+r:wa(bn(e)).left+r}function YA(e){const t=bn(e),r=_d(e),n=e.ownerDocument.body,a=rr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=rr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+bm(e);const l=-r.scrollTop;return Yr(n).direction==="rtl"&&(o+=rr(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:l}}
vendor: 4,766 bytes, line 431
431function XA(e,t){const r=or(e),n=bn(e),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const u=pg();(!u||u&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:i,height:o,x:l,y:c}}function eP(e,t){const r=wa(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=pn(e)?mi(e):Ls(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,u=n*i.y;return{width:o,height:l,x:c,y:u}}function Qx(e,t,r){let n;if(t==="viewport")n=XA(e,r);else if(t==="document")n=YA(bn(e));else if(Zr(t))n=eP(t,r);else{const a=h_(e);n={...t,x:t.x-a.x,y:t.y-a.y}}return Cu(n)}function f_(e,t){const r=Ds(e);return r===t||!Zr(r)||Fi(r)?!1:Yr(r).position==="fixed"||f_(r,t)}function tP(e,t){const r=t.get(e);if(r)return r;let n=dl(e,[],!1).filter(l=>Zr(l)&&ao(l)!=="body"),a=null;const i=Yr(e).position==="fixed";let o=i?Ds(e):e;for(;Zr(o)&&!Fi(o);){const l=Yr(o),c=mg(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||Ul(o)&&!c&&f_(e,o))?n=n.filter(d=>d!==o):a=l,o=Ds(o)}return t.set(e,n),n}function rP(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[...r==="clippingAncestors"?jd(t)?[]:tP(t,this._c):[].concat(r),n],l=o[0],c=o.reduce((u,d)=>{const f=Qx(t,d,a);return u.top=rr(f.top,u.top),u.right=Is(f.right,u.right),u.bottom=Is(f.bottom,u.bottom),u.left=rr(f.left,u.left),u},Qx(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function nP(e){const{width:t,height:r}=d_(e);return{width:t,height:r}}function sP(e,t,r){const n=pn(t),a=bn(t),i=r==="fixed",o=wa(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ls(0);if(n||!n&&!i)if((ao(t)!=="body"||Ul(a))&&(l=_d(t)),n){const p=wa(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else a&&(c.x=bm(a));let u=0,d=0;if(a&&!n&&!i){const p=a.getBoundingClientRect();d=p.top+l.scrollTop,u=p.left+l.scrollLeft-bm(a,p)}const f=o.left+l.scrollLeft-c.x-u,m=o.top+l.scrollTop-c.y-d;return{x:f,y:m,width:o.width,height:o.height}}function Vh(e){return Yr(e).position==="static"}function Zx(e,t){if(!pn(e)||Yr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return bn(e)===r&&(r=r.ownerDocument.body),r}function m_(e,t){const r=or(e);if(jd(e))return r;if(!pn(e)){let a=Ds(e);for(;a&&!Fi(a);){if(Zr(a)&&!Vh(a))return a;a=Ds(a)}return r}let n=Zx(e,t);for(;n&&WA(n)&&Vh(n);)n=Zx(n,t);return n&&Fi(n)&&Vh(n)&&!mg(n)?r:n||KA(e)||r}const aP=async function(e){const t=this.getOffsetParent||m_,r=this.getDimensions,n=await r(e.floating);return{reference:sP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function iP(e){return Yr(e).direction==="rtl"}const oP={convertOffsetParentRelativeRectToViewportRelativeRect:QA,getDocumentElement:bn,getClippingRect:rP,getOffsetParent:m_,getElementRects:aP,getClientRects:ZA,getDimensions:nP,getScale:mi,isElement:Zr,isRTL:iP};function lP(e,t){let r=null,n;const a=bn(e);function i(){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),i();const{left:u,top:d,width:f,height:m}=e.getBoundingClientRect();if(l||t(),!f||!m)return;const p=yc(d),b=yc(a.clientWidth-(u+f)),v=yc(a.clientHeight-(d+m)),x=yc(u),g={rootMargin:-p+"px "+-b+"px "+-v+"px "+-x+"px",threshold:rr(0,Is(1,c))||1};let y=!0;function j(_){const S=_[0].intersectionRatio;if(S!==c){if(!y)return o();S?o(!1,S):n=setTimeout(()=>{o(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(j,{...g,root:a.ownerDocument})}catch{r=new IntersectionObserver(j,g)}r.observe(e)}return o(!0),i}function cP(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=gg(e),d=a||i?[...u?dl(u):[],...dl(t)]:[];d.forEach(w=>{a&&w.addEventListener("scroll",r,{passive:!0}),i&&w.addEventListener("resize",r)});const f=u&&l?lP(u,r):null;let m=-1,p=null;o&&(p=new ResizeObserver(w=>{let[g]=w;g&&g.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),r()}),u&&!c&&p.observe(u),p.observe(t));let b,v=c?wa(e):null;c&&x();function x(){const w=wa(e);v&&(w.x!==v.x||w.y!==v.y||w.width!==v.width||w.height!==v.height)&&r(),v=w,b=requestAnimationFrame(x)}return r(),()=>{var w;d.forEach(g=>{a&&g.removeEventListener("scroll",r),i&&g.removeEventListener("resize",r)}),f==null||f(),(w=p)==null||w.disconnect(),p=null,c&&cancelAnimationFrame(b)}}const uP=BA,dP=VA,hP=FA,fP=HA,mP=zA,Yx=MA,pP=qA,gP=(e,t,r)=>{const n=new Map,a={platform:oP,...r},i={...a.platform,_c:n};return DA(e,t,{...a,platform:i})};var Qc=typeof document<"u"?h.useLayoutEffect:h.useEffect;function Eu(e,t){if(e===t)return!0;
vendor: 4,143 bytes, line 431
431if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,a;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(!Eu(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&e.$$typeof)&&!Eu(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function p_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xx(e,t){const r=p_(e);return Math.round(t*r)/r}function qh(e){const t=h.useRef(e);return Qc(()=>{t.current=e}),t}function vP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=h.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=h.useState(n);Eu(m,n)||p(n);const[b,v]=h.useState(null),[x,w]=h.useState(null),g=h.useCallback(O=>{O!==S.current&&(S.current=O,v(O))},[]),y=h.useCallback(O=>{O!==N.current&&(N.current=O,w(O))},[]),j=i||b,_=o||x,S=h.useRef(null),N=h.useRef(null),E=h.useRef(d),R=c!=null,I=qh(c),A=qh(a),C=qh(u),F=h.useCallback(()=>{if(!S.current||!N.current)return;const O={placement:t,strategy:r,middleware:m};A.current&&(O.platform=A.current),gP(S.current,N.current,O).then(k=>{const L={...k,isPositioned:C.current!==!1};D.current&&!Eu(E.current,L)&&(E.current=L,Ta.flushSync(()=>{f(L)}))})},[m,t,r,A,C]);Qc(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(O=>({...O,isPositioned:!1})))},[u]);const D=h.useRef(!1);Qc(()=>(D.current=!0,()=>{D.current=!1}),[]),Qc(()=>{if(j&&(S.current=j),_&&(N.current=_),j&&_){if(I.current)return I.current(j,_,F);F()}},[j,_,F,I,R]);const z=h.useMemo(()=>({reference:S,floating:N,setReference:g,setFloating:y}),[g,y]),B=h.useMemo(()=>({reference:j,floating:_}),[j,_]),K=h.useMemo(()=>{const O={position:r,left:0,top:0};if(!B.floating)return O;const k=Xx(B.floating,d.x),L=Xx(B.floating,d.y);return l?{...O,transform:"translate("+k+"px, "+L+"px)",...p_(B.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:k,top:L}},[r,l,B.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:F,refs:z,elements:B,floatingStyles:K}),[d,F,z,B,K])}const xP=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Yx({element:n.current,padding:a}).fn(r):{}:n?Yx({element:n,padding:a}).fn(r):{}}}},yP=(e,t)=>({...uP(e),options:[e,t]}),wP=(e,t)=>({...dP(e),options:[e,t]}),bP=(e,t)=>({...pP(e),options:[e,t]}),jP=(e,t)=>({...hP(e),options:[e,t]}),_P=(e,t)=>({...fP(e),options:[e,t]}),NP=(e,t)=>({...mP(e),options:[e,t]}),SP=(e,t)=>({...xP(e),options:[e,t]});var kP="Arrow",g_=h.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...i}=e;return s.jsx(ve.svg,{...i,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});g_.displayName=kP;var CP=g_;function v_(e){const[t,r]=h.useState(void 0);return ht(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,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 vg="Popper",[x_,Nd]=er(vg),[EP,y_]=x_(vg),w_=e=>{const{__scopePopper:t,children:r}=e,[n,a]=h.useState(null);return s.jsx(EP,{scope:t,anchor:n,onAnchorChange:a,children:r})};w_.displayName=vg;var b_="PopperAnchor",j_=h.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,i=y_(b_,r),o=h.useRef(null),l=Me(t,o);return h.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:s.jsx(ve.div,{...a,ref:l})});j_.displayName=b_;var xg="PopperContent",[TP,RP]=x_(xg),__=h.forwardRef((e,t)=>
vendor: 4,212 bytes, line 431
431{var re,Pe,Fe,Ae,G,W;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:b,...v}=e,x=y_(xg,r),[w,g]=h.useState(null),y=Me(t,ae=>g(ae)),[j,_]=h.useState(null),S=v_(j),N=(S==null?void 0:S.width)??0,E=(S==null?void 0:S.height)??0,R=n+(i!=="center"?"-"+i:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},A=Array.isArray(u)?u:[u],C=A.length>0,F={padding:I,boundary:A.filter(PP),altBoundary:C},{refs:D,floatingStyles:z,placement:B,isPositioned:K,middlewareData:O}=vP({strategy:"fixed",placement:R,whileElementsMounted:(...ae)=>cP(...ae,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[yP({mainAxis:a+E,alignmentAxis:o}),c&&wP({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?bP():void 0,...F}),c&&jP({...F}),_P({...F,apply:({elements:ae,rects:Ce,availableWidth:ot,availableHeight:Er})=>{const{width:Ks,height:ho}=Ce.reference,Pa=ae.floating.style;Pa.setProperty("--radix-popper-available-width",`${ot}px`),Pa.setProperty("--radix-popper-available-height",`${Er}px`),Pa.setProperty("--radix-popper-anchor-width",`${Ks}px`),Pa.setProperty("--radix-popper-anchor-height",`${ho}px`)}}),j&&SP({element:j,padding:l}),OP({arrowWidth:N,arrowHeight:E}),m&&NP({strategy:"referenceHidden",...F})]}),[k,L]=k_(B),$=cr(b);ht(()=>{K&&($==null||$())},[K,$]);const H=(re=O.arrow)==null?void 0:re.x,te=(Pe=O.arrow)==null?void 0:Pe.y,ne=((Fe=O.arrow)==null?void 0:Fe.centerOffset)!==0,[Te,Be]=h.useState();return ht(()=>{w&&Be(window.getComputedStyle(w).zIndex)},[w]),s.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:K?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Te,"--radix-popper-transform-origin":[(Ae=O.transformOrigin)==null?void 0:Ae.x,(G=O.transformOrigin)==null?void 0:G.y].join(" "),...((W=O.hide)==null?void 0:W.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(TP,{scope:r,placedSide:k,onArrowChange:_,arrowX:H,arrowY:te,shouldHideArrow:ne,children:s.jsx(ve.div,{"data-side":k,"data-align":L,...v,ref:y,style:{...v.style,animation:K?void 0:"none"}})})})});__.displayName=xg;var N_="PopperArrow",AP={top:"bottom",right:"left",bottom:"top",left:"right"},S_=h.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,i=RP(N_,n),o=AP[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(CP,{...a,ref:r,style:{...a.style,display:"block"}})})});S_.displayName=N_;function PP(e){return e!==null}var OP=e=>({name:"transformOrigin",options:e,fn(t){var x,w,g;const{placement:r,rects:n,middlewareData:a}=t,o=((x=a.arrow)==null?void 0:x.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=k_(r),f={start:"0%",center:"50%",end:"100%"}[d],m=(((w=a.arrow)==null?void 0:w.x)??0)+l/2,p=(((g=a.arrow)==null?void 0:g.y)??0)+c/2;let b="",v="";return u==="bottom"?(b=o?f:`${m}px`,v=`${-c}px`):u==="top"?(b=o?f:`${m}px`,v=`${n.floating.height+c}px`):u==="right"?(b=`${-c}px`,v=o?f:`${p}px`):u==="left"&&(b=`${n.floating.width+c}px`,v=o?f:`${p}px`),{data:{x:b,y:v}}}});function k_(e){const[t,r="center"]=e.split("-");return[t,r]}var C_=w_,E_=j_,T_=__,R_=S_,[Sd,DF]=er("Tooltip",[Nd]),kd=Nd(),A_="TooltipProvider",IP=700,jm="tooltip.open",[LP,yg]=Sd(A_),P_=e=>{const{__scopeTooltip:t,delayDuration:r=IP,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:i}=e,o=h.useRef(!0),l=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),s.jsx(LP,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:h.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>
vendor: 9,970 bytes, line 431
431o.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(u=>{l.current=u},[]),disableHoverableContent:a,children:i})};P_.displayName=A_;var hl="Tooltip",[$P,Cd]=Sd(hl),O_=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=yg(hl,e.__scopeTooltip),u=kd(t),[d,f]=h.useState(null),m=Gr(),p=h.useRef(0),b=o??c.disableHoverableContent,v=l??c.delayDuration,x=h.useRef(!1),[w,g]=Qr({prop:n,defaultProp:a??!1,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(jm))):c.onClose(),i==null||i(N)},caller:hl}),y=h.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),j=h.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x.current=!1,g(!0)},[g]),_=h.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g(!1)},[g]),S=h.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,g(!0),p.current=0},v)},[v,g]);return h.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),s.jsx(C_,{...u,children:s.jsx($P,{scope:t,contentId:m,open:w,stateAttribute:y,trigger:d,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?S():j()},[c.isOpenDelayedRef,S,j]),onTriggerLeave:h.useCallback(()=>{b?_():(window.clearTimeout(p.current),p.current=0)},[_,b]),onOpen:j,onClose:_,disableHoverableContent:b,children:r})})};O_.displayName=hl;var _m="TooltipTrigger",I_=h.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Cd(_m,r),i=yg(_m,r),o=kd(r),l=h.useRef(null),c=Me(t,l,a.onTriggerChange),u=h.useRef(!1),d=h.useRef(!1),f=h.useCallback(()=>u.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),s.jsx(E_,{asChild:!0,...o,children:s.jsx(ve.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:c,onPointerMove:ge(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:ge(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:ge(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ge(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:ge(e.onBlur,a.onClose),onClick:ge(e.onClick,a.onClose)})})});I_.displayName=_m;var DP="TooltipPortal",[MF,MP]=Sd(DP,{forceMount:void 0}),zi="TooltipContent",L_=h.forwardRef((e,t)=>{const r=MP(zi,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...i}=e,o=Cd(zi,e.__scopeTooltip);return s.jsx(qs,{present:n||o.open,children:o.disableHoverableContent?s.jsx($_,{side:a,...i,ref:t}):s.jsx(FP,{side:a,...i,ref:t})})}),FP=h.forwardRef((e,t)=>{const r=Cd(zi,e.__scopeTooltip),n=yg(zi,e.__scopeTooltip),a=h.useRef(null),i=Me(t,a),[o,l]=h.useState(null),{trigger:c,onClose:u}=r,d=a.current,{onPointerInTransitChange:f}=n,m=h.useCallback(()=>{l(null),f(!1)},[f]),p=h.useCallback((b,v)=>{const x=b.currentTarget,w={x:b.clientX,y:b.clientY},g=qP(w,x.getBoundingClientRect()),y=HP(w,g),j=WP(v.getBoundingClientRect()),_=GP([...y,...j]);l(_),f(!0)},[f]);return h.useEffect(()=>()=>m(),[m]),h.useEffect(()=>{if(c&&d){const b=x=>p(x,d),v=x=>p(x,c);return c.addEventListener("pointerleave",b),d.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",b),d.removeEventListener("pointerleave",v)}}},[c,d,p,m]),h.useEffect(()=>{if(o){const b=v=>{const x=v.target,w={x:v.clientX,y:v.clientY},g=(c==null?void 0:c.contains(x))||(d==null?void 0:d.contains(x)),y=!KP(w,o);g?m():y&&(m(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,d,o,u,m]),s.jsx($_,{...e,ref:i})}),[zP,UP]=Sd(hl,{isInside:!1}),BP=pj("TooltipContent"),$_=h.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=Cd(zi,r),u=kd(r),{onClose:d}=c;return h.useEffect(()=>(document.addEventListener(jm,d),()=>document.removeEventListener(jm,d)),[d]),h.useEffect(()=>{if(c.trigger){const f=m=>{const p=m.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),s.jsx($l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:s.jsxs(T_,{"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:[s.jsx(BP,{children:n}),s.jsx(zP,{scope:r,isInside:!0,children:s.jsx(fT,{id:c.contentId,role:"tooltip",children:a||n})})]})})});L_.displayName=zi;var D_="TooltipArrow",VP=h.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=kd(r);return UP(D_,r).isInside?null:s.jsx(R_,{...a,...n,ref:t})});VP.displayName=D_;function qP(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function HP(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 WP(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function KP(e,t){const{x:r,y:n}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],u=l.x,d=l.y,f=c.x,m=c.y;d>n!=m>n&&r<(f-u)*(n-d)/(m-d)+u&&(a=!a)}return a}function GP(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),JP(t)}function JP(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const a=e[n];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))r.pop();else break}r.push(a)}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 QP=P_,ZP=O_,YP=I_,M_=L_;const F_=QP,XP=ZP,eO=YP,z_=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>s.jsx(M_,{ref:n,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));z_.displayName=M_.displayName;var Ed=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(){}},Td=typeof window>"u"||"Deno"in globalThis;function Mr(){}function tO(e,t){return typeof e=="function"?e(t):e}function rO(e){return typeof e=="number"&&e>=0&&e!==1/0}function nO(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Nm(e,t){return typeof e=="function"?e(t):e}function sO(e,t){return typeof e=="function"?e(t):e}function ey(e,t){const{type:r="all",exact:n,fetchStatus:a,predicate:i,queryKey:o,stale:l}=e;if(o){if(n){if(t.queryHash!==wg(o,t.options))return!1}else if(!ml(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||a&&a!==t.state.fetchStatus||i&&!i(t))}function ty(e,t){const{exact:r,status:n,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(fl(t.options.mutationKey)!==fl(i))return!1}else if(!ml(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||a&&!a(t))}function wg(e,t){return((t==null?void 0:t.queryKeyHashFn)||fl)(e)}function fl(e){return JSON.stringify(e,(t,r)=>Sm(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function ml(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ml(e[r],t[r])):!1}function U_(e,t){if(e===t)return e;const r=ry(e)&&ry(t);if(r||Sm(e)&&Sm(t)){const n=r?e:Object.keys(e),a=n.length,i=r?t:Object.keys(t),o=i.length,l=r?[]:{},c=new Set(n);let u=0;for(let d=0;d<o;d++){const f=r?d:i[d];(!r&&c.has(f)||r)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=U_(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return a===o&&u===a?e:l}return t}function ry(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sm(e){if(!ny(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!ny(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ny(e){return Object.prototype.toString.call(e)==="[object Object]"}function aO(e){return new Promise(t=>{setTimeout(t,e)})}function iO(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?U_(e,t):t}function oO(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function lO(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var bg=Symbol();function B_(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===bg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}
vendor: 5,604 bytes, line 431
431var ia,ms,ji,V0,cO=(V0=class extends Ed{constructor(){super();Le(this,ia);Le(this,ms);Le(this,ji);Ne(this,ji,t=>{if(!Td&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){V(this,ms)||this.setEventListener(V(this,ji))}onUnsubscribe(){var t;this.hasListeners()||((t=V(this,ms))==null||t.call(this),Ne(this,ms,void 0))}setEventListener(t){var r;Ne(this,ji,t),(r=V(this,ms))==null||r.call(this),Ne(this,ms,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){V(this,ia)!==t&&(Ne(this,ia,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof V(this,ia)=="boolean"?V(this,ia):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ia=new WeakMap,ms=new WeakMap,ji=new WeakMap,V0),V_=new cO,_i,ps,Ni,q0,uO=(q0=class extends Ed{constructor(){super();Le(this,_i,!0);Le(this,ps);Le(this,Ni);Ne(this,Ni,t=>{if(!Td&&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)}}})}onSubscribe(){V(this,ps)||this.setEventListener(V(this,Ni))}onUnsubscribe(){var t;this.hasListeners()||((t=V(this,ps))==null||t.call(this),Ne(this,ps,void 0))}setEventListener(t){var r;Ne(this,Ni,t),(r=V(this,ps))==null||r.call(this),Ne(this,ps,t(this.setOnline.bind(this)))}setOnline(t){V(this,_i)!==t&&(Ne(this,_i,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return V(this,_i)}},_i=new WeakMap,ps=new WeakMap,Ni=new WeakMap,q0),Tu=new uO;function dO(){let e,t;const r=new Promise((a,i)=>{e=a,t=i});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),e(a)},r.reject=a=>{n({status:"rejected",reason:a}),t(a)},r}function hO(e){return Math.min(1e3*2**e,3e4)}function q_(e){return(e??"online")==="online"?Tu.isOnline():!0}var H_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Hh(e){return e instanceof H_}function W_(e){let t=!1,r=0,n=!1,a;const i=dO(),o=v=>{var x;n||(m(new H_(v)),(x=e.abort)==null||x.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>V_.isFocused()&&(e.networkMode==="always"||Tu.isOnline())&&e.canRun(),d=()=>q_(e.networkMode)&&e.canRun(),f=v=>{var x;n||(n=!0,(x=e.onSuccess)==null||x.call(e,v),a==null||a(),i.resolve(v))},m=v=>{var x;n||(n=!0,(x=e.onError)==null||x.call(e,v),a==null||a(),i.reject(v))},p=()=>new Promise(v=>{var x;a=w=>{(n||u())&&v(w)},(x=e.onPause)==null||x.call(e)}).then(()=>{var v;a=void 0,n||(v=e.onContinue)==null||v.call(e)}),b=()=>{if(n)return;let v;const x=r===0?e.initialPromise:void 0;try{v=x??e.fn()}catch(w){v=Promise.reject(w)}Promise.resolve(v).then(f).catch(w=>{var S;if(n)return;const g=e.retry??(Td?0:3),y=e.retryDelay??hO,j=typeof y=="function"?y(r,w):y,_=g===!0||typeof g=="number"&&r<g||typeof g=="function"&&g(r,w);if(t||!_){m(w);return}r++,(S=e.onFail)==null||S.call(e,r,w),aO(j).then(()=>u()?void 0:p()).then(()=>{t?m(w):b()})})};return{promise:i,cancel:o,continue:()=>(a==null||a(),i),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?b():p().then(b),i)}}var fO=e=>setTimeout(e,0);function mO(){let e=[],t=0,r=l=>{l()},n=l=>{l()},a=fO;const i=l=>{t?e.push(l):a(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{a=l}}}var Vt=mO(),oa,H0,K_=(H0=class{constructor(){Le(this,oa)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rO(this.gcTime)&&Ne(this,oa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Td?1/0:5*60*1e3))}clearGcTimeout(){V(this,oa)&&(clearTimeout(V(this,oa)),Ne(this,oa,void 0))}},oa=new WeakMap,H0),Si,la,xr,ca,$t,Tl,ua,zr,Cn,W0,pO=(W0=class extends K_{constructor(t){super();Le(this,zr);Le(this,Si);Le(this,la);Le(this,xr);Le(this,ca);Le(this,$t);Le(this,Tl);Le(this,ua);Ne(this,ua,!1),Ne(this,Tl,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ne(this,ca,t.client),Ne(this,xr,V(this,ca).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ne(this,Si,vO(this.options)),this.state=t.state??V(this,Si),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=V(this,$t))==null?void 0:t.promise}setOptions(t){this.options={...V(this,Tl),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&V(this,xr).remove(this)}setData(t,r){const n=iO(this.state.data,t,this.options);return Pt(this,zr,Cn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Pt(this,zr,Cn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,a;const r=(n=V(this,$t))==null?void 0:n.promise;return(a=V(this,$t))==null||a.cancel(t),r?r.then(Mr).catch(Mr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(V(this,Si))}isActive(){return this.observers.some(t=>sO(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bg||this.state.dataUpdateCount+this.state.errorUpdate
431Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Nm(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:!nO(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=V(this,$t))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=V(this,$t))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),V(this,xr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(V(this,$t)&&(V(this,ua)?V(this,$t).cancel({revert:!0}):V(this,$t).cancelRetry()),this.scheduleGc()),V(this,xr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Pt(this,zr,Cn).call(this,{type:"invalidate"})}fetch(t,r){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(V(this,$t))return V(this,$t).continueRetry(),V(this,$t).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const n=new AbortController,a=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(Ne(this,ua,!0),n.signal)})},i=()=>{const m=B_(this.options,r),b=(()=>{const v={client:V(this,ca),queryKey:this.queryKey,meta:this.meta};return a(v),v})();return Ne(this,ua,!1),this.options.persister?this.options.persister(m,b,this):m(b)},l=(()=>{const m={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:V(this,ca),state:this.state,fetchFn:i};return a(m),m})();(u=this.options.behavior)==null||u.onFetch(l,this),Ne(this,la,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Pt(this,zr,Cn).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=m=>{var p,b,v,x;Hh(m)&&m.silent||Pt(this,zr,Cn).call(this,{type:"error",error:m}),Hh(m)||((b=(p=V(this,xr).config).onError)==null||b.call(p,m,this),(x=(v=V(this,xr).config).onSettled)==null||x.call(v,this.state.data,m,this)),this.scheduleGc()};return Ne(this,$t,W_({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:m=>{var p,b,v,x;if(m===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(w){c(w);return}(b=(p=V(this,xr).config).onSuccess)==null||b.call(p,m,this),(x=(v=V(this,xr).config).onSettled)==null||x.call(v,m,this.state.error,this),this.scheduleGc()},onError:c,onFail:(m,p)=>{Pt(this,zr,Cn).call(this,{type:"failed",failureCount:m,error:p})},onPause:()=>{Pt(this,zr,Cn).call(this,{type:"pause"})},onContinue:()=>{Pt(this,zr,Cn).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),V(this,$t).start()}},Si=new WeakMap,la=new WeakMap,xr=new WeakMap,ca=new WeakMap,$t=new WeakMap,Tl=new WeakMap,ua=new WeakMap,zr=new WeakSet,Cn=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,...gO(n.data,this.options),fetchMeta:t.meta??null};case"success":return Ne(this,la,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 a=t.error;return Hh(a)&&a.revert&&V(this,la)?{...V(this,la),fetchStatus:"idle"}
vendor: 4,715 bytes, line 431
431:{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Vt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),V(this,xr).notify({query:this,type:"updated",action:t})})},W0);function gO(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:q_(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vO(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 sn,K0,xO=(K0=class extends Ed{constructor(t={}){super();Le(this,sn);this.config=t,Ne(this,sn,new Map)}build(t,r,n){const a=r.queryKey,i=r.queryHash??wg(a,r);let o=this.get(i);return o||(o=new pO({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){V(this,sn).has(t.queryHash)||(V(this,sn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=V(this,sn).get(t.queryHash);r&&(t.destroy(),r===t&&V(this,sn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return V(this,sn).get(t)}getAll(){return[...V(this,sn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ey(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>ey(t,n)):r}notify(t){Vt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},sn=new WeakMap,K0),an,Ut,da,on,ss,G0,yO=(G0=class extends K_{constructor(t){super();Le(this,on);Le(this,an);Le(this,Ut);Le(this,da);this.mutationId=t.mutationId,Ne(this,Ut,t.mutationCache),Ne(this,an,[]),this.state=t.state||wO(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){V(this,an).includes(t)||(V(this,an).push(t),this.clearGcTimeout(),V(this,Ut).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ne(this,an,V(this,an).filter(r=>r!==t)),this.scheduleGc(),V(this,Ut).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){V(this,an).length||(this.state.status==="pending"?this.scheduleGc():V(this,Ut).remove(this))}continue(){var t;return((t=V(this,da))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,l,c,u,d,f,m,p,b,v,x,w,g,y,j,_,S,N,E;const r=()=>{Pt(this,on,ss).call(this,{type:"continue"})};Ne(this,da,W_({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(R,I)=>{Pt(this,on,ss).call(this,{type:"failed",failureCount:R,error:I})},onPause:()=>{Pt(this,on,ss).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>V(this,Ut).canRun(this)}));const n=this.state.status==="pending",a=!V(this,da).canStart();try{if(n)r();else{Pt(this,on,ss).call(this,{type:"pending",variables:t,isPaused:a}),await((o=(i=V(this,Ut).config).onMutate)==null?void 0:o.call(i,t,this));const I=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));I!==this.state.context&&Pt(this,on,ss).call(this,{type:"pending",context:I,variables:t,isPaused:a})}const R=await V(this,da).start();return await((d=(u=V(this,Ut).config).onSuccess)==null?void 0:d.call(u,R,t,this.state.context,this)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,R,t,this.state.context)),await((b=(p=V(this,Ut).config).onSettled)==null?void 0:b.call(p,R,null,this.state.variables,this.state.context,this)),await((x=(v=this.options).onSettled)==null?void 0:x.call(v,R,null,t,this.state.context)),Pt(this,on,ss).call(this,{type:"success",data:R}),R}catch(R){try{throw await((g=(w=V(this,Ut).config).onError)==null?void 0:g.call(w,R,t,this.state.context,this)),await((j=(y=this.options).onError)==null?void 0:j.call(y,R,t,this.state.context)),await((S=(_=V(this,Ut).config).onSettled)==null?void 0:S.call(_,void 0,R,this.state.variables,this.state.context,this)),await((E=(N=this.options).onSettled)==null?void 0:E.
431call(N,void 0,R,t,this.state.context)),R}finally{Pt(this,on,ss).call(this,{type:"error",error:R})}}finally{V(this,Ut).runNext(this)}}},an=new WeakMap,Ut=new WeakMap,da=new WeakMap,on=new WeakSet,ss=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),Vt.batch(()=>{V(this,an).forEach(n=>{n.onMutationUpdate(t)}),V(this,Ut).notify({mutation:this,type:"updated",action:t})})},G0);function wO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var On,Ur,Rl,J0,bO=(J0=class extends Ed{constructor(t={}){super();Le(this,On);Le(this,Ur);Le(this,Rl);this.config=t,Ne(this,On,new Set),Ne(this,Ur,new Map),Ne(this,Rl,0)}build(t,r,n){const a=new yO({mutationCache:this,mutationId:++Yl(this,Rl)._,options:t.defaultMutationOptions(r),state:n});return this.add(a),a}add(t){V(this,On).add(t);const r=wc(t);if(typeof r=="string"){const n=V(this,Ur).get(r);n?n.push(t):V(this,Ur).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(V(this,On).delete(t)){const r=wc(t);if(typeof r=="string"){const n=V(this,Ur).get(r);if(n)if(n.length>1){const a=n.indexOf(t);a!==-1&&n.splice(a,1)}else n[0]===t&&V(this,Ur).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=wc(t);if(typeof r=="string"){const n=V(this,Ur).get(r),a=n==null?void 0:n.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var n;const r=wc(t);if(typeof r=="string"){const a=(n=V(this,Ur).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vt.batch(()=>{V(this,On).forEach(t=>{this.notify({type:"removed",mutation:t})}),V(this,On).clear(),V(this,Ur).clear()})}getAll(){return Array.from(V(this,On))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ty(r,n))}findAll(t={}){return this.getAll().filter(r=>ty(t,r))}notify(t){Vt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>
vendor: 4,438 bytes, line 431
431r.state.isPaused);return Vt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Mr))))}},On=new WeakMap,Ur=new WeakMap,Rl=new WeakMap,J0);function wc(e){var t;return(t=e.options.scope)==null?void 0:t.id}function sy(e){return{onFetch:(t,r)=>{var d,f,m,p,b;const n=t.options,a=(m=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],o=((b=t.state.data)==null?void 0:b.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let v=!1;const x=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},w=B_(t.options,t.fetchOptions),g=async(y,j,_)=>{if(v)return Promise.reject();if(j==null&&y.pages.length)return Promise.resolve(y);const N=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:j,direction:_?"backward":"forward",meta:t.options.meta};return x(A),A})(),E=await w(N),{maxPages:R}=t.options,I=_?lO:oO;return{pages:I(y.pages,E,R),pageParams:I(y.pageParams,j,R)}};if(a&&i.length){const y=a==="backward",j=y?jO:ay,_={pages:i,pageParams:o},S=j(n,_);l=await g(_,S,y)}else{const y=e??i.length;do{const j=c===0?o[0]??n.initialPageParam:ay(n,l);if(c>0&&j==null)break;l=await g(l,j),c++}while(c<y)}return l};t.options.persister?t.fetchFn=()=>{var v,x;return(x=(v=t.options).persister)==null?void 0:x.call(v,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function ay(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 jO(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 rt,gs,vs,ki,Ci,xs,Ei,Ti,Q0,_O=(Q0=class{constructor(e={}){Le(this,rt);Le(this,gs);Le(this,vs);Le(this,ki);Le(this,Ci);Le(this,xs);Le(this,Ei);Le(this,Ti);Ne(this,rt,e.queryCache||new xO),Ne(this,gs,e.mutationCache||new bO),Ne(this,vs,e.defaultOptions||{}),Ne(this,ki,new Map),Ne(this,Ci,new Map),Ne(this,xs,0)}mount(){Yl(this,xs)._++,V(this,xs)===1&&(Ne(this,Ei,V_.subscribe(async e=>{e&&(await this.resumePausedMutations(),V(this,rt).onFocus())})),Ne(this,Ti,Tu.subscribe(async e=>{e&&(await this.resumePausedMutations(),V(this,rt).onOnline())})))}unmount(){var e,t;Yl(this,xs)._--,V(this,xs)===0&&((e=V(this,Ei))==null||e.call(this),Ne(this,Ei,void 0),(t=V(this,Ti))==null||t.call(this),Ne(this,Ti,void 0))}isFetching(e){return V(this,rt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return V(this,gs).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=V(this,rt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=V(this,rt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Nm(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return V(this,rt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=V(this,rt).get(n.queryHash),i=a==null?void 0:a.state.data,o=tO(t,i);if(o!==void 0)return V(this,rt).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Vt.batch(()=>V(this,rt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=V(this,rt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=V(this,rt);Vt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=V(this,rt);return Vt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Vt.batch(()=>V(this,rt).findAll(e).map(a=>a.cancel(r)));return Promise.all(n).then(Mr).catch(Mr)}invalidateQueries(e,t={}){return Vt.batch(()=>(V(this,rt).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=Vt.batch(()=>V(this,rt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,r);return r.throwOnError||(i=i.catch(Mr)),a.state.fetchStatus==="paused"?Promise.resolve():i}
431));return Promise.all(n).then(Mr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=V(this,rt).build(this,t);return r.isStaleByTime(Nm(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mr).catch(Mr)}fetchInfiniteQuery(e){return e.behavior=sy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mr).catch(Mr)}ensureInfiniteQueryData(e){return e.behavior=sy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Tu.isOnline()?V(this,gs).resumePausedMutations():Promise.resolve()}getQueryCache(){return V(this,rt)}getMutationCache(){return V(this,gs)}getDefaultOptions(){return V(this,vs)}setDefaultOptions(e){Ne(this,vs,e)}setQueryDefaults(e,t){V(this,ki).set(fl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...V(this,ki).values()],r={};return t.forEach(n=>{ml(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){V(this,Ci).set(fl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...V(this,Ci).values()],r={};return t.forEach(n=>{ml(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...V(this,vs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=wg(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===bg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...V(this,vs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){V(this,rt).clear(),V(this,gs).clear()}},rt=new WeakMap,gs=new WeakMap,vs=new WeakMap,ki=new WeakMap,Ci=new WeakMap,xs=new WeakMap,Ei=new WeakMap,Ti=new WeakMap,Q0),NO=h.createContext(void 0),SO=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(NO.Provider,{value:e,children:t}));/** 432 * @remix-run/router v1.23.0 433 * 434 * Copyright (c) Remix Software Inc. 435 * 436 * This source code is licensed under the MIT license found in the 437 * LICENSE.md file in the root directory of this source tree. 438 * 439 * @license MIT 440 */function pl(){return pl=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},pl.apply(this,arguments)}var bs;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(bs||(bs={}));const iy="popstate";function kO(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:o,hash:l}=n.location;return km("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Ru(a)}return EO(t,r,null,e)}function et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function G_(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function CO(){return Math.random().toString(36).substr(2,8)}function oy(e,t){return{usr:e.state,key:e.key,idx:t}}function km(e,t,r,n){return r===void 0&&(r=null),pl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?io(t):t,{state:r,key:t&&t.key||n||CO()})}function Ru(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 io(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 EO(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,l=bs.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(pl({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=bs.Pop;let x=d(),w=x==null?null:x-u;u=x,c&&c({action:l,location:v.location,delta:w})}function m(x,w){l=bs.Push;let g=km(v.location,x,w);u=d()+1;let y=oy(g,u),j=v.createHref(g);try{o.pushState(y,"",j)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;a.location.assign(j)}i&&c&&c({action:l,location:v.location,delta:1})}function p(x,w){l=bs.Replace;let g=km(v.location,x,w);u=d();let y=oy(g,u),j=v.createHref(g);o.replaceState(y,"",j),i&&c&&c({action:l,location:v.location,delta:0})}function b(x){let w=a.location.origin!=="null"?a.location.origin:a.location.href,g=typeof x=="str
440ing"?x:Ru(x);return g=g.replace(/ $/,"%20"),et(w,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,w)}let v={get action(){return l},get location(){return e(a,o)},listen(x){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(iy,f),c=x,()=>{a.removeEventListener(iy,f),c=null}},createHref(x){return t(a,x)},createURL:b,encodeLocation(x){let w=b(x);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:m,replace:p,go(x){return o.go(x)}};return v}var ly;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ly||(ly={}));function TO(e,t,r){return r===void 0&&(r="/"),RO(e,t,r,!1)}function RO(e,t,r,n){let a=typeof t=="string"?io(t):t,i=Ui(a.pathname||"/",r);if(i==null)return null;let o=J_(e);AO(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=BO(i);l=zO(o[c],u,n)}return l}function J_(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(et(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=Rs([n,c.relativePath]),d=r.concat(c);i.children&&i.children.length>0&&(et(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),J_(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:MO(u,i.index),routesMeta:d})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of Q_(i.path))a(i,o,c)}),t}function Q_(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=Q_(n.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function AO(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:FO(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const PO=/^:[\w-]+$/,OO=3,IO=2,LO=1,$O=10,DO=-2,cy=e=>e==="*";function MO(e,t){let r=e.split("/"),n=r.length;return r.some(cy)&&(n+=DO),t&&(n+=IO),r.filter(a=>!cy(a)).reduce((a,i)=>a+(PO.test(i)?OO:i===""?LO:$O),n)}function FO(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function zO(e,t,r){let{routesMeta:n}=e,a={},i="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=Au({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),m=c.route;if(!f&&u&&r&&!n[n.length-1].route.index&&(f=Au({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;
vendor: 9,622 bytes, lines 440-449
440Object.assign(a,f.params),o.push({params:a,pathname:Rs([i,f.pathname]),pathnameBase:WO(Rs([i,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(i=Rs([i,f.pathnameBase]))}return o}function Au(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=UO(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((u,d,f)=>{let{paramName:m,isOptional:p}=d;if(m==="*"){let v=l[f]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const b=l[f];return p&&!b?u[m]=void 0:u[m]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function UO(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),G_(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=[],a="^"+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:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function BO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return G_(!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 Ui(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 VO(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?io(e):e;return{pathname:r?r.startsWith("/")?r:qO(r,t):t,search:KO(n),hash:GO(a)}}function qO(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Wh(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 HO(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function jg(e,t){let r=HO(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function _g(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=io(e):(a=pl({},e),et(!a.pathname||!a.pathname.includes("?"),Wh("?","pathname","search",a)),et(!a.pathname||!a.pathname.includes("#"),Wh("#","pathname","hash",a)),et(!a.search||!a.search.includes("#"),Wh("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),f-=1;a.pathname=m.join("/")}l=f>=0?t[f]:"/"}let c=VO(a,l),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Rs=e=>e.join("/").replace(/\/\/+/g,"/"),WO=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),KO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,GO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function JO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Z_=["post","put","patch","delete"];new Set(Z_);const QO=["get",...Z_];new Set(QO);/** 441 * React Router v6.30.1 442 * 443 * Copyright (c) Remix Software Inc. 444 * 445 * This source code is licensed under the MIT license found in the 446 * LICENSE.md file in the root directory of this source tree. 447 * 448 * @license MIT 449 */function gl(){return gl=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},gl.apply(this,arguments)}const Rd=h.createContext(null),Y_=h.createContext(null),Jn=h.createContext(null),Ad=h.createContext(null),jn=h.createContext({outlet:null,matches:[],isDataRoute:!1}),X_=h.createContext(null);function ZO(e,t){let{relative:r}=t===void 0?{}:t;oo()||et(!1);let{basename:n,navigator:a}=h.useContext(Jn),{hash:i,pathname:o,search:l}=Pd(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:Rs([n,o])),a.createHref({pathname:c,search:l,hash:i})}function oo(){return h.useContext(Ad)!=null}function mr(){return oo()||et(!1),h.useContext(Ad).location}function e1(e){h.useContext(Jn).static||h.useLayoutEffect(e)}function pr(){let{isDataRoute:e}=h.useContext(jn);return e?h4():YO()}function YO(){oo()||et(!1);let e=h.useContext(Rd),{basename:t,future:r,navigator:n}=h.useContext(Jn),{matches:a}=h.useContext(jn),{pathname:i}=mr(),o=JSON.stringify(jg(a,r.v7_relativeSplatPath)),l=h.useRef(!1);return e1(()=>{l.current=!0}),h.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=_g(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Rs([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,o,i,e])}const XO=h.createContext(null);function e4(e){let t=h.useContext(jn).outlet;return t&&h.createElement(XO.Provider,{value:e},t)}function Aa(){let{matches:e}=h.useContext(jn),t=e[e.length-1];return t?t.params:{}}function Pd(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=h.useContext(Jn),{matches:a}=h.useContext(jn),{pathname:i}=mr(),o=JSON.stringify(jg(a,n.v7_relativeSplatPath));return h.useMemo(()=>_g(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function t4(e,t){return r4(e,t)}function r4(e,t,r,n){oo()||et(!1);let{navigator:a}=h.useContext(Jn),{matches:i}=h.useContext(jn),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=mr(),d;if(t){var f;let x=typeof t=="string"?io(t):t;c==="/"||(f=x.pathname)!=null&&f.startsWith(c)||et(!1),d=x}else d=u;let m=d.pathname||"/",p=m;if(c!=="/"){let x=c.replace(/^\//,"").split("/");p="/"+m.replace(/^\//,"").split("/").slice(x.length).join("/")}let b=TO(e,{pathname:p}),v=o4(b&&b.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:Rs([c,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Rs([c,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,r,n);return t&&v?h.createElement(Ad.Provider,{value:{location:gl({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:bs.Pop}},v):v}function n4(){let e=d4(),t=JO(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:a},r):null,null)}const s4=h.createElement(n4,null);class a4 extends h.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?h.createElement(jn.Provider,{value:this.props.routeContext},h.createElement(X_.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function i4(e){let{routeContext:t,match:r,children:n}=e,a=h.useContext(Rd);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),h.createElement(jn.Provider,{value:t},n)}function o4(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(a=r)==null?void 0:a.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||et(!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 f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:m,errors:p}=r,b=f.route.loader&&m[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||b){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,m)=>{let p,b=!1,v=null,x=null;r&&(p=l&&f.route.id?l[f.route.id]:void 0,v=f.route.errorElement||s4,c&&(u<0&&m===0?(b=!0,x=null):u===m&&(b=!0,x=f.route.hydrateFallbackElement||null)));let w=t.concat(o.slice(0,m+1)),g=()=>{let y;return p?y=v:b?y=x:f.route.Component?y=h.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=d,h.createElement(i4,{match:f,routeContext:{outlet:d,matches:w,isDataRoute:r!=null},children:y})};return r&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?h.createElement(a4,{location:r.location,revalidation:r.revalidation,component:v,error:p,children:g(),routeC
449ontext:{outlet:null,matches:w,isDataRoute:!0}}):g()},null)}var t1=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(t1||{}),Pu=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}(Pu||{});function l4(e){let t=h.useContext(Rd);return t||et(!1),t}function c4(e){let t=h.useContext(Y_);return t||et(!1),t}function u4(e){let t=h.useContext(jn);return t||et(!1),t}function r1(e){let t=u4(),r=t.matches[t.matches.length-1];return r.route.id||et(!1),r.route.id}function d4(){var e;let t=h.useContext(X_),r=c4(Pu.UseRouteError),n=r1(Pu.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function h4(){let{router:e}=l4(t1.UseNavigateStable),t=r1(Pu.UseNavigateStable),r=h.useRef(!1);return e1(()=>{r.current=!0}),h.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,gl({fromRouteId:t},i)))},[e,t])}function f4(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ou(e){let{to:t,replace:r,state:n,relative:a}=e;oo()||et(!1);let{future:i,static:o}=h.useContext(Jn),{matches:l}=h.useContext(jn),{pathname:c}=mr(),u=pr(),d=_g(t,jg(l,i.v7_relativeSplatPath),c,a==="path"),f=JSON.stringify(d);return h.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:a}),[u,f,a,r,n]),null}function Od(e){return e4(e.context)}function oe(e){et(!1)}function m4(e){let{basename:t="/",children:r=null,location:n,navigationType:a=bs.Pop,navigator:i,static:o=!1,future:l}=e;oo()&&et(!1);let c=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:c,navigator:i,static:o,future:gl({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof n=="string"&&(n=io(n));let{pathname:d="/",search:f="",hash:m="",state:p=null,key:b="default"}=n,v=h.useMemo(()=>{let x=Ui(d,c);return x==null?null:{location:{pathname:x,search:f,hash:m,state:p,key:b},navigationType:a}},[c,d,f,m,p,b,a]);return v==null?null:h.createElement(Jn.Provider,{value:u},h.createElement(Ad.Provider,{children:r,value:v}))}function n1(e){let{children:t,location:r}=e;return t4(Cm(t),r)}new Promise(()=>{});function Cm(e,t){t===void 0&&(t=[]);let r=[];return h.Children.forEach(e,(n,a)=>{if(!h.isValidElement(n))return;let i=[...t,a];if(n.type===h.Fragment){r.push.apply(r,Cm(n.props.children,i));return}n.type!==oe&&et(!1),!n.props.index||!n.props.children||et(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Cm(n.props.children,i)),r.push(o)}),r}/** 450 * React Router DOM v6.30.1 451 * 452 * Copyright (c) Remix Software Inc. 453 * 454 * This source code is licensed under the MIT license found in the 455 * LICENSE.md file in the root directory of this source tree. 456 * 457 * @license MIT 458 */function Iu(){return Iu=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},Iu.apply(this,arguments)}function s1(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function p4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function g4(e,t){return e.button===0&&(!t||t==="_self")&&!p4(e)}function Em(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(a=>[r,a]):[[r,n]])},[]))}function v4(e,t){let r=Em(e);return t&&t.forEach((n,a)=>
458{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const x4=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],y4=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],w4="6";try{window.__reactRouterVersion=w4}catch{}const b4=h.createContext({isTransitioning:!1}),j4="startTransition",uy=lp[j4];function _4(e){let{basename:t,children:r,future:n,window:a}=e,i=h.useRef();i.current==null&&(i.current=kO({window:a,v5Compat:!0}));let o=i.current,[l,c]=h.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},d=h.useCallback(f=>{u&&uy?uy(()=>c(f)):c(f)},[c,u]);return h.useLayoutEffect(()=>o.listen(d),[o,d]),h.useEffect(()=>f4(n),[n]),h.createElement(m4,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const N4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",S4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,me=h.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,m=s1(t,x4),{basename:p}=h.useContext(Jn),b,v=!1;if(typeof u=="string"&&S4.test(u)&&(b=u,N4))try{let y=new URL(window.location.href),j=u.startsWith("//")?new URL(y.protocol+u):new URL(u),_=Ui(j.pathname,p);j.origin===y.origin&&_!=null?u=_+j.search+j.hash:v=!0}catch{}let x=ZO(u,{relative:a}),w=C4(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:a,viewTransition:f});function g(y){n&&n(y),y.defaultPrevented||w(y)}return h.createElement("a",Iu({},m,{href:b||x,onClick:v||i?n:g,ref:r,target:c}))}),Bl=h.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:i="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=s1(t,y4),m=Pd(c,{relative:f.relative}),p=mr(),b=h.useContext(Y_),{navigator:v,basename:x}=h.useContext(Jn),w=b!=null&&E4(m)&&u===!0,g=v.encodeLocation?v.encodeLocation(m).pathname:m.pathname,y=p.pathname,j=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;a||(y=y.toLowerCase(),j=j?j.toLowerCase():null,g=g.toLowerCase()),j&&x&&(j=Ui(j,x)||j);const _=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let S=y===g||!o&&y.startsWith(g)&&y.charAt(_)==="/",N=j!=null&&(j===g||!o&&j.startsWith(g)&&j.charAt(g.length)==="/"),E={isActive:S,isPending:N,isTransitioning:w},R=S?n:void 0,I;typeof i=="function"?I=i(E):I=[i,S?"active":null,N?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let A=typeof l=="function"?l(E):l;return h.createElement(me,Iu({},f,{"aria-current":R,className:I,ref:r,style:A,to:c,viewTransition:u}),typeof d=="function"?d(E):d)});var Tm;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Tm||(Tm={}));var dy;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(dy||(dy={}));function k4(e){let t=h.useContext(Rd);return t||et(!1),t}function C4(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=pr(),u=mr(),d=Pd(e,{relative:o});return h.useCallback(f=>{if(g4(f,r)){f.preventDefault();let m=n!==void 0?n:Ru(u)===Ru(d);c(e,{replace:m,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,d,n,a,r,e,i,o,l])}function Ng(e){let t=h.useRef(Em(e)),r=h.useRef(!1),n=mr(),a=h.useMemo(()=>v4(n.search,r.current?null:t.current),[n.search]),i=pr(),o=h.useCallback((l,c)=>{const u=Em(typeof l=="function"?l(a):l);r.current=!0,i("?"+u,c)},[i,a]);return[a,o]}function E4(e,t){t===void 0&&(t={});let r=h.useContext(b4);r==null&&et(!1);let{basename:n}=k4(Tm.useViewTransitionState),a=Pd(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=Ui(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Ui(r.nextLocation.pathname,n)||r.nextLocation.pathname;
458return Au(a.pathname,o)!=null||Au(a.pathname,i)!=null}function T4(e,t,r,n){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(d){try{u(n.next(d))}catch(f){o(f)}}function c(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):a(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}const R4=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Sg extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class A4 extends Sg{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class hy extends Sg{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class fy extends Sg{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Rm;(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"})(Rm||(Rm={}));class P4{constructor(t,{headers:r={},customFetch:n,region:a=Rm.Any}={}){this.url=t,this.headers=r,this.region=a,this.fetch=R4(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return T4(this,arguments,void 0,function*(r,n={}){var a,i;let o,l,c;try{const{headers:u,method:d,body:f,signal:m,timeout:p}=n;let b={},{region:v}=n;v||(v=this.region);const x=new URL(`${this.url}/${r}`);v&&v!=="any"&&(b["x-region"]=v,x.searchParams.set("forceFunctionRegion",v));let w;const g=!!u&&Object.keys(u).some(E=>E.toLowerCase()==="content-type");f&&!g?typeof Blob<"u"&&f instanceof Blob||f instanceof ArrayBuffer?(b["Content-Type"]="application/octet-stream",w=f):typeof f=="string"?(b["Content-Type"]="text/plain",w=f):typeof FormData<"u"&&f instanceof FormData?w=f:(b["Content-Type"]="application/json",w=JSON.stringify(f)):f&&typeof f!="string"&&!(typeof Blob<"u"&&f instanceof Blob)&&!(f instanceof ArrayBuffer)&&!(typeof FormData<"u"&&f instanceof FormData)?w=JSON.stringify(f):w=f;let y=m;p&&(l=new AbortController,o=setTimeout(()=>l.abort(),p),m?(y=l.signal,c=()=>l.abort(),m.addEventListener("abort",c)):y=l.signal);const j=yield this.fetch(x.toString(),{method:d||"POST",headers:Object.assign(Object.assign(Object.assign({},b),this.headers),u),body:w,signal:y}).catch(E=>{throw new A4(E)}),_=j.headers.get("x-relay-error");if(_&&_==="true")throw new hy(j);if(!j.ok)throw new fy(j);let S=((a=j.headers.get("Content-Type"))!==null&&a!==void 0?a:"text/plain").split(";")[0].trim().toLowerCase(),N;return S==="application/json"?N=yield j.json():S==="application/octet-stream"||S==="application/pdf"?N=yield j.blob():S==="text/event-stream"?N=j:S==="multipart/form-data"?N=yield j.formData():N=yield j.text(),{data:N,error:null,response:j}}catch(u){return{data:null,error:u,response:u instanceof fy||u instanceof hy?u.context:void 0}}finally{o&&clearTimeout(o),c&&((i=n.signal)===null||i===void 0||i.removeEventListener("abort",c))}})}}const a1=3,my=e=>Math.min(1e3*2**e,3e4),O4=[520,503],i1=["GET","HEAD","OPTIONS"];var py=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
458de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function gy(e,t){return new Promise(r=>{if(t!=null&&t.aborted){r();return}const n=setTimeout(()=>{t==null||t.removeEventListener("abort",a),r()},e);function a(){clearTimeout(n),r()}t==null||t.addEventListener("abort",a)})}function I4(e,t,r,n){return!(!n||r>=a1||!i1.includes(e)||!O4.includes(t))}var L4=class{constructor(e){var t,r,n,a,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=e.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(a=e.urlLengthLimit)!==null&&a!==void 0?a:8e3,this.retryEnabled=(i=e.retry)!==null&&i!==void 0?i:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let i=(async()=>{let o=0;for(;;){const u={};r.headers.forEach((f,m)=>{u[m]=f}),o>0&&(u["X-Retry-Count"]=String(o));let d;try{d=await n(r.url.toString(),{method:r.method,headers:u,body:JSON.stringify(r.body,(f,m)=>typeof m=="bigint"?m.toString():m),signal:r.signal})}catch(f){if((f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"||!i1.includes(r.method))throw f;if(r.retryEnabled&&o<a1){const m=my(o);o++,await gy(m,r.signal);continue}throw f}if(I4(r.method,d.status,o,r.retryEnabled)){var l,c;const f=(l=(c=d.headers)===null||c===void 0?void 0:c.get("Retry-After"))!==null&&l!==void 0?l:null,m=f!==null?Math.max(0,parseInt(f,10)||0)*1e3:my(o);await d.text(),o++,await gy(m,r.signal);continue}return await r.processResponse(d)}})();return this.shouldThrowOnError||(i=i.catch(o=>{var l;let c="",u="",d="";const f=o==null?void 0:o.cause;if(f){var m,p,b,v;const g=(m=f==null?void 0:f.message)!==null&&m!==void 0?m:"",y=(p=f==null?void 0:f.code)!==null&&p!==void 0?p:"";c=`${(b=o==null?void 0:o.name)!==null&&b!==void 0?b:"FetchError"}: ${o==null?void 0:o.message}`,c+=` 459 460Caused by: ${(v=f==null?void 0:f.name)!==null&&v!==void 0?v:"Error"}: ${g}`,y&&(c+=` (${y})`),f!=null&&f.stack&&(c+=` 461${f.stack}`)}else{var x;c=(x=o==null?void 0:o.stack)!==null&&x!==void 0?x:""}const w=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(d="",u="Request was aborted (timeout or manual cancellation)",w>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${w} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",u="HTTP headers exceeded server limits (typically 16KB)",w>this.urlLengthLimit&&(u+=`. Your request URL is ${w} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(l=o==null?void 0:o.name)!==null&&l!==void 0?l:"FetchError"}: ${o==null?void 0:o.message}`,details:c,hint:u,code:d},data:null,count:null,status:0,statusText:""}}
461)),i.then(e,t)}async processResponse(e){var t=this;let r=null,n=null,a=null,i=e.status,o=e.statusText;if(e.ok){var l,c;if(t.method!=="HEAD"){var u;const m=await e.text();if(m!=="")if(t.headers.get("Accept")==="text/csv")n=m;else if(t.headers.get("Accept")&&(!((u=t.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text")))n=m;else try{n=JSON.parse(m)}catch{if(r={message:m},n=null,t.shouldThrowOnError)throw new py({message:m,details:"",hint:"",code:""})}}const d=(l=t.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),f=(c=e.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");d&&f&&f.length>1&&(a=parseInt(f[1])),t.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,a=null,i=406,o="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const d=await e.text();try{r=JSON.parse(d),Array.isArray(r)&&e.status===404&&(n=[],r=null,i=200,o="OK")}catch{e.status===404&&d===""?(i=204,o="No Content"):r={message:d}}if(r&&t.shouldThrowOnError)throw new py(r)}return{success:r===null,error:r,data:n,count:a,status:i,statusText:o}}returns(){return this}overrideTypes(){return this}},$4=class extends L4{throwOnError(){return super.throwOnError()}select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:a=n}={}){const i=a?`${a}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const a=typeof n>"u"?"offset":`${n}.offset`,i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(a,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:a=!1,format:i="text"}={}){var o;const l=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,a?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${c}"; options=${l};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const vy=new RegExp("[,()]");var qa=class extends $4{throwOnError(){return super.throwOnError()}eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&vy.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&vy.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let a="";n==="plain"?a="pl":n==="phrase"?a="ph":n==="websearch"&&(a="w");const i=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${a}fts${i}.${t}`),this}match(e){return Object.entries(e).filter(([t,r])=>
461r!==void 0).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},D4=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:a=8e3,retry:i}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=a,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:n}=t??{},a=r?"HEAD":"GET";let i=!1;const o=(e??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",o),n&&c.append("Prefer",`count=${n}`),new qa({method:a,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const a="POST",{url:i,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),r||o.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){const c=[...new Set(l)].map(u=>`"${u}"`);i.searchParams.set("columns",c.join(","))}}return new qa({method:a,url:i,headers:o,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:a=!0}={}){var i;const o="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),n&&c.append("Prefer",`count=${n}`),a||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);l.searchParams.set("columns",d.join(","))}}return new qa({method:o,url:l,headers:c,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var r;const n="PATCH",{url:a,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new qa({method:n,url:a,headers:i,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:a}=this.cloneRequestState();return e&&a.append("Prefer",`count=${e}`),new qa({method:r,url:n,headers:a,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function vl(e){"@babel/helpers - typeof";return vl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vl(e)}function M4(e,t){if(vl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(vl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function F4(e){var t=M4(e,"string");return vl(t)=="symbol"?t:t+""}function z4(e,t,r){return(t=F4(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function bc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xy(Object(r),!0).forEach(function(n){z4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var U4=class o1{constructor(t,{headers:r={},schema:n,fetch:a,timeout:i,urlLengthLimit:o=8e3,retry:l}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;const c=a??globalThis.fetch;i!==void 0&&i>0?this.fetch=(u,d)=>{const f=new AbortController,m=setTimeout(()=>f.abort(),i),p=d==null?void 0:d.signal;if(p){if(p.aborted)return clearTimeout(m),c(u,d);const b=()=>{clearTimeout(m),f.abort()};return p.addEventListener("abort",b,{once:!0}),c(u,bc(bc({},d),{}
461,{signal:f.signal})).finally(()=>{clearTimeout(m),p.removeEventListener("abort",b)})}return c(u,bc(bc({},d),{},{signal:f.signal})).finally(()=>clearTimeout(m))}:this.fetch=c,this.retry=l}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new D4(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new o1(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,r={},{head:n=!1,get:a=!1,count:i}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),f=n&&Object.values(r).some(d);f?(l="POST",u=r):n||a?(l=n?"HEAD":"GET",Object.entries(r).filter(([p,b])=>b!==void 0).map(([p,b])=>[p,Array.isArray(b)?`{${b.join(",")}}`:`${b}`]).forEach(([p,b])=>{c.searchParams.append(p,b)})):(l="POST",u=r);const m=new Headers(this.headers);return f?m.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&m.set("Prefer",`count=${i}`),new qa({method:l,url:c,headers:m,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class B4{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const a=globalThis.process;if(a){const i=a.versions;if(i&&i.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` 462 463Suggested solution: ${t.workaround}`),new Error(r)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}}const V4="2.110.8",q4=`realtime-js/${V4}`,H4="1.0.0",l1="2.0.0",W4=l1,K4=1e4,G4=100,hs={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},c1={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},Am={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class J4{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(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))}_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;const a=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,a)}_encodeJsonUserBroadcastPush(t){var r,n;const a=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(a)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,r,n){var a,i;const o=new TextEncoder,l=o.encode(t.topic),c=o.encode((a=t.ref)!==null&&a!==void 0?a:""),u=o.encode((i=t.join_ref)!==null&&i!==void 0?i:""),d=o.encode(t.payload.event),f=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},m=o.encode(Object.keys(f).length===0?"":JSON.stringify(f));if(u.length>255)throw new Error(`joinRef length ${u.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`ref length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`topic length ${l.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`metadata length ${m.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+u.length+c.length+l.length+d.length+m.length,b=new ArrayBuffer(this.HEADER_LENGTH+p),v=new DataView(b),x=new Uint8Array(b);let w=0;v.setUint8(w++,this.KINDS.userBroadcastPush),v.setUint8(w++,u.length),v.setUint8(w++,c.length),v.setUint8(w++,l.length),v.setUint8(w++,d.length),v.setUint8(w++,m.length),v.setUint8(w++,r),x.set(u,w),w+=u.length,x.set(c,w),w+=c.length,x.set(l,w),w+=l.length,x.set(d,w),w+=d.length,x.set(m,w),w+=m.length;var g=new Uint8Array(b.byteLength+n.byteLength);return g.set(new Uint8Array(b),0),g.set(new Uint8Array(n),b.byteLength),g.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),[a,i,o,l,c]=n;return r({join_ref:a,ref:i,topic:o,event:l,payload:c})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),a=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,a)}}_decodeUserBroadcast(t,r,n){const a=r.getUint8(1),i=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+a));c=c+a;const d=n.decode(t.slice(c,c+i));c=c+i;
463const f=n.decode(t.slice(c,c+o));c=c+o;const m=t.slice(c,t.byteLength),p=l===this.JSON_ENCODING?JSON.parse(n.decode(m)):m,b={type:this.BROADCAST_EVENT,event:d,payload:p};return o>0&&(b.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:b}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}var Ve;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Ve||(Ve={}));const yy=(e,t,r={})=>{var n;const a=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=Q4(o,e,t,a),i),{}):{}},Q4=(e,t,r,n)=>{const a=t.find(l=>
vendor: 5,530 bytes, line 463
463l.name===e),i=a==null?void 0:a.type,o=r[e];return i&&!n.includes(i)?u1(i,o):Pm(o)},u1=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return eI(t,r)}switch(e){case Ve.bool:return Z4(t);case Ve.float4:case Ve.float8:case Ve.int2:case Ve.int4:case Ve.int8:case Ve.numeric:case Ve.oid:return Y4(t);case Ve.json:case Ve.jsonb:return X4(t);case Ve.timestamp:return tI(t);case Ve.abstime:case Ve.date:case Ve.daterange:case Ve.int4range:case Ve.int8range:case Ve.money:case Ve.reltime:case Ve.text:case Ve.time:case Ve.timestamptz:case Ve.timetz:case Ve.tsrange:case Ve.tstzrange:return Pm(t);default:return Pm(t)}},Pm=e=>e,Z4=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Y4=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},X4=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},eI=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let i;const o=e.slice(1,r);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(l=>u1(t,l))}return e},tI=e=>typeof e=="string"?e.replace(" ","T"):e,d1=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var pi=e=>typeof e=="function"?e:function(){return e},rI=typeof self<"u"?self:null,Ha=typeof window<"u"?window:null,nn=rI||Ha||globalThis,nI="2.0.0",sI=1e4,aI=1e3,iI=100,ln={connecting:0,open:1,closing:2,closed:3},Kt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Tn={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Om={longpoll:"longpoll",websocket:"websocket"},oI={complete:4},Im="base64url.bearer.phx.",jc=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},h1=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},lI=class{constructor(e,t,r){this.state=Kt.closed,this.topic=e,this.params=pi(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new jc(this,Tn.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new h1(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Kt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=Kt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Kt.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=Kt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new jc(this,Tn.leave,pi({}),this.timeout).send(),this.state=Kt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Tn.reply,(n,a)=>{this.trigger(this.replyEventName(a),n)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}
vendor: 19,019 bytes, lines 463-464
463teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Kt.closed,this.bindings=[]}onClose(e){this.on(Tn.close,e)}onError(e){return this.on(Tn.error,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>!(r.event===e&&(typeof t>"u"||t===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new jc(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Kt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Tn.close,"leave")},r=new jc(this,Tn.leave,pi({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic!==e?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Kt.joining,this.joinPush.resend(e))}trigger(e,t,r,n){let a=this.onMessage(e,t,r,n);if(t&&!a)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(o=>o.event===e&&this.filterBindings(o,t,r));for(let o=0;o<i.length;o++)i[o].callback(a,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Kt.closed}isErrored(){return this.state===Kt.errored}isJoined(){return this.state===Kt.joined}isJoining(){return this.state===Kt.joining}isLeaving(){return this.state===Kt.leaving}},Lu=class{static request(e,t,r,n,a,i,o){if(nn.XDomainRequest){let l=new nn.XDomainRequest;return this.xdomainRequest(l,e,t,n,a,i,o)}else if(nn.XMLHttpRequest){let l=new nn.XMLHttpRequest;return this.xhrRequest(l,e,t,r,n,a,i,o)}else{if(nn.fetch&&nn.AbortController)return this.fetchRequest(e,t,r,n,a,i,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,r,n,a,i,o){let l={method:e,headers:r,body:n},c=null;return a&&(c=new AbortController,setTimeout(()=>c.abort(),a),l.signal=c.signal),nn.fetch(t,l).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>o&&o(u)).catch(u=>{u.name==="AbortError"&&i?i():o&&o(null)}),c}static xdomainRequest(e,t,r,n,a,i,o){return e.timeout=a,e.open(t,r),e.onload=()=>{let l=this.parseJSON(e.responseText);o&&o(l)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,a,i,o,l){e.open(t,r,!0),e.timeout=i;for(let[c,u]of Object.entries(n))e.setRequestHeader(c,u);return e.onerror=()=>l&&l(null),e.onreadystatechange=()=>{if(e.readyState===oI.complete&&l){let c=this.parseJSON(e.responseText);l(c)}},o&&(e.ontimeout=o),e.send(a),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let a=t?`${t}[${n}]`:n,i=e[n];typeof i=="object"?r.push(this.serialize(i,a)):r.push(encodeURIComponent(a)+"="+encodeURIComponent(i))}return r.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},cI=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let a=0;a<n;a++)t+=String.fromCharCode(r[a]);return btoa(t)},Da=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Im)&&(this.authToken=atob(t[1].slice(Im.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=ln.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Om.websocket),"$1/"+Om.longpoll)}endpointURL(){return Lu.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=ln.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===ln.open||this.readyState===ln.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:r,token:n,messages:a}=t;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:a.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=ln.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(e){typeof e!="string"&&(e=cI(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e,t=0){this.awaitingBatchAck=!0;const r=t+iI,n=e.slice(t,r);this.ajax("POST",{"Content-Type":"application/x-ndjson"},n.join(` 464`),()=>this.onerror("timeout"),a=>{!a||a.status!==200?(this.awaitingBatchAck=!1,this.onerror(a&&a.status),this.closeAndRetry(1011,"internal server error",!1)):r<e.length?this.batchSend(e,r):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(e,t,r){for(let a of this.reqs)a.abort();this.readyState=ln.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,a){let i,o=()=>{this.reqs.delete(i),n()};i=Lu.request(e,this.endpointURL(),t,r,this.timeout,o,l=>{this.reqs.delete(i),this.isActive()&&a(l)}),this.reqs.add(i)}},uI=class Ro{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state=Object.create(null),this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,a=>{let{onJoin:i,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Ro.syncState(this.state,a,i,o),this.pendingDiffs.forEach(c=>{this.state=Ro.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],l()}),this.channel.on(n.diff,a=>{let{onJoin:i,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=Ro.syncDiff(this.state,a,i,o),l())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return Ro.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,r,n,a){let i=this.toNullProtoObj(this.clone(t));r=this.toNullProtoObj(r);let o=Object.create(null),l=Object.create(null);return this.map(i,(c,u)=>{r[c]||(l[c]=u)}),this.map(r,(c,u)=>{let d=i[c];if(d){let f=u.metas.map(v=>v.phx_ref),m=d.metas.map(v=>v.phx_ref),p=u.metas.filter(v=>m.indexOf(v.phx_ref)<0),b=d.metas.filter(v=>f.indexOf(v.phx_ref)<0);p.length>0&&(o[c]=u,o[c].metas=p),b.length>0&&(l[c]=this.clone(d),l[c].metas=b)}else o[c]=u}),this.syncDiff(i,{joins:o,leaves:l},n,a)}static syncDiff(t,r,n,a){t=this.toNullProtoObj(t);let{joins:i,leaves:o}=this.clone(r);return n||(n=function(){}),a||(a=function(){}),this.map(i,(l,c)=>{let u=t[l];if(t[l]=this.clone(c),u){let d=t[l].metas.map(m=>m.phx_ref),f=u.metas.filter(m=>d.indexOf(m.phx_ref)<0);t[l].metas.unshift(...f)}n(l,u,c)}),this.map(o,(l,c)=>{let u=t[l];if(!u)return;let d=c.metas.map(f=>f.phx_ref);u.metas=u.metas.filter(f=>d.indexOf(f.phx_ref)<0),a(l,u,c),u.metas.length===0&&delete t[l]}),t}static list(t,r){return r||(r=function(n,a){return a}),this.map(t,(n,a)=>r(n,a))}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static toNullProtoObj(t){if(Object.getPrototypeOf(t)===null)return t;let r=Object.create(null);return Object.getOwnPropertyNames(t).forEach(n=>{r[n]=t[n]}),r}static clone(t){return JSON.parse(JSON.stringify(t))}},_c={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,a,i,o]=JSON.parse(e);return t({join_ref:r,ref:n,topic:a,event:i,payload:o})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:a,payload:i}=e,o=new TextEncoder,l=o.encode(t),c=o.encode(r),u=o.encode(a),d=o.encode(n);this.assertFieldSize(l.byteLength,"join_ref"),this.assertFieldSize(c.byteLength,"ref"),this.assertFieldSize(u.byteLength,"topic"),this.assertFieldSize(d.byteLength,"event");let f=this.META_LENGTH+l.byteLength+c.byteLength+u.byteLength+d.byteLength,m=new ArrayBuffer(this.HEADER_LENGTH+f),p=new Uint8Array(m),b=new DataView(m),v=0;b.setUint8(v++,this.KINDS.push),b.setUint8(v++,l.byteLength),b.setUint8(v++,c.byteLength),b.setUint8(v++,u.byteLength),b.setUint8(v++,d.byteLength),p.set(l,v),v+=l.byteLength,p.set(c,v),v+=c.byteLength,p.set(u,v),v+=u.byteLength,p.set(d,v),v+=d.byteLength;var x=new Uint8Array(m.byteLength+i.byteLength);return x.set(p,0),x.set(new Uint8Array(i),m.byteLength),x.buffer},assertFieldSize(e,t){if(e>255)throw new Error(`unable to convert ${t} to binary: must be less than or equal to 255 bytes, but is ${e} bytes`)},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),a=t.getUint8(2),i=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,l=r.decode(e.slice(o,o+n));o=o+n;let c=r.decode(e.slice(o,o+a));o=o+a;let u=r.decode(e.slice(o,o+i));o=o+i;let d=e.slice(o,e.byteLength);return{join_ref:l,ref:null,topic:c,event:u,payload:d}},decodeReply(e,t,r){let n=t.getUint8(1),a=t.getUint8(2),i=t.getUint8(3),o=t.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,c=r.decode(e.slice(l,l+n));l=l+n;let u=r.decode(e.slice(l,l+a));l=l+a;let d=r.decode(e.slice(l,l+i));l=l+i;let f=r.decode(e.slice(l,l+o));l=l+o;let m=e.slice(l,e.byteLength),p={status:f,response:m};return{join_ref:c,ref:u,topic:d,event:Tn.reply,payload:p}},decodeBroadcast(e,t,r){let n=t.getUint8(1),a=t.getUint8(2),i=this.HEADER_LENGTH+2,o=r.decode(e.slice(i,i+n));i=i+n;let l=r.decode(e.slice(i,i+a));i=i+a;let c=e.slice(i,e.byteLength);return{join_ref:null,ref:null,topic:o,event:l,payload:c}}},dI=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||sI,this.transport=t.transport||nn.WebSocket||Da,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=nn&&nn.sessionStorage}catch{}this.sessionStore=t.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=_c.encode.bind(_c),this.defaultDecoder=_c.decode.bind(_c),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Da?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Ha&&Ha.addEventListener&&(Ha.addEventListener("pagehide",a=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Ha.addEventListener("pageshow",a=>{n===this.connectClock&&(n=null,this.connect())}),Ha.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=a=>t.rejoinAfterMs?t.rejoinAfterMs(a):[1e3,2e3,5e3][a-1]||1e4,this.reconnectAfterMs=a=>t.reconnectAfterMs?t.reconnectAfterMs(a):[10,50,100,150,200,250,500,1e3,2e3][a-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(a,i,o)=>{console.log(`${a}: ${i}`,o)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=pi(t.params||{}),this.endPoint=`${e}/${Om.websocket}`,this.vsn=t.vsn||nI,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new h1(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken&&pi(t.authToken)}getLongPollTransport(){return Da}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=Lu.appendParams(Lu.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=pi(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Da?this.connectWithFallback(Da,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(a=>{a.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){switch(e){case Da:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Im}${btoa(this.authToken()).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,a,i,o=this.transportName(e),l=c=>{this.log("transport",`falling back to ${o}...`,c),this.off([a,i]),n=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return l("memorized");this.fallbackTimer=setTimeout(l,t),i=this.onError(c=>{this.log("transport","error",c),n&&!r&&(clearTimeout(this.fallbackTimer),l(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let c=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(l,t),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),aI,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();const n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){if(r===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r)}waitForSocketClosed(e,t,r=1){if(r===5||e.readyState===ln.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError(e)}
vendor: 4,126 bytes, line 464
464triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(Tn.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case ln.connecting:return"connecting";case ln.open:return"open";case ln.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([r])=>e.indexOf(r)===-1)}channel(e,t={}){let r=new lI(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:a,join_ref:i}=e;this.log("push",`${t} ${r} (${i}, ${a})`,n)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:r,event:n,payload:a,ref:i,join_ref:o}=t;if(i&&i===this.pendingHeartbeatRef){const l=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(a.status==="ok"?"ok":"error",l)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${a.status||""} ${r} ${n} ${i&&"("+i+")"||""}`.trim(),a);for(let l=0;l<this.channels.length;l++){const c=this.channels[l];c.isMember(r,n,a,o)&&c.trigger(n,a,i,o)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(a){this.log("error",`error in ${e} callback`,a)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r.isJoined()||r.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class Ho{constructor(t,r){const n=fI(r);this.presence=new uI(t.getChannel(),n),this.presence.onJoin((a,i,o)=>{const l=Ho.onJoinPayload(a,i,o);t.getChannel().trigger("presence",l)}),this.presence.onLeave((a,i,o)=>{const l=Ho.onLeavePayload(a,i,o);t.getChannel().trigger("presence",l)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return Ho.transformState(this.presence.state)}static transformState(t){return t=hI(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const a=t[n];return r[n]=Zc(a),r},{})}static onJoinPayload(t,r,n){const a=wy(r),i=Zc(n);return{event:"join",key:t,currentPresences:a,newPresences:i}}static onLeavePayload(t,r,n){const a=wy(r),i=Zc(n);return{event:"leave",key:t,currentPresences:a,leftPresences:i}}}function Zc(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function hI(e){return JSON.parse(JSON.stringify(e))}function fI(e){return(e==null?void 0:e.events)&&{events:e.events}}function wy(e){return e!=null&&e.metas?Zc(e):[]}var by;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(by||(by={}));class mI{get state(){return this.presenceAdapter.state}constructor(t,r){this.channel=t,this.presenceAdapter=new Ho(this.channel.channelAdapter,r)}}function pI(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);
464if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const r=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${r}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class gI{constructor(t,r,n){const a=vI(n);this.channel=t.getSocket().channel(r,a),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,r){return this.channel.on(t,r)}off(t,r){this.channel.off(t,r)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,r,n){let a;try{a=this.channel.push(t,r,n)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>G4){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return a}updateJoinPayload(t){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),t)}canPush(){return this.socket.isConnected()&&this.state===hs.joined}isJoined(){return this.state===hs.joined}isJoining(){return this.state===hs.joining}isClosed(){return this.state===hs.closed}isLeaving(){return this.state===hs.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function vI(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}const xI=/[,()"\\]/,yI=e=>xI.test(e)||e!==e.trim(),wI=e=>`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,jy=e=>{const t=e===null?"null":String(e);return yI(t)?wI(t):t},bI=e=>e===null?"null":String(e),jI=(e,t)=>{if(e==="in"){const r=Array.isArray(t)?t:[t];if(r.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(r)).map(a=>jy(a)).join(",")})`}return e==="is"?`is.${bI(t)}`:`${e}.${jy(t)}`};class _I{constructor(){this.filters=[]}add(t,r,n,a=!1){const i=a?"not.":"";return this.filters.push(`${t}=${i}${jI(r,n)}`),this}eq(t,r){return this.add(t,"eq",r)}neq(t,r){return this.add(t,"neq",r)}gt(t,r){return this.add(t,"gt",r)}gte(t,r){return this.add(t,"gte",r)}lt(t,r){return this.add(t,"lt",r)}lte(t,r){return this.add(t,"lte",r)}in(t,r){return this.add(t,"in",r)}like(t,r){return this.add(t,"like",r)}ilike(t,r){return this.add(t,"ilike",r)}match(t,r){return this.add(t,"match",r)}imatch(t,r){return this.add(t,"imatch",r)}is(t,r){return this.add(t,"is",r)}isDistinct(t,r){return this.add(t,"isdistinct",r)}not(t,r,n){return this.add(t,r,n,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}var _y;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(_y||(_y={}));var ii;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ii||(ii={}));var Rn;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Rn||(Rn={}));class Wo{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,r={config:{}},n){var a,i;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},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.channelAdapter=new gI(this.socket.socketAdapter,t,this.params),this.presence=new mI(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=d1(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(a=this.params.config)===null||a===void 0?void 0:a.broadcast)===null||i===void 0)&&i.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,r=this.timeout){var n,a,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:l,private:c}}=this.params,u=(a=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(p=>p.filter))!==null&&a!==void 0?a:[],d=!!this.bindings[ii.PRESENCE]&&this.bindings[ii.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,f={},m={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(p=>{t==null||t(Rn.CHANNEL_ERROR,pI(p))}),this._onClose(()=>t==null?void 0:t(Rn.CLOSED)),this.updateJoinPayload(Object.assign({config:m},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(Rn.SUBSCRIBED);return}this._updatePostgresBindings(p,t)}
464).receive("error",p=>{this.state=hs.errored;const b=Object.values(p).join(", ")||"error";t==null||t(Rn.CHANNEL_ERROR,new Error(b,{cause:p}))}).receive("timeout",()=>{t==null||t(Rn.TIMED_OUT)})}return this}_updatePostgresBindings(t,r){var n;const a=this.bindings.postgres_changes,i=(n=a==null?void 0:a.length)!==null&&n!==void 0?n:0,o=[];for(let l=0;l<i;l++){const c=a[l],{filter:{event:u,schema:d,table:f,filter:m}}=c,p=t&&t[l];if(p&&p.event===u&&Wo.isFilterValueEqual(p.schema,d)&&Wo.isFilterValueEqual(p.table,f)&&Wo.isFilterValueEqual(p.filter,m))o.push(Object.assign(Object.assign({},c),{id:p.id}));else{this.unsubscribe(),this.state=hs.errored,r==null||r(Rn.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=hs.errored&&r&&r(Rn.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){const a=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=t===ii.PRESENCE||t===ii.POSTGRES_CHANGES;if(a&&i)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,r,n)}async httpSend(t,r,n={}){var a;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const i=r instanceof ArrayBuffer||ArrayBuffer.isView(r),o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":i?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l=new URL(this.broadcastEndpointURL);l.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(t)}`,this.private&&l.searchParams.set("private","true");const c={method:"POST",headers:o,body:i?r:JSON.stringify(r)},u=await this._fetchWithTimeout(l.toString(),c,(a=n.timeout)!==null&&a!==void 0?a:this.timeout);if(u.status===202)return{success:!0};if(u.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let d=u.statusText;try{const f=await u.json();d=f.error||f.message||d}catch{}return Promise.reject(new Error(d))}async send(t,r={}){var n,a;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated
464in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((a=u.body)===null||a===void 0?void 0:a.cancel()),u.ok?"ok":"error"}catch(u){return u instanceof Error&&u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,l,c;const u=this.channelAdapter.push(t.type,t,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)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,r,n){const a=new AbortController,i=setTimeout(()=>a.abort(),n),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:a.signal}));return clearTimeout(i),o}_on(t,r,n){const a=t.toLocaleLowerCase(),i=r==null?void 0:r.filter;(i instanceof _I||typeof i=="object"&&i!==null&&typeof i.build=="function")&&(r=Object.assign(Object.assign({},r),{filter:i.build()}));const o=this.channelAdapter.on(t,n),l={type:a,filter:r,callback:n,ref:o};return this.bindings[a]?this.bindings[a].push(l):this.bindings[a]=[l],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,r,n)=>{var a,i,o,l,c,u,d;const f=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,n))return!1;const m=(a=this.bindings[f])===null||a===void 0?void 0:a.find(p=>p.ref===t.ref);if(!m)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in m){const p=m.id,b=(i=m.filter)===null||i===void 0?void 0:i.event;return p&&((o=r.ids)===null||o===void 0?void 0:o.includes(p))&&(b==="*"||(b==null?void 0:b.toLocaleLowerCase())===((l=r.data)===null||l===void 0?void 0:l.type.toLocaleLowerCase()))}else{const p=(u=(c=m==null?void 0:m.filter)===null||c===void 0?void 0:c.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return p==="*"||p===((d=r==null?void 0:r.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===f})}_notThisChannelEvent(t,r){const{close:n,error:a,leave:i,join:o}=c1;return r&&[n,a,i,o].includes(t)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,r,n)=>{if(typeof r=="object"&&"ids"in r){const a=r.data,{schema:i,table:o,commit_timestamp:l,type:c,errors:u}=a;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:l,eventType:c,new:{},old:{},errors:u}),this._getPayloadRecords(a))}return r})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in t.bindings)for(const n of t.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=yy(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=yy(t.columns,t.old_record)),r}}class NI{constructor(t,r){this.socket=new dI(t,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,r,n,a=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),a),this.socket.disconnect(()=>{t(),i("ok")},r,n)})}push(t){this.socket.push(t)}log(t,r,n){this.socket.log(t,r,n)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Am.connecting}isDisconnecting(){return this.socket.connectionState()==Am.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Ny={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},SI=[1e3,2e3,5e3,1e4],kI=1e4;function CI(){const e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){var r;return(r=Array.from(e.keys())[t])!==null&&r!==void 0?r:null},removeItem(t){e.delete(t)},setItem(t,r){e.set(t,String(r))}}}function EI(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return CI()}const TI=` 465 addEventListener("message", (e) => { 466 if (e.data.event === "start") { 467 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 468 } 469 });`;class RI{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
469,this.ref=0,this.serializer=new J4,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=i=>i?(...o)=>i(...o):(...o)=>fetch(...o),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const a=this._initializeOptions(r);this.socketAdapter=new NI(t,a),this.httpEndpoint=d1(t),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const r=t.message;throw new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,r)}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return r==="ok"&&t.teardown(),r}async removeAllChannels(){const t=this.channels.map(async n=>{const a=await n.unsubscribe();return n.teardown(),a}),r=await Promise.all(t);return await this.disconnect(),r}log(t,r,n){this.socketAdapter.log(t,r,n)}connectionState(){return this.socketAdapter.connectionState()||Am.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,r={config:{}}){const n=`realtime:${t}`,a=this.getChannels().find(i=>i.topic===n);if(a)return a;{const i=new Wo(`realtime:${t}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(i),i}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
469this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let r,n=!1;if(t)r=t,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(a){this.log("error","Error fetching access token from callback",a),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(a=>{const i={access_token:r,version:q4};r&&a.updateJoinPayload(i),a.joinedOnce&&a.channelAdapter.isJoined()&&a.channelAdapter.push(c1.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(r,n)=>{r!=="disconnected"&&(r=="sent"&&this._setAuthSafely(),t&&t(r,n))}}_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._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([TI],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(t){var r,n,a,i,o,l,c,u,d,f,m,p;this.worker=(r=t==null?void 0:t.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=t==null?void 0:t.accessToken)!==null&&n!==void 0?n:null;const b={};b.timeout=(a=t==null?void 0:t.timeout)!==null&&a!==void 0?a:K4,b.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:Ny.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(o=t==null?void 0:t.disconnectOnEmptyChannelsAfterMs)!==null&&o!==void 0?o:2*((l=t==null?void 0:t.heartbeatIntervalMs)!==null&&l!==void 0?l:Ny.HEARTBEAT_INTERVAL),b.transport=(c=t==null?void 0:t.transport)!==null&&c!==void 0?c:B4.getWebSocketConstructor(),b.params=t==null?void 0:t.params,b.logger=t==null?void 0:t.logger,b.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),b.sessionStorage=(u=t==null?void 0:t.sessionStorage)!==null&&u!==void 0?u:EI(),b.reconnectAfterMs=(d=t==null?void 0:t.reconnectAfterMs)!==null&&d!==void 0?d:g=>SI[g-1]||kI;let v,x;const w=(f=t==null?void 0:t.vsn)!==null&&f!==void 0?f:W4;switch(w){case H4:v=(g,y)=>y(JSON.stringify(g)),x=(g,y)=>y(JSON.parse(g));break;case l1:v=this.serializer.encode.bind(this.serializer),x=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${b.vsn}`)}if(b.vsn=w,b.encode=(m=t==null?void 0:t.encode)!==null&&m!==void 0?m:v,b.decode=(p=t==null?void 0:t.decode)!==null&&p!==void 0?p:x,b.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,b.params=Object.assign(Object.assign({},b.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,b.autoSendHeartbeat=!this.worker}return b}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
469var xl=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function AI(e,t,r){const n=new URL(t,e);if(r)for(const[a,i]of Object.entries(r))i!==void 0&&n.searchParams.set(a,i);return n.toString()}async function PI(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function OI(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:a,body:i,headers:o}){const l=AI(e.baseUrl,n,a),c=await PI(e.auth),u=await t(l,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...c,...o},body:i?JSON.stringify(i):void 0}),d=await u.text(),f=(u.headers.get("content-type")||"").includes("application/json"),m=f&&d?JSON.parse(d):d;if(!u.ok){const p=f?m:void 0,b=p==null?void 0:p.error;throw new xl((b==null?void 0:b.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:b==null?void 0:b.type,icebergCode:b==null?void 0:b.code,details:p})}return{status:u.status,headers:u.headers,data:m}}}}function Nc(e){return e.join("�")}var II=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Nc(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Nc(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Nc(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Nc(e.namespace)}`}),!0}catch(t){if(t instanceof xl&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof xl&&r.status===409)return;throw r}}};function Ma(e){return e.join("�")}var LI=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ma(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ma(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ma(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ma(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ma(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Ma(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof xl&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof xl&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},$I=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=OI({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new II(this.client,t),this.tableOps=new LI(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
469async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function yl(e){"@babel/helpers - typeof";return yl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yl(e)}function DI(e,t){if(yl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MI(e){var t=DI(e,"string");return yl(t)=="symbol"?t:t+""}function FI(e,t,r){return(t=MI(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function xe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sy(Object(r),!0).forEach(function(n){FI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Id=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Ld(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Lm=class extends Id{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return xe({},super.toJSON())}},f1=class extends Id{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function $u(e,t,r){const n=xe({},e),a=t.toLowerCase();for(const i of Object.keys(n))i.toLowerCase()===a&&delete n[i];return n[a]=r,n}function zI(e){const t={};for(const[r,n]of Object.entries(e))t[r.toLowerCase()]=n;return t}const UI=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),BI=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)},$m=e=>{if(Array.isArray(e))return e.map(r=>$m(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const a=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[a]=$m(n)}),t},VI=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),m1=e=>e.split("/").map(encodeURIComponent).join("/"),ky=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const r=t.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(e)},qI=async(e,t,r,n)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const a=e;let i=parseInt(String(a.status),10);Number.isFinite(i)||(i=500),a.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";t(new Lm(ky(o),i,l,n))}).catch(()=>{const o=i+"";t(new Lm(a.statusText||`HTTP ${i} error`,i,o,n))})}else t(new f1(ky(e),e,n))},HI=(e,t,r,n)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!n)return xe(xe({},a),r);if(BI(n)){var i;const o=(t==null?void 0:t.headers)||{};let l;for(const[c,u]of Object.entries(o))c.toLowerCase()==="content-type"&&(l=u);a.headers=$u(o,"Content-Type",(i=l)!==null&&i!==void 0?i:"application/json"),a.body=JSON.stringify(n)}else a.body=n;return t!=null&&t.duplex&&(a.duplex=t.duplex),xe(xe({},a),r)};async function No(e,t,r,n,a,i,o){return new Promise((l,c)=>{e(r,HI(t,n,a,i)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;if(o==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>l(u)).catch(u=>qI(u,c,n,o))})}function p1(e="storage"){return{get:async(t,r,n,a)=>No(t,"GET",r,n,a,void 0,e),post:async(t,r,n,a,i)=>No(t,"POST",r,a,i,n,e),put:async(t,r,n,a,i)=>No(t,"PUT",r,a,i,n,e),head:async(t,r,n,a)=>
469No(t,"HEAD",r,xe(xe({},n),{},{noResolveJson:!0}),a,void 0,e),remove:async(t,r,n,a,i)=>No(t,"DELETE",r,a,i,n,e)}}const WI=p1("storage"),{get:wl,post:Fr,put:Dm,head:KI,remove:bl}=WI,nr=p1("vectors");var lo=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=zI(t),this.fetch=UI(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=$u(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Ld(r))return{data:null,error:r};throw r}}};let g1;g1=Symbol.toStringTag;var GI=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[g1]="StreamDownloadBuilder",this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Ld(t))return{data:null,error:t};throw t}}};let v1;v1=Symbol.toStringTag;var JI=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[v1]="BlobDownloadBuilder",this.promise=null}asStream(){return new GI(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Ld(t))return{data:null,error:t};throw t}}};const Kh={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Cy={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var QI=class extends lo{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var a=this;return a.handleOperation(async()=>{let i;const o=xe(xe({},Cy),n);let l=xe(xe({},a.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;if(typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",a.encodeMetadata(c)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),c&&!i.has("metadata")&&i.append("metadata",a.encodeMetadata(c))):(i=r,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=a.toBase64(a.encodeMetadata(c))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),n!=null&&n.headers)for(const[m,p]of Object.entries(n.headers))l=$u(l,m,p);const u=a._removeEmptyFolders(t),d=a._getFinalPath(u),f=await(e=="PUT"?Dm:Fr)(a.fetch,`${a.url}/object/${d}`,i,xe({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:f.Id,fullPath:f.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var a=this;const i=a._removeEmptyFolders(e),o=a._getFinalPath(i),l=new URL(a.url+`/object/upload/sign/${o}`);return l.searchParams.set("token",t),a.handleOperation(async()=>{let c;const u=xe(xe({},Cy),n);let d=xe(xe({},a.headers),{"x-upsert":String(u.upsert)});const f=u.metadata;if(typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),f&&c.append("metadata",a.encodeMetadata(f)),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.has("cacheControl")||c.append("cacheControl",u.cacheControl),f&&!c.has("metadata")&&c.append("metadata",a.encodeMetadata(f))):(c=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType,f&&(d["x-metadata"]=a.toBase64(a.encodeMetadata(f))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!u.duplex&&(u.duplex="half")),n!=null&&n.headers)for(const[m,p]of Object.entries(n.headers))d=$u(d,m,p);return{path:i,fullPath:(await Dm(a.fetch,l.toString(),c,xe({headers:d},u!=null&&u.duplex?{duplex:u.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e);const a=xe({},r.headers);t!=null&&t.upsert&&(a["x-upsert"]="true");const i=await Fr(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:a}),o=new URL(r.url+i.url),l=o.searchParams.get("token");if(!l)throw new Id("No token returned by API");return{signedUrl:o.toString(),path:e,token:l}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await Fr(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
469stinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await Fr(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let a=n._getFinalPath(e);const i=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let o=await Fr(n.fetch,`${n.url}/object/sign/${a}`,xe({expiresIn:t},i?{transform:r.transform}:{}),{headers:n.headers});const l=new URLSearchParams;r!=null&&r.download&&l.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&l.set("cacheNonce",String(r.cacheNonce));const c=l.toString();return{signedUrl:encodeURI(`${n.url}${o.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{const a=await Fr(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),i=new URLSearchParams;r!=null&&r.download&&i.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&i.set("cacheNonce",String(r.cacheNonce));const o=i.toString();return a.map(l=>xe(xe({},l),{},{signedUrl:l.signedURL?encodeURI(`${n.url}${l.signedURL}${o?`&${o}`:""}`):null}))})}download(e,t,r){const n=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",a=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(a,t.transform),(t==null?void 0:t.cacheNonce)!=null&&a.set("cacheNonce",String(t.cacheNonce));const i=a.toString(),o=this._getFinalPath(e),l=()=>wl(this.fetch,`${this.url}/${n}/${o}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new JI(l,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>$m(await wl(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await KI(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(a){if(t.shouldThrowOnError)throw a;if(Ld(a)){var n;const i=a instanceof Lm?a.status:a instanceof f1?(n=a.originalError)===null||n===void 0?void 0:n.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:a}}throw a}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=new URLSearchParams;t!=null&&t.download&&n.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(n,t.transform),(t==null?void 0:t.cacheNonce)!=null&&n.set("cacheNonce",String(t.cacheNonce));const a=n.toString(),i=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}`)+(a?`?${a}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await bl(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async purgeCache(e,t,r){var n=this;return n.handleOperation(async()=>{const a=m1(n._getFinalPath(e)),i=new URLSearchParams;t!=null&&t.transformations&&i.set("transformations","true");const o=i.toString();return await bl(n.fetch,`${n.url}/cdn/${a}${o?`?${o}`:""}`,{},{headers:n.headers},r)})}async list(e,t,r){var n=this;return n.handleOperation(async()=>{const a=t!=null&&t.sortBy?xe(xe({},Kh.sortBy),t.sortBy):Kh.sortBy,i=xe(xe(xe({},Kh),t),{},{sortBy:a,prefix:e||""});return await Fr(n.fetch,`${n.url}/object/list/${n.bucketId}`,i,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const n=xe({},e);return await Fr(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("qual
469ity",t.quality.toString()),e}};const ZI="2.110.8",Vl={"X-Client-Info":`storage-js/${ZI}`};var YI=class extends lo{constructor(e,t={},r,n){const a=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase."));const i=a.href.replace(/\/$/,""),o=xe(xe({},Vl),t);super(i,o,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await wl(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await wl(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await Fr(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await Dm(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Fr(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await bl(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}async purgeBucketCache(e,t,r){var n=this;return n.handleOperation(async()=>{const a=new URLSearchParams;t!=null&&t.transformations&&a.set("transformations","true");const i=a.toString();return await bl(n.fetch,`${n.url}/cdn/${m1(e)}${i?`?${i}`:""}`,{},{headers:n.headers},r)})}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},XI=class extends lo{constructor(e,t={},r){const n=e.replace(/\/$/,""),a=xe(xe({},Vl),t);super(n,a,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Fr(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),a=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await wl(t.fetch,a,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await bl(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!VI(e))throw new Id("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new $I({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(a,i){const o=a[i];return typeof o!="function"?o:async(...l)=>{try{return{data:await o.apply(a,l),error:null}}catch(c){if(n)throw c;return{data:null,error:c}}}}})}},eL=class extends lo{constructor(e,t={},r){const n=e.replace(/\/$/,""),a=xe(xe({},Vl),{},{"Content-Type":"application/json"},t);super(n,a,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await nr.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await nr.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await nr.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await nr.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},tL=class extends lo{constructor(e,t={},r){const n=e.replace(/\/$/,""),a=xe(xe({},Vl),{},{"Content-Type":"application/json"},t);super(n,a,r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await nr.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await nr.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
469if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await nr.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await nr.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await nr.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},rL=class extends lo{constructor(e,t={},r){const n=e.replace(/\/$/,""),a=xe(xe({},Vl),{},{"Content-Type":"application/json"},t);super(n,a,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await nr.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await nr.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await nr.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await nr.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},nL=class extends rL{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new sL(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},sL=class extends eL{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,xe(xe({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,xe(xe({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new aL(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},aL=class extends tL{constructor(e,t,r,n,a){super(e,t,a),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,xe(xe({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,xe(xe({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,xe(xe({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,xe(xe({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,xe(xe({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},iL=class extends YI{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new QI(this.url,this.headers,e,this.fetch)}get vectors(){return new nL(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new XI(this.url+"/iceberg",this.headers,this.fetch)}};function $d(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 a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}const x1="2.110.8",An=30*1e3,Ao=3,Gh=Ao*An,oL=2*An,lL="http://localhost:9999",cL="supabase.auth.token",uL={"X-Client-Info":`gotrue-js/${x1}`},Mm="X-Supabase-Api-Version",y1={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},dL=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,hL=10*60*1e3;
469class jl extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function se(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class fL extends jl{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function mL(e){return se(e)&&e.name==="AuthApiError"}class qr extends jl{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class _n extends jl{constructor(t,r,n,a){super(t,n,a),this.name=r,this.status=n}}class _t extends _n{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Sc(e){return se(e)&&e.name==="AuthSessionMissingError"}class Fa extends _n{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class kc extends _n{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Cc extends _n{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function pL(e){return se(e)&&e.name==="AuthImplicitGrantRedirectError"}class Ey extends _n{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class gL extends _n{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Fm extends _n{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function Ec(e){return se(e)&&e.name==="AuthRetryableFetchError"}class Ty extends _n{constructor(t="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(t,"AuthRefreshDiscardedError",409,void 0)}}function vL(e){return se(e)&&e.name==="AuthRefreshDiscardedError"}class Ry extends _n{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Du extends _n{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Mu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Ay=`
470\r=`.split(""),xL=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Ay.length;t+=1)e[Ay[t].charCodeAt(0)]=-2;for(let t=0;t<Mu.length;t+=1)e[Mu[t].charCodeAt(0)]=t;return e})();function Py(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(Mu[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(Mu[n]),t.queuedBits-=6}}function w1(e,t,r){const n=xL[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 Oy(e){const t=[],r=o=>{t.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},i=o=>{bL(o,n,r)};for(let o=0;o<e.length;o+=1)w1(e.charCodeAt(o),a,i);return t.join("")}function yL(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 wL(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const a=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|a)+65536,r+=1}yL(n,t)}}function bL(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 gi(e){const t=[],r={queue:0,queuedBits:0},n=a=>{t.push(a)};for(let a=0;a<e.length;a+=1)w1(e.charCodeAt(a),r,n);return new Uint8Array(t)}function jL(e){const t=[];return wL(e,r=>t.push(r)),new Uint8Array(t)}function aa(e){const t=[],r={queue:0,queuedBits:0},n=a=>{t.push(a)};return e.forEach(a=>Py(a,r,n)),Py(null,r,n),t.join("")}function _L(e){return Math.round(Date.now()/1e3)+e}function NL(){return Symbol("auth-callback")}const Lt=()=>typeof window<"u"&&typeof document<"u",Qs={tested:!1,writable:!1},b1=()=>{if(!Lt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Qs.tested)return Qs.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Qs.tested=!0,Qs.writable=!0}catch{Qs.tested=!0,Qs.writable=!1}return Qs.writable};function SL(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((a,i)=>{t[i]=a})}catch{}return r.searchParams.forEach((n,a)=>{t[a]=n}),t}const j1=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),kL=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Wa=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},Ir=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return null}},ft=async(e,t)=>{await e.removeItem(t)};class Dd{constructor(){this.promise=new Dd.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}Dd.promiseConstructor=Promise;function Tc(e){const t=e.split(".");if(t.length!==3)throw new Du("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!dL.test(t[n]))throw new Du("JWT not in base64url format");return{header:JSON.parse(Oy(t[0])),payload:JSON.parse(Oy(t[1])),signature:gi(t[2]),raw:{header:t[0],payload:t[1]}}}async function CL(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function EL(e,t){return new Promise((n,a)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){n(o);return}}catch(o){if(!t(i,o)){a(o);return}}})()})}function TL(e){return("0"+e.toString(16)).substr(-2)}function RL(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let a="";for(let i=0;i<56;i++)a+=r.charAt(Math.floor(Math.random()*n));return a}return crypto.getRandomValues(t),Array.from(t,TL).join("")}async function AL(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),a=new Uint8Array(n);return Array.from(a).map(i=>String.fromCharCode(i)).join("")}async function PL(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code
470challenge method will default to use plain instead of sha256."),e;const r=await AL(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Zs(e,t,r=!1){const n=RL();let a=n;r&&(a+="/recovery"),await Wa(e,`${t}-code-verifier`,a);const i=await PL(n);return[i,n===i?"plain":"s256"]}const OL=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function IL(e){const t=e.headers.get(Mm);if(!t||!t.match(OL))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function LL(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 $L(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 DL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Sn(e){if(!DL.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Lr(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function Jh(){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 ML(e,t){return new Proxy(e,{get:(r,n,a)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,a)}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,a)}})}function Iy(e){return JSON.parse(JSON.stringify(e))}const ta=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},FL=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Ly(e){var t;if(!kL(e))throw new Fm(ta(e),0);if(FL.includes(e.status))throw new Fm(ta(e),e.status);let r;try{r=await e.json()}catch(i){throw new qr(ta(i),i)}let n;const a=IL(e);if(a&&a.getTime()>=y1["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 Ry(ta(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new _t}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((i,o)=>
470i&&typeof o=="string",!0))throw new Ry(ta(r),e.status,r.weak_password.reasons);throw new fL(ta(r),e.status||500,n)}const zL=(e,t,r,n)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),a.body=JSON.stringify(n),Object.assign(Object.assign({},a),r))};async function de(e,t,r,n){var a;const i=Object.assign({},n==null?void 0:n.headers);i[Mm]||(i[Mm]=y1["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const o=(a=n==null?void 0:n.query)!==null&&a!==void 0?a:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await UL(e,t,r+l,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function UL(e,t,r,n,a,i){const o=zL(t,n,a,i);let l;try{l=await e(r,Object.assign({},o))}catch(c){throw new Fm(ta(c),0)}if(l.ok||await Ly(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(c){await Ly(c)}}function vr(e){var t;let r=null;qL(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=_L(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:typeof(e==null?void 0:e.id)=="string"?e:null;return{data:{session:r,user:n},error:null}}function $y(e){const t=vr(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 fs(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function BL(e){return{data:e,error:null}}function VL(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:a,verification_type:i}=e,o=$d(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:n,redirect_to:a,verification_type:i},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function Dy(e){return e}function qL(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const Qh=["global","local","others"];class HL{constructor({url:t="",headers:r={},fetch:n,experimental:a}){this.url=t,this.headers=r,this.fetch=j1(n),this.experimental=a??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}
vendor: 4,780 bytes, line 470
470async signOut(t,r=Qh[0]){if(Qh.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Qh.join(", ")}`);try{return await de(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(se(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await de(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:fs})}catch(n){if(se(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=$d(t,["options"]),a=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(a.new_email=n==null?void 0:n.newEmail,delete a.newEmail),await de(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:VL,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(se(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await de(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:fs})}catch(r){if(se(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,a,i,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await de(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:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:Dy});if(d.error)throw d.error;const f=await d.json(),m=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(b=>{const v=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(b.split(";")[1].split("=")[1]);u[`${x}Page`]=v}),u.total=parseInt(m)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(se(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){Sn(t);try{return await de(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:fs})}catch(r){if(se(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){Sn(t);try{return await de(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:fs})}catch(n){if(se(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){Sn(t);try{return await de(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:fs})}catch(n){if(se(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){Sn(t.userId);try{const{data:r,error:n}=await de(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:r,error:n}}catch(r){if(se(r))return{data:null,error:r};throw r}}async _deleteFactor(t){Sn(t.userId),Sn(t.id);try{return{data:await de(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(se(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,a,i,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await de(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:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:Dy});if(d.error)throw d.error;const f=await d.json(),m=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(b=>{const v=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(b.split(";")[1].split("=")[1]);u[`${x}Page`]=v}),u.total=parseInt(m)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(se(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await de(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await de(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await de(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(se(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await de(this.fetch,"DELET
470E",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(se(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await de(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _listCustomProviders(t){try{const r={};return t!=null&&t.type&&(r.type=t.type),await de(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var a;return{data:{providers:(a=n==null?void 0:n.providers)!==null&&a!==void 0?a:[]},error:null}}})}catch(r){if(se(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(t){try{return await de(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _getCustomProvider(t){try{return await de(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _updateCustomProvider(t,r){try{return await de(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(se(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(t){try{return await de(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(se(r))return{data:null,error:r};throw r}}async _adminListPasskeys(t){Lr(this.experimental),Sn(t.userId);try{return await de(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(t){Lr(this.experimental),Sn(t.userId),Sn(t.passkeyId);try{return await de(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(se(r))return{data:null,error:r};throw r}}}function My(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}globalThis&&b1()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class WL extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}function KL(){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 _1(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function GL(e){return parseInt(e,16)}function JL(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function QL(e){var t;const{chainId:r,domain:n,expirationTime:a,issuedAt:i=new Date,nonce:o,notBefore:l,requestId:c,resources:u,scheme:d,uri:f,version:m}=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(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(m!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${m}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 471`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=_1(e.address),b=d?`${d}://${n}`:n,v=e.statement?`${e.statement} 472`:"",x=`${b} wants you to sign in with your Ethereum account: 473${p} 474 475${v}`;let w=`URI: ${f} 476Version: ${m} 477Chain ID: ${r}${o?` 478Nonce: ${o}`:""} 479Issued At: ${i.toISOString()}`;if(a&&(w+=` 480Expiration Time: ${a.toISOString()}`),l&&(w+=` 481Not Before: ${l.toISOString()}
481`),c&&(w+=` 482Request ID: ${c}`),u){let g=` 483Resources:`;for(const y of u){if(!y||typeof y!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${y}`);g+=` 484- ${y}`}w+=g}return`${x} 485${w}`}class mt extends Error{constructor({message:t,code:r,cause:n,name:a}){var i;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(i=a??(n instanceof Error?n.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Fu extends mt{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function ZL({error:e,options:t}){var r,n,a;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new mt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=i.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new mt({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=i.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new mt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((a=i.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new mt({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 mt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new mt({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return i.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new mt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new mt({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(N1(o)){if(i.rp.id!==o)return new mt({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new mt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new mt({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 mt({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 mt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function YL({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 mt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new mt({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(N1(n)){if(r.rpId!==n)return new mt({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new mt({message:`${window.location.hostname}
485 is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new mt({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 mt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class XL{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 zm=new XL;function Fy(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,a=$d(e,["challenge","user","excludeCredentials"]),i=gi(t).buffer,o=Object.assign(Object.assign({},r),{id:gi(r.id).buffer}),l=Object.assign(Object.assign({},a),{challenge:i,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:gi(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function zy(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=$d(e,["challenge","allowCredentials"]),a=gi(t).buffer,i=Object.assign(Object.assign({},n),{challenge:a});if(r&&r.length>0){i.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const l=r[o];i.allowCredentials[o]=Object.assign(Object.assign({},l),{id:gi(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return i}function Uy(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:aa(new Uint8Array(e.response.attestationObject)),clientDataJSON:aa(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function By(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),a=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:aa(new Uint8Array(a.authenticatorData)),clientDataJSON:aa(new Uint8Array(a.clientDataJSON)),signature:aa(new Uint8Array(a.signature)),userHandle:a.userHandle?aa(new Uint8Array(a.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function N1(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function zu(){var e,t;return!!(Lt()&&"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 S1(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Fu("Browser returned unexpected credential type",t)}:{data:null,error:new Fu("Empty credential response",t)}}catch(t){return{data:null,error:ZL({error:t,options:e})}}}async function k1(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Fu("Browser returned unexpected credential type",t)}:{data:null,error:new Fu("Empty credential response",t)}}
485catch(t){return{data:null,error:YL({error:t,options:e})}}}const e$={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},t$={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Uu(...e){const t=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),r=a=>a instanceof ArrayBuffer||ArrayBuffer.isView(a),n={};for(const a of e)if(a)for(const i in a){const o=a[i];if(o!==void 0)if(Array.isArray(o))n[i]=o;else if(r(o))n[i]=o;else if(t(o)){const l=n[i];t(l)?n[i]=Uu(l,o):n[i]=Uu(o)}else n[i]=o}return n}function r$(e,t){return Uu(e$,e,t||{})}function n$(e,t){return Uu(t$,e,t||{})}class s${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:a},i){var o;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!l)return{data:null,error:c};const u=a??zm.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:d}=l.webauthn.credential_options.publicKey;if(!d.name){const f=n;if(f)d.name=`${d.id}:${f}`;else{const p=(await this.client.getUser()).data.user,b=((o=p==null?void 0:p.user_metadata)===null||o===void 0?void 0:o.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";d.name=`${d.id}:${b}`}}d.displayName||(d.displayName=d.name)}switch(l.webauthn.type){case"create":{const d=r$(l.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:f,error:m}=await S1({publicKey:d,signal:u});return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:m}}case"request":{const d=n$(l.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:f,error:m}=await k1(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:d,signal:u}));return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:m}}}}catch(l){return se(l)?{data:null,error:l}:{data:null,error:new qr("Unexpected error in challenge",l)}}}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:a}={}},i){if(!r)return{data:null,error:new jl("rpId is required for WebAuthn authentication")};try{if(!zu())return{data:null,error:new qr("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:a},{request:i});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:n,credential_response:c.credential_response}})}catch(o){return se(o)?{data:null,error:o}:{data:null,error:new qr("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:a}={}},i){if(!r)return{data:null,error:new jl("rpId is required for WebAuthn registration")};try{if(!zu())return{data:null,error:new qr("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 f;return(f=d.data)===null||f===void 0?void 0:f.all.find(m=>m.factor_type==="webauthn"&&m.friendly_name===t&&m.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:a},{create:i});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 se(o)?{data:null,error:o}:{data:null,error:new qr("Unexpected error in register",o)}}}}KL();const a$={url:lL,storageKey:cL,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:uL,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},za={};class _l{get jwks(){var t,r;return(r=(t=za[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){za[this.storageKey]=Object.assign(Object.assign({},za[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=za[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){za[this.storageKey]=Object.assign(Object.assign({},za[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,a;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this._pendingInitNotifications=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},a$),t);if(this.storageKey=i.storageKey,this.instanceID=(r=_l.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,_l.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&Lt()){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=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.experimental=(n=i.experimental)!==null&&n!==void 0?n:{},this.admin=new HL({url:i.url,headers:i.headers,fetch:i.fetch,experimental:this.experimental}),this.url=i.url,this.headers=i.headers,this.fetch=j1(i.fetch),this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock!=null&&(this.lock=i.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new s$(this)}
485,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:b1()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=My(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=My(this.memoryStorage)),Lt()&&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)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),(o.data.event==="TOKEN_REFRESHED"||o.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}i.skipAutoInitialize||this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${x1}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){var t;if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())();
485const r=await this.initializePromise,n=(t=this._pendingInitNotifications)!==null&&t!==void 0?t:[];this._pendingInitNotifications=null;for(const a of n)await this._notifyAllSubscribers(a.event,a.session,a.broadcast);return r}async _initialize(){var t;try{let r={},n="none";if(Lt()&&(r=SL(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Lt()&&this.detectSessionInUrl&&n!=="none"){const{data:a,error:i}=await this._getSessionFromURL(r,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),pL(i)){const c=(t=i.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:o,redirectType:l}=a;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return se(r)?this._returnResult({error:r}):this._returnResult({error:new qr("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,a;try{const i=await de(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:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}},xform:vr}),{data:o,error:l}=i;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(se(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var r,n,a;try{let i;if("email"in t){const{email:d,password:f,options:m}=t;let p=null,b=null;this.flowType==="pkce"&&([p,b]=await Zs(this.storage,this.storageKey)),i=await de(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:m==null?void 0:m.emailRedirectTo,body:{email:d,password:f,data:(r=m==null?void 0:m.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken},code_challenge:p,code_challenge_method:b},xform:vr})}else if("phone"in t){const{phone:d,password:f,options:m}=t;i=await de(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(n=m==null?void 0:m.data)!==null&&n!==void 0?n:{},channel:(a=m==null?void 0:m.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken}},xform:vr})}else throw new kc("You must provide either an email or phone number and a password");const{data:o,error:l}=i;if(l||!o)return await ft(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(await ft(this.storage,`${this.storageKey}-code-verifier`),se(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(t){try{let r;if("email"in t){const{email:i,password:o,options:l}=t;r=await de(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:$y})}else if("phone"in t){const{phone:i,password:o,options:l}=t;r=await de(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:$y})}else throw new kc("You must provide either an email or phone number and a password");const{data:n,error:a}=r;if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!n||!n.session||!n.user){const i=new Fa;return this._returnResult({data:{user:null,session:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:a})}catch(r){if(se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,a,i;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:(a=t.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t)):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,a,i,o,l,c,u,d,f,m;let p,b;if("message"in t)p=t.message,b=t.signature;else{const{chain:v,wallet:x,statement:w,options:g}=t;let y;if(Lt())if(typeof x=="object")y=x;else{const R=window;if("ethereum"in R&&typeof R.ethereum=="object"&&"request"in R.ethereum&&typeof R.ethereum.request=="function")y=R.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(g!=null&&g.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=x}const j=new URL((r=g==null?void 0:g.url)!==null&&r!==void 0?r:window.location.href),_=await y.request({method:"eth_requestAccounts"}).then(R=>R).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!_||_.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const S=_1(_[0]);let N=(n=g==null?void 0:g.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!N){const R=await y.request({method:"eth_chainId"});N=GL(R)}const E={domain:j.host,address:S,statement:w,uri:j.href,version:"1",chainId:N,nonce:(a=g==null?void 0:g.signInWithEthereum)===null||a===void 0?void 0:a.nonce,issuedAt:(o=(i=g==null?void 0:g.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=g==null?void 0:g.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=g==null?void 0:g.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=g==null?void 0:g.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=g==null?void 0:g.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=QL(E),b=await y.request({method:"personal_sign",params:[JL(p),S]})}try{const{data:v,error:x}=await de(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:b},!((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:vr});if(x)throw x;if(!v||!v.session||!v.user){const w=new Fa;return this._returnResult({data:{user:null,session:null},error:w})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:x})}catch(v){if(se(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async signInWithSolana(t){var r,n,a,i,o,l,c,u,d,f,m,p;let b,v;if("message"in t)b=t.message,v=t.signature;else{const{chain:x,wallet:w,statement:g,options:y}=t;let j;if(Lt())if(typeof w=="object")j=w;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 w!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=w}const _=new URL((r=y==null?void 0:y.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()},y==null?void 0:y.signInWithSolana),{version:"1",domain:_.host,uri:_.href}),g?{statement:g}:null));let N;if(Array.isArray(S)&&S[0]&&typeof S[0]=="object")N=S[0];else if(S&&typeof S=="object"&&"signedMessage"in S&&"signature"in S)N=S;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in N&&"signature"in N&&(typeof N.signedMessage=="string"||N.signedMessage instanceof Uint8Array)&&N.signature instanceof Uint8Array)b=typeof N.signedMessage=="string"?N.signedMessage:new TextDecoder().decode(N.signedMessage),v=N.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in j)||typeof j.signMessage!="function"||!("publicKey"in j)||typeof j!="object"||!j.publicKey||!("toBase58"in j.publicKey)||typeof j.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");b=[`${_.host} wants you to sign in with your Solana account:`,j.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${_.href}`,`Issued At: ${(a=(n=y==null?void 0:y.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((i=y==null?void 0:y.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((o=y==null?void 0:y.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((l=y==null?void 0:y.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((c=y==null?void 0:y.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((u=y==null?void 0:y.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((f=(d=y==null?void 0:y.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...y.signInWithSolana.resources.map(N=>`- ${N}`)]:[]].join(` 486`);const S=await j.signMessage(new TextEncoder().encode(b),"utf8");if(!S||!(S instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=S}}try{const{data:x,error:w}=await de(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:b,signature:aa(v)},!((m=t.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:vr});if(w)throw w;if(!x||!x.session||!x.user){const g=new Fa;return this._returnResult({data:{user:null,session:null},error:g})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:w})}
486catch(x){if(se(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async _exchangeCodeForSession(t){const r=await Ir(this.storage,`${this.storageKey}-code-verifier`),[n,a]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new gL;const{data:i,error:o}=await de(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:vr});if(await ft(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const l=new Fa;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers(a==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:a??null}),error:o})}catch(i){if(await ft(this.storage,`${this.storageKey}-code-verifier`),se(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(t){try{const{options:r,provider:n,token:a,access_token:i,nonce:o}=t,l=await de(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:a,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:vr}),{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 Fa;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(se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,a,i,o;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await Zs(this.storage,this.storageKey));const{error:f}=await de(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:f})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await de(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(a=c==null?void 0:c.data)!==null&&a!==void 0?a:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new kc("You must provide either an email or phone number.")}catch(l){if(await ft(this.storage,`${this.storageKey}-code-verifier`),se(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var r,n;try{let a,i;"options"in t&&(a=(r=t.options)===null||r===void 0?void 0:r.redirectTo,i=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:l}=await de(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:a,xform:vr});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(a){if(se(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithSSO(t){var r,n,a,i,o;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await Zs(this.storage,this.storageKey));const u=await de(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}),!((a=t==null?void 0:t.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:BL});return!((i=u.data)===null||i===void 0)&&i.url&&Lt()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await ft(this.storage,`${this.storageKey}-code-verifier`),se(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new _t;const{error:a}=await de(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:a})})}catch(t){if(se(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:a,options:i}=t;let o=null,l=null;this.flowType==="pkce"&&([o,l]=await Zs(this.storage,this.storageKey));const{error:c}=await de(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}
486,code_challenge:o,code_challenge_method:l},redirectTo:i==null?void 0:i.emailRedirectTo});return c&&await ft(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:c})}else if("phone"in t){const{phone:n,type:a,options:i}=t,{data:o,error:l}=await de(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new kc("You must provide either an email or phone number and a type")}catch(r){if(await ft(this.storage,`${this.storageKey}-code-verifier`),se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async t=>t)):await this._useSession(async t=>t)}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(),a=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.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.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await Ir(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 valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<Gh:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const o=await Ir(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=Jh()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=ML(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);if(i){if(!!(t.expires_at&&t.expires_at*1e3>Date.now())){const l=await Ir(this.storage,this.storageKey);if(l&&l.refresh_token===t.refresh_token)return this._returnResult({data:{session:t},error:null})}return this._returnResult({data:{session:null},error:i})}return this._returnResult({data:{session:a},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;let r;return this.lock!=null?r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):r=await this._getUser(),r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await de(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:fs}):await this._useSession(async r=>{var n,a,i;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 _t}:await de(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(a=o.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0,xform:fs})})}catch(r){if(se(r))return Sc(r)&&(await this._removeSession(),await ft(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r)):await this._updateUser(t,r)}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:a,error:i}=n;if(i)throw i;if(!a.session)throw new _t;const o=a.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Zs(this.storage,this.storageKey));const{data:u,error:d}=await de(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:fs});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(await ft(this.storage,`${this.storageKey}-code-verifier`),se(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t)):await this._setSession(t)}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new _t;const r=Date.now()/1e3;let n=r,a=!0,i=null;const{payload:o}=Tc(t.access_token);if(o.exp&&(n=o.exp,a=n<=r),a){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};i=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});i={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(r){if(se(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t)):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 _t;const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):a?this._returnResult({data:{user:a.user,session:a},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){var n;try{if(!Lt())throw new Cc("No browser detected.");
486if(t.error||t.error_description||t.error_code)throw new Cc(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 Ey("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Cc("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 Ey("No code detected.");const{data:y,error:j}=await this._exchangeCodeForSession(t.code);if(j)throw j;const _=new URL(window.location.href);return _.searchParams.delete("code"),window.history.replaceState(window.history.state,"",_.toString()),{data:{session:y.session,redirectType:(n=y.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:a,provider_refresh_token:i,access_token:o,refresh_token:l,expires_in:c,expires_at:u,token_type:d}=t;if(!o||!c||!l||!d)throw new Cc("No session defined in URL");const f=Math.round(Date.now()/1e3),m=parseInt(c);let p=f+m;u&&(p=parseInt(u));const b=p-f;b*1e3<=An&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${b}s, should have been closer to ${m}s`);const v=p-m;f-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,p,f):f-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,p,f);const{data:x,error:w}=await this._getUser(o);if(w)throw w;const g={provider_token:a,provider_refresh_token:i,access_token:o,expires_in:m,expires_at:p,refresh_token:l,token_type:d,user:x.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:g,redirectType:t.type},error:null})}catch(a){if(se(a))return this._returnResult({data:{session:null,redirectType:null},error:a});throw a}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error||t.error_description||t.error_code)}async _isPKCECallback(t){const r=await Ir(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t)):await this._signOut(t)}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const a=async()=>{await this._removeSession(),await ft(this.storage,`${this.storageKey}-code-verifier`)},{data:i,error:o}=r;if(o&&!Sc(o))return this._returnResult({error:o});const l=(n=i.session)===null||n===void 0?void 0:n.access_token;if(l){const{error:c}=await this.admin.signOut(l,t);if(c&&!(mL(c)&&(c.status===404||c.status===401||c.status===403)||Sc(c)))return t!=="others"&&await a(),this._returnResult({error:c})}return t!=="others"&&await a(),this._returnResult({error:null})})}onAuthStateChange(t){const r=NL(),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,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)}):await this._emitInitialSession(r)))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,a;try{const{data:{session:i},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),Sc(i)||Ec(i)?console.warn(i):console.error(i)}})}async resetPasswordForEmail(t,r={}){let n=null,a=null;this.flowType==="pkce"&&([n,a]=await Zs(this.storage,this.storageKey,!0));try{return await de(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:a,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(i){if(await ft(this.storage,`${this.storageKey}-code-verifier`),se(i))return this._returnResult({data:null,error:i});throw i}}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(se(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:a}=await this._useSession(async i=>{var o,l,c,u,d;const{data:f,error:m}=i;if(m)throw m;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await de(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(a)throw a;return Lt()&&!(!((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(se(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:a,data:{session:i}}=r;if(a)throw a;const{options:o,provider:l,token:c,access_token:u,nonce:d}=t,f=await de(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=i==null?void 0:i.access_token)!==null&&n!==void 0?n:void 0,body:{provider:l,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:vr}),{data:m,error:p}=f;return p?this._returnResult({data:{user:null,session:null},error:p}):!m||!m.session||!m.user?this._returnResult({data:{user:null,session:null},error:new Fa}):(m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("USER_UPDATED",m.session)),this._returnResult({data:m,error:p}))}catch(a){if(await ft(this.storage,`${this.storageKey}-code-verifier`),se(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,a;const{data:i,error:o}=r;if(o)throw o;
486return await de(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(a=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&a!==void 0?a:void 0})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r="#_refreshAccessToken()";this._debug(r,"begin");try{const n=Date.now();return await EL(async a=>(a>0&&await CL(200*Math.pow(2,a-1)),this._debug(r,"refreshing attempt",a),await de(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:vr})),(a,i)=>{const o=200*Math.pow(2,a);return i&&Ec(i)&&Date.now()+o-n<An})}catch(n){if(this._debug(r,"error",n),se(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),Lt()&&!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 a=await Ir(this.storage,this.storageKey);if(a&&this.userStorage){let o=await Ir(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:a.user},await Wa(this.userStorage,this.storageKey+"-user",o)),a.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:Jh()}else if(a&&!a.user&&!a.user){const o=await Ir(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(a.user=o.user,await ft(this.storage,this.storageKey+"-user"),await Wa(this.storage,this.storageKey,a)):a.user=Jh()}if(this._debug(n,"session from storage",a),!this._isValidSession(a)){this._debug(n,"session is not valid"),a!==null&&await this._removeSession();return}const i=((r=a.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Gh;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${Gh}s`),i){if(this.autoRefreshToken&&a.refresh_token){const{error:o}=await this._callRefreshToken(a.refresh_token);o&&(vL(o)?this._debug(n,"refresh discarded by commit guard",o):this._debug(n,"refresh failed",o))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(a.access_token);!l&&(o!=null&&o.user)?(a.user=o.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):this._debug(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",a)}catch(a){this._debug(n,"error",a),Ec(a)?console.warn(a):console.error(a);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new _t;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===t&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const a="#_callRefreshToken()";this._debug(a,"begin");try{this.refreshingDeferred=new Dd;const i=await Ir(this.storage,this.storageKey),{data:o,error:l}=await this._refreshAccessToken(t);if(l)throw l;if(!o.session)throw new _t;const c=await Ir(this.storage,this.storageKey);if(i!==null&&(c===null||c.refresh_token!==i.refresh_token)){this._debug(a,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:c?"replaced":"cleared"});const m={data:null,error:new Ty};return this.refreshingDeferred.resolve(m),m}const d=this._sessionRemovalEpoch;if(await this._saveSession(o.session),this._sessionRemovalEpoch!==d){this._debug(a,"commit guard (post-save): _removeSession ran during _saveSession, und
486oing write"),await ft(this.storage,this.storageKey),this.userStorage&&await ft(this.userStorage,this.storageKey+"-user");const m={data:null,error:new Ty};return this.refreshingDeferred.resolve(m),m}await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);const f={data:o.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(f),f}catch(i){if(this._debug(a,"error",i),se(i)){const o={data:null,error:i};if(!Ec(i)){const l=await Ir(this.storage,this.storageKey);!!(l!=null&&l.expires_at&&l.expires_at*1e3>Date.now())?this._debug(a,"proactive refresh failed, access token still valid â preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:t,result:o,expiresAt:Date.now()+oL},(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(t,r,n=!0){if(this._pendingInitNotifications!==null&&n){this._pendingInitNotifications.push({event:t,session:r,broadcast:n});return}const a=`#_notifyAllSubscribers(${t})`;this._debug(a,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,r)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let l=0;l<i.length;l+=1)console.error(i[l]);throw i[0]}}finally{this._debug(a,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Wa(this.userStorage,this.storageKey+"-user",{user:r.user});const a=Object.assign({},r);delete a.user;const i=Iy(a);await Wa(this.storage,this.storageKey,i)}else{const a=Iy(r);await Wa(this.storage,this.storageKey,a)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await ft(this.storage,this.storageKey),await ft(this.storage,this.storageKey+"-code-verifier"),await ft(this.storage,this.storageKey+"-user"),this.userStorage&&await ft(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Lt()&&(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(),An);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var t;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(t=this.broadcastChannel)===null||t===void 0||t.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const 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 a=Math.floor((n.expires_at*1e3-t)/An);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${An}ms, refresh threshold is ${Ao} ticks`),a<=Ao&&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 instanceof WL)this._debug("auto refresh token tick lock not available");else throw t}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const t=Date.now();try{await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((n.expires_at*1e3-t)/An);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${An}ms, refresh threshold is ${Ao} ticks`),a<=Ao&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Lt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;if(this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!t)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>
486{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(r,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const a=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&a.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&a.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,o]=await Zs(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});a.push(l.toString())}if(n!=null&&n.queryParams){const i=new URLSearchParams(n.queryParams);a.push(i.toString())}return n!=null&&n.skipBrowserRedirect&&a.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${a.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:a,error:i}=r;return i?this._returnResult({data:null,error:i}):await de(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,a;const{data:i,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 de(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((a=c==null?void 0:c.totp)===null||a===void 0)&&a.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){const r=async()=>{try{return await this._useSession(async n=>{var a;const{data:i,error:o}=n;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?Uy(t.webauthn.credential_response):By(t.webauthn.credential_response)})}:{code:t.code}),{data:c,error:u}=await de(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:l,headers:this.headers,jwt:(a=i==null?void 0:i.session)===null||a===void 0?void 0:a.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),this._returnResult({data:c,error:u}))})}catch(n){if(se(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challenge(t){const r=async()=>{try{return await this._useSession(async n=>{var a;const{data:i,error:o}=n;if(o)return this._returnResult({data:null,error:o});const l=await de(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(a=i==null?void 0:i.session)===null||a===void 0?void 0:a.access_token});if(l.error)return l;const{data:c}=l;if(c.type!=="webauthn")return{data:c,error:null};switch(c.webauthn.type){case"create":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:Fy(c.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:zy(c.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(se(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):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 a={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])a.all.push(i),i.status==="verified"&&a[i.factor_type].push(i);return{data:a,error:null}}async _getAuthenticatorAssuranceLevel(t){var r,n,a,i;if(t)try{const{payload:p}=Tc(t);let b=null;p.aal&&(b=p.aal);let v=b;const{data:{user:x},error:w}=await this.getUser(t);if(w)return this._returnResult({data:null,error:w});((n=(r=x==null?void 0:x.factors)===null||r===void 0?void 0:r.filter(j=>j.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(v="aal2");const y=p.amr||[];return{data:{currentLevel:b,nextLevel:v,currentAuthenticationMethods:y},error:null}}catch(p){if(se(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:o},error:l}
486=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=Tc(o.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((i=(a=o.user.factors)===null||a===void 0?void 0:a.filter(p=>p.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(d="aal2");const m=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:m},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:a}=r;return a?this._returnResult({data:null,error:a}):n?await de(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new _t})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:a},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new _t});const o=await de(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Lt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(se(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:a},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new _t});const o=await de(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Lt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(se(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 de(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new _t})})}catch(t){if(se(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:a}=r;return a?this._returnResult({data:null,error:a}):n?(await de(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new _t})})}catch(r){if(se(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 a=Date.now();if(n=this.jwks.keys.find(l=>l.kid===t),n&&this.jwks_cached_at+hL>a)return n;const{data:i,error:o}=await de(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=a,n=i.keys.find(l=>l.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:p,error:b}
486=await this.getSession();if(b||!p.session)return this._returnResult({data:null,error:b});n=p.session.access_token}const{header:a,payload:i,signature:o,raw:{header:l,payload:c}}=Tc(n);if(!(r!=null&&r.allowExpired))try{LL(i.exp)}catch(p){throw new Du(p instanceof Error?p.message:"JWT validation failed")}const u=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:p}=await this.getUser(n);if(p)throw p;return{data:{claims:i,header:a,signature:o},error:null}}const d=$L(a.alg),f=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,o,jL(`${l}.${c}`)))throw new Du("Invalid JWT signature");return{data:{claims:i,header:a,signature:o},error:null}}catch(n){if(se(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(t){var r,n,a;Lr(this.experimental);try{if(!zu())return this._returnResult({data:null,error:new qr("Browser does not support WebAuthn",null)});const{data:i,error:o}=await this._startPasskeyAuthentication({options:{captchaToken:(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.captchaToken}});if(o||!i)return this._returnResult({data:null,error:o});const l=zy(i.options),c=(a=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.signal)!==null&&a!==void 0?a:zm.createNewAbortSignal(),{data:u,error:d}=await k1({publicKey:l,signal:c});if(d||!u)return this._returnResult({data:null,error:d??new qr("WebAuthn ceremony failed",null)});const f=By(u);return this._verifyPasskeyAuthentication({challengeId:i.challenge_id,credential:f})}catch(i){if(se(i))return this._returnResult({data:null,error:i});throw i}}async registerPasskey(t){var r,n;Lr(this.experimental);try{if(!zu())return this._returnResult({data:null,error:new qr("Browser does not support WebAuthn",null)});const{data:a,error:i}=await this._startPasskeyRegistration();if(i||!a)return this._returnResult({data:null,error:i});const o=Fy(a.options),l=(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:zm.createNewAbortSignal(),{data:c,error:u}=await S1({publicKey:o,signal:l});if(u||!c)return this._returnResult({data:null,error:u??new qr("WebAuthn ceremony failed",null)});const d=Uy(c);return this._verifyPasskeyRegistration({challengeId:a.challenge_id,credential:d})}catch(a){if(se(a))return this._returnResult({data:null,error:a});throw a}}async _startPasskeyRegistration(){Lr(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new _t});const{data:a,error:i}=await de(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:a,error:null})})}catch(t){if(se(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){Lr(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!n)return this._returnResult({data:null,error:new _t});const{data:i,error:o}=await de(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(t){var r;Lr(this.experimental);try{const{data:n,error:a}=await de(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.captchaToken}}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:n,error:null})}catch(n){if(se(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(t){Lr(this.experimental);try{const{data:r,error:n}=await de(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:vr});return n?this._returnResult({data:null,error:n}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){Lr(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new _t});const{data:a,error:i}=await de(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:a,error:null})})}catch(t){if(se(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){Lr(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!n)return this._returnResult({data:null,error:new _t});const{data:i,error:o}=await de(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:t.friendlyName}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(t){Lr(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!n)return this._returnResult({data:null,error:new _t});const{error:i}
486=await de(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}}_l.nextInstanceID={};const i$=_l,o$="2.110.8";let Po="",Bu;if(typeof Deno<"u"){var Zh;Po="deno",Bu=(Zh=Deno.version)===null||Zh===void 0?void 0:Zh.deno}else if(typeof document<"u")Po="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Po="react-native";else{var Yh;Po="node";const e=globalThis.process;Bu=e==null||(Yh=e.version)===null||Yh===void 0?void 0:Yh.replace(/^v/,"")}const C1=[`runtime=${Po}`];Bu&&C1.push(`runtime-version=${Bu}`);const l$={"X-Client-Info":`supabase-js/${o$}; ${C1.join("; ")}`},c$={headers:l$},u$={schema:"public"},d$={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},h$={},f$={enabled:!1,respectSamplingDecision:!0};function m$(e,t,r,n){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(d){try{u(n.next(d))}catch(f){o(f)}}function c(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):a(d.value).then(l,c)}u((n=n.apply(e,[])).next())})}let Xh=null;const p$="@opentelemetry/api";function g$(){return Xh===null&&(Xh=import(p$).catch(()=>null)),Xh}function v$(){return m$(this,void 0,void 0,function*(){try{const e=yield g$();if(!e||!e.propagation||!e.context)return null;const t={};e.propagation.inject(e.context.active(),t);const r=t.traceparent;return r?{traceparent:r,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function x$(e){if(!e||typeof e!="string")return null;const t=e.split("-");if(t.length!==4)return null;const[r,n,a,i]=t;if(r.length!==2||n.length!==32||a.length!==16||i.length!==2)return null;const o=/^[0-9a-f]+$/i;return!o.test(r)||!o.test(n)||!o.test(a)||!o.test(i)||n==="00000000000000000000000000000000"||a==="0000000000000000"?null:{version:r,traceId:n,parentId:a,traceFlags:i,isSampled:(parseInt(i,16)&1)===1}}function y$(e,t){if(!e||!t||t.length===0)return!1;let r;if(e instanceof URL)r=e;else try{r=new URL(e)}catch{return!1}for(const n of t)try{if(typeof n=="string"){if(w$(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function w$(e,t){if(t===e)return!0;if(t.startsWith("*.")){const r=t.slice(2);if(e.endsWith(r)&&(e===r||e.endsWith("."+r)))return!0}return!1}function b$(e){const t=[];try{const r=new URL(e);t.push(r.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function Nl(e){"@babel/helpers - typeof";return Nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nl(e)}function j$(e,t){if(Nl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _$(e){var t=j$(e,"string");return Nl(t)=="symbol"?t:t+""}function N$(e,t,r){return(t=_$(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vy(Object(r),!0).forEach(function(n){N$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const S$=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),k$=()=>Headers,E1=e=>e.startsWith("sb_publishable_")||e.startsWith("sb_secret_"),C$="sb_temp_",qy=new Set,E$=e=>{var t,r;if(!e.startsWith("sb_")||E1(e)||e.startsWith(C$))return;const n=(t=(r=e.match(/^sb_[a-zA-Z0-9]+_/))===null||r===void 0?void 0:r[0])!==null&&t!==void 0?t:"unknown";qy.has(n)||(qy.add(n),console.warn("@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is;
486 if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type."))},Hy=(e,t,r,n,a,i)=>{const o=S$(n),l=k$(),c=(a==null?void 0:a.enabled)===!0,u=(a==null?void 0:a.respectSamplingDecision)!==!1,d=c?b$(t):null,f=!(i!=null&&i.omitApiKeyAsBearer&&E1(e));return async(m,p)=>{const b=await r();let v=new l(p==null?void 0:p.headers);if(v.has("apikey")||v.set("apikey",e),!v.has("Authorization")){const x=b??(f?e:null);x&&v.set("Authorization",`Bearer ${x}`)}if(d){const x=await T$(m,d,u);x&&(x.traceparent&&!v.has("traceparent")&&v.set("traceparent",x.traceparent),x.tracestate&&!v.has("tracestate")&&v.set("tracestate",x.tracestate),x.baggage&&!v.has("baggage")&&v.set("baggage",x.baggage))}return o(m,nt(nt({},p),{},{headers:v}))}};async function T$(e,t,r){if(!y$(typeof e=="string"||e instanceof URL?e:e.url,t))return null;const n=await v$();if(!n||!n.traceparent)return null;if(r){const a=x$(n.traceparent);if(a&&!a.isSampled)return null}return n}function Wy(e){return typeof e=="boolean"?{enabled:e}:e}function R$(e){return e.endsWith("/")?e:e+"/"}function A$(e,t){var r,n,a,i,o,l;const{db:c,auth:u,realtime:d,global:f}=e,{db:m,auth:p,realtime:b,global:v}=t,x=Wy(e.tracePropagation),w=Wy(t.tracePropagation),g={db:nt(nt({},m),c),auth:nt(nt({},p),u),realtime:nt(nt({},b),d),storage:{},global:nt(nt(nt({},v),f),{},{headers:nt(nt({},(r=v==null?void 0:v.headers)!==null&&r!==void 0?r:{}),(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(a=(i=x==null?void 0:x.enabled)!==null&&i!==void 0?i:w==null?void 0:w.enabled)!==null&&a!==void 0?a:!1,respectSamplingDecision:(o=(l=x==null?void 0:x.respectSamplingDecision)!==null&&l!==void 0?l:w==null?void 0:w.respectSamplingDecision)!==null&&o!==void 0?o:!0},accessToken:async()=>""};return e.accessToken?g.accessToken=e.accessToken:delete g.accessToken,g}function P$(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(R$(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var O$=class extends i${constructor(e){super(e)}},I$=class{constructor(e,t,r){var n,a;this.supabaseUrl=e,this.supabaseKey=t;const i=P$(e);if(!t)throw new Error("supabaseKey is required.");E$(t),this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,l={db:u$,realtime:h$,auth:nt(nt({},d$),{},{storageKey:o}),global:c$,tracePropagation:f$},c=A$(r??{},l);if(this.settings=c,this.storageKey=(n=c.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(a=c.global.headers)!==null&&a!==void 0?a:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=Hy(t,e,this._getSessionToken.bind(this),c.global.fetch,c.tracePropagation),this.functionsFetch=Hy(t,e,this._getSessionToken.bind(this),c.global.fetch,c.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient(nt({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new U4(new URL("rest/v1",i).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new iL(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new P4(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
486channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:null}async _getAccessToken(){var e=this,t;return(t=await e._getSessionToken())!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:a,storageKey:i,flowType:o,lock:l,debug:c,throwOnError:u,experimental:d,lockAcquireTimeout:f,skipAutoInitialize:m},p,b){const v={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new O$({url:this.authUrl.href,headers:nt(nt({},v),p),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:a,flowType:o,lock:l,debug:c,throwOnError:u,experimental:d,fetch:b,lockAcquireTimeout:f,skipAutoInitialize:m,hasCustomAuthorizationHeader:Object.keys(this.headers).some(x=>x.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new RI(this.realtimeUrl.href,nt(nt({},e),{},{params:nt(nt({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN"||e==="INITIAL_SESSION")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const L$=(e,t,r)=>new I$(e,t,r);function $$(){if(typeof window<"u"||globalThis.Deno!==void 0)return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=20:!1}$$()&&console.warn("â ï¸ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715");function D$(){var x,w;if(typeof window>"u")return;const e=location.hostname,r=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(g=>e===g||e.endsWith("."+g)),n="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",a=r?((x=e.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+n+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:x[1])??((w=e.match(new RegExp("^("+n+")(?=[.-])","i")))==null?void 0:w[1]):void 0,i=window.parent&&window.parent!==window;if(!a||!i)return localStorage;const o=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),l=o?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),u=c&&l.test(c)?[c]:o?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],d="lovable-preview-auth:result",f=2e3,m=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),p=(g,y,j)=>new Promise(_=>{const S=m();let N=!1,E;const R=C=>{N||(N=!0,clearTimeout(E),window.removeEventListener("message",I),_(C))},I=C=>{if(u.indexOf(C.origin)<0)return;const F=C.data;F&&F.type===d&&F.requestId===S&&R(F)};window.addEventListener("message",I);const A={type:g,requestId:S,projectId:a,key:y};j!==void 0&&(A.value=j);for(const C of u)window.parent.postMessage(A,C);E=setTimeout(()=>R(null),f)});let b=!0;const v=250;return{getItem:async g=>{let y=await p("lovable-preview-auth:get",g);return!y&&b&&(await new Promise(j=>setTimeout(j,v)),y=await p("lovable-preview-auth:get",g)),b=!1,y&&y.ok&&typeof y.value=="string"?y.value===""?(localStorage.removeItem(g),null):y.value:localStorage.getItem(g)},setItem:(g,y)=>(localStorage.setItem(g,y),p("lovable-preview-auth:set",g,y).then(j=>
486{j&&j.ok&&typeof j.value=="string"&&localStorage.getItem(g)===y&&(j.value===""?localStorage.removeItem(g):localStorage.setItem(g,j.value))})),removeItem:g=>(localStorage.removeItem(g),p("lovable-preview-auth:remove",g).then(()=>{}))}}const M$="https://pdxvmguwcqweyzhylhyg.supabase.co",Ky="sb_publishable_8cQzr-bIDrbyVQRwfQIakA_DvydG_8X";function F$(e){return e.startsWith("sb_publishable_")||e.startsWith("sb_secret_")}function z$(e){return(t,r)=>{const n=new Headers(typeof Request<"u"&&t instanceof Request?t.headers:void 0);return r!=null&&r.headers&&new Headers(r.headers).forEach((a,i)=>n.set(i,a)),F$(e)&&n.get("Authorization")===`Bearer ${e}`&&n.delete("Authorization"),n.set("apikey",e),fetch(t,{...r,headers:n})}}const T=L$(M$,Ky,{global:{fetch:z$(Ky)},auth:{storage:D$(),persistSession:!0,autoRefreshToken:!0}}),T1=h.createContext(void 0),U$=({children:e})=>{const[t,r]=h.useState(null),[n,a]=h.useState(null),[i,o]=h.useState([]),[l,c]=h.useState(!0),[u,d]=h.useState(!1),f=h.useRef(0);h.useEffect(()=>{const{data:v}=T.auth.onAuthStateChange((x,w)=>{r(w),a((w==null?void 0:w.user)??null),w!=null&&w.user?(d(!1),setTimeout(()=>m(w.user.id),0)):(f.current+=1,o([]),d(!0))});return T.auth.getSession().then(({data:x})=>{var w,g;r(x.session),a(((w=x.session)==null?void 0:w.user)??null),(g=x.session)!=null&&g.user?m(x.session.user.id).finally(()=>c(!1)):(d(!0),c(!1))}),()=>v.subscription.unsubscribe()},[]);const m=async v=>{const x=++f.current,{data:w,error:g}=await T.from("user_roles").select("role").eq("user_id",v);x===f.current&&(o(!g&&w?w.map(y=>y.role):[]),d(!0))},p=async()=>{await T.auth.signOut()},b=v=>i.includes(v);return s.jsx(T1.Provider,{value:{user:n,session:t,roles:i,loading:l,rolesLoaded:u,signOut:p,hasRole:b},children:e})},it=()=>{const e=h.useContext(T1);if(!e)throw new Error("useAuth deve ser usado dentro de AuthProvider");return e};function R1(e){const t=e.trim().match(/^#?([0-9a-f]{6})$/i);if(!t)return null;const r=parseInt(t[1],16),n=(r>>16&255)/255,a=(r>>8&255)/255,i=(r&255)/255,o=Math.max(n,a,i),l=Math.min(n,a,i);let c=0,u=0;const d=(o+l)/2;if(o!==l){const f=o-l;switch(u=d>.5?f/(2-o-l):f/(o+l),o){case n:c=(a-i)/f+(a<i?6:0);break;case a:c=(i-n)/f+2;break;case i:c=(n-a)/f+4;break}c/=6}return`${Math.round(c*360)} ${Math.round(u*100)}% ${Math.round(d*100)}%`}function Ct(){const{slug:e}=Aa();return e?`/t/${e}`:""}function A1(){return h.useContext(kg)??null}function B$(e){var n;const t=(n=e.custom_domain)==null?void 0:n.trim(),r=typeof window<"u"?Gy(window.location.hostname):"";return t&&Gy(t)===r?"":`/t/${e.slug}`}const kg=h.createContext(void 0);function Gy(e){const t=e.toLowerCase();return t.startsWith("www.")?t.slice(4):t}function P1(e){const t=e.toLowerCase();return!!(["localhost","127.0.0.1"].includes(t)||t.endsWith(".lovable.app")||t==="orangerh.com.br"||t==="www.orangerh.com.br")}function V$(){if(typeof window>"u")return null;const e=window.location.hostname;if(!P1(e))return null;const t=e.split(".");if(t.length<3)return null;const r=t[0];return["www","app","admin"].includes(r)||r.startsWith("id-preview")?null:r}async function q$(){if(typeof window>"u")return null;const e=window.location.hostname;if(P1(e))return null;const{data:t,error:r}=await T.rpc("get_public_tenant_by_domain",{_domain:e}).maybeSingle();return r||!t?null:{...t,is_active:!0}}const Cg=({children:e})=>{const r=Aa().slug??null,[n,a]=h.useState(null),[i,o]=h.useState(!0),[l,c]=h.useState(null);return h.useEffect(()=>{let u=!1;return(async()=>{if(r){o(!0);const{data:v,error:x}=await T.rpc("get_public_tenants",{_slug:r}).maybeSingle();if(u)return;x&&c(x.message),a(v?{...v,is_active:!0}:null),c(v?null:"Cliente não encontrado ou inativo"),o(!1);return}const f=await q$();if(u)return;if(f){a(f),c(null),o(!1);return}const m=V$();if(!m){a(null),o(!1),c("Cliente não identificado");return}o(!0);const{data:p,error:b}=await T.rpc("get_public_tenants",{_slug:m}).maybeSingle();u||(b&&c(b.message),a(p?{...p,is_active:!0}:null),c(p?null:"Cliente não encontrado ou inativo"),o(!1))})(),()=>{u=!0}},[r]),h.useEffect(()=>{if(!(n!=null&&n.primary_color))return;const u=R1(n.primary_color);if(!u)return;const d=document.documentElement,f=d.style.getPropertyValue("--primary"),m=d.style.getPropertyValue("--ring"),p=d.style.getPropertyValue("--accent");d.style.setProperty("--primary",u),d.style.setProperty("--ring",u),d.style.setProperty("--accent",u);const b=document.title;return document.title=`${n.name} â Carreiras`,()=>{f?d.style.setProperty("--primary",f):d.style.removeProperty("--primary"),m?d.style.setProperty("--ring",m):d.style.removeProperty("--ring"),p?d.style.setProperty("--accent",p):d.style.removeProperty("--accent"),document.title=b}},[n]),h.useEffect(()=>{const u=document.querySelector('link[rel="icon"]');if(!u)return;const d="/favicon.svg";return n!=null&&n.logo_url&&(u.type="",u.href=n.logo_url),()=>{u.type="image/svg+xml",u.href=d}},[n==null?void 0:n.logo_url]),s.jsx(kg.Provider,{value:{tenant:n,loading:i,error:l},children:e})},xt=()=>{const e=h.useContext(kg);if(!e)throw new Error("useTenant deve ser usado dentro de TenantProvider");return e},ls=({children:e,roles:t})=>{const{user:r,loading:n,rolesLoaded:a,hasRole:i}=it(),o=mr(),l=A1(),c=o.pathname.match(/^\/t\/([^/]+)/),u=c?`/t/${c[1]}`:l!=null&&l.tenant?"":null;if(n||r&&!a)return s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx(le,{className:"w-8 h-8 animate-spin text-primary"})});if(!r){const d=u!==null?`${u}/auth`:"/auth";return s.jsx(Ou,{to:`${d}?next=${encodeURIComponent(o.pathname)}`,replace:!0})}return t&&!t.some(d=>i(d))?s.jsx(Ou,{to:u!==null?`${u}/minha-area`:"/",replace:!0}):s.jsx(s.Fragment,{children:e})},Eg=Xi("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-semibold transition-all duration-300 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 shadow-button hover:shadow-lg hover:-translate-y-0.5",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border-2 border-primary bg-transparent text-primary hover:bg-primary hover:text-primary-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",hero:"gradient-hero text-primary-foreground shadow-button hover:shadow-lg hover:-translate-y-1 hover:scale-[1.02]","hero-outline":"border-2 border-primary-foreground
486/30 bg-primary-foreground/10 text-primary-foreground backdrop-blur-sm hover:bg-primary-foreground/20 hover:border-primary-foreground/50",success:"bg-success text-success-foreground hover:bg-success/90"},size:{default:"h-11 px-6 py-2",sm:"h-9 rounded-md px-4 text-xs",lg:"h-14 rounded-xl px-8 text-base",xl:"h-16 rounded-xl px-10 text-lg",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),P=h.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},i)=>{const o=n?Yi:"button";return s.jsx(o,{className:Y(Eg({variant:t,size:r,className:e})),ref:i,...a})});P.displayName="Button";const Tg=()=>{const{tenant:e}=xt(),t=mr(),r=pr(),{user:n,hasRole:a,signOut:i}=it(),o=Ct();if(!e)return null;const l=a("tenant_admin")||a("recruiter")||a("super_admin"),c=[{to:`${o}`,label:"InÃcio",end:!0},{to:`${o}/vagas`,label:"Vagas"},...e.tenant_type==="agency"?[{to:`${o}/empresas`,label:"Empresas"},{to:`${o}/empresas/cadastro`,label:"Seja parceiro"}]:[],{to:`${o}/sobre`,label:"Sobre"},{to:`${o}/contato`,label:"Contato"}];return s.jsx("header",{className:"sticky top-0 inset-x-0 z-40 border-b border-border bg-background/85 backdrop-blur-xl",children:s.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between gap-6",children:[s.jsxs(me,{to:o,className:"flex items-center gap-3 min-w-0",children:[e.logo_url?s.jsx("img",{src:e.logo_url,alt:`Logo ${e.name}`,className:"h-9 max-w-[160px] w-auto object-contain"}):s.jsx("div",{className:"h-9 w-9 rounded-lg bg-primary text-primary-foreground flex items-center justify-center",children:s.jsx(Mt,{className:"w-4 h-4"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-base font-bold truncate",children:e.name}),s.jsx("div",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:e.tenant_type==="agency"?"Recrutamento e Seleção":"Carreiras"})]})]}),s.jsx("nav",{className:"hidden md:flex items-center gap-6",children:c.map(u=>s.jsx(Bl,{to:u.to,end:u.end,className:({isActive:d})=>`text-sm font-medium transition-colors ${d?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:u.label},u.to))}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[!n&&s.jsx(P,{asChild:!0,variant:"ghost",size:"sm",children:s.jsxs(me,{to:`${o}/auth?next=${encodeURIComponent(t.pathname)}`,children:[s.jsx(QT,{className:"w-4 h-4 sm:mr-2"}),s.jsx("span",{className:"hidden sm:inline",children:"Entrar"})]})}),n&&s.jsxs(s.Fragment,{children:[s.jsx(P,{asChild:!0,variant:"ghost",size:"sm",children:s.jsxs(me,{to:l?"/painel":`${o}/minha-area`,children:[l?s.jsx(wd,{className:"w-4 h-4 sm:mr-2"}):s.jsx(Zj,{className:"w-4 h-4 sm:mr-2"}),s.jsx("span",{className:"hidden sm:inline",children:l?"Painel":"Minha área"})]})}),s.jsx(P,{variant:"ghost",size:"icon",title:"Sair","aria-label":"Sair",onClick:async()=>{await i(),r(o||"/",{replace:!0})},children:s.jsx(ig,{className:"w-4 h-4"})})]}),s.jsx(P,{asChild:!0,size:"sm",children:s.jsx(me,{to:`${o}/vagas`,children:"Ver vagas"})})]})]})})},Rg=()=>{const{tenant:e}=xt(),t=Ct();return e?s.jsxs("footer",{className:"border-t border-border bg-card mt-16",children:[s.jsxs("div",{className:"container mx-auto px-4 py-10 grid gap-8 md:grid-cols-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-base font-bold mb-2",children:e.name}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-xs",children:"Trabalhe conosco. Acompanhe nossas oportunidades e envie sua candidatura."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Institucional"}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsx("li",{children:s.jsx(me,{to:`${t}/sobre`,className:"hover:text-foreground",children:"Sobre"})}),s.jsx("li",{children:s.jsx(me,{to:`${t}/vagas`,className:"hover:text-foreground",children:"Vagas"})}),s.jsx("li",{children:s.jsx(me,{to:`${t}/contato`,className:"hover:text-foreground",children:"Contato"})}),s.jsx("li",{children:s.jsx(me,{to:`${t}/lgpd`,className:"hover:text-foreground",children:"PolÃtica de Privacidade (LGPD)"})})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Contato"}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[e.contact_email&&s.jsx("li",{children:e.contact_email}),e.contact_phone&&s.jsx("li",{children:e.contact_phone})]})]})]}),s.jsx("div",{className:"border-t border-border",children:s.jsxs("div",{className:"container mx-auto px-4 py-5 text-xs text-muted-foreground",children:["© ",new Date().getFullYear()," ",e.name,". Todos os direitos reservados."]})})]}):null};function H$({tenant:e,system:t,shell:r}){const{tenant:n,loading:a}=xt();return a?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx(le,{className:"w-8 h-8 animate-spin text-primary"})}):n?r?s.jsxs("div",{className:"min-h-screen flex flex-col bg-background text-foreground",children:[s.jsx(Tg,{}),s.jsx("main",{className:"flex-1",children:e}),s.jsx(Rg,{})]}):s.jsx(s.Fragment,{children:e}):s.jsx(s.Fragment,{children:t})}function ef({tenant:e,system:t,shell:r=!0}){return s.jsx(Cg,{children:s.jsx(H$,{tenant:e,system:t,shell:r})})}const W$=[{to:"/#recursos",label:"Recursos"},{to:"/planos",label:"Planos"},{to:"/#faq",label:"FAQ"},{to:"/#contato",label:"Contato"}],Md=()=>s.jsx("header",{className:"fixed top-0 inset-x-0 z-50 border-b border-border/60 bg-background/70 backdrop-blur-xl",children:s.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[s.jsxs(me,{to:"/",className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl gradient-hero flex items-center justify-center shadow-button",children:s.jsx(Ft,{className:"w-4 h-4 text-primary-foreground"})}),s.jsxs("div",{className:"leading-tight",children:[s.jsxs("div",{className:"text-base font-extrabold tracking-tight text-foreground",children:["Orange",s.jsx("span",{className:"text-primary",children:"RH"})]}),s.jsx("div",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:"White Label R&S"})]})]}),s.jsx("nav",{className:"hidden md:flex items-center gap-7",children:W$.map(e=>s.jsx("a",{href:e.to,className:"text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:e.label},e.to))}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(P,{asChild:!0,size:"sm",children:s.jsx(Bl,{to:"/quero-minha-plataforma",children:"Quero minha plataforma"})})})]})}),Fd=()=>s.jsxs("footer",{className:"border-t border-border bg-card",children:[s.jsxs("div",{className:"container mx-auto px-4 py-14 grid gap-10 md:grid-cols-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2.5 mb-4",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl gradient-hero flex items-center justify-center",children:s.jsx(Ft,{className:"w-4 h-4 text-primary-foreground"})}),s.jsxs("span",{className:"text-base font-extrabold",children:["Orange",s.jsx("span",{className:"text-primary",children:"RH"})]})]}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-xs",children:"Plataforma SaaS White Label de Recrutamento e Seleção. Sua marca, seu domÃnio, sua operação."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Produto"}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsx("li",{children:s.jsx("a",{href:"/#recursos",className:"hover:text-foreground",children:"Recursos"})}),s.jsx("li",{children:s.jsx(me,{to:"/planos",className:"hover:text-foreground",children:"Planos"})}),s.jsx("li",{children:s.jsx(me,{to:"/demo",className:"hover:text-foreground",children:"Demonstração"})})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Empresa"}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsx("li",{children:s.jsx("a",{href:"/#faq",className:"hover:text-foreground",children:"FAQ"})}),s.jsx("li",{children:s.jsx("a",{href:"/#contato",className:"hover:text-foreground",children:"Contato"})}),s.jsx("li",{children:s.jsx("a",{href:"#",className:"hover:text-foreground",children:"LGPD"})})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Contato"}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsx("li",{children:"[email protected]"}),s.jsx("li",{children:"www.orangerh.com.br"})]})]})]}),s.jsx("div",{className:"border-t border-border",children:s.jsxs("div",{className:"container mx-auto px-4 py-6 text-xs text-muted-foreground flex flex-col md:flex-row justify-between gap-2",children:[s.jsxs("span",{children:["© ",new Date().getFullYear()," Orange RH. Todos os direitos reservados."]}
vendor: 4,346 bytes, line 486
486),s.jsx("span",{children:"CNPJ 00.000.000/0000-00"})]})})]}),q=h.forwardRef(({className:e,type:t,...r},n)=>s.jsx("input",{type:t,className:Y("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}));q.displayName="Input";const ct=h.forwardRef(({className:e,...t},r)=>s.jsx("textarea",{className:Y("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}));ct.displayName="Textarea";var zd="Collapsible",[K$,O1]=er(zd),[G$,Ag]=K$(zd),I1=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:a,disabled:i,onOpenChange:o,...l}=e,[c,u]=Qr({prop:n,defaultProp:a??!1,onChange:o,caller:zd});return s.jsx(G$,{scope:r,disabled:i,contentId:Gr(),open:c,onOpenToggle:h.useCallback(()=>u(d=>!d),[u]),children:s.jsx(ve.div,{"data-state":Og(c),"data-disabled":i?"":void 0,...l,ref:t})})});I1.displayName=zd;var L1="CollapsibleTrigger",$1=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,a=Ag(L1,r);return s.jsx(ve.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":Og(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...n,ref:t,onClick:ge(e.onClick,a.onOpenToggle)})});$1.displayName=L1;var Pg="CollapsibleContent",D1=h.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=Ag(Pg,e.__scopeCollapsible);return s.jsx(qs,{present:r||a.open,children:({present:i})=>s.jsx(J$,{...n,ref:t,present:i})})});D1.displayName=Pg;var J$=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:a,...i}=e,o=Ag(Pg,r),[l,c]=h.useState(n),u=h.useRef(null),d=Me(t,u),f=h.useRef(0),m=f.current,p=h.useRef(0),b=p.current,v=o.open||l,x=h.useRef(v),w=h.useRef(void 0);return h.useEffect(()=>{const g=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(g)},[]),ht(()=>{const g=u.current;if(g){w.current=w.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const y=g.getBoundingClientRect();f.current=y.height,p.current=y.width,x.current||(g.style.transitionDuration=w.current.transitionDuration,g.style.animationName=w.current.animationName),c(n)}},[o.open,n]),s.jsx(ve.div,{"data-state":Og(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!v,...i,ref:d,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:v&&a})});function Og(e){return e?"open":"closed"}var Q$=I1,Z$=$1,Y$=D1,X$=h.createContext(void 0);function Ud(e){const t=h.useContext(X$);return e||t||"ltr"}var Xr="Accordion",e3=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ig,t3,r3]=pd(Xr),[Bd,FF]=er(Xr,[r3,O1]),Lg=O1(),M1=J.forwardRef((e,t)=>{const{type:r,...n}=e,a=n,i=n;return s.jsx(Ig.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?s.jsx(i3,{...i,ref:t}):s.jsx(a3,{...a,ref:t})})});M1.displayName=Xr;var[F1,n3]=Bd(Xr),[z1,s3]=Bd(Xr,{collapsible:!1}),a3=J.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},collapsible:i=!1,...o}=e,[l,c]=Qr({prop:r,defaultProp:n??"",onChange:a,caller:Xr});return s.jsx(F1,{scope:e.__scopeAccordion,value:J.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:J.useCallback(()=>i&&c(""),[i,c]),children:s.jsx(z1,{scope:e.__scopeAccordion,collapsible:i,children:s.jsx(U1,{...o,ref:t})})})}),i3=J.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...i}=e,[o,l]=Qr({prop:r,defaultProp:n??[],onChange:a,caller:Xr}),c=J.useCallback(d=>l((f=[])=>[...f,d]),[l]),u=J.useCallback(d=>l((f=[])=>f.filter(m=>m!==d)),[l]);return s.jsx(F1,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:u,children:s.jsx(z1,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(U1,{...i,ref:t})})})}),[o3,Vd]=Bd(Xr),U1=J.forwardRef((e,t)=>
486{const{__scopeAccordion:r,disabled:n,dir:a,orientation:i="vertical",...o}=e,l=J.useRef(null),c=Me(l,t),u=t3(r),f=Ud(a)==="ltr",m=ge(e.onKeyDown,p=>{var E;if(!e3.includes(p.key))return;const b=p.target,v=u().filter(R=>{var I;return!((I=R.ref.current)!=null&&I.disabled)}),x=v.findIndex(R=>R.ref.current===b),w=v.length;if(x===-1)return;p.preventDefault();let g=x;const y=0,j=w-1,_=()=>{g=x+1,g>j&&(g=y)},S=()=>{g=x-1,g<y&&(g=j)};switch(p.key){case"Home":g=y;break;case"End":g=j;break;case"ArrowRight":i==="horizontal"&&(f?_():S());break;case"ArrowDown":i==="vertical"&&_();break;case"ArrowLeft":i==="horizontal"&&(f?S():_());break;case"ArrowUp":i==="vertical"&&S();break}const N=g%w;(E=v[N].ref.current)==null||E.focus()});return s.jsx(o3,{scope:r,disabled:n,direction:a,orientation:i,children:s.jsx(Ig.Slot,{scope:r,children:s.jsx(ve.div,{...o,"data-orientation":i,ref:c,onKeyDown:n?void 0:m})})})}),Vu="AccordionItem",[l3,$g]=Bd(Vu),B1=J.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...a}=e,i=Vd(Vu,r),o=n3(Vu,r),l=Lg(r),c=Gr(),u=n&&o.value.includes(n)||!1,d=i.disabled||e.disabled;return s.jsx(l3,{scope:r,open:u,disabled:d,triggerId:c,children:s.jsx(Q$,{"data-orientation":i.orientation,"data-state":G1(u),...l,...a,ref:t,disabled:d,open:u,onOpenChange:f=>{f?o.onItemOpen(n):o.onItemClose(n)}})})});B1.displayName=Vu;var V1="AccordionHeader",q1=J.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=Vd(Xr,r),i=$g(V1,r);return s.jsx(ve.h3,{"data-orientation":a.orientation,"data-state":G1(i.open),"data-disabled":i.disabled?"":void 0,...n,ref:t})});q1.displayName=V1;var Um="AccordionTrigger",H1=J.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=Vd(Xr,r),i=$g(Um,r),o=s3(Um,r),l=Lg(r);return s.jsx(Ig.ItemSlot,{scope:r,children:s.jsx(Z$,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":a.orientation,id:i.triggerId,...l,...n,ref:t})})});H1.displayName=Um;var W1="AccordionContent",K1=J.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=Vd(Xr,r),i=$g(W1,r),o=Lg(r);return s.jsx(Y$,{role:"region","aria-labelledby":i.triggerId,"data-orientation":a.orientation,...o,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});K1.displayName=W1;function G1(e){return e?"open":"closed"}var c3=M1,u3=B1,d3=q1,J1=H1,Q1=K1;const h3=c3,Z1=h.forwardRef(({className:e,...t},r)=>s.jsx(u3,{ref:r,className:Y("border-b",e),...t}));Z1.displayName="AccordionItem";const Y1=h.forwardRef(({className:e,children:t,...r},n)=>s.jsx(d3,{className:"flex",children:s.jsxs(J1,{ref:n,className:Y("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,s.jsx(rg,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Y1.displayName=J1.displayName;const X1=h.forwardRef(({className:e,children:t,...r},n)=>s.jsx(Q1,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:s.jsx("div",{className:Y("pb-4 pt-0",e),children:t})}));X1.displayName=Q1.displayName;const Q=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:Y("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Q.displayName="Card";const ye=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:Y("flex flex-col space-y-1.5 p-6",e),...t}));ye.displayName="CardHeader";const we=h.forwardRef(({className:e,...t},r)=>s.jsx("h3",{ref:r,className:Y("text-2xl font-semibold leading-none tracking-tight",e),...t}));we.displayName="CardTitle";const bt=h.forwardRef(({className:e,...t},r)=>s.jsx("p",{ref:r,className:Y("text-sm text-muted-foreground",e),...t}));bt.displayName="CardDescription";const X=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:Y("p-6 pt-0",e),...t}));X.displayName="CardContent";const f3=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:Y("flex items-center p-6 pt-0",e),...t}));f3.displayName="CardFooter";
486const m3=[{icon:Mt,title:"Página Trabalhe Conosco",desc:"Portal público com sua marca, domÃnio próprio e SEO otimizado."},{icon:ur,title:"Banco de Talentos",desc:"Busca inteligente, filtros avançados, tags e favoritos."},{icon:ag,title:"Pipeline Kanban",desc:"Etapas personalizáveis do primeiro contato à contratação."},{icon:og,title:"Ãrea do Candidato",desc:"Cadastro, currÃculo, histórico e notificações em tempo real."},{icon:LT,title:"Relatórios & Analytics",desc:"Tempo de contratação, funil, origem e conversão."},{icon:XT,title:"100% White Label",desc:"Sua logo, suas cores, sua identidade. Zero marca Orange."},{icon:qj,title:"DomÃnio Próprio",desc:"trabalhe.suaempresa.com.br ou subdomÃnio dedicado."},{icon:Gj,title:"Integrações",desc:"SMTP, WhatsApp, Google Calendar, Outlook, Meet, Teams, Zoom."}],p3=[{name:"Starter",price:"R$ 297",tag:"Ideal para começar",features:["Até 3 usuários","10 vagas simultâneas","5 GB de armazenamento","DomÃnio orangerh.com.br","Suporte por e-mail"]},{name:"Business",price:"R$ 697",tag:"Mais popular",highlight:!0,features:["Até 10 usuários","50 vagas simultâneas","50 GB de armazenamento","DomÃnio próprio","Integrações incluÃdas","Suporte prioritário"]},{name:"Enterprise",price:"Sob consulta",tag:"Para agências e grupos",features:["Usuários ilimitados","Vagas ilimitadas","Armazenamento dedicado","Multi-marca","SLA e onboarding dedicado","API e SSO"]}],g3=[{q:"O que é uma plataforma White Label?",a:"à a sua própria plataforma de recrutamento, com sua marca, seu domÃnio e seus dados isolados. Seus candidatos e clientes não veem nenhuma menção à Orange RH."},{q:"A Orange RH faz recrutamento?",a:"Não. A Orange RH é uma empresa de tecnologia. Fornecemos a plataforma para que você (empresa ou agência de RH) realize seus próprios processos seletivos."},{q:"Cada cliente tem banco de dados isolado?",a:"Sim. Trabalhamos com arquitetura multi-tenant e Row Level Security. Nenhum cliente en
486xerga dados de outro."},{q:"Posso usar meu próprio domÃnio?",a:"Sim, nos planos Business e Enterprise você pode apontar seu domÃnio (ex.: trabalhe.suaempresa.com.br)."},{q:"Tem perÃodo de teste?",a:"Sim. Oferecemos trial para você conhecer a plataforma antes de contratar."},{q:"Como funciona o suporte?",a:"E-mail, chat e â no Enterprise â gerente de conta dedicado com SLA."}],eN=()=>s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Md,{}),s.jsxs("section",{className:"relative pt-32 pb-24 overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 gradient-subtle"}),s.jsx("div",{className:"absolute top-20 -left-24 w-96 h-96 rounded-full bg-primary/20 blur-3xl animate-float"}),s.jsx("div",{className:"absolute bottom-0 -right-24 w-[32rem] h-[32rem] rounded-full bg-accent/20 blur-3xl animate-float",style:{animationDelay:"1.5s"}}),s.jsx("div",{className:"container mx-auto px-4 relative z-10",children:s.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[s.jsxs("div",{className:"inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-primary/10 border border-primary/20 mb-8 animate-fade-in",children:[s.jsx(Ft,{className:"w-3.5 h-3.5 text-primary"}),s.jsx("span",{className:"text-xs font-semibold text-primary tracking-wide uppercase",children:"SaaS White Label de R&S"})]}),s.jsxs("h1",{className:"text-4xl md:text-6xl lg:text-7xl font-extrabold tracking-tight text-foreground leading-[1.05] mb-6 animate-fade-in",style:{animationDelay:".1s"},children:["Seu próprio sistema de ",s.jsx("span",{className:"text-gradient",children:"Recrutamento e Seleção"})," com sua marca."]}),s.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto mb-10 leading-relaxed animate-fade-in",style:{animationDelay:".2s"},children:"Tenha uma plataforma White Label completa para sua empresa ou agência de RH â domÃnio próprio, banco de talentos, pipeline, área do candidato e relatórios."}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-3 animate-fade-in",style:{animationDelay:".3s"},children:[s.jsx(P,{asChild:!0,size:"lg",className:"shadow-button",children:s.jsxs(me,{to:"/demo",children:["Solicitar demonstração ",s.jsx(Mn,{className:"w-4 h-4"})]})}),s.jsx(P,{asChild:!0,size:"lg",variant:"outline",children:s.jsx(me,{to:"/planos",children:"Conhecer planos"})})]}),s.jsx("div",{className:"mt-16 grid grid-cols-2 md:grid-cols-4 gap-4 max-w-3xl mx-auto animate-fade-in",style:{animationDelay:".4s"},children:[{k:"+120",v:"Empresas usando"},{k:"45k",v:"Candidatos/mês"},{k:"99.9%",v:"Uptime"},{k:"-38%",v:"Tempo de contratação"}].map(e=>s.jsxs("div",{className:"p-4 rounded-2xl bg-card/60 border border-border backdrop-blur",children:[s.jsx("div",{className:"text-2xl font-extrabold text-foreground",children:e.k}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:e.v})]},e.v))})]})})]}),s.jsx("section",{id:"recursos",className:"py-24 bg-background",children:s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsxs("div",{className:"max-w-2xl mb-14",children:[s.jsx("span",{className:"text-xs font-bold tracking-widest uppercase text-primary",children:"Recursos"}),s.jsx("h2",{className:"text-3xl md:text-5xl font-extrabold tracking-tight mt-3 mb-4",children:"Tudo que sua operação de R&S precisa"}),s.jsx("p",{className:"text-muted-foreground text-lg",children:"Uma plataforma pensada para escalar: da atração ao onboarding, com sua identidade em cada tela."})]}),s.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-
4865",children:m3.map(e=>s.jsxs(Q,{className:"p-6 border-border hover:shadow-card-hover transition-all hover:-translate-y-1 gradient-card",children:[s.jsx("div",{className:"w-11 h-11 rounded-xl gradient-hero flex items-center justify-center mb-4 shadow-button",children:s.jsx(e.icon,{className:"w-5 h-5 text-primary-foreground"})}),s.jsx("h3",{className:"font-bold text-foreground mb-1.5",children:e.title}),s.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e.desc})]},e.title))})]})}),s.jsx("section",{className:"py-24 gradient-subtle",children:s.jsxs("div",{className:"container mx-auto px-4 grid lg:grid-cols-2 gap-12 items-center",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-xs font-bold tracking-widest uppercase text-primary",children:"Arquitetura"}),s.jsx("h2",{className:"text-3xl md:text-5xl font-extrabold tracking-tight mt-3 mb-5",children:"Multi-tenant, isolado e seguro por design"}),s.jsxs("p",{className:"text-muted-foreground text-lg mb-6",children:["Cada cliente tem sua instância lógica, com dados isolados por ",s.jsx("strong",{children:"tenant_id"})," e ",s.jsx("strong",{children:"Row Level Security"}),". Sua marca, seu domÃnio, seus candidatos â nada é compartilhado."]}),s.jsx("ul",{className:"space-y-3",children:["Banco isolado por Tenant com RLS ativa","RBAC granular de permissões","Logs de auditoria completos","LGPD, backups e alta disponibilidade"].map(e=>s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"w-6 h-6 rounded-full bg-primary/15 flex items-center justify-center mt-0.5",children:s.jsx(ya,{className:"w-3.5 h-3.5 text-primary"})}),s.jsx("span",{className:"text-foreground",children:e})]},e))})]}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute -inset-6 gradient-hero opacity-20 blur-3xl rounded-full"}),s.jsxs(Q,{className:"relative p-6 shadow-card-hover",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-destructive/70"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-primary/70"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-success/70"}),s.jsx("div",{className:"ml-3 text-xs text-muted-foreground font-mono",children:"trabalhe.suaempresa.com.br"})]}),s.jsx("div",{className:"grid grid-cols-3 gap-3",children:["Triagem","Entrevista","Teste","Gestor","Docs","Contratado"].map((e,t)=>s.jsxs("div",{className:"p-3 rounded-lg border border-border bg-background",children:[s.jsxs("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-1",children:["Etapa ",t+1]}),s.jsx("div",{className:"text-sm font-semibold",children:e}),s.jsx("div",{className:"mt-2 h-1.5 rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full gradient-hero",style:{width:`${20+t*12}%`}})})]},e))}),s.jsxs("div",{className:"mt-4 flex items-center gap-3 p-3 rounded-lg bg-muted/50",children:[s.jsx(ro,{className:"w-4 h-4 text-primary"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Tenant isolado · RLS ativa · LGPD"})]})]})]})]})}),s.jsx("section",{id:"planos",className:"py-24",children:s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsxs("div",{className:"max-w-2xl mx-auto text-center mb-14",children:[s.jsx("span",{className:"text-xs font-bold tracking-widest uppercase text-primary",children:"Planos"}),s.jsx("h2",{className:"text-3xl md:text-5xl font-extrabold tracking-tight mt-3 mb-4",children:"Escolha o tamanho da sua operação"}),s.jsx("p",{className:"text-muted-foreground text-lg",children:"Comece pequeno e escale quando precisar. Sem custos escondidos."})]}),s.jsx("div",{className:"grid md:grid-cols-3 gap-6 max-w-6xl mx-auto",children:p3.map(e=>s.jsxs(Q,{className:`p-8 relative ${e.highlight?"border-primary shadow-card-hover scale-[1.02]":"border-border"}`,children:[e.highlight&&s.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 px-3 py-1 rounded-full text-xs font-bold gradient-hero text-primary-foreground shadow-button",children:e.tag}),s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:e.name}),s.jsxs("div",{className:"mt-3 flex items-baseline gap-1",children:[s.jsx("span",{className:"text-4xl font-extrabold text-foreground",children:e.price}),e.price.startsWith("R$")&&s.jsx("span",{className:"text-muted-foreground text-sm",children:"/mês"})]}),!e.highlight&&s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:e.tag})]}),s.jsx("ul",{className:"space-y-2.5 mb-6",children:e.features.map(t=>s.jsxs("li",{className:"flex items-start gap-2.5 text-sm",children:[s.jsx(ya,{className:"w-4 h-4 text-primary mt-0.5 shrink-0"}),s.jsx("span",{children:t})]},t))}),s.jsx(P,{asChild:!0,className:"w-full",variant:e.highlight?"default":"outline",children:s.jsx(me,{to:"/demo",children:"Começar agora"})})]},e.name))})]})}),s.jsx("section",{id:"faq",className:"py-24 bg-card",children:s.jsxs("div",{className:"container mx-auto px-4 max-w-3xl",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsx("span",{className:"text-xs font-bold tracking-widest uppercase text-primary",children:"FAQ"}),s.jsx("h2",{className:"text-3xl md:text-5xl font-extrabold tracking-tight mt-3 mb-4",children:"Perguntas frequentes"})]}),s.jsx(h3,{type:"single",collapsible:!0,className:"w-full",children:g3.map((e,t)=>s.jsxs(Z1,{value:`item-${t}`,children:[s.jsx(Y1,{className:"text-left font-semibold",children:e.q}),s.jsx(X1,{className:"text-muted-foreground leading-relaxed",children:e.a})]},t))})]})}),s.jsx("section",{id:"contato",className:"py-24",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsxs(Q,{className:"max-w-4xl mx-auto p-10 md:p-14 relative overflow-hidden border-border",children:[s.jsx("div",{className:"absolute inset-0 gradient-hero opacity-[0.08]"}),s.jsxs("div",{className:"relative grid md:grid-cols-2 gap-10 items-center",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-xs font-bold tracking-widest uppercase text-primary",children:"Contato"}),s.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold tracking-tight mt-3 mb-3",children:"Vamos conversar"}),s.jsx("p",{className:"text-muted-foreground",children:"Conte um pouco sobre a sua operação de RH e retornaremos com uma demonstração personalizada."}),s.jsxs("div",{className:"mt-6 space-y-2 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(At,{className:"w-4 h-4 text-primary"})," Orange RH · São Paulo, BR"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(lg,{className:"w-4 h-4 text-primary"})," Resposta em até 24h úteis"]})]})]}),s.jsxs("form",{onSubmit:e=>e.preventDefault(),className:"space-y-3",children:[s.jsx(q,{placeholder:"Nome"}),s.jsx(q,{placeholder:"E-mail corporativo",type:"email"}),s.jsx(q,{placeholder:"Empresa"}),s.jsx(ct,{placeholder:"Como podemos ajudar?",rows:4}),s.jsx(P,{type:"submit",className:"w-full shadow-button",children:"Enviar mensagem"})]})]})]})})}),s.jsx(Fd,{})]}),Dg=()=>{const e=mr();return h.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),s.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},v3=[{name:"Starter",price:"R$ 297",period:"/mês",tag:"Ideal para começar",features:["Até 3 usuários","10 vagas simultâneas","5 GB de armazenamento","SubdomÃnio orangerh.com.br","Página pública de vagas","Banco de talentos","Suporte por e-mail"]},{name:"Business",price:"R$ 697",period:"/mês",tag:"Mais popular",highlight:!0,features:["Até 10 usuários","50 vagas simultâneas","50 GB de armazenamento","DomÃnio próprio","Pipeline personalizável","Integrações (Google, Outlook, Meet, Teams, Zoom)","Relatórios avançados","Suporte prioritário"]},{name:"Enterprise",price:"Sob consulta",period:"",tag:"Para agências e grupos",features:["Usuários ilimitados","Vagas ilimitadas","Armazenamento dedicado","Multi-marca (várias marcas na mesma conta)","SSO / SAML","API dedicada","Onboarding e gerente dedicado","SLA contratual"]}],x3=()=>s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Md,{}),s.jsx("section",{className:"pt-32 pb-16 gradient-subtle",children:s.jsxs("div",{className:"container mx-auto px-4 text-center max-w-3xl",children:[s.jsx("span",{className:"text-xs font-bold tracking-widest uppercase text-primary",children:"Planos"}),s.jsxs("h1",{className:"text-4xl md:text-6xl font-extrabold tracking-tight mt-3 mb-5",children:["Escolha o plano ideal para ",s.jsx("span",{className:"text-gradient",children:"sua operação"})]}),s.jsx("p",{className:"text-muted-foreground text-lg",children:"Todos os planos incluem plataforma White Label, banco de talentos, pipeline e página pública de vagas."})]})}),s.jsx("section",{className:"py-20",children:s.jsx("div",{className:"container mx-auto px-4 grid md:grid-cols-3 gap-6 max-w-6xl",children:v3.map(e=>s.jsxs(Q,{className:`p-8 relative ${e.highlight?"border-primary shadow-card-hover":"border-border"}`,children:[e.highlight&&s.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 px-3 py-1 rounded-full text-xs font-bold gradient-hero text-primary-foreground shadow-button",children:e.tag}),s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:e.name}),s.jsxs("div",{className:"mt-3 flex items-baseline gap-1",children:[s.jsx("span",{className:"text-4xl font-extrabold text-foreground",children:e.price}),e.period&&s.jsx("span",{className:"text-muted-foreground text-sm",children:e.period})]}),!e.highlight&&s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:e.tag})]}),s.jsx("ul",{className:"space-y-2.5 mb-6",children:e.features.map(t=>s.jsxs("li",{className:"flex items-start gap-2.5 text-sm",children:[s.jsx(ya,{className:"w-4 h-4 text-primary mt-0.5 shrink-0"}),s.jsx("span",{children:t})]},t))}),s.jsx(P,{asChild:!0,className:"w-full",variant:e.highlight?"default":"outline",children:s.jsx(me,{to:"/demo",children:"Solicitar demonstração"})})]},e.name))})}),s.jsx(Fd,{})]});var y3="Label",tN=h.forwardRef((e,t)=>
486s.jsx(ve.label,{...e,ref:t,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));tN.displayName=y3;var rN=tN;const w3=Xi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),U=h.forwardRef(({className:e,...t},r)=>s.jsx(rN,{ref:r,className:Y(w3(),e),...t}));U.displayName=rN.displayName;const b3=()=>{const{toast:e}=hj(),[t,r]=h.useState(!1),[n,a]=h.useState({name:"",email:"",company:"",phone:"",size:"",message:""}),i=o=>{if(o.preventDefault(),!n.name||!n.email||!n.company){e({title:"Campos obrigatórios",description:"Preencha nome, e-mail e empresa.",variant:"destructive"});return}r(!0),e({title:"Solicitação recebida!",description:"Nosso time entrará em contato em até 24h úteis."})};return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Md,{}),s.jsx("section",{className:"pt-32 pb-20",children:s.jsxs("div",{className:"container mx-auto px-4 grid lg:grid-cols-2 gap-12 max-w-6xl",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-xs font-bold tracking-widest uppercase text-primary",children:"Demonstração"}),s.jsxs("h1",{className:"text-4xl md:text-5xl font-extrabold tracking-tight mt-3 mb-5",children:["Veja a Orange RH em ",s.jsx("span",{className:"text-gradient",children:"ação"})]}),s.jsx("p",{className:"text-muted-foreground text-lg mb-8",children:"Agende uma demonstração personalizada. Vamos mostrar como funciona a criação da sua plataforma White Label, do domÃnio ao pipeline."}),s.jsx("ul",{className:"space-y-3",children:["Tour completo da área administrativa","Simulação de portal com sua marca","Personalização de pipeline e etapas","Discussão de plano ideal para sua operação"].map(o=>s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"w-6 h-6 rounded-full bg-primary/15 flex items-center justify-center mt-0.5",children:s.jsx(ya,{className:"w-3.5 h-3.5 text-primary"})}),s.jsx("span",{children:o})]},o))})]}),s.jsx(Q,{className:"p-8",children:t?s.jsxs("div",{className:"flex flex-col items-center text-center py-8",children:[s.jsx("div",{className:"w-16 h-16 rounded-full bg-success/10 flex items-center justify-center mb-5",children:s.jsx(wn,{className:"w-8 h-8 text-success"})}),s.jsx("h3",{className:"text-2xl font-bold mb-2",children:"Recebido!"}),s.jsx("p",{className:"text-muted-foreground",children:"Retornaremos em até 24h úteis com uma demonstração personalizada."})]}):s.jsxs("form",{onSubmit:i,className:"space-y-4",children:[s.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"name",children:"Nome *"}),s.jsx(q,{id:"name",value:n.name,onChange:o=>a({...n,name:o.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"email",children:"E-mail corporativo *"}),s.jsx(q,{id:"email",type:"email",value:n.email,onChange:o=>a({...n,email:o.target.value})})]})]}),s.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"company",children:"Empresa *"}),s.jsx(q,{id:"company",value:n.company,onChange:o=>a({...n,company:o.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"phone",children:"Telefone"}),s.jsx(q,{id:"phone",value:n.phone,onChange:o=>a({...n,phone:o.target.value})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"size",children:"Tamanho da operação"}),s.jsx(q,{id:"size",placeholder:"Ex.: 5 recrutadores / 30 vagas mês",value:n.size,onChange:o=>a({...n,size:o.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"msg",children:"Mensagem"}),s.jsx(ct,{id:"msg",rows:4,value:n.message,onChange:o=>a({...n,message:o.target.value})})]}),s.jsx(P,{type:"submit",className:"w-full shadow-button",children:"Solicitar demonstração"})]})})]})}),s.jsx(Fd,{})]})};var De;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of i)o[l]=a[l];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o}
vendor: 5,526 bytes, line 486
486,e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(De||(De={}));var Jy;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Jy||(Jy={}));const he=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cs=e=>{switch(typeof e){case"undefined":return he.undefined;case"string":return he.string;case"number":return Number.isNaN(e)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":return Array.isArray(e)?he.array:e===null?he.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?he.promise:typeof Map<"u"&&e instanceof Map?he.map:typeof Set<"u"&&e instanceof Set?he.set:typeof Date<"u"&&e instanceof Date?he.date:he.object;default:return he.unknown}},ee=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Wn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let l=n,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(r(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return a(this),n}static assert(t){if(!(t instanceof Wn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Wn.create=e=>new Wn(e);const Bm=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===he.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:De.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ee.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;
vendor: 5,024 bytes, line 486
486case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,De.assertNever(e)}return{message:r}};let j3=Bm;function _3(){return j3}const N3=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let l="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...a,path:i,message:l}};function ce(e,t){const r=_3(),n=N3({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Bm?void 0:Bm].filter(a=>!!a)});e.common.issues.push(n)}class dr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const a of r){if(a.status==="aborted")return be;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return dr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return be;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}}const be=Object.freeze({status:"aborted"}),Oo=e=>({status:"dirty",value:e}),Cr=e=>({status:"valid",value:e}),Qy=e=>e.status==="aborted",Zy=e=>e.status==="dirty",Bi=e=>e.status==="valid",qu=e=>typeof Promise<"u"&&e instanceof Promise;var fe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(fe||(fe={}));class Ms{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Yy=(e,t)=>{if(Bi(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Wn(e.common.issues);return this._error=r,this._error}}};function Ee(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??n??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??r??l.defaultError}},description:a}}class Ie{get description(){return this._def.description}_getType(t){return cs(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:cs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new dr,ctx:{common:t.parent.common,data:t.data,parsedType:cs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(qu(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cs(t)},a=this._parseSync({data:t,path:n.path,parent:n});return Yy(n,a)}"~validate"(t){var n,a;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cs(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:r});return Bi(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>Bi(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cs(t)},a=this._parse({data:t,path:n.path,parent:n}),i=await(qu(a)?a:Promise.resolve(a));return Yy(n,i)}refine(t,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}
vendor: 6,204 bytes, line 486
486:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=t(a),l=()=>i.addIssue({code:ee.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new Hi({schema:this,typeName:je.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return As.create(this,this._def)}nullable(){return Wi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fn.create(this)}promise(){return Gu.create(this,this._def)}or(t){return Wu.create([this,t],this._def)}and(t){return Ku.create(this,t,this._def)}transform(t){return new Hi({...Ee(this._def),schema:this,typeName:je.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new qm({...Ee(this._def),innerType:this,defaultValue:r,typeName:je.ZodDefault})}brand(){return new K3({typeName:je.ZodBranded,type:this,...Ee(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Hm({...Ee(this._def),innerType:this,catchValue:r,typeName:je.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Mg.create(this,t)}readonly(){return Wm.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const S3=/^c[^\s-]{8,}$/i,k3=/^[0-9a-z]+$/,C3=/^[0-9A-HJKMNP-TV-Z]{26}$/i,E3=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,T3=/^[a-z0-9_-]{21}$/i,R3=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,A3=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,P3=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,O3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let tf;const I3=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,L3=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$3=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,D3=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,M3=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,F3=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nN="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",z3=new RegExp(`^${nN}$`);function sN(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function U3(e){return new RegExp(`^${sN(e)}$`)}function B3(e){let t=`${nN}T${sN(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function V3(e,t){return!!((t==="v4"||!t)&&I3.test(e)||(t==="v6"||!t)&&$3.test(e))}function q3(e,t){if(!R3.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function H3(e,t){return!!((t==="v4"||!t)&&L3.test(e)||(t==="v6"||!t)&&D3.test(e))}class $n extends Ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==he.string){const i=this._getOrReturnCtx(t);
vendor: 19,317 bytes, line 486
486return ce(i,{code:ee.invalid_type,expected:he.string,received:i.parsedType}),be}const n=new dr;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),ce(a,{code:ee.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),ce(a,{code:ee.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,l=t.data.length<i.value;(o||l)&&(a=this._getOrReturnCtx(t,a),o?ce(a,{code:ee.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&ce(a,{code:ee.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")P3.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"email",code:ee.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")tf||(tf=new RegExp(O3,"u")),tf.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"emoji",code:ee.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")E3.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"uuid",code:ee.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")T3.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"nanoid",code:ee.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")S3.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"cuid",code:ee.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")k3.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"cuid2",code:ee.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")C3.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"ulid",code:ee.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),ce(a,{validation:"url",code:ee.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"regex",code:ee.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),ce(a,{code:ee.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),ce(a,{code:ee.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),ce(a,{code:ee.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?B3(i).test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:ee.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?z3.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:ee.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?U3(i).test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:ee.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?A3.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"duration",code:ee.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?V3(t.data,i.version)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"ip",code:ee.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?q3(t.data,i.alg)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"jwt",code:ee.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?H3(t.data,i.version)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"cidr",code:ee.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?M3.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"base64",code:ee.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?F3.test(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{validation:"base64url",code:ee.invalid_string,message:i.message}),n.dirty()):De.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:ee.invalid_string,...fe.errToObj(n)})}_addCheck(t){return new $n({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...fe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...fe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...fe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...fe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...fe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...fe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...fe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...fe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...fe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...fe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...fe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...fe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...fe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...fe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...fe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...fe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...fe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...fe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...fe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...fe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...fe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...fe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...fe.errToObj(r)})}nonempty(t){return this.min(1,fe.errToObj(t))}trim(){return new $n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new $n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new $n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}$n.create=e=>new $n({checks:[],typeName:je.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Ee(e)});function W3(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(t.toFixed(a).replace(".",""));return i%o/10**a}class ba extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==he.number){const i=this._getOrReturnCtx(t);return ce(i,{code:ee.invalid_type,expected:he.number,received:i.parsedType}),be}let n;const a=new dr;for(const i of this._def.checks)i.kind==="int"?De.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?W3(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_finite,message:i.message}),a.dirty()):De.assertNever(i);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,fe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,fe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,fe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,fe.toString(r))}setLimit(t,r,n,a){return new ba({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:fe.toString(a)}]})}_addCheck(t){return new ba({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:fe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:fe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&De.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}ba.create=e=>new ba({checks:[],typeName:je.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ee(e)});class ja extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==he.bigint)return this._getInvalidInput(t);let n;const a=new dr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):De.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:he.bigint,received:r.parsedType}),be}gte(t,r){return this.setLimit("min",t,!0,fe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,fe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,fe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,fe.toString(r))}setLimit(t,r,n,a){return new ja({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:fe.toString(a)}]})}_addCheck(t){return new ja({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}ja.create=e=>new ja({checks:[],typeName:je.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Ee(e)});class Hu extends Ie{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==he.boolean){const n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:he.boolean,received:n.parsedType}),be}return Cr(t.data)}}Hu.create=e=>new Hu({typeName:je.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ee(e)});class Vi extends Ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==he.date){const i=this._getOrReturnCtx(t);return ce(i,{code:ee.invalid_type,expected:he.date,received:i.parsedType}),be}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ce(i,{code:ee.invalid_date}),be}const n=new dr;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),ce(a,{code:ee.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),ce(a,{code:ee.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):De.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Vi({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:fe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:fe.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}Vi.create=e=>new Vi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:je.ZodDate,...Ee(e)});class Xy extends Ie{_parse(t){if(this._getType(t)!==he.symbol){const n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:he.symbol,received:n.parsedType}),be}return Cr(t.data)}}Xy.create=e=>new Xy({typeName:je.ZodSymbol,...Ee(e)});class e0 extends Ie{_parse(t){if(this._getType(t)!==he.undefined){const n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:he.undefined,received:n.parsedType}),be}return Cr(t.data)}}e0.create=e=>new e0({typeName:je.ZodUndefined,...Ee(e)});class t0 extends Ie{_parse(t){if(this._getType(t)!==he.null){const n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:he.null,received:n.parsedType}),be}return Cr(t.data)}}t0.create=e=>new t0({typeName:je.ZodNull,...Ee(e)});class r0 extends Ie{constructor(){super(...arguments),this._any=!0}_parse(t){return Cr(t.data)}}r0.create=e=>new r0({typeName:je.ZodAny,...Ee(e)});class n0 extends Ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Cr(t.data)}}n0.create=e=>new n0({typeName:je.ZodUnknown,...Ee(e)});class Fs extends Ie{_parse(t){const r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:he.never,received:r.parsedType}),be}}Fs.create=e=>new Fs({typeName:je.ZodNever,...Ee(e)});class s0 extends Ie{_parse(t){if(this._getType(t)!==he.undefined){const n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:he.void,received:n.parsedType}),be}return Cr(t.data)}}s0.create=e=>new s0({typeName:je.ZodVoid,...Ee(e)});class fn extends Ie{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==he.array)return ce(r,{code:ee.invalid_type,expected:he.array,received:r.parsedType}),be;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(o||l)&&(ce(r,{code:o?ee.too_big:ee.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(ce(r,{code:ee.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(ce(r,{code:ee.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>a.type._parseAsync(new Ms(r,o,r.path,l)))).then(o=>dr.mergeArray(n,o));const i=[...r.data].map((o,l)=>a.type._parseSync(new Ms(r,o,r.path,l)));return dr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new fn({...this._def,minLength:{value:t,message:fe.toString(r)}})}max(t,r){return new fn({...this._def,maxLength:{value:t,message:fe.toString(r)}})}length(t,r){return new fn({...this._def,exactLength:{value:t,message:fe.toString(r)}})}nonempty(t){return this.min(1,t)}}fn.create=(e,t)=>new fn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:je.ZodArray,...Ee(t)});function Ka(e){if(e instanceof st){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=As.create(Ka(n))}return new st({...e._def,shape:()=>t})}else return e instanceof fn?new fn({...e._def,type:Ka(e.element)}):e instanceof As?As.create(Ka(e.unwrap())):e instanceof Wi?Wi.create(Ka(e.unwrap())):e instanceof _a?_a.create(e.items.map(t=>Ka(t))):e}class st extends Ie{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;
vendor: 4,147 bytes, line 486
486const t=this._def.shape(),r=De.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==he.object){const u=this._getOrReturnCtx(t);return ce(u,{code:ee.invalid_type,expected:he.object,received:u.parsedType}),be}const{status:n,ctx:a}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Fs&&this._def.unknownKeys==="strip"))for(const u in a.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=i[u],f=a.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Ms(a,f,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof Fs){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:a.data[d]}});else if(u==="strict")l.length>0&&(ce(a,{code:ee.unrecognized_keys,keys:l}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const f=a.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Ms(a,f,a.path,d)),alwaysSet:d in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,m=await d.value;u.push({key:f,value:m,alwaysSet:d.alwaysSet})}return u}).then(u=>dr.mergeObjectSync(n,u)):dr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return fe.errToObj,new st({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:fe.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new st({...this._def,unknownKeys:"strip"})}passthrough(){return new st({...this._def,unknownKeys:"passthrough"})}extend(t){return new st({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new st({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:je.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new st({...this._def,catchall:t})}pick(t){const r={};for(const n of De.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new st({...this._def,shape:()=>r})}omit(t){const r={};for(const n of De.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new st({...this._def,shape:()=>r})}deepPartial(){return Ka(this)}partial(t){const r={};for(const n of De.objectKeys(this.shape)){const a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new st({...this._def,shape:()=>r})}required(t){const r={};for(const n of De.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof As;)i=i._def.innerType;r[n]=i}return new st({...this._def,shape:()=>r})}keyof(){return aN(De.objectKeys(this.shape))}}st.create=(e,t)=>new st({shape:()=>e,unknownKeys:"strip",catchall:Fs.create(),typeName:je.ZodObject,...Ee(t)});st.strictCreate=(e,t)=>new st({shape:()=>e,unknownKeys:"strict",catchall:Fs.create(),typeName:je.ZodObject,...Ee(t)});st.lazycreate=(e,t)=>new st({shape:e,unknownKeys:"strip",catchall:Fs.create(),typeName:je.ZodObject,...Ee(t)});class Wu extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function a(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Wn(l.ctx.common.issues));return ce(r,{code:ee.invalid_union,unionErrors:o}),be}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new Wn(c));
vendor: 2,728 bytes, line 486
486return ce(r,{code:ee.invalid_union,unionErrors:l}),be}}get options(){return this._def.options}}Wu.create=(e,t)=>new Wu({options:e,typeName:je.ZodUnion,...Ee(t)});function Vm(e,t){const r=cs(e),n=cs(t);if(e===t)return{valid:!0,data:e};if(r===he.object&&n===he.object){const a=De.objectKeys(t),i=De.objectKeys(e).filter(l=>a.indexOf(l)!==-1),o={...e,...t};for(const l of i){const c=Vm(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(r===he.array&&n===he.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const o=e[i],l=t[i],c=Vm(o,l);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===he.date&&n===he.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ku extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=(i,o)=>{if(Qy(i)||Qy(o))return be;const l=Vm(i.value,o.value);return l.valid?((Zy(i)||Zy(o))&&r.dirty(),{status:r.value,value:l.data}):(ce(n,{code:ee.invalid_intersection_types}),be)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ku.create=(e,t,r)=>new Ku({left:e,right:t,typeName:je.ZodIntersection,...Ee(r)});class _a extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==he.array)return ce(n,{code:ee.invalid_type,expected:he.array,received:n.parsedType}),be;if(n.data.length<this._def.items.length)return ce(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&n.data.length>this._def.items.length&&(ce(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Ms(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>dr.mergeArray(r,o)):dr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new _a({...this._def,rest:t})}}_a.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _a({items:e,typeName:je.ZodTuple,rest:null,...Ee(t)})};class a0 extends Ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==he.map)return ce(n,{code:ee.invalid_type,expected:he.map,received:n.parsedType}),be;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([l,c],u)=>
vendor: 4,124 bytes, line 486
486({key:a._parse(new Ms(n,l,n.path,[u,"key"])),value:i._parse(new Ms(n,c,n.path,[u,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return be;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return be;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}}}}a0.create=(e,t,r)=>new a0({valueType:t,keyType:e,typeName:je.ZodMap,...Ee(r)});class Sl extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==he.set)return ce(n,{code:ee.invalid_type,expected:he.set,received:n.parsedType}),be;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(ce(n,{code:ee.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(ce(n,{code:ee.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return be;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const l=[...n.data.values()].map((c,u)=>i._parse(new Ms(n,c,n.path,u)));return n.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,r){return new Sl({...this._def,minSize:{value:t,message:fe.toString(r)}})}max(t,r){return new Sl({...this._def,maxSize:{value:t,message:fe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Sl.create=(e,t)=>new Sl({valueType:e,minSize:null,maxSize:null,typeName:je.ZodSet,...Ee(t)});class i0 extends Ie{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}i0.create=(e,t)=>new i0({getter:e,typeName:je.ZodLazy,...Ee(t)});class o0 extends Ie{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ce(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}}o0.create=(e,t)=>new o0({value:e,typeName:je.ZodLiteral,...Ee(t)});function aN(e,t){return new qi({values:e,typeName:je.ZodEnum,...Ee(t)})}class qi extends Ie{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{expected:De.joinValues(n),received:r.parsedType,code:ee.invalid_type}),be}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{received:r.data,code:ee.invalid_enum_value,options:n}),be}return Cr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return qi.create(t,{...this._def,...r})}exclude(t,r=this._def){return qi.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}qi.create=aN;class l0 extends Ie{_parse(t){const r=De.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==he.string&&n.parsedType!==he.number){const a=De.objectValues(r);return ce(n,{expected:De.joinValues(a),received:n.parsedType,code:ee.invalid_type}),be}if(this._cache||(this._cache=new Set(De.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=De.objectValues(r);return ce(n,{received:n.data,code:ee.invalid_enum_value,options:a}),be}return Cr(t.data)}get enum(){return this._def.values}}l0.create=(e,t)=>new l0({values:e,typeName:je.ZodNativeEnum,...Ee(t)});class Gu extends Ie{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==he.promise&&r.common.async===!1)return ce(r,{code:ee.invali
vendor: 4,075 bytes, line 486
486d_type,expected:he.promise,received:r.parsedType}),be;const n=r.parsedType===he.promise?r.data:Promise.resolve(r.data);return Cr(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Gu.create=(e,t)=>new Gu({type:e,typeName:je.ZodPromise,...Ee(t)});class Hi extends Ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===je.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{ce(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return be;const c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?be:c.status==="dirty"||r.value==="dirty"?Oo(c.value):c});{if(r.value==="aborted")return be;const l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?be:l.status==="dirty"||r.value==="dirty"?Oo(l.value):l}}if(a.type==="refinement"){const o=l=>{const c=a.refinement(l,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?be:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?be:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Bi(o))return be;const l=a.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Bi(o)?Promise.resolve(a.transform(o.value,i)).then(l=>({status:r.value,value:l})):be);De.assertNever(a)}}Hi.create=(e,t,r)=>new Hi({schema:e,typeName:je.ZodEffects,effect:t,...Ee(r)});Hi.createWithPreprocess=(e,t,r)=>new Hi({schema:t,effect:{type:"preprocess",transform:e},typeName:je.ZodEffects,...Ee(r)});class As extends Ie{_parse(t){return this._getType(t)===he.undefined?Cr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}As.create=(e,t)=>new As({innerType:e,typeName:je.ZodOptional,...Ee(t)});class Wi extends Ie{_parse(t){return this._getType(t)===he.null?Cr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Wi.create=(e,t)=>new Wi({innerType:e,typeName:je.ZodNullable,...Ee(t)});class qm extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===he.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}qm.create=(e,t)=>new qm({innerType:e,typeName:je.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ee(t)});class Hm extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return qu(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Wn(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Wn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Hm.create=(e,t)=>new Hm({innerType:e,typeName:je.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ee(t)});class c0 extends Ie{_parse(t){if(this._getType(t)!==he.nan){const n=this._getOrReturnCtx(t);
486return ce(n,{code:ee.invalid_type,expected:he.nan,received:n.parsedType}),be}return{status:"valid",value:t.data}}}c0.create=e=>new c0({typeName:je.ZodNaN,...Ee(e)});class K3 extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Mg extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?be:i.status==="dirty"?(r.dirty(),Oo(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?be:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new Mg({in:t,out:r,typeName:je.ZodPipeline})}}class Wm extends Ie{_parse(t){const r=this._def.innerType._parse(t),n=a=>(Bi(a)&&(a.value=Object.freeze(a.value)),a);return qu(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}Wm.create=(e,t)=>new Wm({innerType:e,typeName:je.ZodReadonly,...Ee(t)});st.lazycreate;var je;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(je||(je={}));const Qe=$n.create;ba.create;ja.create;const G3=Hu.create;Vi.create;Fs.create;fn.create;const ql=st.create;st.strictCreate;Wu.create;Ku.create;_a.create;const J3=qi.create;Gu.create;As.create;Wi.create;const Km={string:e=>$n.create({...e,coerce:!0}),number:e=>ba.create({...e,coerce:!0}),boolean:e=>Hu.create({...e,coerce:!0}),bigint:e=>ja.create({...e,coerce:!0}),date:e=>Vi.create({...e,coerce:!0})};function u0(e,[t,r]){return Math.min(r,Math.max(t,e))}var rf=0;function iN(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??d0()),document.body.insertAdjacentElement("beforeend",e[1]??d0()),rf++,()=>{rf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),rf--}},[])}function d0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var nf="focusScope.autoFocusOnMount",sf="focusScope.autoFocusOnUnmount",h0={bubbles:!1,cancelable:!0},Q3="FocusScope",Fg=h.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=h.useState(null),u=cr(a),d=cr(i),f=h.useRef(null),m=Me(t,v=>c(v)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let v=function(y){if(p.paused||!l)return;const j=y.target;l.contains(j)?f.current=j:as(f.current,{select:!0})},x=function(y){if(p.paused||!l)return;const j=y.relatedTarget;j!==null&&(l.contains(j)||as(f.current,{select:!0}))},w=function(y){if(document.activeElement===document.body)for(const _ of y)_.removedNodes.length>0&&as(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",x);const g=new MutationObserver(w);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),g.disconnect()}}},[n,l,p.paused]),h.useEffect(()=>{if(l){m0.add(p);const v=document.activeElement;if(!l.contains(v)){const w=new CustomEvent(nf,h0);l.addEventListener(nf,u),l.dispatchEvent(w),w.defaultPrevented||(Z3(r5(oN(l)),{select:!0}),document.activeElement===v&&as(l))}return()=>{l.removeEventListener(nf,u),setTimeout(()=>{const w=new CustomEvent(sf,h0);l.addEventListener(sf,d),l.dispatchEvent(w),w.defaultPrevented||as(v??document.body,{select:!0}),l.removeEventListener(sf,d),m0.remove(p)}
vendor: 4,814 bytes, line 486
486,0)}}},[l,u,d,p]);const b=h.useCallback(v=>{if(!r&&!n||p.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(x&&w){const g=v.currentTarget,[y,j]=Y3(g);y&&j?!v.shiftKey&&w===j?(v.preventDefault(),r&&as(y,{select:!0})):v.shiftKey&&w===y&&(v.preventDefault(),r&&as(j,{select:!0})):w===g&&v.preventDefault()}},[r,n,p.paused]);return s.jsx(ve.div,{tabIndex:-1,...o,ref:m,onKeyDown:b})});Fg.displayName=Q3;function Z3(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(as(n,{select:t}),document.activeElement!==r)return}function Y3(e){const t=oN(e),r=f0(t,e),n=f0(t.reverse(),e);return[r,n]}function oN(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function f0(e,t){for(const r of e)if(!X3(r,{upTo:t}))return r}function X3(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 e5(e){return e instanceof HTMLInputElement&&"select"in e}function as(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&e5(e)&&t&&e.select()}}var m0=t5();function t5(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=p0(e,t),e.unshift(t)},remove(t){var r;e=p0(e,t),(r=e[0])==null||r.resume()}}}function p0(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function r5(e){return e.filter(t=>t.tagName!=="A")}function lN(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var n5=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ua=new WeakMap,Rc=new WeakMap,Ac={},af=0,cN=function(e){return e&&(e.host||cN(e.parentNode))},s5=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=cN(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})},a5=function(e,t,r,n){var a=s5(t,Array.isArray(e)?e:[e]);Ac[r]||(Ac[r]=new WeakMap);var i=Ac[r],o=[],l=new Set,c=new Set(a),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};a.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(m){if(l.has(m))d(m);else try{var p=m.getAttribute(n),b=p!==null&&p!=="false",v=(Ua.get(m)||0)+1,x=(i.get(m)||0)+1;Ua.set(m,v),i.set(m,x),o.push(m),v===1&&b&&Rc.set(m,!0),x===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};return d(t),l.clear(),af++,function(){o.forEach(function(f){var m=Ua.get(f)-1,p=i.get(f)-1;Ua.set(f,m),i.set(f,p),m||(Rc.has(f)||f.removeAttribute(n),Rc.delete(f)),p||f.removeAttribute(r)}),af--,af||(Ua=new WeakMap,Ua=new WeakMap,Rc=new WeakMap,Ac={})}},uN=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=n5(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live]"))),a5(n,a,r,"aria-hidden")):function(){return null}},un=function(){return un=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},un.apply(this,arguments)};function dN(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 a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function i5(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var Yc="right-scroll-bar-position",Xc="width-before-scroll-bar",o5="with-scroll-bars-hidden",l5="--removed-body-scroll-bar-size";function of(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function c5(e,t){var r=h.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=t,r.facade}var u5=typeof window<"u"?h.useLayoutEffect:h.useEffect,g0=new WeakMap;function d5(e,t){var r=c5(null,function(n){return e.forEach(function(a){return of(a,n)})});return u5(function(){var n=g0.get(r);if(n){var a=new Set(n),i=new Set(e),o=r.current;a.forEach(function(l){i.has(l)||of(l,null)}
vendor: 4,153 bytes, lines 486-501
486),i.forEach(function(l){a.has(l)||of(l,o)})}g0.set(r,e)},[e]),r}function h5(e){return e}function f5(e,t){t===void 0&&(t=h5);var r=[],n=!1,a={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(i){var o=t(i,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(i),o=r}var c=function(){var d=o;o=[],d.forEach(i)},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 a}function m5(e){e===void 0&&(e={});var t=f5(null);return t.options=un({async:!0,ssr:!1},e),t}var hN=function(e){var t=e.sideCar,r=dN(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 h.createElement(n,un({},r))};hN.isSideCarExport=!0;function p5(e,t){return e.useMedium(t),hN}var fN=m5(),lf=function(){},qd=h.forwardRef(function(e,t){var r=h.useRef(null),n=h.useState({onScrollCapture:lf,onWheelCapture:lf,onTouchMoveCapture:lf}),a=n[0],i=n[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,p=e.noRelative,b=e.noIsolation,v=e.inert,x=e.allowPinchZoom,w=e.as,g=w===void 0?"div":w,y=e.gapMode,j=dN(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=m,S=d5([r,t]),N=un(un({},j),a);return h.createElement(h.Fragment,null,d&&h.createElement(_,{sideCar:fN,removeScrollBar:u,shards:f,noRelative:p,noIsolation:b,inert:v,setCallbacks:i,allowPinchZoom:!!x,lockRef:r,gapMode:y}),o?h.cloneElement(h.Children.only(l),un(un({},N),{ref:S})):h.createElement(g,un({},N,{className:c,ref:S}),l))});qd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qd.classNames={fullWidth:Xc,zeroRight:Yc};var g5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function v5(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=g5();return t&&e.setAttribute("nonce",t),e}function x5(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function y5(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var w5=function(){var e=0,t=null;return{add:function(r){e==0&&(t=v5())&&(x5(t,r),y5(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},b5=function(){var e=w5();return function(t,r){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},mN=function(){var e=b5(),t=function(r){var n=r.styles,a=r.dynamic;return e(n,a),null};return t},j5={left:0,top:0,right:0,gap:0},cf=function(e){return parseInt(e||"",10)||0},_5=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[cf(r),cf(n),cf(a)]},N5=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return j5;var t=_5(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])}},S5=mN(),vi="data-scroll-locked",k5=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),` 487 .`.concat(o5,` { 488 overflow: hidden `).concat(n,`; 489 padding-right: `).concat(l,"px ").concat(n,`; 490 } 491 body[`).concat(vi,`] { 492 overflow: hidden `).concat(n,`; 493 overscroll-behavior: contain; 494 `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` 495 padding-left: `.concat(a,`px; 496 padding-top: `).concat(i,`px; 497 padding-right: `).concat(o,`px; 498 margin-left:0; 499 margin-top:0; 500 margin-right: `).concat(l,"px ").concat(n,`; 501 `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";
501")].filter(Boolean).join(""),` 502 } 503 504 .`).concat(Yc,` { 505 right: `).concat(l,"px ").concat(n,`; 506 } 507 508 .`).concat(Xc,` { 509 margin-right: `).concat(l,"px ").concat(n,`; 510 } 511 512 .`).concat(Yc," .").concat(Yc,` { 513 right: 0 `).concat(n,`; 514 } 515 516 .`).concat(Xc," .").concat(Xc,` { 517 margin-right: 0 `).concat(n,`; 518 } 519 520 body[`).concat(vi,`] { 521 `).concat(l5,": ").concat(l,`px; 522 } 523`)},v0=function(){var e=parseInt(document.body.getAttribute(vi)||"0",10);return isFinite(e)?e:0},C5=function(){h.useEffect(function(){return document.body.setAttribute(vi,(v0()+1).toString()),function(){var e=v0()-1;e<=0?document.body.removeAttribute(vi):document.body.setAttribute(vi,e.toString())}},[])},E5=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;C5();var i=h.useMemo(function(){return N5(a)},[a]);return h.createElement(S5,{styles:k5(i,!t,a,r?"":"!important")})},Gm=!1;if(typeof window<"u")try{var Pc=Object.defineProperty({},"passive",{get:function(){return Gm=!0,!0}});window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch{Gm=!1}var Ba=Gm?{passive:!1}:!1,T5=function(e){return e.tagName==="TEXTAREA"},pN=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!T5(e)&&r[t]==="visible")},R5=function(e){return pN(e,"overflowY")},A5=function(e){return pN(e,"overflowX")},x0=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=gN(e,n);if(a){var i=vN(e,n),o=i[1],l=i[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},P5=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},O5=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},gN=function(e,t){return e==="v"?R5(t):A5(t)},vN=function(e,t){return e==="v"?P5(t):O5(t)},I5=function(e,t){return e==="h"&&t==="rtl"?-1:1},L5=function(e,t,r,n,a){var i=I5(e,window.getComputedStyle(t).direction),o=i*n,l=r.target,c=t.contains(l),u=!1,d=o>0,f=0,m=0;do{if(!l)break;var p=vN(e,l),b=p[0],v=p[1],x=p[2],w=v-x-i*b;(b||w)&&gN(e,l)&&(f+=w,m+=b);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!a)||!d&&(Math.abs(m)<1||!a))&&(u=!0),u},Oc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},y0=function(e){return[e.deltaX,e.deltaY]},w0=function(e){return e&&"current"in e?e.current:e},$5=function(e,t){return e[0]===t[0]&&e[1]===t[1]},D5=function(e){return` 524 .block-interactivity-`.concat(e,` {pointer-events: none;} 525 .allow-interactivity-`).concat(e,` {pointer-events: all;} 526`)},M5=0,Va=[];function F5(e){var t=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),a=h.useState(M5++)[0],i=h.useState(mN)[0],o=h.useRef(e);h.useEffect(function(){o.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=i5([e.lockRef.current],(e.shards||[]).map(w0),!0).filter(Boolean);return v.forEach(function(x){return x.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(v,x){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var w=Oc(v),g=r.current,y="deltaX"in v?v.deltaX:g[0]-w[0],j="deltaY"in v?v.deltaY:g[1]-w[1],_,S=v.target,N=Math.abs(y)>Math.abs(j)?"h":"v";if("touches"in v&&N==="h"&&S.type==="range")return!1;var E=x0(N,S);if(!E)return!0;if(E?_=N:(_=N==="v"?"h":"v",E=x0(N,S)),!E)return!1;if(!n.current&&"changedTouches"in v&&(y||j)&&(n.current=_),!_)return!0;var R=n.current||_;return L5(R,x,v,R==="h"?y:j,!0)},[]),c=h.useCallback(function(v){var x=v;if(!(!Va.length||Va[Va.length-1]!==i)){var w="deltaY"in x?y0(x):Oc(x),g=t.current.filter(function(_){return _.name===x.type&&(_.target===x.target||x.target===_.shadowParent)&&$5(_.delta,w)})[0];if(g&&g.should){x.cancelable&&x.preventDefault();return}
vendor: 4,125 bytes, line 526
526if(!g){var y=(o.current.shards||[]).map(w0).filter(Boolean).filter(function(_){return _.contains(x.target)}),j=y.length>0?l(x,y[0]):!o.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),u=h.useCallback(function(v,x,w,g){var y={name:v,delta:x,target:w,should:g,shadowParent:z5(w)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(j){return j!==y})},1)},[]),d=h.useCallback(function(v){r.current=Oc(v),n.current=void 0},[]),f=h.useCallback(function(v){u(v.type,y0(v),v.target,l(v,e.lockRef.current))},[]),m=h.useCallback(function(v){u(v.type,Oc(v),v.target,l(v,e.lockRef.current))},[]);h.useEffect(function(){return Va.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Ba),document.addEventListener("touchmove",c,Ba),document.addEventListener("touchstart",d,Ba),function(){Va=Va.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ba),document.removeEventListener("touchmove",c,Ba),document.removeEventListener("touchstart",d,Ba)}},[]);var p=e.removeScrollBar,b=e.inert;return h.createElement(h.Fragment,null,b?h.createElement(i,{styles:D5(a)}):null,p?h.createElement(E5,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function z5(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const U5=p5(fN,F5);var zg=h.forwardRef(function(e,t){return h.createElement(qd,un({},e,{ref:t,sideCar:U5}))});zg.classNames=qd.classNames;var B5=[" ","Enter","ArrowUp","ArrowDown"],V5=[" ","Enter"],Na="Select",[Hd,Wd,q5]=pd(Na),[co,zF]=er(Na,[q5,Nd]),Kd=Nd(),[H5,Hs]=co(Na),[W5,K5]=co(Na),xN=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:m,required:p,form:b}=e,v=Kd(t),[x,w]=h.useState(null),[g,y]=h.useState(null),[j,_]=h.useState(!1),S=Ud(u),[N,E]=Qr({prop:n,defaultProp:a??!1,onChange:i,caller:Na}),[R,I]=Qr({prop:o,defaultProp:l,onChange:c,caller:Na}),A=h.useRef(null),C=x?b||!!x.closest("form"):!0,[F,D]=h.useState(new Set),z=Array.from(F).map(B=>B.props.value).join(";");return s.jsx(C_,{...v,children:s.jsxs(H5,{required:p,scope:t,trigger:x,onTriggerChange:w,valueNode:g,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:_,contentId:Gr(),value:R,onValueChange:I,open:N,onOpenChange:E,dir:S,triggerPointerDownPosRef:A,disabled:m,children:[s.jsx(Hd.Provider,{scope:t,children:s.jsx(W5,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(B=>{D(K=>new Set(K).add(B))},[]),onNativeOptionRemove:h.useCallback(B=>{D(K=>{const O=new Set(K);return O.delete(B),O})},[]),children:r})}),C?s.jsxs(BN,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:R,onChange:B=>I(B.target.value),disabled:m,form:b,children:[R===void 0?s.jsx("option",{value:""}):null,Array.from(F)]},z):null]})})};xN.displayName=Na;var yN="SelectTrigger",wN=h.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...a}=e,i=Kd(r),o=Hs(yN,r),l=o.disabled||n,c=Me(t,o.onTriggerChange),u=Wd(r),d=h.useRef("touch"),[f,m,p]=qN(v=>{const x=u().filter(y=>!y.disabled),w=x.find(y=>y.value===o.value),g=HN(x,v,w);g!==void 0&&o.onValueChange(g.value)}),b=v=>{l||(o.onOpenChange(!0),p()),v&&(o.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return s.jsx(E_,{asChild:!0,...i,children:s.jsx(ve.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":VN(o.value)?"":void 0,...a,ref:c,onClick:ge(a.onClick,v=>{v.currentTarget.focus(),d.current!=="mouse"&&b(v)}),onPointerDown:ge(a.onPointerDown,v=>{d.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(b(v),v.preventDefault())}),onKeyDown:ge(a.onKeyDown,v=>{const x=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(x&&v.key===" ")&&B5.includes(v.key)&&
vendor: 15,637 bytes, line 526
526(b(),v.preventDefault())})})})});wN.displayName=yN;var bN="SelectValue",jN=h.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,children:i,placeholder:o="",...l}=e,c=Hs(bN,r),{onValueNodeHasChildrenChange:u}=c,d=i!==void 0,f=Me(t,c.onValueNodeChange);return ht(()=>{u(d)},[u,d]),s.jsx(ve.span,{...l,ref:f,style:{pointerEvents:"none"},children:VN(c.value)?s.jsx(s.Fragment,{children:o}):i})});jN.displayName=bN;var G5="SelectIcon",_N=h.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...a}=e;return s.jsx(ve.span,{"aria-hidden":!0,...a,ref:t,children:n||"â¼"})});_N.displayName=G5;var J5="SelectPortal",NN=e=>s.jsx(gd,{asChild:!0,...e});NN.displayName=J5;var Sa="SelectContent",SN=h.forwardRef((e,t)=>{const r=Hs(Sa,e.__scopeSelect),[n,a]=h.useState();if(ht(()=>{a(new DocumentFragment)},[]),!r.open){const i=n;return i?Ta.createPortal(s.jsx(kN,{scope:e.__scopeSelect,children:s.jsx(Hd.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(CN,{...e,ref:t})});SN.displayName=Sa;var $r=10,[kN,Ws]=co(Sa),Q5="SelectContentImpl",Z5=Di("SelectContent.RemoveScroll"),CN=h.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:b,hideWhenDetached:v,avoidCollisions:x,...w}=e,g=Hs(Sa,r),[y,j]=h.useState(null),[_,S]=h.useState(null),N=Me(t,re=>j(re)),[E,R]=h.useState(null),[I,A]=h.useState(null),C=Wd(r),[F,D]=h.useState(!1),z=h.useRef(!1);h.useEffect(()=>{if(y)return uN(y)},[y]),iN();const B=h.useCallback(re=>{const[Pe,...Fe]=C().map(W=>W.ref.current),[Ae]=Fe.slice(-1),G=document.activeElement;for(const W of re)if(W===G||(W==null||W.scrollIntoView({block:"nearest"}),W===Pe&&_&&(_.scrollTop=0),W===Ae&&_&&(_.scrollTop=_.scrollHeight),W==null||W.focus(),document.activeElement!==G))return},[C,_]),K=h.useCallback(()=>B([E,y]),[B,E,y]);h.useEffect(()=>{F&&K()},[F,K]);const{onOpenChange:O,triggerPointerDownPosRef:k}=g;h.useEffect(()=>{if(y){let re={x:0,y:0};const Pe=Ae=>{var G,W;re={x:Math.abs(Math.round(Ae.pageX)-(((G=k.current)==null?void 0:G.x)??0)),y:Math.abs(Math.round(Ae.pageY)-(((W=k.current)==null?void 0:W.y)??0))}},Fe=Ae=>{re.x<=10&&re.y<=10?Ae.preventDefault():y.contains(Ae.target)||O(!1),document.removeEventListener("pointermove",Pe),k.current=null};return k.current!==null&&(document.addEventListener("pointermove",Pe),document.addEventListener("pointerup",Fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Pe),document.removeEventListener("pointerup",Fe,{capture:!0})}}},[y,O,k]),h.useEffect(()=>{const re=()=>O(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[O]);const[L,$]=qN(re=>{const Pe=C().filter(G=>!G.disabled),Fe=Pe.find(G=>G.ref.current===document.activeElement),Ae=HN(Pe,re,Fe);Ae&&setTimeout(()=>Ae.ref.current.focus())}),H=h.useCallback((re,Pe,Fe)=>{const Ae=!z.current&&!Fe;(g.value!==void 0&&g.value===Pe||Ae)&&(R(re),Ae&&(z.current=!0))},[g.value]),te=h.useCallback(()=>y==null?void 0:y.focus(),[y]),ne=h.useCallback((re,Pe,Fe)=>{const Ae=!z.current&&!Fe;(g.value!==void 0&&g.value===Pe||Ae)&&A(re)},[g.value]),Te=n==="popper"?Jm:EN,Be=Te===Jm?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:b,hideWhenDetached:v,avoidCollisions:x}:{};return s.jsx(kN,{scope:r,content:y,viewport:_,onViewportChange:S,itemRefCallback:H,selectedItem:E,onItemLeave:te,itemTextRefCallback:ne,focusSelectedItem:K,selectedItemText:I,position:n,isPositioned:F,searchRef:L,children:s.jsx(zg,{as:Z5,allowPinchZoom:!0,children:s.jsx(Fg,{asChild:!0,trapped:g.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:ge(a,re=>{var Pe;(Pe=g.trigger)==null||Pe.focus({preventScroll:!0}),re.preventDefault()}),children:s.jsx($l,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:s.jsx(Te,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:re=>re.preventDefault(),...w,...Be,onPlaced:()=>D(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:ge(w.onKeyDown,re=>{const Pe=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!Pe&&re.key.length===1&&$(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let Ae=C().filter(G=>!G.disabled).map(G=>G.ref.current);if(["ArrowUp","End"].includes(re.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const G=re.target,W=Ae.indexOf(G);Ae=Ae.slice(W+1)}setTimeout(()=>B(Ae)),re.preventDefault()}})})})})})})});CN.displayName=Q5;var Y5="SelectItemAlignedPosition",EN=h.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...a}=e,i=Hs(Sa,r),o=Ws(Sa,r),[l,c]=h.useState(null),[u,d]=h.useState(null),f=Me(t,N=>d(N)),m=Wd(r),p=h.useRef(!1),b=h.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:w,focusSelectedItem:g}=o,y=h.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&v&&x&&w){const N=i.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),I=w.getBoundingClientRect();if(i.dir!=="rtl"){const G=I.left-E.left,W=R.left-G,ae=N.left-W,Ce=N.width+ae,ot=Math.max(Ce,E.width),Er=window.innerWidth-$r,Ks=u0(W,[$r,Math.max($r,Er-ot)]);l.style.minWidth=Ce+"px",l.style.left=Ks+"px"}else{const G=E.right-I.right,W=window.innerWidth-R.right-G,ae=window.innerWidth-N.right-W,Ce=N.width+ae,ot=Math.max(Ce,E.width),Er=window.innerWidth-$r,Ks=u0(W,[$r,Math.max($r,Er-ot)]);l.style.minWidth=Ce+"px",l.style.right=Ks+"px"}const A=m(),C=window.innerHeight-$r*2,F=v.scrollHeight,D=window.getComputedStyle(u),z=parseInt(D.borderTopWidth,10),B=parseInt(D.paddingTop,10),K=parseInt(D.borderBottomWidth,10),O=parseInt(D.paddingBottom,10),k=z+B+F+O+K,L=Math.min(x.offsetHeight*5,k),$=window.getComputedStyle(v),H=parseInt($.paddingTop,10),te=parseInt($.paddingBottom,10),ne=N.top+N.height/2-$r,Te=C-ne,Be=x.offsetHeight/2,re=x.offsetTop+Be,Pe=z+B+re,Fe=k-Pe;if(Pe<=ne){const G=A.length>0&&x===A[A.length-1].ref.current;l.style.bottom="0px";const W=u.clientHeight-v.offsetTop-v.offsetHeight,ae=Math.max(Te,Be+(G?te:0)+W+K),Ce=Pe+ae;l.style.height=Ce+"px"}else{const G=A.length>0&&x===A[0].ref.current;l.style.top="0px";const ae=Math.max(ne,z+v.offsetTop+(G?H:0)+Be)+Fe;l.style.height=ae+"px",v.scrollTop=Pe-ne+v.offsetTop}l.style.margin=`${$r}px 0`,l.style.minHeight=L+"px",l.style.maxHeight=C+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[m,i.trigger,i.valueNode,l,u,v,x,w,i.dir,n]);ht(()=>y(),[y]);const[j,_]=h.useState();ht(()=>{u&&_(window.getComputedStyle(u).zIndex)},[u]);const S=h.useCallback(N=>{N&&b.current===!0&&(y(),g==null||g(),b.current=!1)},[y,g]);return s.jsx(eD,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:s.jsx(ve.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});EN.displayName=Y5;var X5="SelectPopperPosition",Jm=h.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=$r,...i}=e,o=Kd(r);return s.jsx(T_,{...o,...i,ref:t,align:n,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Jm.displayName=X5;var[eD,Ug]=co(Sa,{}),Qm="SelectViewport",TN=h.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...a}=e,i=Ws(Qm,r),o=Ug(Qm,r),l=Me(t,i.onViewportChange),c=h.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),s.jsx(Hd.Slot,{scope:r,children:s.jsx(ve.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ge(a.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=o;if(m!=null&&m.current&&f){const p=Math.abs(c.current-d.scrollTop);if(p>0){const b=window.innerHeight-$r*2,v=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),w=Math.max(v,x);if(w<b){const g=w+p,y=Math.min(b,g),j=g-y;f.style.height=y+"px",f.style.bottom==="0px"&&(d.scrollTop=j>0?j:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});TN.displayName=Qm;var RN="SelectGroup",[tD,rD]=co(RN),nD=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=Gr();return s.jsx(tD,{scope:r,id:a,children:s.jsx(ve.div,{role:"group","aria-labelledby":a,...n,ref:t})})});nD.displayName=RN;var AN="SelectLabel",PN=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=rD(AN,r);return s.jsx(ve.div,{id:a.id,...n,ref:t})});PN.displayName=AN;var Ju="SelectItem",[sD,ON]=co(Ju),IN=h.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:i,...o}=e,l=Hs(Ju,r),c=Ws(Ju,r),u=l.value===n,[d,f]=h.useState(i??""),[m,p]=h.useState(!1),b=Me(t,g=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,g,n,a)}),v=Gr(),x=h.useRef("touch"),w=()=>{a||(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 s.jsx(sD,{scope:r,value:n,disabled:a,textId:v,isSelected:u,onItemTextChange:h.useCallback(g=>{f(y=>y||((g==null?void 0:g.textContent)??"").trim())},[]),children:s.jsx(Hd.ItemSlot,{scope:r,value:n,disabled:a,textValue:d,children:s.jsx(ve.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:b,onFocus:ge(o.onFocus,()=>p(!0)),onBlur:ge(o.onBlur,()=>p(!1)),onClick:ge(o.onClick,()=>{x.current!=="mouse"&&w()}),onPointerUp:ge(o.onPointerUp,()=>{x.current==="mouse"&&w()}),onPointerDown:ge(o.onPointerDown,g=>{x.current=g.pointerType}),onPointerMove:ge(o.onPointerMove,g=>{var y;x.current=g.pointerType,a?(y=c.onItemLeave)==null||y.call(c):x.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ge(o.onPointerLeave,g=>{var y;g.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:ge(o.onKeyDown,g=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&g.key===" "||(V5.includes(g.key)&&w(),g.key===" "&&g.preventDefault())})})})})});IN.displayName=Ju;var Io="SelectItemText",LN=h.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,...i}=e,o=Hs(Io,r),l=Ws(Io,r),c=ON(Io,r),u=K5(Io,r),[d,f]=h.useState(null),m=Me(t,w=>f(w),c.onItemTextChange,w=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,w,c.value,c.disabled)}),p=d==null?void 0:d.textContent,b=h.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:x}=u;return ht(()=>(v(b),()=>x(b)),[v,x,b]),s.jsxs(s.Fragment,{children:[s.jsx(ve.span,{id:c.textId,...i,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ta.createPortal(i.children,o.valueNode):null]})});LN.displayName=Io;var $N="SelectItemIndicator",DN=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return ON($N,r).isSelected?s.jsx(ve.span,{"aria-hidden":!0,...n,ref:t}):null});DN.displayName=$N;var Zm="SelectScrollUpButton",MN=h.forwardRef((e,t)=>{const r=Ws(Zm,e.__scopeSelect),n=Ug(Zm,e.__scopeSelect),[a,i]=h.useState(!1),o=Me(t,n.onScrollButtonChange);return ht(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?s.jsx(zN,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});MN.displayName=Zm;var Ym="SelectScrollDownButton",FN=h.forwardRef((e,t)=>{const r=Ws(Ym,e.__scopeSelect),n=Ug(Ym,e.__scopeSelect),[a,i]=h.useState(!1),o=Me(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;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?s.jsx(zN,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});FN.displayName=Ym;var zN=h.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=e,i=Ws("SelectScrollButton",r),o=h.useRef(null),l=Wd(r),c=h.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),ht(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),s.jsx(ve.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:ge(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:ge(a.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:ge(a.onPointerLeave,()=>{c()})})}),aD="SelectSeparator",UN=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return s.jsx(ve.div,{"aria-hidden":!0,...n,ref:t})});UN.displayName=aD;var Xm="SelectArrow",iD=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=Kd(r),i=Hs(Xm,r),o=Ws(Xm,r);return i.open&&o.position==="popper"?s.jsx(R_,{...a,...n,ref:t}):null});iD.displayName=Xm;var oD="SelectBubbleInput",BN=h.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const a=h.useRef(null),i=Me(n,a),o=lN(t);return h.useEffect(()=>{const l=a.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const f=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[o,t]),s.jsx(ve.select,{...r,style:{...wj,...r.style},ref:i,defaultValue:t})});BN.displayName=oD;function VN(e){return e===""||e===void 0}function qN(e){const t=cr(e),r=h.useRef(""),n=h.useRef(0),a=h.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]),i=h.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,i]}function HN(e,t,r){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=lD(e,Math.max(i,0));a.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==r?c:void 0}function lD(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var cD=xN,WN=wN,uD=jN,dD=_N,hD=NN,KN=SN,fD=TN,GN=PN,JN=IN,mD=LN,pD=DN,QN=MN,ZN=FN,YN=UN;const gt=cD,vt=uD,ut=h.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(WN,{ref:n,className:Y("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
526ing-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,s.jsx(dD,{asChild:!0,children:s.jsx(rg,{className:"h-4 w-4 opacity-50"})})]}));ut.displayName=WN.displayName;const XN=h.forwardRef(({className:e,...t},r)=>s.jsx(QN,{ref:r,className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx($T,{className:"h-4 w-4"})}));XN.displayName=QN.displayName;const eS=h.forwardRef(({className:e,...t},r)=>s.jsx(ZN,{ref:r,className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(rg,{className:"h-4 w-4"})}));eS.displayName=ZN.displayName;const dt=h.forwardRef(({className:e,children:t,position:r="popper",...n},a)=>s.jsx(hD,{children:s.jsxs(KN,{ref:a,className:Y("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:[s.jsx(XN,{}),s.jsx(fD,{className:Y("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(eS,{})]})}));dt.displayName=KN.displayName;const gD=h.forwardRef(({className:e,...t},r)=>s.jsx(GN,{ref:r,className:Y("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));gD.displayName=GN.displayName;const ke=h.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(JN,{ref:n,className:Y("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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(pD,{children:s.jsx(ya,{className:"h-4 w-4"})})}),s.jsx(mD,{children:t})]}));ke.displayName=JN.displayName;const vD=h.forwardRef(({className:e,...t},r)=>s.jsx(YN,{ref:r,className:Y("-mx-1 my-1 h-px bg-muted",e),...t}));vD.displayName=YN.displayName;const xD=ql({client_type:J3(["company","agency"]),company_name:Qe().trim().min(2,"Informe o nome da empresa").max(160),cnpj:Qe().trim().max(20).optional(),contact_name:Qe().trim().min(2,"Informe o responsável").max(120),contact_phone:Qe().trim().max(30).optional(),contact_email:Qe().trim().email("E-mail inválido").max(255),city:Qe().trim().max(120).optional(),state:Qe().trim().max(60).optional(),jobs_per_month:Km.number().int().min(0).max(1e5).optional(),users_count:Km.number().int().min(0).max(1e5).optional(),has_own_domain:G3(),message:Qe().trim().max(1e3).optional()}),yD=()=>{const[e,t]=h.useState("company"),[r,n]=h.useState("nao"),[a,i]=h.useState(!1),[o,l]=h.useState(!1);h.useEffect(()=>{document.title="Quero minha Plataforma | Orange RH White Label";const u=document.querySelector('meta[name="description"]');u&&u.setAttribute("content","Solicite sua plataforma de recrutamento White Label da Orange RH. Cadastro online para empresas e agencias de RH.")},[]);const c=async u=>{var v;u.preventDefault();const d=new FormData(u.currentTarget),f={client_type:e,company_name:String(d.get("company_name")||""),cnpj:String(d.get("cnpj")||""),contact_name:String(d.get("contact_name")||""),contact_phone:String(d.get("contact_phone")||""),contact_email:String(d.get("contact_email")||""),city:String(d.get("city")||""),state:String(d.get("state")||""),jobs_per_month:d.get("jobs_per_month")?Number(d.get("jobs_per_month")):void 0,users_count:d.get("users_count")?Number(d.get("users_count")):void 0,has_own_domain:r==="sim",message:String(d.get("message")||"")},m=xD.safeParse(f);if(!m.success){M.error(((v=m.error.issues[0])==null?void 0:v.message)??"Verifique os dados informados");return}i(!0);const p=m.data,{error:b}=await T.from("onboarding_leads").insert({client_type:p.client_type,company_name:p.company_name,cnpj:p.cnpj||null,contact_name:p.contact_name,contact_phone:p.contact_phone||null,contact_email:p.contact_email,city:p.city||null,state:p.state||null,jobs_per_month:p.jobs_per_month??null,users_count:p.users_count??null,has_own_domain:p.has_own_domain,message:p.message||null,status:"awaiting_implementation"});if(i(!1),b){M.error("Não foi possÃvel enviar sua solicitação. Tente novamente.");return}l(!0),M.success("Solicitação enviada! Nossa equipe entrará em contato.")};return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(Md,{}),s.jsxs("main",{className:"container mx-auto px-4 pt-28 pb-20 max-w-3xl",children:[s.jsxs("header",{className:"text-center mb-10",children:[s.jsxs("h1",{className:"text-3xl md:text-5xl font-extrabold tracking-tight",children:["Quero minha ",s.jsx("span",{className:"text-primary",children:"Plataforma"})]}),s.jsx("p",{className:"mt-4 text-muted-foreground",children:"Preencha o cadastro e nossa equipe cuida da implantação, personalização e ativação do seu ambiente."})]}),o?s.jsxs(Q,{className:"text-center",children:[s.jsxs(ye,{children:[s.jsx("div",{className:"mx-auto w-14 h-14 roun
526ded-2xl gradient-hero flex items-center justify-center",children:s.jsx(wn,{className:"w-7 h-7 text-primary-foreground"})}),s.jsx(we,{className:"mt-4",children:"Solicitação recebida!"}),s.jsxs(bt,{children:["Seu ambiente foi registrado com status ",s.jsx("strong",{children:"Aguardando implantação"}),". Nossa equipe comercial entrará em contato para definir plano, branding e treinamento."]})]}),s.jsx(X,{children:s.jsx(P,{asChild:!0,variant:"outline",children:s.jsx(me,{to:"/",children:"Voltar para o inÃcio"})})})]}):s.jsxs(Q,{children:[s.jsxs(ye,{children:[s.jsx(we,{children:"Cadastro inicial"}),s.jsx(bt,{children:"Leva menos de 2 minutos."})]}),s.jsx(X,{children:s.jsxs("form",{onSubmit:c,className:"space-y-6",children:[s.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:[{key:"company",label:"Empresa",desc:"Recruto para o meu próprio time",icon:At},{key:"agency",label:"Agência de RH",desc:"Recruto para várias empresas",icon:ur}].map(u=>s.jsxs("button",{type:"button",onClick:()=>t(u.key),className:`text-left rounded-xl border p-4 transition-colors ${e===u.key?"border-primary bg-primary/5":"border-border hover:bg-muted/50"}`,children:[s.jsx(u.icon,{className:"w-5 h-5 text-primary mb-2"}),s.jsx("div",{className:"font-semibold",children:u.label}),s.jsx("div",{className:"text-xs text-muted-foreground",children:u.desc})]},u.key))}),s.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(U,{htmlFor:"company_name",children:"Nome da empresa *"}),s.jsx(q,{id:"company_name",name:"company_name",required:!0,maxLength:160})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"cnpj",children:"CNPJ"}),s.jsx(q,{id:"cnpj",name:"cnpj",maxLength:20,placeholder:"00.000.000/0000-00"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"contact_name",children:"Responsável *"}),s.jsx(q,{id:"contact_name",name:"contact_name",required:!0,maxLength:120})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"contact_email",children:"E-mail *"}),s.jsx(q,{id:"contact_email",name:"contact_email",type:"email",required:!0,maxLength:255})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"contact_phone",children:"Telefone"}),s.jsx(q,{id:"contact_phone",name:"contact_phone",maxLength:30})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"city",children:"Cidade"}),s.jsx(q,{id:"city",name:"city",maxLength:120})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"state",children:"Estado"}),s.jsx(q,{id:"state",name:"state",maxLength:60,placeholder:"SP"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"jobs_per_month",children:"Vagas por mês (aprox.)"}),s.jsx(q,{id:"jobs_per_month",name:"jobs_per_month",type:"number",min:0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"users_count",children:"Usuários (aprox.)"}),s.jsx(q,{id:"users_count",name:"users_count",type:"number",min:0})]}),s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(U,{children:"Possui domÃnio próprio?"}),s.jsxs(gt,{value:r,onValueChange:n,children:[s.jsx(ut,{children:s.jsx(vt,{})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"sim",children:"Sim"}),s.jsx(ke,{value:"nao",children:"Não"})]})]})]}),s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(U,{htmlFor:"message",children:"Mensagem"}),s.jsx(ct,{id:"message",name:"message",rows:4,maxLength:1e3})]})]}),s.jsx(P,{type:"submit",size:"lg",className:"w-full",disabled:a,children:a?"Enviando...":"Solicitar Plataforma"})]})})]})]}),s.jsx(Fd,{})]})};var wD={name:"@lovable.dev/cloud-auth-js",version:"1.1.2",description:"Lovable Cloud Auth JS",main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist"],scripts:{build:"tsup src/index.ts --format cjs,esm --dts --outDir dist",dev:"tsup src/index.ts --format cjs,esm --dts --watch",test:"vitest run",typecheck:"tsgo --noEmit",prepublishOnly:"npm run clean && npm run build",clean:"rimraf dist"},keywords:["lovable","oauth","authentication"],license:"MIT",devDependencies:{"@types/node":"^22",jsdom:"^26",rimraf:"^5.0.0",tsup:"^7.2.0",typescript:"^5",vitest:"^4.1.0"}},bD="authorization_response",jD="/~oauth/initiate",_D=["https://oauth.lovable.app","https://lovable.dev"],ND="lovable://oauth-callback",SD="http://127.0.0.1/iframe-oauth/callback",kD=500,CD=12e4;function ED(e){let t;const r=new Promise(i=>{t=i}),n=i=>{if(!e.some(c=>
526i.origin===c))return;const l=i.data;!l||typeof l!="object"||l.type===bD&&t(l.response)},a=()=>{window.removeEventListener("message",n)};return window.addEventListener("message",n),{cleanup:a,messagePromise:r}}function TD(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,a=t?window.screenX+(window.outerWidth-r)/2:(window.screen.width-r)/2,i=t?window.screenY+(window.outerHeight-n)/2:(window.screen.height-n)/2;return{width:r,height:n,left:a,top:i}}function b0(e,t){return e.state!==t?{error:new Error("State is invalid")}:e.error?e.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(e.error_description??"Sign in failed")}:!e.access_token||!e.refresh_token?{error:new Error("No tokens received")}:{tokens:{access_token:e.access_token,refresh_token:e.refresh_token},error:null}}function RD(){const e=navigator.userAgent;return!!(/iPhone|iPad|iPod|Android/i.test(e)||/Macintosh/i.test(e)&&navigator.maxTouchPoints>1)}function AD(){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 PD(e={}){const t=e.oauthBrokerUrl??jD,r=e.supportedOAuthOrigins??_D;async function n(a,i={}){let o=!1;try{o=window.self!==window.top}catch{o=!0}const l=navigator.userAgent,c=/LovableApp\//.test(l),u=!c&&/lovable/i.test(l),d=AD();let f=i.redirect_uri??window.location.origin;c&&o?f=ND:u&&o&&(f=SD);const m=new URLSearchParams({...i.extraParams,provider:a,redirect_uri:f,state:d});if(!o)return window.location.href=`${t}?${m.toString()}`,{error:null,redirected:!0};!c&&!u&&m.set("response_mode","web_message");const p=`${t}?${m.toString()}`,b=u?[...r,window.location.origin]:r,{messagePromise:v,cleanup:x}=ED(b);let w;if(RD())w=window.open(p,"_blank");else{const{width:j,height:_,left:S,top:N}=TD(o);w=window.open(p,"oauth",`width=${j},height=${_},left=${S},top=${N}`)}if(!w&&(c||u)){let j;const _=new Promise((S,N)=>{j=setTimeout(()=>{N(new Error("OAuth timed out waiting for response"))},CD)});try{const S=await Promise.race([v,_]);return b0(S,d)}catch(S){return{error:S instanceof Error?S:new Error(String(S))}}finally{j&&clearTimeout(j),x()}}if(!w)return x(),{error:new Error("Popup was blocked")};let g;const y=new Promise((j,_)=>{g=setInterval(()=>{w.closed&&(clearInterval(g),_(new Error("Sign in was cancelled")))},kD)});try{const j=await Promise.race([v,y]);return b0(j,d)}catch(j){return{error:j instanceof Error?j:new Error(String(j))}}finally{clearInterval(g),x(),w==null||w.close()}}return{signInWithOAuth:n}}typeof window<"u"&&(window.__lovable_cloud_auth_js_version=wD.version);function OD(e={}){return PD(e)}const ID=OD(),tS={auth:{signInWithOAuth:async(e,t)=>{const r=await ID.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 T.auth.setSession(r.tokens)}catch(n){return{error:n instanceof Error?n:new Error(String(n))}}return r}}};function Bg(e){return!e||!/^\/(?!\/)/.test(e)||e==="/app"||e.startsWith("/app/")?null:e}function kl(e,{tenantBase:t=null,next:r=null}={}){const n=Bg(r),a=o=>e.includes(o);if(a("super_admin"))return n&&n.startsWith("/admin")?n:"/admin";if(a("tenant_admin")||a("recruiter"))return n&&n.startsWith("/painel")?n:"/painel";if(t!==null){const o=t;return n&&(o===""?!n.startsWith("/t/"):n.startsWith(o))?n:`${o}/minha-area`}return n??"/"}const LD=ql({email:Qe().email("E-mail inválido"),password:Qe().min(6,"MÃnimo de 6 caracteres")}),$D=()=>{const e=pr(),[t]=Ng(),{user:r,loading:n,rolesLoaded:a,roles:i}=it(),[o,l]=h.useState(!1),c=Bg(t.get("next"));h.useEffect(()=>{n||!r||!a||e(kl(i,{next:c}),{replace:!0})},[r,n,a,i,e,c]);const u=async f=>{f.preventDefault();const m=new FormData(f.currentTarget),p=LD.safeParse({email:m.get("email"),password:m.get("password")});if(!p.success){M.error(p.error.issues[0].message);return}l(!0);const{data:b,error:v}=await T.auth.signInWithPassword({email:p.data.email,password:p.data.password});if(v){l(!1),M.error(v.message==="Invalid login credentials"?"E-mail ou senha inválidos":v.message);return}const{data:x}=await T.from("user_roles").select("role").eq("user_id",b.user.id);l(!1),M.success("Bem-vindo de volta!");const w=(x??[]).map(g=>g.role);e(kl(w,{next:c}),{replace:!0})},d=async()=>
526{l(!0),(await tS.auth.signInWithOAuth("google",{redirect_uri:`${window.location.origin}/auth`})).error&&(l(!1),M.error("Não foi possÃvel entrar com o Google"))};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background via-background to-primary/5 px-4 py-12",children:s.jsxs("div",{className:"w-full max-w-md",children:[s.jsxs(me,{to:"/",className:"flex items-center justify-center gap-2.5 mb-8",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl gradient-hero flex items-center justify-center shadow-button",children:s.jsx(Ft,{className:"w-5 h-5 text-primary-foreground"})}),s.jsxs("div",{className:"leading-tight",children:[s.jsxs("div",{className:"text-lg font-extrabold tracking-tight",children:["Orange",s.jsx("span",{className:"text-primary",children:"RH"})]}),s.jsx("div",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:"White Label R&S"})]})]}),s.jsxs(Q,{className:"border-border/60 shadow-xl",children:[s.jsxs(ye,{children:[s.jsx(we,{className:"text-2xl",children:"Acesso restrito"}),s.jsx(bt,{children:"Ãrea exclusiva para a equipe Orange RH e clientes da plataforma."})]}),s.jsxs(X,{children:[s.jsxs("form",{onSubmit:u,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"signin-email",children:"E-mail"}),s.jsx(q,{id:"signin-email",name:"email",type:"email",autoComplete:"email",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"signin-password",children:"Senha"}),s.jsx(q,{id:"signin-password",name:"password",type:"password",autoComplete:"current-password",required:!0})]}),s.jsxs(P,{type:"submit",className:"w-full",disabled:o,children:[o&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),"Entrar"]})]}),s.jsxs("div",{className:"relative my-6",children:[s.jsx("div",{className:"absolute inset-0 flex items-center",children:s.jsx("span",{className:"w-full border-t border-border"})}),s.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:s.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"ou continue com"})})]}),s.jsxs(P,{type:"button",variant:"outline",className:"w-full",onClick:d,disabled:o,children:[s.jsxs("svg",{className:"w-4 h-4 mr-2",viewBox:"0 0 24 24",children:[s.jsx("path",{fill:"#4285F4",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"}),s.jsx("path",{fill:"#34A853",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"}),s.jsx("path",{fill:"#FBBC05",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"}),s.jsx("path",{fill:"#EA4335",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"})]}),"Google"]}),s.jsx("p",{className:"text-xs text-muted-foreground text-center mt-6",children:"à candidato? O acesso acontece pelo portal da empresa em que você se cadastrou."})]})]})]})})},DD=()=>{const{user:e,loading:t,rolesLoaded:r,roles:n}=it();return t||e&&!r?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx(le,{className:"w-8 h-8 animate-spin text-primary"})}):e?s.jsx(Ou,{to:kl(n),replace:!0}):s.jsx(Ou,{to:"/auth",replace:!0})};var rS={exports:{}},nS={};/** 527 * @license React 528 * use-sync-external-store-shim.production.js 529 * 530 * Copyright (c) Meta Platforms, Inc. and affiliates. 531 * 532 * This source code is licensed under the MIT license found in the 533 * LICENSE file in the root directory of this source tree. 534 */var Ki=h;function MD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var FD=typeof Object.is=="function"?Object.is:MD,zD=Ki.useState,UD=Ki.useEffect,BD=Ki.useLayoutEffect,VD=Ki.useDebugValue;function qD(e,t){var r=t(),n=zD({inst:{value:r,getSnapshot:t}}),a=n[0].inst,i=n[1];return BD(function(){a.value=r,a.getSnapshot=t,uf(a)&&i({inst:a})},[e,r,t]),UD(function(){return uf(a)&&i({inst:a}),e(function(){uf(a)&&i({inst:a})})},[e]),VD(r),r}function uf(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!FD(e,r)}catch{return!0}}function HD(e,t){return t()}var WD=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?HD:qD;nS.useSyncExternalStore=Ki.useSyncExternalStore!==void 0?Ki.useSyncExternalStore:WD;rS.exports=nS;var KD=rS.exports;function GD(){return KD.useSyncExternalStore(JD,()=>!0,()=>!1)}function JD(){return()=>{}}var Vg="Avatar",[QD,UF]=er(Vg),[ZD,sS]=QD(Vg),aS=h.forwardRef((e,t)=>
534{const{__scopeAvatar:r,...n}=e,[a,i]=h.useState("idle");return s.jsx(ZD,{scope:r,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:s.jsx(ve.span,{...n,ref:t})})});aS.displayName=Vg;var iS="AvatarImage",oS=h.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:a=()=>{},...i}=e,o=sS(iS,r),l=YD(n,i),c=cr(u=>{a(u),o.onImageLoadingStatusChange(u)});return ht(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?s.jsx(ve.img,{...i,ref:t,src:n}):null});oS.displayName=iS;var lS="AvatarFallback",cS=h.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...a}=e,i=sS(lS,r),[o,l]=h.useState(n===void 0);return h.useEffect(()=>{if(n!==void 0){const c=window.setTimeout(()=>l(!0),n);return()=>window.clearTimeout(c)}},[n]),o&&i.imageLoadingStatus!=="loaded"?s.jsx(ve.span,{...a,ref:t}):null});cS.displayName=lS;function j0(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function YD(e,{referrerPolicy:t,crossOrigin:r}){const n=GD(),a=h.useRef(null),i=n?(a.current||(a.current=new window.Image),a.current):null,[o,l]=h.useState(()=>j0(i,e));return ht(()=>{l(j0(i,e))},[i,e]),ht(()=>{const c=f=>()=>{l(f)};if(!i)return;const u=c("loaded"),d=c("error");return i.addEventListener("load",u),i.addEventListener("error",d),t&&(i.referrerPolicy=t),typeof r=="string"&&(i.crossOrigin=r),()=>{i.removeEventListener("load",u),i.removeEventListener("error",d)}},[i,r,t]),o}var uS=aS,dS=oS,hS=cS;const Gd=h.forwardRef(({className:e,...t},r)=>s.jsx(uS,{ref:r,className:Y("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Gd.displayName=uS.displayName;const Jd=h.forwardRef(({className:e,...t},r)=>s.jsx(dS,{ref:r,className:Y("aspect-square h-full w-full",e),...t}));Jd.displayName=dS.displayName;const Qd=h.forwardRef(({className:e,...t},r)=>s.jsx(hS,{ref:r,className:Y("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Qd.displayName=hS.displayName;const XD=Xi("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 pe({className:e,variant:t,...r}){return s.jsx("div",{className:Y(XD({variant:t}),e),...r})}const qg="candidate-photos",Qu=async e=>{if(!e)return null;if(e.startsWith("http"))return e;const{data:t}=await T.storage.from(qg).createSignedUrl(e,60*60);return(t==null?void 0:t.signedUrl)??null},eM=".pdf,.docx,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document",tM=e=>new Promise((t,r)=>{const n=new FileReader;n.onload=()=>t(String(n.result)),n.onerror=()=>r(new Error("Não consegui ler o arquivo")),n.readAsDataURL(e)}),fS=({onSaved:e})=>{var f,m,p,b;const{user:t}=it(),r=h.useRef(null),[n,a]=h.useState(!1),[i,o]=h.useState(null),[l,c]=h.useState(!1),u=async v=>{if(v.size>10*1024*1024){M.error("O arquivo deve ter no máximo 10MB.");return}a(!0),o(null);try{const x=await tM(v),{data:w,error:g}=await T.functions.invoke("resume-parse",{body:{fileName:v.name,mimeType:v.type,fileData:x}}),y=w;if(g||y!=null&&y.error||!(y!=null&&y.resume)){M.error((y==null?void 0:y.error)??"Não consegui ler esse currÃculo. Tente um PDF.");return}o(y.resume),M.success("CurrÃculo lido! Confira os dados antes de salvar.")}catch(x){M.error(x instanceof Error?x.message:"Erro ao processar o arquivo")}finally{a(!1)}},d=async()=>{var y,j,_,S;if(!t||!i)return;c(!0);const{data:v}=await T.from("candidate_resumes").select("*").eq("user_id",t.id).maybeSingle(),x=v??null,w={user_id:t.id,photo_url:(x==null?void 0:x.photo_url)??null,headline:i.headline??(x==null?void 0:x.headline)??null,summary:i.summary??(x==null?void 0:x.summary)??null,location:i.location??(x==null?void 0:x.location)??null,phone:i.phone??(x==null?void 0:x.phone)??null,linkedin_url:i.linkedin_url??(x==null?void 0:x.linkedin_url)??null,github_url:i.github_url??(x==null?void 0:x.github_url)??null,instagram_url:(x==null?void 0:x.instagram_url)??null,portfolio_url:i.portfolio_url??(x==null?void 0:x.portfolio_url)??null,skills:(y=i.skills)!=null&&y.length?i.skills:(x==null?void 0:x.skills)??[],languages:(j=i.languages)!=null&&j.length?i.languages:(x==null?void 0:x.languages)??[],experiences:(_=i.experiences)!=null&&_.length?
534i.experiences:(x==null?void 0:x.experiences)??[],education:(S=i.education)!=null&&S.length?i.education:(x==null?void 0:x.education)??[],is_complete:!0},{error:g}=await T.from("candidate_resumes").upsert(w,{onConflict:"user_id"});if(!g&&(i.full_name||i.phone)){const N={};i.full_name&&(N.full_name=i.full_name),i.phone&&(N.phone=i.phone),await T.from("profiles").update(N).eq("id",t.id)}if(c(!1),g){M.error(g.message);return}M.success("CurrÃculo preenchido automaticamente!"),e==null||e(i)};return s.jsxs("div",{className:"rounded-lg border border-dashed p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"w-9 h-9 rounded-md bg-primary/10 text-primary flex items-center justify-center shrink-0",children:s.jsx(Ft,{className:"w-4 h-4"})}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"font-semibold text-sm",children:"Já tem um currÃculo pronto?"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Envie o arquivo em PDF ou DOCX (até 10MB) e a IA preenche tÃtulo, resumo, experiências, formação, competências e idiomas para você revisar."})]})]}),s.jsx("input",{ref:r,type:"file",accept:eM,className:"hidden",onChange:v=>{var w;const x=(w=v.target.files)==null?void 0:w[0];x&&u(x),v.target.value=""}}),s.jsxs(P,{variant:"secondary",onClick:()=>{var v;return(v=r.current)==null?void 0:v.click()},disabled:n||l,children:[n?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(BT,{className:"w-4 h-4 mr-2"}),n?"Lendo com IA...":"Enviar currÃculo (PDF/DOCX)"]}),i&&s.jsxs("div",{className:"rounded-md bg-muted/50 p-3 space-y-2 text-sm",children:[s.jsxs("p",{className:"flex items-center gap-2 font-medium text-primary",children:[s.jsx(wn,{className:"w-4 h-4"})," Dados encontrados"]}),i.headline&&s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"TÃtulo:"})," ",i.headline]}),i.summary&&s.jsx("p",{className:"line-clamp-3 text-muted-foreground",children:i.summary}),s.jsxs("p",{className:"text-muted-foreground",children:[((f=i.experiences)==null?void 0:f.length)??0," experiência(s) · ",((m=i.education)==null?void 0:m.length)??0," formação(ões) ·"," ",((p=i.languages)==null?void 0:p.length)??0," idioma(s)"]}),!!((b=i.skills)!=null&&b.length)&&s.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.skills.slice(0,10).map(v=>s.jsx(pe,{variant:"secondary",children:v},v))}),s.jsxs(P,{size:"sm",onClick:d,disabled:l,children:[l&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"})," Salvar no meu currÃculo"]})]})]})},mS=e=>[{id:"exp_role",text:e===1?"Vamos falar de experiência profissional. Qual foi seu cargo mais recente?":"Qual o cargo dessa outra experiência?",kind:"text",placeholder:"Ex: Analista de Marketing"},{id:"exp_company",text:"Em qual empresa?",kind:"text",placeholder:"Ex: Orange RH"},{id:"exp_period",text:"Qual o perÃodo? (mês/ano de inÃcio e fim)",kind:"text",placeholder:"Ex: 01/2022 - atual"},{id:"exp_desc",text:"Conte rapidamente o que você fazia e seus principais resultados.",kind:"long",placeholder:"Principais atividades e conquistas..."},{id:"exp_more",text:"Quer adicionar outra experiência?",kind:"yesno"}],pS=e=>[{id:"edu_course",text:e===1?"Agora sua formação. Qual curso você fez ou está fazendo?":"Qual o nome desse outro curso?",kind:"text",placeholder:"Ex: Administração"},{id:"edu_school",text:"Em qual instituição?",kind:"text",placeholder:"Ex: USP"},{id:"edu_period",text:"Qual o perÃodo de conclusão?",kind:"text",placeholder:"Ex: 2018 - 2022"},{id:"edu_more",text:"Quer adicionar outra formação?",kind:"yesno"}],_0=[{id:"name",text:"Oi! ð Sou o assistente da Orange RH e vou montar seu currÃculo em uma conversa rápida. Para começar: qual é o seu nome completo?",kind:"text",placeholder:"Seu nome completo"},{id:"photo",text:"Prazer! Que tal enviar uma foto de perfil? Ela aparece no seu currÃculo para as empresas.",kind:"photo",optional:!0},{id:"headline",text:"Qual é o seu tÃtulo profissional?",kind:"text",placeholder:"Ex: Desenvolvedor Front-end Pleno"},{id:"location",text:"Em qual cidade/estado você mora?",kind:"text",placeholder:"Ex: São Paulo - SP",optional:!0},{id:"phone",text:"Qual seu telefone/WhatsApp para contato?",kind:"text",placeholder:"(11) 99999-9999",optional:!0},{id:"summary",text:"Me conte um resumo sobre você: sua trajetória e o que procura hoje.",kind:"long",placeholder:"Escreva alguns parágrafos..."},{id:"skills",text:"Quais são suas principais competências? Separe por vÃrgula.",kind:"list",placeholder:"Ex: Excel, SQL, Liderança"},{id:"languages",text:"E quais idiomas você fala? Separe por vÃrgula.",kind:"list",placeholder:"Ex: Inglês avançado, Espanhol básico",optional:!0},...mS(1),...pS(1),{id:"linkedin_url",text:"Vamos à s redes sociais. Qual o link do seu LinkedIn?",kind:"text",placeholder:"https://linkedin.com/in/...",optional:!0},{id:"github_url",text:"E o GitHub?",kind:"text",placeholder:"https://github.com/...",optional:!0},{id:"instagram_url",text:"Instagram profissional?",kind:"text",placeholder:"https://instagram.com/...",optional:!0},{id:"portfolio_url",text:"Por último: você tem um portfólio ou site pessoal?",kind:"text",placeholder:"https://...",optional:!0}],N0={photo_url:null,headline:null,summary:null,location:null,phone:null,linkedin_url:null,github_url:null,instagram_url:null,portfolio_url:null,skills:[],languages:[],experiences:[],education:[],is_complete:!1},eu=()=>{const{user:e}=it(),t=pr(),[r]=Ng(),n=Ct(),i=r.get("next")??`${n}/minha-area`,[o,l]=h.useState(!0),[c,u]=h.useState(null),[d,f]=h.useState(null),[m,p]=h.useState(!1),[b,v]=h.useState([]),[x,w]=h.useState([]),[g,y]=h.useState(""),[j,_]=h.useState(!1),[S,N]=h.useState(!1),[E,R]=h.useState(""),[I,A]=h.useState(!1),C=h.useRef({...N0}),F=h.useRef({}),D=h.useRef({}),z=h.useRef(1),B=h.useRef(1),K=h.useRef(null),O=h.useRef(null),k=x[0];h.useEffect(()=>{e&&(async()=>{const{data:G}=await T.from("candidate_resumes").select("*").eq("user_id",e.id).maybeSingle();if(G){const W=G;u(W),f(await Qu(W.photo_url))}l(!1)})()},[e]),h.useEffect(()=>{var G;(G=K.current)==null||G.scrollIntoView({behavior:"smooth"})},[b,x]);const L=G=>v(W=>[...W,{id:crypto.randomUUID(),from:"bot",text:G}]),$=(G,W)=>v(ae=>[...ae,{id:crypto.randomUUID(),from:"user",text:G,image:W}]),H=()=>{C.current={...N0,skills:[],languages:[],experiences:[],education:[]},F.current={},D.current={},z.current=1,B.current=1,v([{id:crypto.randomUUID(),from:"bot",text:_0[0].text}]),w(_0),p(!0)},te=G=>{w(G),G.length>0?setTimeout(()=>L(G[0].text),350):Fe()},ne=(G,W)=>{const ae=C.current;switch(G.id){case"name":R(W);break;case"headline":ae.headline=W||null;break;case"location":ae.location=W||null;break;case"phone":ae.phone=W||null;break;case"summary":ae.summary=W||null;break;case"skills":ae.skills=W.split(",").map(Ce=>
534Ce.trim()).filter(Boolean);break;case"languages":ae.languages=W.split(",").map(Ce=>Ce.trim()).filter(Boolean);break;case"exp_role":F.current.role=W;break;case"exp_company":F.current.company=W;break;case"exp_period":F.current.period=W;break;case"exp_desc":F.current.description=W;break;case"edu_course":D.current.course=W;break;case"edu_school":D.current.school=W;break;case"edu_period":D.current.period=W;break;case"linkedin_url":ae.linkedin_url=W||null;break;case"github_url":ae.github_url=W||null;break;case"instagram_url":ae.instagram_url=W||null;break;case"portfolio_url":ae.portfolio_url=W||null;break}},Te=["headline","summary","exp_desc","skills","languages"],Be=async()=>{if(!k)return;A(!0);const G=[E?`Nome: ${E}`:"",C.current.headline?`TÃtulo: ${C.current.headline}`:"",F.current.role?`Cargo em edição: ${F.current.role}`:"",F.current.company?`Empresa: ${F.current.company}`:"",C.current.skills.length?`Competências: ${C.current.skills.join(", ")}`:""].filter(Boolean).join(` 535`),{data:W,error:ae}=await T.functions.invoke("resume-assist",{body:{field:k.id,text:g,context:G}});if(A(!1),ae||!(W!=null&&W.suggestion)){M.error("Não consegui gerar a sugestão agora. Tente novamente.");return}y(W.suggestion),M.success("Sugestão pronta â revise antes de enviar")},re=(G,W)=>{if(I||!k)return;const ae=G.trim();$(W!=null&&W.skipped?"Pular":ae||"â",W==null?void 0:W.image),ne(k,W!=null&&W.skipped?"":ae),y("");let Ce=x.slice(1);if(k.id==="exp_desc"){const ot=F.current;C.current.experiences.push({role:ot.role??"",company:ot.company??"",period:ot.period??"",description:ot.description??""}),F.current={}}if(k.id==="edu_period"){const ot=D.current;C.current.education.push({course:ot.course??"",school:ot.school??"",period:ot.period??""}),D.current={}}k.id==="exp_more"&&ae==="sim"&&(z.current+=1,Ce=[...mS(z.current),...Ce]),k.id==="edu_more"&&ae==="sim"&&(B.current+=1,Ce=[...pS(B.current),...Ce]),te(Ce)},Pe=async G=>{var Er;if(!e)return;if(G.size>5*1024*1024){M.error("A foto deve ter no máximo 5MB.");return}_(!0);const W=((Er=G.name.split(".").pop())==null?void 0:Er.toLowerCase())??"jpg",ae=`${e.id}/perfil-${Date.now()}.${W}`,{error:Ce}=await T.storage.from(qg).upload(ae,G,{upsert:!0});if(_(!1),Ce){M.error(Ce.message);return}C.current.photo_url=ae;const ot=await Qu(ae);f(ot),re("Foto enviada",{image:ot})},Fe=async()=>{if(!e)return;N(!0);const G=C.current,W={user_id:e.id,photo_url:G.photo_url,headline:G.headline,summary:G.summary,location:G.location,phone:G.phone,linkedin_url:G.linkedin_url,github_url:G.github_url,instagram_url:G.instagram_url,portfolio_url:G.portfolio_url,skills:G.skills,languages:G.languages,experiences:G.experiences,education:G.education,chat_transcript:b,is_complete:!0},{error:ae}=await T.from("candidate_resumes").upsert(W,{onConflict:"user_id"});if(!ae&&E&&await T.from("profiles").update({full_name:E,phone:G.phone}).eq("id",e.id),N(!1),ae){M.error(ae.message);return}L("Prontinho! â Seu currÃculo foi salvo e já pode ser enviado para as vagas."),u({...G,is_complete:!0}),p(!1),M.success("CurrÃculo concluÃdo!"),i&&setTimeout(()=>t(i),1200)},Ae=h.useMemo(()=>(E||(e==null?void 0:e.email)||"C").slice(0,2).toUpperCase(),[E,e]);return o?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):s.jsxs("div",{className:"min-h-screen bg-muted/40 flex flex-col",children:[s.jsxs("header",{className:"h-16 bg-primary text-primary-foreground flex items-center gap-3 px-4 shrink-0",children:[s.jsx(P,{asChild:!0,variant:"ghost",size:"icon",className:"text-primary-foreground hover:bg-white/10",children:s.jsx(me,{to:i??"/app","aria-label":"Voltar",children:s.jsx(Mi,{className:"w-5 h-5"})})}),s.jsxs(Gd,{className:"w-10 h-10 border border-white/30",children:[d&&s.jsx(Jd,{src:d,alt:"Foto do candidato"}),s.jsx(Qd,{className:"bg-white/20 text-primary-foreground text-xs",children:Ae})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-semibold leading-tight truncate",children:"Assistente de CurrÃculo"}),s.jsx("p",{className:"text-xs opacity-80",children:m?"digitando...":c!=null&&c.is_complete?"currÃculo concluÃdo":"online"})]})]}),s.jsx("main",{className:"flex-1 overflow-y-auto px-4 py-6",children:s.jsxs("div",{className:"max-w-2xl mx-auto
535space-y-3",children:[!m&&b.length===0&&s.jsx(Q,{children:s.jsxs(X,{className:"p-6 space-y-4",children:[s.jsx("h1",{className:"text-xl font-bold",children:"Monte seu currÃculo conversando"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Responda algumas perguntas em formato de chat e nós montamos um currÃculo completo, com foto, competências, experiências e redes sociais â usado para calcular seu match com cada vaga."}),c!=null&&c.is_complete?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary",children:[s.jsx(wn,{className:"w-4 h-4"})," Você já tem um currÃculo salvo"]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:c.skills.slice(0,8).map(G=>s.jsx(pe,{variant:"secondary",children:G},G))}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(P,{onClick:H,variant:"secondary",children:[s.jsx(nR,{className:"w-4 h-4 mr-2"})," Refazer currÃculo"]}),i&&s.jsx(P,{onClick:()=>t(i),children:"Continuar candidatura"})]})]}):s.jsx(P,{onClick:H,children:"Começar conversa"}),s.jsx(fS,{onSaved:()=>{i?t(i):window.location.reload()}})]})}),b.map(G=>s.jsx("div",{className:G.from==="user"?"flex justify-end":"flex justify-start",children:s.jsxs("div",{className:G.from==="user"?"max-w-[80%] rounded-2xl rounded-br-sm bg-primary text-primary-foreground px-4 py-2.5 text-sm shadow-sm":"max-w-[80%] rounded-2xl rounded-bl-sm bg-background border px-4 py-2.5 text-sm shadow-sm",children:[G.image&&s.jsx("img",{src:G.image,alt:"Foto enviada",className:"w-28 h-28 object-cover rounded-lg mb-2"}),s.jsx("p",{className:"whitespace-pre-wrap",children:G.text})]})},G.id)),S&&s.jsx("div",{className:"flex justify-start",children:s.jsxs("div",{className:"rounded-2xl bg-background border px-4 py-2.5 text-sm flex items-center gap-2",children:[s.jsx(le,{className:"w-4 h-4 animate-spin"})," Salvando currÃculo..."]})}),s.jsx("div",{ref:K})]})}),m&&k&&s.jsx("footer",{className:"border-t bg-background p-3 shrink-0",children:s.jsxs("div",{className:"max-w-2xl mx-auto space-y-2",children:[k.kind==="yesno"?s.jsxs("div",{className:"flex gap-2",children:[s.jsx(P,{className:"flex-1",onClick:()=>re("sim"),children:"Sim"}),s.jsx(P,{className:"flex-1",variant:"secondary",onClick:()=>re("não"),children:"Não, seguir"})]}):k.kind==="photo"?s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{ref:O,type:"file",accept:"image/*",className:"hidden",onChange:G=>{var ae;const W=(ae=G.target.files)==null?void 0:ae[0];W&&Pe(W),G.target.value=""}}),s.jsxs(P,{className:"flex-1",onClick:()=>{var G;return(G=O.current)==null?void 0:G.click()},disabled:j,children:[j?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(sg,{className:"w-4 h-4 mr-2"}),"Enviar foto"]}),s.jsx(P,{variant:"ghost",onClick:()=>re("",{skipped:!0}),children:"Pular"})]}):s.jsxs("form",{className:"flex items-end gap-2",onSubmit:G=>{if(G.preventDefault(),!g.trim()&&!k.optional){M.error("Responda para continuar ou revise o campo.");return}re(g)},children:[k.kind==="long"?s.jsx(ct,{autoFocus:!0,rows:3,value:g,placeholder:k.placeholder,onChange:G=>y(G.target.value),className:"resize-none"}):s.jsx(q,{autoFocus:!0,value:g,placeholder:k.placeholder,onChange:G=>y(G.target.value)}),k.optional&&s.jsx(P,{type:"button",variant:"ghost",onClick:()=>re("",{skipped:!0}),children:"Pular"}),s.jsx(P,{type:"submit",size:"icon","aria-label":"Enviar resposta",children:s.jsx(iR,{className:"w-4 h-4"})})]}),k&&Te.includes(k.id)&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(P,{type:"button",variant:"outline",size:"sm",onClick:Be,disabled:I,children:[I?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(Ft,{className:"w-4 h-4 mr-2"}),g.trim()?"Melhorar com IA":"Sugerir com IA"]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"A IA usa o que você já contou. Revise antes de enviar."})]})]})})]})},df=768;function rM(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const r=window.matchMedia(`(max-width: ${df-1}px)`),n=()=>{t(window.innerWidth<df)};return r.addEventListener("change",n),t(window.innerWidth<df),()=>r.removeEventListener("change",n)},[]),!!e}
vendor: 4,285 bytes, line 535
535var nM="Separator",S0="horizontal",sM=["horizontal","vertical"],gS=h.forwardRef((e,t)=>{const{decorative:r,orientation:n=S0,...a}=e,i=aM(n)?n:S0,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(ve.div,{"data-orientation":i,...l,...a,ref:t})});gS.displayName=nM;function aM(e){return sM.includes(e)}var vS=gS;const Cl=h.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},a)=>s.jsx(vS,{ref:a,decorative:r,orientation:t,className:Y("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Cl.displayName=vS.displayName;var Zd="Dialog",[xS,yS]=er(Zd),[iM,en]=xS(Zd),wS=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=h.useRef(null),c=h.useRef(null),[u,d]=Qr({prop:n,defaultProp:a??!1,onChange:i,caller:Zd});return s.jsx(iM,{scope:t,triggerRef:l,contentRef:c,contentId:Gr(),titleId:Gr(),descriptionId:Gr(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(f=>!f),[d]),modal:o,children:r})};wS.displayName=Zd;var bS="DialogTrigger",jS=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=en(bS,r),i=Me(t,a.triggerRef);return s.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Kg(a.open),...n,ref:i,onClick:ge(e.onClick,a.onOpenToggle)})});jS.displayName=bS;var Hg="DialogPortal",[oM,_S]=xS(Hg,{forceMount:void 0}),NS=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,i=en(Hg,t);return s.jsx(oM,{scope:t,forceMount:r,children:h.Children.map(n,o=>s.jsx(qs,{present:r||i.open,children:s.jsx(gd,{asChild:!0,container:a,children:o})}))})};NS.displayName=Hg;var Zu="DialogOverlay",SS=h.forwardRef((e,t)=>{const r=_S(Zu,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=en(Zu,e.__scopeDialog);return i.modal?s.jsx(qs,{present:n||i.open,children:s.jsx(cM,{...a,ref:t})}):null});SS.displayName=Zu;var lM=Di("DialogOverlay.RemoveScroll"),cM=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=en(Zu,r);return s.jsx(zg,{as:lM,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(ve.div,{"data-state":Kg(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ka="DialogContent",kS=h.forwardRef((e,t)=>{const r=_S(ka,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=en(ka,e.__scopeDialog);return s.jsx(qs,{present:n||i.open,children:i.modal?s.jsx(uM,{...a,ref:t}):s.jsx(dM,{...a,ref:t})})});kS.displayName=ka;var uM=h.forwardRef((e,t)=>{const r=en(ka,e.__scopeDialog),n=h.useRef(null),a=Me(t,r.contentRef,n);return h.useEffect(()=>{const i=n.current;if(i)return uN(i)},[]),s.jsx(CS,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ge(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ge(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:ge(e.onFocusOutside,i=>i.preventDefault())})}),dM=h.forwardRef((e,t)=>{const r=en(ka,e.__scopeDialog),n=h.useRef(!1),a=h.useRef(!1);return s.jsx(CS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),CS=h.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=en(ka,r),c=h.useRef(null),u=Me(t,c);return iN(),s.jsxs(s.Fragment,{children:[s.jsx(Fg,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx($l,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Kg(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(fM,{titleId:l.titleId}),s.jsx(pM,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Wg="DialogTitle",ES=h.forwardRef((e,t)=>
535{const{__scopeDialog:r,...n}=e,a=en(Wg,r);return s.jsx(ve.h2,{id:a.titleId,...n,ref:t})});ES.displayName=Wg;var TS="DialogDescription",RS=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=en(TS,r);return s.jsx(ve.p,{id:a.descriptionId,...n,ref:t})});RS.displayName=TS;var AS="DialogClose",PS=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=en(AS,r);return s.jsx(ve.button,{type:"button",...n,ref:t,onClick:ge(e.onClick,()=>a.onOpenChange(!1))})});PS.displayName=AS;function Kg(e){return e?"open":"closed"}var OS="DialogTitleWarning",[hM,IS]=VE(OS,{contentName:ka,titleName:Wg,docsSlug:"dialog"}),fM=({titleId:e})=>{const t=IS(OS),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 536 537If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 538 539For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},mM="DialogDescriptionWarning",pM=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${IS(mM).contentName}}.`;return h.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Gg=wS,LS=jS,Jg=NS,Hl=SS,Wl=kS,Kl=ES,Gl=RS,Yd=PS;const Qg=Gg,gM=Jg,$S=h.forwardRef(({className:e,...t},r)=>s.jsx(Hl,{className:Y("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}));$S.displayName=Hl.displayName;const vM=Xi("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"}}),Xd=h.forwardRef(({side:e="right",className:t,children:r,...n},a)=>s.jsxs(gM,{children:[s.jsx($S,{}),s.jsxs(Wl,{ref:a,className:Y(vM({side:e}),t),...n,children:[r,s.jsxs(Yd,{className:"absolute right-4 top-4 roun
539ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(zl,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xd.displayName=Wl.displayName;const Zg=({className:e,...t})=>s.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",e),...t});Zg.displayName="SheetHeader";const Yg=h.forwardRef(({className:e,...t},r)=>s.jsx(Kl,{ref:r,className:Y("text-lg font-semibold text-foreground",e),...t}));Yg.displayName=Kl.displayName;const DS=h.forwardRef(({className:e,...t},r)=>s.jsx(Gl,{ref:r,className:Y("text-sm text-muted-foreground",e),...t}));DS.displayName=Gl.displayName;function k0({className:e,...t}){return s.jsx("div",{className:Y("animate-pulse rounded-md bg-muted",e),...t})}const xM="sidebar:state",yM=60*60*24*7,wM="16rem",bM="18rem",jM="3rem",_M="b",MS=h.createContext(null);function uo(){const e=h.useContext(MS);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Xg=h.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:a,children:i,...o},l)=>{const c=rM(),[u,d]=h.useState(!1),[f,m]=h.useState(e),p=t??f,b=h.useCallback(g=>{const y=typeof g=="function"?g(p):g;r?r(y):m(y),document.cookie=`${xM}=${y}; path=/; max-age=${yM}`},[r,p]),v=h.useCallback(()=>c?d(g=>!g):b(g=>!g),[c,b,d]);h.useEffect(()=>{const g=y=>{y.key===_M&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),v())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[v]);const x=p?"expanded":"collapsed",w=h.useMemo(()=>({state:x,open:p,setOpen:b,isMobile:c,openMobile:u,setOpenMobile:d,toggleSidebar:v}),[x,p,b,c,u,d,v]);return s.jsx(MS.Provider,{value:w,children:s.jsx(F_,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":wM,"--sidebar-width-icon":jM,...a},className:Y("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:l,...o,children:i})})})});Xg.displayName="SidebarProvider";const ev=h.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:a,...i},o)=>{const{isMobile:l,state:c,openMobile:u,setOpenMobile:d}=uo();return r==="none"?s.jsx("div",{className:Y("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:o,...i,children:a}):l?s.jsx(Qg,{open:u,onOpenChange:d,...i,children:s.jsx(Xd,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":bM},side:e,children:s.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):s.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?r:"","data-variant":t,"data-side":e,children:[s.jsx("div",{className:Y("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),s.jsx("div",{className:Y("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),...i,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})});ev.displayName="Sidebar";const tv=h.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:a}=uo();return s.jsxs(P,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Y("h-7 w-7",e),onClick:i=>{t==null||t(i),a()},...r,children:[s.jsx(eR,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});tv.displayName="SidebarTrigger";const NM=h.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=uo();return s.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:Y("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})});NM.displayName="SidebarRail";const SM=h.forwardRef(({className:e,...t},r)=>s.jsx("main",{ref:r,className:Y("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-
539h-[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}));SM.displayName="SidebarInset";const kM=h.forwardRef(({className:e,...t},r)=>s.jsx(q,{ref:r,"data-sidebar":"input",className:Y("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));kM.displayName="SidebarInput";const CM=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"header",className:Y("flex flex-col gap-2 p-2",e),...t}));CM.displayName="SidebarHeader";const EM=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"footer",className:Y("flex flex-col gap-2 p-2",e),...t}));EM.displayName="SidebarFooter";const TM=h.forwardRef(({className:e,...t},r)=>s.jsx(Cl,{ref:r,"data-sidebar":"separator",className:Y("mx-2 w-auto bg-sidebar-border",e),...t}));TM.displayName="SidebarSeparator";const rv=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"content",className:Y("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));rv.displayName="SidebarContent";const nv=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"group",className:Y("relative flex w-full min-w-0 flex-col p-2",e),...t}));nv.displayName="SidebarGroup";const sv=h.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?Yi:"div";return s.jsx(a,{ref:n,"data-sidebar":"group-label",className:Y("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})});sv.displayName="SidebarGroupLabel";const RM=h.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?Yi:"button";return s.jsx(a,{ref:n,"data-sidebar":"group-action",className:Y("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})});RM.displayName="SidebarGroupAction";const av=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"group-content",className:Y("w-full text-sm",e),...t}));av.displayName="SidebarGroupContent";const iv=h.forwardRef(({className:e,...t},r)=>s.jsx("ul",{ref:r,"data-sidebar":"menu",className:Y("flex w-full min-w-0 flex-col gap-1",e),...t}));iv.displayName="SidebarMenu";const ov=h.forwardRef(({className:e,...t},r)=>s.jsx("li",{ref:r,"data-sidebar":"menu-item",className:Y("group/menu-item relative",e),...t}));ov.displayName="SidebarMenuItem";const AM=Xi("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"}}),lv=h.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:a,className:i,...o},l)=>{const c=e?Yi:"button",{isMobile:u,state:d}=uo(),f=s.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:Y(AM({variant:r,size:n}),i),...o});
539return a?(typeof a=="string"&&(a={children:a}),s.jsxs(XP,{children:[s.jsx(eO,{asChild:!0,children:f}),s.jsx(z_,{side:"right",align:"center",hidden:d!=="collapsed"||u,...a})]})):f});lv.displayName="SidebarMenuButton";const PM=h.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},a)=>{const i=t?Yi:"button";return s.jsx(i,{ref:a,"data-sidebar":"menu-action",className:Y("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})});PM.displayName="SidebarMenuAction";const OM=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:Y("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}));OM.displayName="SidebarMenuBadge";const IM=h.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const a=h.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:Y("flex h-8 items-center gap-2 rounded-md px-2",e),...r,children:[t&&s.jsx(k0,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(k0,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});IM.displayName="SidebarMenuSkeleton";const LM=h.forwardRef(({className:e,...t},r)=>s.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:Y("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}));LM.displayName="SidebarMenuSub";const $M=h.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));$M.displayName="SidebarMenuSubItem";const DM=h.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...a},i)=>{const o=e?Yi:"a";return s.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:Y("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),...a})});DM.displayName="SidebarMenuSubButton";const MM=[{title:"Dashboard",url:"/admin",icon:wd,end:!0},{title:"Clientes",url:"/admin/clientes",icon:At},{title:"Usuários",url:"/admin/usuarios",icon:ur},{title:"Solicitações",url:"/admin/solicitacoes",icon:Wj},{title:"Planos",url:"/admin/planos",icon:FT},{title:"Ãreas de atuação",url:"/admin/areas",icon:ag},{title:"Financeiro",url:"/admin/financeiro",icon:tR},{title:"Suporte",url:"/admin/suporte",icon:Kj},{title:"Logs",url:"/admin/logs",icon:aR},{title:"Integrações",url:"/admin/integracoes",icon:Gj},{title:"Configurações",url:"/admin/configuracoes",icon:Jj}],FM=()=>{const{state:e}=uo(),t=e==="collapsed",{pathname:r}=mr();return s.jsx(ev,{collapsible:"icon",children:s.jsxs(rv,{children:[s.jsxs("div",{className:"px-3 py-4 flex items-center gap-2.5",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl gradient-hero flex items-center justify-center shadow-button shrink-0",children:s.jsx(Ft,{className:"w-4 h-4 text-primary-foreground"})}),!t&&s.jsxs("div",{className:"leading-tight",children:[s.jsxs("div",{className:"text-sm font-extrabold tracking-tight",children:["Orange",s.jsx("span",{className:"text-primary",children:"RH"})]}),s.jsx("div",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:"Super Admin"})]})]}),s.jsxs(nv,{children:[s.jsx(sv,{children:"Plataforma"}),s.jsx(av,{children:s.jsx(iv,{children:MM.map(n=>{const a=n.end?r===n.url:r.startsWith(n.url);return s.jsx(ov,{children:s.jsx(lv,{asChild:!0,isActive:a,children:s.jsxs(Bl,{to:n.url,end:n.end,className:"flex items-center gap-2",children:[s.jsx(n.icon,{className:"h-4 w-4"}),!t&&s.jsx("span",{children:n.title})]})})},n.title)})})})]})]})})},zM=()=>{const e=pr(),{signOut:t,user:r}=it(),n=async()=>{await t(),e("/",{replace:!0})};return s.jsx(Xg,{children:s.jsxs("div",{className:"min-h-screen flex w-full bg-muted/30",children:[s.jsx(FM,{}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsxs("header",{className:"h-14 flex items-center justify-between border-b bg-background px-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(tv,{}),s.jsx("span",{className:"text-sm text-muted-foreground hidden sm:inline",children:"Painel Super Administrador"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs text-muted-foreground hidden md:inline",children:r==null?void 0:r.email}),s.jsxs(P,{variant:"ghost",size:"sm",onClick:n,children:[s.jsx(ig,{className:"w-4 h-4 mr-2"})," Sair"]})]})]}),s.jsx("main",{className:"flex-1 p-6",children:s.jsx(Od,{})})]})]})})},UM=ql({email:Qe().email("E-mail inválido"),password:Qe().min(8,"Use pelo menos 8 caracteres"),fullName:Qe().min(2,"Informe seu nome").max(120)}),BM=()=>{const e=pr(),{user:t,rolesLoaded:r,hasRole:n}=it(),[a,i]=h.useState(!1),[o,l]=h.useState(!0),[c,u]=h.useState(!1);h.useEffect(()=>{T.from("user_roles").select("id",{count:"exact",head:!0}).eq("role","super_admin").then(({count:m,error:p})=>{u(!p&&(m??0)===0),l(!1)})},[]),h.useEffect(()=>{r&&t&&n("super_admin")&&e("/admin",{replace:!0})},[r,t,n,e]);const d=async()=>{const{data:m,error:p}=await T.rpc("claim_super_admin");return p?(M.error(p.message),!1):m?(M.success("Super Administrador criado!"),window.location.href="/admin",!0):(M.error("Já existe um Super Administrador na plataforma"),!1)},f=async m=>{m.preventDefault();const p=new FormData(m.currentTarget),b=UM.safeParse({email:p.get("email"),password:p.get("password"),fullName:p.get("fullName")}
539);if(!b.success)return M.error(b.error.issues[0].message);i(!0);const{data:v,error:x}=await T.auth.signUp({email:b.data.email,password:b.data.password,options:{emailRedirectTo:`${window.location.origin}/admin/bootstrap`,data:{full_name:b.data.fullName}}});if(x&&!x.message.toLowerCase().includes("already")){i(!1),M.error(x.message);return}let w=(v==null?void 0:v.session)??null;if(!w){const{data:g,error:y}=await T.auth.signInWithPassword({email:b.data.email,password:b.data.password});if(y){i(!1),M.error(y.message==="Invalid login credentials"?"Confirme seu e-mail (ou verifique a senha) e tente novamente.":y.message);return}w=g.session}await d(),i(!1)};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background via-background to-primary/5 px-4 py-12",children:s.jsxs(Q,{className:"w-full max-w-md border-border/60 shadow-xl",children:[s.jsxs(ye,{className:"space-y-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl gradient-hero flex items-center justify-center shadow-button",children:s.jsx(ro,{className:"w-5 h-5 text-primary-foreground"})}),s.jsx(we,{className:"text-2xl",children:"Primeiro acesso Orange RH"}),s.jsx(bt,{children:"Crie a conta de Super Administrador da plataforma. DisponÃvel apenas enquanto não existir nenhum administrador."})]}),s.jsx(X,{children:o?s.jsx("div",{className:"flex justify-center py-6",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):c?s.jsxs("form",{onSubmit:f,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"bs-name",children:"Nome completo"}),s.jsx(q,{id:"bs-name",name:"fullName",autoComplete:"name",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"bs-email",children:"E-mail"}),s.jsx(q,{id:"bs-email",name:"email",type:"email",autoComplete:"email",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"bs-password",children:"Senha"}),s.jsx(q,{id:"bs-password",name:"password",type:"password",autoComplete:"new-password",minLength:8,required:!0})]}),s.jsxs(P,{type:"submit",className:"w-full",disabled:a,children:[a&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),"Criar Super Administrador"]})]}):s.jsxs("div",{className:"space-y-4 text-sm",children:[s.jsx("p",{className:"text-muted-foreground",children:"Já existe um Super Administrador nesta plataforma. Use a tela de login."}),s.jsx(P,{className:"w-full",onClick:()=>e("/auth",{replace:!0}),children:"Ir para o login"})]})})]})})},VM=()=>{const[e,t]=h.useState({total:0,active:0,trial:0,suspended:0}),[r,n]=h.useState(!0);h.useEffect(()=>{(async()=>{const{data:i}=await T.from("tenants").select("status, is_active");i&&t({total:i.length,active:i.filter(o=>o.is_active&&o.status==="active").length,trial:i.filter(o=>o.status==="trial").length,suspended:i.filter(o=>!o.is_active||o.status==="suspended").length}),n(!1)})()},[]);const a=[{label:"Total de clientes",value:e.total,icon:At,tone:"text-primary"},{label:"Ativos",value:e.active,icon:wn,tone:"text-green-600"},{label:"Em trial",value:e.trial,icon:Vj,tone:"text-amber-600"},{label:"Suspensos",value:e.suspended,icon:DT,tone:"text-red-600"}];return s.jsxs("div",{className:"space-y-6 max-w-6xl",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Dashboard"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Visão geral da plataforma Orange RH."})]}),s.jsx(P,{asChild:!0,children:s.jsx(me,{to:"/admin/clientes",children:"Gerenciar clientes"})})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:a.map(i=>s.jsxs(Q,{children:[s.jsxs(ye,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(we,{className:"text-sm font-medium text-muted-foreground",children:i.label}),s.jsx(i.icon,{className:`w-4 h-4 ${i.tone}`})]}),s.jsx(X,{children:s.jsx("div",{className:"text-3xl font-bold",children:r?"â":i.value})})]},i.label))}),s.jsxs(Q,{children:[s.jsx(ye,{children:s.jsx(we,{children:"Próximos passos"})}),s.jsxs(X,{className:"text-sm text-muted-foreground space-y-2",children:[s.jsxs("p",{children:["⢠Cadastre novos clientes em ",s.jsx(me,{to:"/admin/clientes",className:"text-primary underline",children:"Clientes"}),"."]}),s.jsx("p",{children:"⢠Módulos de Planos, Financeiro, Suporte, Logs, Integrações e Configurações serão liberados nas próximas etapas."})]})]})]})},xi=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:r,className:Y("w-full caption-bottom text-sm",e),...t})}));xi.displayName="Table";const yi=h.forwardRef(({className:e,...t},r)=>s.jsx("thead",{ref:r,className:Y("[&_tr]:border-b",e),...t}));yi.displayName="TableHeader";const wi=h.forwardRef(({className:e,...t},r)=>s.jsx("tbody",{ref:r,className:Y("[&_tr:last-child]:border-0",e),...t}));wi.displayName="TableBody";const qM=h.forwardRef(({className:e,...t},r)=>s.jsx("tfoot",{ref:r,className:Y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));qM.displayName="TableFooter";const Nt=h.forwardRef(({className:e,...t},r)=>s.jsx("tr",{ref:r,className:Y("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));
539Nt.displayName="TableRow";const Ke=h.forwardRef(({className:e,...t},r)=>s.jsx("th",{ref:r,className:Y("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Ke.displayName="TableHead";const $e=h.forwardRef(({className:e,...t},r)=>s.jsx("td",{ref:r,className:Y("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));$e.displayName="TableCell";const HM=h.forwardRef(({className:e,...t},r)=>s.jsx("caption",{ref:r,className:Y("mt-4 text-sm text-muted-foreground",e),...t}));HM.displayName="TableCaption";const Kn=Gg,FS=LS,WM=Jg,zS=h.forwardRef(({className:e,...t},r)=>s.jsx(Hl,{ref:r,className:Y("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}));zS.displayName=Hl.displayName;const gn=h.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(WM,{children:[s.jsx(zS,{}),s.jsxs(Wl,{ref:n,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,s.jsxs(Yd,{className:"absolute right-4 top-4 roun
539ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(zl,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));gn.displayName=Wl.displayName;const vn=({className:e,...t})=>s.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});vn.displayName="DialogHeader";const xn=({className:e,...t})=>s.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xn.displayName="DialogFooter";const yn=h.forwardRef(({className:e,...t},r)=>s.jsx(Kl,{ref:r,className:Y("text-lg font-semibold leading-none tracking-tight",e),...t}));yn.displayName=Kl.displayName;const zs=h.forwardRef(({className:e,...t},r)=>s.jsx(Gl,{ref:r,className:Y("text-sm text-muted-foreground",e),...t}));zs.displayName=Gl.displayName;var US="AlertDialog",[KM,BF]=er(US,[yS]),Qn=yS(),BS=e=>{const{__scopeAlertDialog:t,...r}=e,n=Qn(t);return s.jsx(Gg,{...n,...r,modal:!0})};BS.displayName=US;var GM="AlertDialogTrigger",JM=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Qn(r);return s.jsx(LS,{...a,...n,ref:t})});JM.displayName=GM;var QM="AlertDialogPortal",VS=e=>{const{__scopeAlertDialog:t,...r}=e,n=Qn(t);return s.jsx(Jg,{...n,...r})};VS.displayName=QM;var ZM="AlertDialogOverlay",qS=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Qn(r);return s.jsx(Hl,{...a,...n,ref:t})});qS.displayName=ZM;var bi="AlertDialogContent",[YM,XM]=KM(bi),e6=pj("AlertDialogContent"),HS=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...a}=e,i=Qn(r),o=h.useRef(null),l=Me(t,o),c=h.useRef(null);return s.jsx(hM,{contentName:bi,titleName:WS,docsSlug:"alert-dialog",children:s.jsx(YM,{scope:r,cancelRef:c,children:s.jsxs(Wl,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:ge(a.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[s.jsx(e6,{children:n}),s.jsx(r6,{contentRef:o})]})})})});HS.displayName=bi;var WS="AlertDialogTitle",KS=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Qn(r);return s.jsx(Kl,{...a,...n,ref:t})});KS.displayName=WS;var GS="AlertDialogDescription",JS=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Qn(r);return s.jsx(Gl,{...a,...n,ref:t})});JS.displayName=GS;var t6="AlertDialogAction",QS=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Qn(r);return s.jsx(Yd,{...a,...n,ref:t})});QS.displayName=t6;var ZS="AlertDialogCancel",YS=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:a}=XM(ZS,r),i=Qn(r),o=Me(t,a);return s.jsx(Yd,{...i,...n,ref:o})});YS.displayName=ZS;var r6=({contentRef:e})=>{const t=`\`${bi}\` requires a description for the component to be accessible for screen reader users. 540 541You can add a description to the \`${bi}\` by passing a \`${GS}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 542 543Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${bi}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 544 545For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},n6=BS,s6=VS,XS=qS,ek=HS,tk=QS,rk=YS,nk=KS,sk=JS;const cv=n6,a6=s6,ak=h.forwardRef(({className:e,...t},r)=>s.jsx(XS,{className:Y("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}));ak.displayName=XS.displayName;const eh=h.forwardRef(({className:e,...t},r)=>s.jsxs(a6,{children:[s.jsx(ak,{}),s.jsx(ek,{ref:r,className:Y("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
545nded-lg",e),...t})]}));eh.displayName=ek.displayName;const th=({className:e,...t})=>s.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",e),...t});th.displayName="AlertDialogHeader";const rh=({className:e,...t})=>s.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});rh.displayName="AlertDialogFooter";const nh=h.forwardRef(({className:e,...t},r)=>s.jsx(nk,{ref:r,className:Y("text-lg font-semibold",e),...t}));nh.displayName=nk.displayName;const sh=h.forwardRef(({className:e,...t},r)=>s.jsx(sk,{ref:r,className:Y("text-sm text-muted-foreground",e),...t}));sh.displayName=sk.displayName;const ah=h.forwardRef(({className:e,...t},r)=>s.jsx(tk,{ref:r,className:Y(Eg(),e),...t}));ah.displayName=tk.displayName;const ih=h.forwardRef(({className:e,...t},r)=>s.jsx(rk,{ref:r,className:Y(Eg({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ih.displayName=rk.displayName;const i6=2*1024*1024,o6=60*60*24*3650,l6="Tamanho ideal: 512 à 512 px (quadrado) ou 400 à 120 px (horizontal). PNG ou SVG com fundo transparente, até 2 MB.",uv=({value:e,onChange:t,label:r="Logo",folder:n="geral",hint:a})=>{const i=h.useRef(null),[o,l]=h.useState(!1),c=async u=>{var b;if(!u.type.startsWith("image/"))return M.error("Envie um arquivo de imagem (PNG, JPG, SVG ou WebP)");if(u.size>i6)return M.error("A imagem deve ter no máximo 2 MB");l(!0);const d=((b=u.name.split(".").pop())==null?void 0:b.toLowerCase())||"png",f=`${n}/${Date.now()}-${Math.random().toString(36).slice(2,8)}.${d}`,{error:m}=await T.storage.from("tenant-logos").upload(f,u,{cacheControl:"31536000",upsert:!1,contentType:u.type});if(m)return l(!1),M.error("Não foi possÃvel enviar a logo: "+m.message);const{data:p}=await T.storage.from("tenant-logos").createSignedUrl(f,o6);if(l(!1),!(p!=null&&p.signedUrl))return M.error("Falha ao gerar o link da imagem");t(p.signedUrl),M.success("Logo enviada")};return s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:r}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-xl border bg-muted/40 flex items-center justify-center overflow-hidden shrink-0",children:e?s.jsx("img",{src:e,alt:"Pré-visualização da logo",className:"w-full h-full object-contain"}):s.jsx(At,{className:"w-6 h-6 text-muted-foreground"})}),s.jsxs("div",{className:"flex-1 space-y-2 min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(P,{type:"button",size:"sm",variant:"secondary",disabled:o,onClick:()=>{var u;return(u=i.current)==null?void 0:u.click()},children:[o?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(uR,{className:"w-4 h-4 mr-2"}),"Enviar logo"]}),e&&s.jsxs(P,{type:"button",size:"sm",variant:"ghost",onClick:()=>t(""),children:[s.jsx(zl,{className:"w-4 h-4 mr-2"})," Remover"]})]}),s.jsx(q,{placeholder:"ou cole uma URL https://...",value:e,onChange:u=>t(u.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:a??l6})]})]}),s.jsx("input",{ref:i,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp",className:"hidden",onChange:u=>{var f;const d=(f=u.target.files)==null?void 0:f[0];d&&c(d),u.target.value=""}})]})},C0={name:"",slug:"",contact_name:"",contact_email:"",contact_phone:"",primary_color:"#F97316",logo_url:"",custom_domain:"",plan:"trial",status:"trial",job_limit:10,user_limit:5,notes:"",is_active:!0},E0=e=>e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)+/g,"").slice(0,60);function hf(e){return e?e.toLowerCase().replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\/.*$/,"").trim():""}const c6=e=>e==="active"?"default":e==="trial"?"secondary":"destructive",u6=()=>{const e=pr(),[t,r]=h.useState([]),[n,a]=h.useState(!0),[i,o]=h.useState(""),[l,c]=h.useState(!1),[u,d]=h.useState(null),[f,m]=h.useState({...C0}),[p,b]=h.useState(!1),[v,x]=h.useState(null),w=async()=>{a(!0);const{data:N,error:E}=await T.from("tenants").select("*").order("created_at",{ascending:!1});E?M.error("Erro ao carregar clientes"):r(N),a(!1)};h.useEffect(()=>{w()},[]);const g=()=>{d(null),m({...C0}),c(!0)},y=N=>{d(N),m({name:N.name,slug:N.slug,contact_name:N.contact_name??"",contact_email:N.contact_email??"",contact_phone:N.contact_phone??"",primary_color:N.primary_color??"#F97316",logo_url:N.logo_url??"",custom_domain:N.custom_domain??"",plan:N.plan,status:N.status,job_limit:N.job_limit,user_limit:N.user_limit,notes:N.notes??"",is_active:N.is_active}),c(!0)},j=async N=>{if(N.preventDefault(),!f.name.trim()||!f.slug.trim()){M.error("Nome e identificador são obrigatórios");return}const E=hf(f.custom_domain);if(E){const A=t.find(C=>C.id!==(u==null?void 0:u.id)&&hf(C.custom_domain||"")===E);if(A){M.error(`DomÃnio já está em uso pelo cliente ${A.name}`);return}}b(!0);const R={name:f.name.trim(),slug:E0(f.slug),contact_name:f.contact_name||null,contact_email:f.contact_email||null,contact_phone:f.contact_phone||null,primary_color:f.primary_color||null,logo_url:f.logo_url||null,custom_domain:E||null,plan:f.plan,status:f.status,job_limit:Number(f.job_limit)||0,user_limit:Number(f.user_limit)||0,notes:f.notes||null,is_active:f.is_active},{error:I}=u?await T.from("tenants").update(R).eq("id",u.id):await T.from("tenants").insert(R);if(b(!1),I){M.error(I.message.includes("duplicate")?"Identificador já em uso":I.message);return}M.success(u?"Cliente atualizado":"Cliente criado"),c(!1),w()},_=async()=>
545{if(!v)return;const{error:N}=await T.from("tenants").delete().eq("id",v.id);if(N){M.error(N.message);return}M.success("Cliente removido"),x(null),w()},S=t.filter(N=>{const E=i.toLowerCase().trim();return E?N.name.toLowerCase().includes(E)||N.slug.toLowerCase().includes(E)||(N.contact_email??"").toLowerCase().includes(E):!0});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Clientes"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Empresas que utilizam a plataforma White Label."})]}),s.jsxs(P,{onClick:g,children:[s.jsx(mn,{className:"w-4 h-4 mr-2"})," Novo cliente"]})]}),s.jsxs(Q,{children:[s.jsx(ye,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(we,{className:"text-base",children:"Lista"}),s.jsxs("div",{className:"ml-auto relative w-full max-w-xs",children:[s.jsx(kr,{className:"w-4 h-4 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(q,{className:"pl-8",placeholder:"Buscar por nome, slug ou e-mail",value:i,onChange:N=>o(N.target.value)})]})]})}),s.jsx(X,{className:"p-0",children:s.jsxs(xi,{children:[s.jsx(yi,{children:s.jsxs(Nt,{children:[s.jsx(Ke,{children:"Cliente"}),s.jsx(Ke,{children:"Slug"}),s.jsx(Ke,{children:"Plano"}),s.jsx(Ke,{children:"Status"}),s.jsx(Ke,{children:"Contato"}),s.jsx(Ke,{className:"text-right",children:"Ações"})]})}),s.jsxs(wi,{children:[n&&s.jsx(Nt,{children:s.jsx($e,{colSpan:6,className:"text-center py-10",children:s.jsx(le,{className:"w-5 h-5 animate-spin inline text-muted-foreground"})})}),!n&&S.length===0&&s.jsx(Nt,{children:s.jsx($e,{colSpan:6,className:"text-center py-10 text-muted-foreground",children:"Nenhum cliente cadastrado ainda."})}),!n&&S.map(N=>s.jsxs(Nt,{children:[s.jsxs($e,{children:[s.jsx("div",{className:"font-medium",children:N.name}),N.custom_domain&&s.jsx("div",{className:"text-xs text-muted-foreground",children:N.custom_domain})]}),s.jsx($e,{className:"font-mono text-xs",children:N.slug}),s.jsx($e,{className:"capitalize",children:N.plan}),s.jsx($e,{children:s.jsx(pe,{variant:c6(N.status),className:"capitalize",children:N.status})}),s.jsxs($e,{className:"text-sm",children:[s.jsx("div",{children:N.contact_name||"â"}),s.jsx("div",{className:"text-xs text-muted-foreground",children:N.contact_email||""})]}),s.jsxs($e,{className:"text-right",children:[s.jsx(P,{variant:"ghost",size:"icon",title:"Visualizar cliente (somente leitura)","aria-label":`Visualizar ${N.name}`,onClick:()=>e(`/admin/clientes/${N.id}`),children:s.jsx(ng,{className:"w-4 h-4"})}),s.jsx(P,{variant:"ghost",size:"icon",onClick:()=>y(N),children:s.jsx(Ml,{className:"w-4 h-4"})}),s.jsx(P,{variant:"ghost",size:"icon",onClick:()=>x(N),className:"text-destructive hover:text-destructive",children:s.jsx(Vn,{className:"w-4 h-4"})})]})]},N.id))]})]})})]}),s.jsx(Kn,{open:l,onOpenChange:c,children:s.jsxs(gn,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(vn,{children:[s.jsx(yn,{children:u?"Editar cliente":"Novo cliente"}),s.jsx(zs,{children:"Dados básicos, plano e branding do portal White Label."})]}),s.jsxs("form",{onSubmit:j,className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"name",children:"Razão social / Nome *"}),s.jsx(q,{id:"name",value:f.name,onChange:N=>{const E=N.target.value;m(R=>({...R,name:E,slug:!u&&!R.slug?E0(E):R.slug}))},required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"slug",children:"Identificador (slug) *"}),s.jsx(q,{id:"slug",value:f.slug,onChange:N=>m(E=>({...E,slug:N.target.value})),placeholder:"ex: acme",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"contact_name",children:"Responsável"}),s.jsx(q,{id:"contact_name",value:f.contact_name,onChange:N=>m(E=>({...E,contact_name:N.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"contact_email",children:"E-mail do responsável"}),s.jsx(q,{id:"contact_email",type:"email",value:f.contact_email,onChange:N=>m(E=>({...E,contact_email:N.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"contact_phone",children:"Telefone"}),s.jsx(q,{id:"contact_phone",value:f.contact_phone,onChange:N=>m(E=>({...E,contact_phone:N.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"custom_domain",children:"DomÃnio personalizado"}),s.jsx(q,{id:"custom_domain",value:f.custom_domain,onChange:N=>m(E=>({...E,custom_domain:hf(N.target.value)})),placeholder:"vagas.cliente.com.br"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requer plano Pro/Business no Lovable. Após salvar, o cliente deve apontar o A record @ e www para 185.158.133.1 e adicionar o domÃnio em Configurações do projeto â DomÃnios."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"plan",children:"Plano"}),s.jsxs(gt,{value:f.plan,onValueChange:N=>m(E=>({...E,plan:N})),children:[s.jsx(ut,{id:"plan",children:s.jsx(vt,{})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"trial",children:"Trial"}),s.jsx(ke,{value:"starter",children:"Starter"}),s.jsx(ke,{value:"pro",children:"Pro"}),s.jsx(ke,{value:"enterprise",children:"Enterprise"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"status",children:"Status"}),s.jsxs(gt,{value:f.status,onValueChange:N=>m(E=>({...E,status:N,is_active:N!=="suspended"})),children:[s.jsx(ut,{id:"status",children:s.jsx(vt,{})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"trial",children:"Trial"}),s.jsx(ke,{value:"active",children:"Ativo"}),s.jsx(ke,{value:"suspended",children:"Suspenso"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"job_limit",children:"Limite de vagas"}),s.jsx(q,{id:"job_limit",type:"number",min:0,value:f.job_limit,onChange:N=>m(E=>({...E,job_limit:Number(N.target.value)}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"user_limit",children:"Limite de usuários"}),s.jsx(q,{id:"user_limit",type:"number",min:0,value:f.user_limit,onChange:N=>m(E=>({...E,user_limit:Number(N.target.value)}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"primary_color",children:"Cor primária"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(q,{id:"primary_color",type:"color",value:f.primary_color,onChange:N=>m(E=>({...E,primary_color:N.target.value})),className:"w-14 p-1 h-10"}),s.jsx(q,{value:f.primary_color,onChange:N=>m(E=>({...E,primary_color:N.target.value}))})]})]}),s.jsx("div",{className:"space-y-2 md:col-span-2",children:s.jsx(uv,{label:"Logo do cliente (topo do portal)",folder:(u==null?void 0:u.id)??"novos",value:f.logo_url,onChange:N=>m(E=>({...E,logo_url:N}
545))})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"notes",children:"Observações"}),s.jsx(ct,{id:"notes",value:f.notes,onChange:N=>m(E=>({...E,notes:N.target.value})),rows:3})]}),s.jsxs(xn,{children:[s.jsx(P,{type:"button",variant:"outline",onClick:()=>c(!1),children:"Cancelar"}),s.jsxs(P,{type:"submit",disabled:p,children:[p&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),u?"Salvar alterações":"Criar cliente"]})]})]})]})}),s.jsx(cv,{open:!!v,onOpenChange:N=>!N&&x(null),children:s.jsxs(eh,{children:[s.jsxs(th,{children:[s.jsx(nh,{children:"Remover cliente?"}),s.jsxs(sh,{children:["Esta ação remove ",s.jsx("strong",{children:v==null?void 0:v.name})," permanentemente. Registros vinculados também serão afetados."]})]}),s.jsxs(rh,{children:[s.jsx(ih,{children:"Cancelar"}),s.jsx(ah,{onClick:_,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remover"})]})]})})]})};var ff="rovingFocusGroup.onEntryFocus",d6={bubbles:!1,cancelable:!0},Jl="RovingFocusGroup",[ep,ik,h6]=pd(Jl),[f6,ok]=er(Jl,[h6]),[m6,p6]=f6(Jl),lk=h.forwardRef((e,t)=>s.jsx(ep.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(ep.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(g6,{...e,ref:t})})}));lk.displayName=Jl;var g6=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,m=h.useRef(null),p=Me(t,m),b=Ud(i),[v,x]=Qr({prop:o,defaultProp:l??null,onChange:c,caller:Jl}),[w,g]=h.useState(!1),y=cr(u),j=ik(r),_=h.useRef(!1),[S,N]=h.useState(0);return h.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(ff,y),()=>E.removeEventListener(ff,y)},[y]),s.jsx(m6,{scope:r,orientation:n,dir:b,loop:a,currentTabStopId:v,onItemFocus:h.useCallback(E=>x(E),[x]),onItemShiftTab:h.useCallback(()=>g(!0),[]),onFocusableItemAdd:h.useCallback(()=>N(E=>E+1),[]),onFocusableItemRemove:h.useCallback(()=>N(E=>E-1),[]),children:s.jsx(ve.div,{tabIndex:w||S===0?-1:0,"data-orientation":n,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:ge(e.onMouseDown,()=>{_.current=!0}),onFocus:ge(e.onFocus,E=>{const R=!_.current;if(E.target===E.currentTarget&&R&&!w){const I=new CustomEvent(ff,d6);if(E.currentTarget.dispatchEvent(I),!I.defaultPrevented){const A=j().filter(B=>B.focusable),C=A.find(B=>B.active),F=A.find(B=>
vendor: 5,833 bytes, line 545
545B.id===v),z=[C,F,...A].filter(Boolean).map(B=>B.ref.current);dk(z,d)}}_.current=!1}),onBlur:ge(e.onBlur,()=>g(!1))})})}),ck="RovingFocusGroupItem",uk=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,children:o,...l}=e,c=Gr(),u=i||c,d=p6(ck,r),f=d.currentTabStopId===u,m=ik(r),{onFocusableItemAdd:p,onFocusableItemRemove:b,currentTabStopId:v}=d;return h.useEffect(()=>{if(n)return p(),()=>b()},[n,p,b]),s.jsx(ep.ItemSlot,{scope:r,id:u,focusable:n,active:a,children:s.jsx(ve.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:ge(e.onMouseDown,x=>{n?d.onItemFocus(u):x.preventDefault()}),onFocus:ge(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:ge(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){d.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const w=y6(x,d.orientation,d.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let y=m().filter(j=>j.focusable).map(j=>j.ref.current);if(w==="last")y.reverse();else if(w==="prev"||w==="next"){w==="prev"&&y.reverse();const j=y.indexOf(x.currentTarget);y=d.loop?w6(y,j+1):y.slice(j+1)}setTimeout(()=>dk(y))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:v!=null}):o})})});uk.displayName=ck;var v6={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function x6(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function y6(e,t,r){const n=x6(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return v6[n]}function dk(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function w6(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var b6=lk,j6=uk,oh="Tabs",[_6,VF]=er(oh,[ok]),hk=ok(),[N6,dv]=_6(oh),fk=h.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=Ud(l),[f,m]=Qr({prop:n,onChange:a,defaultProp:i??"",caller:oh});return s.jsx(N6,{scope:r,baseId:Gr(),value:f,onValueChange:m,orientation:o,dir:d,activationMode:c,children:s.jsx(ve.div,{dir:d,"data-orientation":o,...u,ref:t})})});fk.displayName=oh;var mk="TabsList",pk=h.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...a}=e,i=dv(mk,r),o=hk(r);return s.jsx(b6,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:s.jsx(ve.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});pk.displayName=mk;var gk="TabsTrigger",vk=h.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:a=!1,...i}=e,o=dv(gk,r),l=hk(r),c=wk(o.baseId,n),u=bk(o.baseId,n),d=n===o.value;return s.jsx(j6,{asChild:!0,...l,focusable:!a,active:d,children:s.jsx(ve.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:ge(e.onMouseDown,f=>{!a&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:ge(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:ge(e.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!a&&f&&o.onValueChange(n)})})})});vk.displayName=gk;var xk="TabsContent",yk=h.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:a,children:i,...o}=e,l=dv(xk,r),c=wk(l.baseId,n),u=bk(l.baseId,n),d=n===l.value,f=h.useRef(d);return h.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),s.jsx(qs,{present:a||d,children:({present:m})=>s.jsx(ve.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&i})})});yk.displayName=xk;function wk(e,t){return`${e}-trigger-${t}`}function bk(e,t){return`${e}-content-${t}`}var S6=fk,jk=pk,_k=vk,Nk=yk;const El=S6,Gi=h.forwardRef(({className:e,...t},r)=>s.jsx(jk,{ref:r,className:Y("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Gi.displayName=jk.displayName;const ar=h.forwardRef(({className:e,...t},r)=>s.jsx(_k,{ref:r,className:Y("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}));ar.displayName=_k.displayName;const Hr=h.forwardRef(({className:e,...t},r)=>s.jsx(Nk,{ref:r,className:Y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Hr.displayName=Nk.displayName;const jt=({label:e,value:t})=>s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:e}),s.jsx("div",{className:"text-sm font-medium break-words",children:t||"â"})]}),mf=({icon:e,label:t,value:r})=>s.jsx(Q,{children:s.jsxs(X,{className:"p-4 flex items-center gap-3",children:[s.jsx("div",{className:"w-9 h-9 rounded-lg bg-primary/10 text-primary flex items-center justify-center",children:s.jsx(e,{className:"w-4 h-4"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xl font-bold leading-none",children:r}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:t})]})]})}),k6=()=>{const{tenantId:e}=Aa(),t=pr(),[r,n]=h.useState(null),[a,i]=h.useState([]),[o,l]=h.useState([]),[c,u]=h.useState([]),[d,f]=h.useState(!0);if(h.useEffect(()=>{(async()=>
545{if(!e)return;f(!0);const[b,v,x,w]=await Promise.all([T.from("tenants").select("*").eq("id",e).maybeSingle(),T.from("jobs").select("id,title,slug,status,location,created_at").eq("tenant_id",e).order("created_at",{ascending:!1}),T.from("job_applications").select("id,status,created_at,match_score,job_id,candidate_id").eq("tenant_id",e).order("created_at",{ascending:!1}),T.from("user_roles").select("user_id,role").eq("tenant_id",e)]);(b.error||!b.data)&&M.error("Cliente não encontrado"),n(b.data??null),i(v.data??[]),l(x.data??[]);const g=w.data??[];if(g.length){const{data:y}=await T.from("profiles").select("id,full_name,email").in("id",g.map(j=>j.user_id));u(g.map(j=>{const _=y==null?void 0:y.find(S=>S.id===j.user_id);return{user_id:j.user_id,role:j.role,full_name:(_==null?void 0:_.full_name)??null,email:(_==null?void 0:_.email)??null}}))}else u([]);f(!1)})()},[e]),d)return s.jsx("div",{className:"py-20 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-muted-foreground"})});if(!r)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Cliente não encontrado"}),s.jsxs(P,{variant:"outline",onClick:()=>t("/admin/clientes"),children:[s.jsx(Mi,{className:"w-4 h-4 mr-2"})," Voltar"]})]});const m=p=>{var b;return((b=a.find(v=>v.id===p))==null?void 0:b.title)??"â"};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(P,{variant:"ghost",size:"icon",onClick:()=>t("/admin/clientes"),children:s.jsx(Mi,{className:"w-4 h-4"})}),r.logo_url?s.jsx("img",{src:r.logo_url,alt:r.name,className:"w-11 h-11 rounded-lg object-cover"}):s.jsx("div",{className:"w-11 h-11 rounded-lg bg-primary/10 text-primary flex items-center justify-center font-bold",children:r.name.slice(0,2).toUpperCase()}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold leading-tight",children:r.name}),s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[s.jsx("span",{className:"font-mono",children:r.slug}),s.jsx(pe,{variant:"secondary",className:"capitalize",children:r.plan}),s.jsx(pe,{variant:r.status==="active"?"default":"secondary",className:"capitalize",children:r.status})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(pe,{variant:"outline",className:"gap-1",children:[s.jsx(ng,{className:"w-3 h-3"})," Somente leitura"]}),s.jsx(P,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs("a",{href:`/t/${r.slug}`,target:"_blank",rel:"noreferrer",children:[s.jsx(yd,{className:"w-4 h-4 mr-2"})," Portal público"]})}),s.jsx(P,{asChild:!0,size:"sm",children:s.jsx(me,{to:`/painel?tenant=${r.slug}`,children:"Abrir painel do cliente"})})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsx(mf,{icon:Mt,label:"Vagas",value:a.length}),s.jsx(mf,{icon:eo,label:"Candidaturas",value:o.length}),s.jsx(mf,{icon:ur,label:"Usuários vinculados",value:c.length})]}),s.jsxs(El,{defaultValue:"cadastro",children:[s.jsxs(Gi,{children:[s.jsx(ar,{value:"cadastro",children:"Cadastro"}),s.jsx(ar,{value:"vagas",children:"Vagas"}),s.jsx(ar,{value:"candidaturas",children:"Candidaturas"}),s.jsx(ar,{value:"usuarios",children:"Usuários"})]}),s.jsxs(Hr,{value:"cadastro",className:"mt-4 space-y-4",children:[s.jsxs(Q,{children:[s.jsx(ye,{className:"pb-3",children:s.jsx(we,{className:"text-base",children:"Dados cadastrais"})}),s.jsxs(X,{className:"grid gap-4 sm:grid-cols-3",children:[s.jsx(jt,{label:"Razão social",value:r.name}),s.jsx(jt,{label:"Identificador",value:r.slug}),s.jsx(jt,{label:"Tipo",value:r.tenant_type==="agency"?"Agência de RH":"Empresa"}),s.jsx(jt,{label:"Responsável",value:r.contact_name}),s.jsx(jt,{label:"E-mail",value:r.contact_email}),s.jsx(jt,{label:"Telefone",value:r.contact_phone}),s.jsx(jt,{label:"DomÃnio próprio",value:r.custom_domain}),s.jsx(jt,{label:"Criado em",value:new Date(r.created_at).toLocaleDateString("pt-BR")}),s.jsx(jt,{label:"Ativo",value:r.is_active?"Sim":"Não"})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs(Q,{children:[s.jsx(ye,{className:"pb-3",children:s.jsx(we,{className:"text-base",children:"Plano e limites"})}),s.jsxs(X,{className:"grid gap-4 sm:grid-cols-2",children:[s.jsx(jt,{label:"Plano",value:s.jsx("span",{className:"capitalize",children:r.plan})}),s.jsx(jt,{label:"Status",value:s.jsx("span",{className:"capitalize",children:r.status})}),s.jsx(jt,{label:"Limite de vagas",value:`${a.length} / ${r.job_limit}`}),s.jsx(jt,{label:"Limite de usuários",value:`${c.length} / ${r.user_limit}`})]})]}),s.jsxs(Q,{children:[s.jsx(ye,{className:"pb-3",children:s.jsx(we,{className:"text-base",children:"Branding e marketplace"})}),s.jsxs(X,{className:"grid gap-4 sm:grid-cols-2",children:[s.jsx(jt,{label:"Cor primária",value:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx("span",{className:"w-4 h-4 rounded border",style:{background:r.primary_color??void 0}}),r.primary_color]})}),s.jsx(jt,{label:"Logo",value:r.logo_url?"Configurado":"â"}),s.jsx(jt,{label:"Adesão marketplace",value:r.marketplace_opt_in?"Sim":"Não"}),s.jsx(jt,{label:"Assinante marketplace",value:r.marketplace_subscribed?"Sim":"Não"}),s.jsx(jt,{label:"Comissão",value:`${r.marketplace_commission}%`})]})]})]}),r.notes&&s.jsxs(Q,{children:[s.jsx(ye,{className:"pb-3",children:s.jsx(we,{className:"text-base",children:"Observações"})}),s.jsx(X,{className:"text-sm whitespace-pre-wrap",children:r.notes})]})]}),s.jsx(Hr,{value:"vagas",className:"mt-4",children:s.jsx(Q,{children:s.jsx(X,{className:"p-0",children:s.jsxs(xi,{children:[s.jsx(yi,{children:s.jsxs(Nt,{children:[s.jsx(Ke,{children:"Vaga"}),s.jsx(Ke,{children:"Local"}),s.jsx(Ke,{children:"Status"}),s.jsx(Ke,{children:"Criada em"})]})}),s.jsxs(wi,{children:[a.length===0&&s.jsx(Nt,{children:s.jsx($e,{colSpan:4,className:"text-center py-10 text-muted-foreground",children:"Nenhuma vaga cadastrada."})}),a.map(p=>s.jsxs(Nt,{children:[s.jsx($e,{className:"font-medium",children:p.title}),s.jsx($e,{children:p.location||"â"}),s.jsx($e,{children:s.jsx(pe,{variant:"secondary",className:"capitalize",children:p.status})}),s.jsx($e,{className:"text-sm text-muted-foreground",children:new Date(p.created_at).toLocaleDateString("pt-BR")})]}
545,p.id))]})]})})})}),s.jsx(Hr,{value:"candidaturas",className:"mt-4",children:s.jsx(Q,{children:s.jsx(X,{className:"p-0",children:s.jsxs(xi,{children:[s.jsx(yi,{children:s.jsxs(Nt,{children:[s.jsx(Ke,{children:"Vaga"}),s.jsx(Ke,{children:"Etapa"}),s.jsx(Ke,{children:"Match"}),s.jsx(Ke,{children:"Data"})]})}),s.jsxs(wi,{children:[o.length===0&&s.jsx(Nt,{children:s.jsx($e,{colSpan:4,className:"text-center py-10 text-muted-foreground",children:"Nenhuma candidatura recebida."})}),o.map(p=>s.jsxs(Nt,{children:[s.jsx($e,{className:"font-medium",children:m(p.job_id)}),s.jsx($e,{children:s.jsx(pe,{variant:"secondary",className:"capitalize",children:p.status})}),s.jsx($e,{children:p.match_score!=null?`${p.match_score}%`:"â"}),s.jsx($e,{className:"text-sm text-muted-foreground",children:new Date(p.created_at).toLocaleDateString("pt-BR")})]},p.id))]})]})})})}),s.jsx(Hr,{value:"usuarios",className:"mt-4",children:s.jsx(Q,{children:s.jsx(X,{className:"p-0",children:s.jsxs(xi,{children:[s.jsx(yi,{children:s.jsxs(Nt,{children:[s.jsx(Ke,{children:"Usuário"}),s.jsx(Ke,{children:"E-mail"}),s.jsx(Ke,{children:"Papel"})]})}),s.jsxs(wi,{children:[c.length===0&&s.jsx(Nt,{children:s.jsx($e,{colSpan:3,className:"text-center py-10 text-muted-foreground",children:"Nenhum usuário vinculado."})}),c.map(p=>s.jsxs(Nt,{children:[s.jsx($e,{className:"font-medium",children:p.full_name||"â"}),s.jsx($e,{className:"text-sm",children:p.email||"â"}),s.jsx($e,{children:s.jsx(pe,{variant:"outline",children:p.role})})]},`${p.user_id}-${p.role}`))]})]})})})})]})]})},T0={awaiting_implementation:{label:"Aguardando implantação",variant:"secondary"},in_contact:{label:"Em contato",variant:"outline"},implementing:{label:"Em implantação",variant:"default"},active:{label:"Ativado",variant:"default"},lost:{label:"Perdido",variant:"outline"}},C6=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40),E6=()=>{var b,v;const[e,t]=h.useState([]),[r,n]=h.useState(!0),[a,i]=h.useState(""),[o,l]=h.useState(null),[c,u]=h.useState(!1),d=async()=>{n(!0);const{data:x,error:w}=await T.from("onboarding_leads").select("*").order("created_at",{ascending:!1});w&&M.error("Erro ao carregar solicitações"),t(x??[]),n(!1)};h.useEffect(()=>{d()},[]);const f=h.useMemo(()=>{const x=a.trim().toLowerCase();return x?e.filter(w=>[w.company_name,w.contact_name,w.contact_email,w.city,w.state].filter(Boolean).some(g=>String(g).toLowerCase().includes(x))):e},[e,a]),m=async(x,w)=>{const{error:g}=await T.from("onboarding_leads").update({status:w}).eq("id",x.id);if(g)return M.error("Não foi possÃvel atualizar o status");t(y=>y.map(j=>j.id===x.id?{...j,status:w}:j)),l(y=>y&&y.id===x.id?{...y,status:w}:y),M.success("Status atualizado")},p=async x=>{if(x.tenant_id)return M.info("Pré-tenant já criado para esta solicitação");u(!0);const g=`${C6(x.company_name)||"cliente"}-${Math.random().toString(36).slice(2,6)}`,{data:y,error:j}=await T.from("tenants").insert({name:x.company_name,slug:g,tenant_type:x.client_type,contact_name:x.contact_name,contact_email:x.contact_email,contact_phone:x.contact_phone,status:"trial",is_active:!1,job_limit:x.jobs_per_month??10,user_limit:x.users_count??5,notes:x.message}).select("id, slug").single();if(j||!y)return u(!1),M.error("Erro ao criar pré-tenant");await T.from("onboarding_leads").update({tenant_id:y.id,status:"implementing"}).eq("id",x.id),u(!1),M.success(`Pré-tenant criado: /t/${y.slug}`),d(),l(null)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Solicitações de plataforma"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Leads vindos do autocadastro em /quero-minha-plataforma"})]}),s.jsxs("div",{className:"relative w-full sm:w-72",children:[s.jsx(kr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(q,{value:a,onChange:x=>i(x.target.value),placeholder:"Buscar...",className:"pl-9"})]})]}),s.jsxs(Q,{children:[s.jsx(ye,{className:"pb-2",children:s.jsxs(we,{className:"text-base",children:[f.length," solicitação(ões)"]}
545)}),s.jsxs(X,{className:"space-y-2",children:[r&&s.jsx("p",{className:"text-sm text-muted-foreground py-6",children:"Carregando..."}),!r&&f.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground py-6",children:"Nenhuma solicitação encontrada."}),f.map(x=>{const w=T0[x.status]??{label:x.status,variant:"outline"};return s.jsxs("button",{onClick:()=>l(x),className:"w-full text-left rounded-lg border border-border p-4 hover:bg-muted/50 transition-colors",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[x.client_type==="agency"?s.jsx(ur,{className:"h-4 w-4 text-primary"}):s.jsx(At,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"font-semibold",children:x.company_name}),s.jsx(pe,{variant:w.variant,children:w.label}),x.tenant_id&&s.jsx(pe,{variant:"outline",children:"Pré-tenant criado"})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(x.created_at).toLocaleDateString("pt-BR")})]}),s.jsxs("div",{className:"mt-1 text-sm text-muted-foreground",children:[x.contact_name," · ",x.contact_email,x.city?` · ${x.city}${x.state?`/${x.state}`:""}`:""]})]},x.id)})]})]}),s.jsx(Qg,{open:!!o,onOpenChange:x=>!x&&l(null),children:s.jsx(Xd,{className:"w-full sm:max-w-lg overflow-y-auto",children:o&&s.jsxs(s.Fragment,{children:[s.jsxs(Zg,{children:[s.jsx(Yg,{children:o.company_name}),s.jsx(DS,{children:o.client_type==="agency"?"Agência de RH":"Empresa"})]}),s.jsxs("div",{className:"mt-6 space-y-4 text-sm",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(kn,{label:"Responsável",value:o.contact_name}),s.jsx(kn,{label:"E-mail",value:o.contact_email}),s.jsx(kn,{label:"Telefone",value:o.contact_phone}),s.jsx(kn,{label:"CNPJ",value:o.cnpj}),s.jsx(kn,{label:"Cidade",value:o.city}),s.jsx(kn,{label:"Estado",value:o.state}),s.jsx(kn,{label:"Vagas/mês",value:(b=o.jobs_per_month)==null?void 0:b.toString()}),s.jsx(kn,{label:"Usuários",value:(v=o.users_count)==null?void 0:v.toString()}),s.jsx(kn,{label:"DomÃnio próprio",value:o.has_own_domain?"Sim":"Não"})]}),o.message&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Mensagem"}),s.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:o.message})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Status"}),s.jsxs(gt,{value:o.status,onValueChange:x=>m(o,x),children:[s.jsx(ut,{children:s.jsx(vt,{})}),s.jsx(dt,{children:Object.entries(T0).map(([x,w])=>s.jsx(ke,{value:x,children:w.label},x))})]})]}),s.jsxs(P,{className:"w-full",disabled:c||!!o.tenant_id,onClick:()=>p(o),children:[s.jsx(og,{className:"h-4 w-4 mr-2"}),o.tenant_id?"Pré-tenant já criado":"Criar pré-tenant"]})]})]})})})]})},kn=({label:e,value:t})=>s.jsxs("div",{children:[s.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:e}),s.jsx("div",{className:"font-medium",children:t||"â"})]}),T6={super_admin:"Super admin",tenant_admin:"Admin do cliente",recruiter:"Recrutador",candidate:"Candidato"},Ic=async e=>{var a;let{data:{session:t}}=await T.auth.getSession();if(!t)throw new Error("Sua sessão expirou. Entre novamente.");if(t.expires_at&&t.expires_at*1e3<=Date.now()+3e4){const{data:i,error:o}=await T.auth.refreshSession();if(o||!i.session)throw new Error("Sua sessão expirou. Entre novamente.");t=i.session}const{data:r,error:n}=await T.functions.invoke("admin-users",{body:e,headers:{Authorization:`Bearer ${t.access_token}`}});if(n){let i=n.message;try{const o=await((a=n.context)==null?void 0:a.json());o!=null&&o.error&&(i=String(o.error))}catch{}throw/weak|easy to guess|pwned|leak/i.test(i)?i="Essa senha é muito conhecida e não pôde ser usada por segurança. Tente outra combinação (ex.: Intercast#Rh2026) ou deixe o campo em branco para a pessoa criar a própria senha por e-mail.":/already|registered|exists/i.test(i)?i="Esse e-mail já está cadastrado. Use a opção Recuperação para enviar um novo acesso.":/non-2xx|failed to fetch/i.test(i)&&(i="Não conseguimos concluir agora. Confira os dados e tente novamente em instantes."),new Error(i)}if(r!=null&&r.error)throw new Error(r.error);return r},R6=()=>{const[e,t]=h.useState([]),[r,n]=h.useState([]),[a,i]=h.useState(!0),[o,l]=h.useState(""),[c,u]=h.useState(null),[d,f]=h.useState(!1),[m,p]=h.useState({email:"",fullName:"",tenantId:"",role:"tenant_admin",password:""}),[b,v]=h.useState(!1),[x,w]=h.useState(null),[g,y]=h.useState(""),j=h.useCallback(async()=>{i(!0);try{const[{users:C},{data:F}]=await Promise.all([Ic({action:"list"}),T.from("tenants").select("id,name").order("name")]);t(C??[]),n(F??[])}catch(C){M.error(C instanceof Error?C.message:"Falha ao carregar usuários")}i(!1)},[]);h.useEffect(()=>{j()},[j]);const _=h.useMemo(()=>{const C=o.trim().toLowerCase();return C?e.filter(F=>[F.full_name,F.email,F.tenant_name].some(D=>D==null?void 0:D.toLowerCase().includes(C))):e},[e,o]),S=_.filter(C=>C.roles.some(F=>
545F!=="candidate")),N=_.filter(C=>!C.roles.some(F=>F!=="candidate")),E=async C=>{if(!C.email)return M.error("Usuário sem e-mail cadastrado.");u(C.id);try{await Ic({action:"send_recovery",email:C.email,redirectTo:`${window.location.origin}/auth`}),M.success("E-mail de recuperação enviado.")}catch(F){M.error(F instanceof Error?F.message:"Falha ao enviar e-mail")}u(null)},R=async()=>{if(x){u(x.id);try{await Ic({action:"set_password",userId:x.id,password:g}),M.success("Senha redefinida."),w(null),y("")}catch(C){M.error(C instanceof Error?C.message:"Falha ao redefinir senha")}u(null)}},I=async()=>{v(!0);try{const C=await Ic({action:"create_tenant_admin",...m});M.success(C.created?"Usuário criado e vinculado ao cliente.":"Papel atribuÃdo ao usuário existente."),f(!1),p({email:"",fullName:"",tenantId:"",role:"tenant_admin",password:""}),j()}catch(C){M.error(C instanceof Error?C.message:"Falha ao criar usuário")}v(!1)},A=({u:C})=>s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b last:border-0 py-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium truncate",children:C.full_name||C.email||C.id.slice(0,8)}),s.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:[C.email??"â",C.tenant_name&&s.jsxs(s.Fragment,{children:[" · ",C.tenant_name]})]}),s.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[C.roles.map(F=>s.jsx(pe,{variant:"secondary",className:"text-[10px]",children:T6[F]??F},F)),!C.confirmed&&s.jsx(pe,{variant:"outline",className:"text-[10px]",children:"e-mail não confirmado"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(P,{variant:"outline",size:"sm",onClick:()=>E(C),disabled:c===C.id,children:[c===C.id?s.jsx(le,{className:"w-4 h-4 animate-spin"}):s.jsx(to,{className:"w-4 h-4"}),s.jsx("span",{className:"hidden sm:inline ml-2",children:"Recuperação"})]}),s.jsxs(P,{variant:"outline",size:"sm",onClick:()=>{w(C),y("")},children:[s.jsx(WT,{className:"w-4 h-4"}),s.jsx("span",{className:"hidden sm:inline ml-2",children:"Nova senha"})]})]})]});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Usuários"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Gestão de acessos de clientes e candidatos."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(P,{variant:"outline",size:"sm",onClick:j,disabled:a,children:s.jsx(rR,{className:`w-4 h-4 ${a?"animate-spin":""}`})}),s.jsxs(Kn,{open:d,onOpenChange:f,children:[s.jsx(FS,{asChild:!0,children:s.jsxs(P,{size:"sm",children:[s.jsx(Qj,{className:"w-4 h-4 mr-2"})," Novo usuário de cliente"]})}),s.jsxs(gn,{children:[s.jsxs(vn,{children:[s.jsx(yn,{children:"Novo acesso de cliente"}),s.jsx(zs,{children:"Cria (ou vincula) um usuário como administrador ou recrutador de um cliente."})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(U,{children:"E-mail"}),s.jsx(q,{type:"email",value:m.email,onChange:C=>p({...m,email:C.target.value})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(U,{children:"Nome completo"}),s.jsx(q,{value:m.fullName,onChange:C=>p({...m,fullName:C.target.value})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(U,{children:"Cliente"}),s.jsxs(gt,{value:m.tenantId,onValueChange:C=>p({...m,tenantId:C}),children:[s.jsx(ut,{children:s.jsx(vt,{placeholder:"Selecione o cliente"})}),s.jsx(dt,{children:r.map(C=>s.jsx(ke,{value:C.id,children:C.name},C.id))})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(U,{children:"Papel"}),s.jsxs(gt,{value:m.role,onValueChange:C=>p({...m,role:C}),children:[s.jsx(ut,{children:s.jsx(vt,{})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"tenant_admin",children:"Admin do cliente"}),s.jsx(ke,{value:"recruiter",children:"Recrutador"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(U,{children:"Senha inicial (opcional)"}),s.jsx(q,{type:"text",value:m.password,onChange:C=>p({...m,password:C.target.value}),placeholder:"mÃnimo 8 caracteres"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Dica: deixe em branco e depois clique em ",s.jsx("strong",{children:"Recuperação"})," â a pessoa recebe um e-mail e cria a própria senha."]})]})]}),s.jsx(xn,{children:s.jsxs(P,{onClick:I,disabled:b||!m.email||!m.tenantId,children:[b&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"})," Salvar"]})})]})]})]})]}),s.jsxs("div",{className:"relative max-w-sm",children:[s.jsx(kr,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(q,{className:"pl-9",placeholder:"Buscar por nome, e-mail ou cliente",value:o,onChange:C=>l(C.target.value)})]}),a?s.jsx("div",{className:"py-20 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):s.jsxs(El,{defaultValue:"staff",children:[s.jsxs(Gi,{children:[s.jsxs(ar,{value:"staff",children:["Usuários de clientes (",S.length,")"]}),s.jsxs(ar,{value:"candidates",children:["Candidatos (",N.length,")"]})]}),s.jsx(Hr,{value:"staff",children:s.jsx(Q,{children:s.jsx(X,{className:"p-4",children:S.length===0?s.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"Nenhum usuário encontrado."}):S.map(C=>s.jsx(A,{u:C},C.id))})})}),s.jsx(Hr,{value:"candidates",children:s.jsx(Q,{children:s.jsx(X,{className:"p-4",children:N.length===0?s.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"Nenhum candidato encontrado."}):N.map(C=>s.jsx(A,{u:C},C.id))})})})]}),s.jsx(Kn,{open:!!x,onOpenChange:C=>!C&&w(null),children:s.jsxs(gn,{children:[s.jsxs(vn,{children:[s.jsx(yn,{children:"Redefinir senha"}),s.jsx(zs,{children:x==null?void 0:x.email})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(U,{children:"Nova senha"}),s.jsx(q,{type:"text",value:g,onChange:C=>y(C.target.value),placeholder:"mÃnimo 8 caracteres"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use pelo menos 8 caracteres. Prefira combinações únicas â senhas muito comuns podem ser recusadas por segurança."})]}),s.jsx(xn,{children:s.jsxs(P,{onClick:R,disabled:g.length<8||c===(x==null?void 0:x.id),children:[c===(x==null?void 0:x.id)&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"})," Salvar senha"]})})]})})]})};var lh="Switch",[A6,qF]=er(lh),[P6,O6]=A6(lh),Sk=h.forwardRef((e,t)=>
545{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[m,p]=h.useState(null),b=Me(t,y=>p(y)),v=h.useRef(!1),x=m?d||!!m.closest("form"):!0,[w,g]=Qr({prop:a,defaultProp:i??!1,onChange:u,caller:lh});return s.jsxs(P6,{scope:r,checked:w,disabled:l,children:[s.jsx(ve.button,{type:"button",role:"switch","aria-checked":w,"aria-required":o,"data-state":Tk(w),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:b,onClick:ge(e.onClick,y=>{g(j=>!j),x&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),x&&s.jsx(Ek,{control:m,bubbles:!v.current,name:n,value:c,checked:w,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});Sk.displayName=lh;var kk="SwitchThumb",Ck=h.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,a=O6(kk,r);return s.jsx(ve.span,{"data-state":Tk(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});Ck.displayName=kk;var I6="SwitchBubbleInput",Ek=h.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...a},i)=>{const o=h.useRef(null),l=Me(o,i),c=lN(r),u=v_(t);return h.useEffect(()=>{const d=o.current;if(!d)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&p){const b=new Event("click",{bubbles:n});p.call(d,r),d.dispatchEvent(b)}},[c,r,n]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:l,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ek.displayName=I6;function Tk(e){return e?"checked":"unchecked"}var Rk=Sk,L6=Ck;const _r=h.forwardRef(({className:e,...t},r)=>s.jsx(Rk,{className:Y("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:s.jsx(L6,{className:Y("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")})}));_r.displayName=Rk.displayName;const R0={key:"",name:"",description:"",price_monthly:0,job_limit:10,user_limit:5,features:"",is_highlighted:!1,is_active:!0,sort_order:0},$6=e=>e.toLocaleString("pt-BR",{style:"currency",currency:"BRL",maximumFractionDigits:0}),D6=()=>{const[e,t]=h.useState([]),[r,n]=h.useState({}),[a,i]=h.useState(!0),[o,l]=h.useState(!1),[c,u]=h.useState(null),[d,f]=h.useState({...R0}),[m,p]=h.useState(!1),[b,v]=h.useState(null),x=async()=>{i(!0);const[_,S]=await Promise.all([T.from("plans").select("*").order("sort_order"),T.from("tenants").select("plan")]);_.error?M.error("Erro ao carregar planos"):t(_.data);const N={};(S.data??[]).forEach(E=>{N[E.plan]=(N[E.plan]??0)+1}),n(N),i(!1)};h.useEffect(()=>{x()},[]);const w=()=>{u(null),f({...R0,sort_order:e.length+1}),l(!0)},g=_=>{u(_),f({key:_.key,name:_.name,description:_.description??"",price_monthly:Number(_.price_monthly),job_limit:_.job_limit,user_limit:_.user_limit,features:(_.features??[]).join(` 546`),is_highlighted:_.is_highlighted,is_active:_.is_active,sort_order:_.sort_order}),l(!0)},y=async _=>{if(_.preventDefault(),!d.key.trim()||!d.name.trim()){M.error("Chave e nome são obrigatórios");return}p(!0);const S={key:d.key.trim().toLowerCase(),name:d.name.trim(),description:d.description||null,price_monthly:Number(d.price_monthly)||0,job_limit:Number(d.job_limit)||0,user_limit:Number(d.user_limit)||0,features:d.features.split(` 547`).map(E=>E.trim()).filter(Boolean),is_highlighted:d.is_highlighted,is_active:d.is_active,sort_order:Number(d.sort_order)||0},{error:N}=c?await T.from("plans").update(S).eq("id",c.id):await T.from("plans").insert(S);if(p(!1),N){M.error(N.message.includes("duplicate")?"Chave de plano já existe":N.message);return}M.success(c?"Plano atualizado":"Plano criado"),l(!1),x()},j=async()=>{if(!b)return;const{error:_}=await T.from("plans").delete().eq("id",b.id);if(_)return M.error(_.message);M.success("Plano removido"),v(null),x()};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Planos"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Catálogo comercial usado na página pública e nos limites de cada cliente."})]}),s.jsxs(P,{onClick:w,children:[s.jsx(mn,{className:"w-4 h-4 mr-2"})," Novo plano"]})]}),s.jsxs(Q,{children:[s.jsx(ye,{className:"pb-3",children:s.jsx(we,{className:"text-base",children:"Catálogo"})}),s.jsx(X,{className:"p-0",children:s.jsxs(xi,{children:[s.jsx(yi,{children:s.jsxs(Nt,{children:[s.jsx(Ke,{children:"Plano"}
547),s.jsx(Ke,{children:"Preço/mês"}),s.jsx(Ke,{children:"Vagas"}),s.jsx(Ke,{children:"Usuários"}),s.jsx(Ke,{children:"Clientes"}),s.jsx(Ke,{children:"Status"}),s.jsx(Ke,{className:"text-right",children:"Ações"})]})}),s.jsxs(wi,{children:[a&&s.jsx(Nt,{children:s.jsx($e,{colSpan:7,className:"text-center py-10",children:s.jsx(le,{className:"w-5 h-5 animate-spin inline text-muted-foreground"})})}),!a&&e.length===0&&s.jsx(Nt,{children:s.jsx($e,{colSpan:7,className:"text-center py-10 text-muted-foreground",children:"Nenhum plano cadastrado."})}),!a&&e.map(_=>s.jsxs(Nt,{children:[s.jsxs($e,{children:[s.jsxs("div",{className:"font-medium flex items-center gap-2",children:[_.name,_.is_highlighted&&s.jsx(lg,{className:"w-3.5 h-3.5 text-primary fill-primary"})]}),s.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:_.key})]}),s.jsx($e,{children:$6(Number(_.price_monthly))}),s.jsx($e,{children:_.job_limit}),s.jsx($e,{children:_.user_limit}),s.jsx($e,{children:r[_.key]??0}),s.jsx($e,{children:s.jsx(pe,{variant:_.is_active?"default":"secondary",children:_.is_active?"Ativo":"Inativo"})}),s.jsxs($e,{className:"text-right",children:[s.jsx(P,{variant:"ghost",size:"icon",onClick:()=>g(_),children:s.jsx(Ml,{className:"w-4 h-4"})}),s.jsx(P,{variant:"ghost",size:"icon",className:"text-destructive hover:text-destructive",onClick:()=>v(_),children:s.jsx(Vn,{className:"w-4 h-4"})})]})]},_.id))]})]})})]}),s.jsx(Kn,{open:o,onOpenChange:l,children:s.jsxs(gn,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(vn,{children:[s.jsx(yn,{children:c?"Editar plano":"Novo plano"}),s.jsx(zs,{children:"Preço, limites e recursos exibidos ao cliente."})]}),s.jsxs("form",{onSubmit:y,className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"plan-name",children:"Nome *"}),s.jsx(q,{id:"plan-name",value:d.name,onChange:_=>f(S=>({...S,name:_.target.value})),required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"plan-key",children:"Chave *"}),s.jsx(q,{id:"plan-key",value:d.key,onChange:_=>f(S=>({...S,key:_.target.value})),placeholder:"ex: pro",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"plan-price",children:"Preço mensal (R$)"}),s.jsx(q,{id:"plan-price",type:"number",min:0,value:d.price_monthly,onChange:_=>f(S=>({...S,price_monthly:Number(_.target.value)}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"plan-order",children:"Ordem de exibição"}),s.jsx(q,{id:"plan-order",type:"number",min:0,value:d.sort_order,onChange:_=>f(S=>({...S,sort_order:Number(_.target.value)}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"plan-jobs",children:"Limite de vagas"}),s.jsx(q,{id:"plan-jobs",type:"number",min:0,value:d.job_limit,onChange:_=>f(S=>({...S,job_limit:Number(_.target.value)}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"plan-users",children:"Limite de usuários"}),s.jsx(q,{id:"plan-users",type:"number",min:0,value:d.user_limit,onChange:_=>f(S=>({...S,user_limit:Number(_.target.value)}))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"plan-desc",children:"Descrição"}),s.jsx(q,{id:"plan-desc",value:d.description,onChange:_=>f(S=>({...S,description:_.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"plan-features",children:"Recursos (um por linha)"}),s.jsx(ct,{id:"plan-features",rows:5,value:d.features,onChange:_=>f(S=>({...S,features:_.target.value}))})]}),s.jsxs("div",{className:"flex flex-wrap gap-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_r,{id:"plan-highlight",checked:d.is_highlighted,onCheckedChange:_=>f(S=>({...S,is_highlighted:_}))}),s.jsx(U,{htmlFor:"plan-highlight",children:"Destacar plano"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_r,{id:"plan-active",checked:d.is_active,onCheckedChange:_=>f(S=>({...S,is_active:_}))}),s.jsx(U,{htmlFor:"plan-active",children:"Ativo"})]})]}),s.jsxs(xn,{children:[s.jsx(P,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancelar"}),s.jsxs(P,{type:"submit",disabled:m,children:[m&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),c?"Salvar alterações":"Criar plano"]})]})]})]})}),s.jsx(cv,{open:!!b,onOpenChange:_=>!_&&v(null),children:s.jsxs(eh,{children:[s.jsxs(th,{children:[s.jsx(nh,{children:"Remover plano?"}),s.jsxs(sh,{children:["O plano ",s.jsx("strong",{children:b==null?void 0:b.name})," deixará de aparecer no catálogo. Clientes já vinculados mantêm seus limites atuais."]})]}),s.jsxs(rh,{children:[s.jsx(ih,{children:"Cancelar"}),s.jsx(ah,{onClick:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remover"})]})]})})]})},ch=(e=!1)=>{const[t,r]=h.useState([]),[n,a]=h.useState(!0),i=h.useCallback(async()=>{a(!0);let o=T.from("talent_areas").select("id,key,name,description,sort_order,is_active").order("sort_order",{ascending:!0}).order("name",{ascending:!0});e||(o=o.eq("is_active",!0));const{data:l}=await o;r(l??[]),a(!1)},[e]);return h.useEffect(()=>{i()},[i]),{areas:t,loading:n,reload:i}},M6=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,""),F6=()=>{const{areas:e,loading:t,reload:r}=ch(!0),[n,a]=h.useState(!1),[i,o]=h.useState(null),[l,c]=h.useState(""),[u,d]=h.useState(""),[f,m]=h.useState("0"),[p,b]=h.useState(!1),v=()=>{var j;o(null),c(""),d(""),m(String((((j=e[e.length-1])==null?void 0:j.sort_order)??0)+10)),a(!0)},x=j=>{o(j),c(j.name),d(j.description??""),m(String(j.sort_order)),a(!0)},w=async()=>
547{if(!l.trim())return M.error("Informe o nome da área.");b(!0);const j={name:l.trim(),description:u.trim()||null,sort_order:Number(f)||0},{error:_}=i?await T.from("talent_areas").update(j).eq("id",i.id):await T.from("talent_areas").insert({...j,key:M6(l)});if(b(!1),_)return M.error(_.message);M.success(i?"Ãrea atualizada.":"Ãrea criada."),a(!1),r()},g=async j=>{const{error:_}=await T.from("talent_areas").update({is_active:!j.is_active}).eq("id",j.id);if(_)return M.error(_.message);r()},y=async j=>{const{error:_}=await T.from("talent_areas").delete().eq("id",j.id);if(_)return M.error(_.message);M.success("Ãrea removida."),r()};return s.jsxs("div",{className:"space-y-6 max-w-4xl",children:[s.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Ãreas de atuação"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Lista global usada para classificar currÃculos no banco de talentos e no marketplace. Somente o super admin pode alterar."})]}),s.jsxs(Kn,{open:n,onOpenChange:a,children:[s.jsx(FS,{asChild:!0,children:s.jsxs(P,{onClick:v,children:[s.jsx(mn,{className:"w-4 h-4 mr-2"})," Nova área"]})}),s.jsxs(gn,{children:[s.jsx(vn,{children:s.jsx(yn,{children:i?"Editar área":"Nova área de atuação"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Nome"}),s.jsx(q,{value:l,onChange:j=>c(j.target.value),placeholder:"Ex.: Fiscal e Contábil"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Descrição (opcional)"}),s.jsx(q,{value:u,onChange:j=>d(j.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Ordem de exibição"}),s.jsx(q,{type:"number",value:f,onChange:j=>m(j.target.value)})]})]}),s.jsxs(xn,{children:[s.jsx(P,{variant:"outline",onClick:()=>a(!1),children:"Cancelar"}),s.jsxs(P,{onClick:w,disabled:p,children:[p&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"})," Salvar"]})]})]})]})]}),s.jsxs(Q,{children:[s.jsx(ye,{children:s.jsxs(we,{className:"text-base flex items-center gap-2",children:[s.jsx(ag,{className:"w-4 h-4 text-primary"})," ",e.length," área(s) cadastrada(s)"]})}),s.jsx(X,{className:"space-y-1",children:t?s.jsx(le,{className:"w-5 h-5 animate-spin text-primary"}):e.map(j=>s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b last:border-0 py-2.5",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-medium",children:j.name}),s.jsx(pe,{variant:"outline",className:"text-[10px]",children:j.key}),!j.is_active&&s.jsx(pe,{variant:"secondary",children:"inativa"})]}),j.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:j.description})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_r,{checked:j.is_active,onCheckedChange:()=>g(j)}),s.jsx(P,{variant:"ghost",size:"icon",onClick:()=>x(j),children:s.jsx(Ml,{className:"w-4 h-4"})}),s.jsx(P,{variant:"ghost",size:"icon",onClick:()=>y(j),children:s.jsx(Vn,{className:"w-4 h-4 text-destructive"})})]})]},j.id))})]})]})},Ys=e=>e.toLocaleString("pt-BR",{style:"currency",currency:"BRL",maximumFractionDigits:0}),z6=()=>{const[e,t]=h.useState([]),[r,n]=h.useState([]),[a,i]=h.useState(!0);h.useEffect(()=>{(async()=>{const[{data:b},{data:v}]=await Promise.all([T.from("tenants").select("id,name,plan,status,is_active,trial_ends_at,created_at").order("created_at",{ascending:!1}),T.from("plans").select("key,name,price_monthly")]);t(b??[]),n(v??[]),i(!1)})()},[]);const o=b=>{var v;return((v=r.find(x=>x.key===b))==null?void 0:v.price_monthly)??0},l=e.filter(b=>b.is_active&&b.status==="active"),c=l.reduce((b,v)=>b+Number(o(v.plan)),0),d=e.filter(b=>b.status==="trial").reduce((b,v)=>b+Number(o(v.plan)),0),f=l.length?c/l.length:0,m=r.map(b=>{const v=l.filter(x=>x.plan===b.key);return{...b,count:v.length,revenue:v.length*Number(b.price_monthly)}}).sort((b,v)=>v.revenue-b.revenue),p=[{label:"MRR",value:Ys(c),icon:hR,tone:"text-primary"},{label:"ARR estimado",value:Ys(c*12),icon:cR,tone:"text-green-600"},{label:"Ticket médio",value:Ys(f),icon:At,tone:"text-foreground"},{label:"Potencial em trial",value:Ys(d),icon:Vj,tone:"text-amber-600"}];return a?s.jsx("div",{className:"flex justify-center py-20",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):s.jsxs("div",{className:"space-y-6 max-w-6xl",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Financeiro"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Receita recorrente da plataforma com base nos planos ativos."})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:p.map(b=>s.jsxs(Q,{children:[s.jsxs(ye,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(we,{className:"text-sm font-medium text-muted-foreground",children:b.label}),s.jsx(b.icon,{className:`w-4 h-4 ${b.tone}`})]}),s.jsx(X,{children:s.jsx("div",{className:"text-2xl font-bold",children:b.value})})]},b.label))}),s.jsxs(Q,{children:[s.jsx(ye,{children:s.jsx(we,{className:"text-base",children:"Receita por plano"})}),s.jsxs(X,{className:"space-y-3",children:[m.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum plano cadastrado."}),m.map(b=>s.jsxs("div",{className:"flex items-center justify-between gap-4 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-medium",children:b.name}),s.jsxs(pe,{variant:"outline",children:[b.count," cliente(s)"]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("div",{className:"font-semibold",children:Ys(b.revenue)}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[Ys(Number(b.price_monthly)),"/mês"]})]})]},b.key))]})]}),s.jsxs(Q,{children:[s.jsx(ye,{children:s.jsx(we,{className:"text-base",children:"Faturamento por cliente"})}),s.jsxs(X,{className:"space-y-2",children:[e.map(b=>{const v=Number(o(b.plan)),x=b.is_active&&b.status==="active";return s.jsxs("div",{className:"flex items-center justify-between gap-3 border-b last:border-0 py-2 text-sm",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium truncate",children:b.name}),s.jsxs("div",{className:"text-xs text-muted-foreground capitalize",children:[b.plan," · ",b.status]})]}),s.jsx("div",{className:x?"font-semibold":"text-muted-foreground",children:x?`${Ys(v)}/mês`:"não faturado"})]},b.id)}),e.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum cliente cadastrado."})]})]})]})},U6=()=>{const[e,t]=h.useState([]),[r,n]=h.useState(""),[a,i]=h.useState(!0);h.useEffect(()=>{(async()=>{const{data:c}=await T.from("tenants").select("id,name,slug,status,plan,contact_name,contact_email,contact_phone,is_active").order("name");t(c??[]),i(!1)})()},[]);const o=h.useMemo(()=>{const c=r.trim().toLowerCase();return c?e.filter(u=>[u.name,u.slug,u.contact_name,u.contact_email].some(d=>d==null?void 0:d.toLowerCase().includes(c))):e},[e,r]),l=e.filter(c=>!c.is_active||c.status==="suspended");return s.jsxs("div",{className:"space-y-6 max-w-5xl",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Suporte"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Central de atendimento aos clientes: contatos, status da conta e acesso rápido à inspeção."})]}),l.length>0&&s.jsx(Q,{className:"border-amber-500/40",children:s.jsxs(X,{className:"p-4 flex items-start gap-3",children:[s.jsx(Kj,{className:"w-4 h-4 text-amber-600 mt-0.5"}),s.jsxs("div",{className:"text-sm",children:[s.jsxs("p",{className:"font-medium",children:[l.length," cliente(s) precisam de atenção"]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[l.map(c=>c.name).join(", ")," estão suspensos ou inativos."]})]})]})}),s.jsx(q,{placeholder:"Buscar por empresa, slug ou contato...",value:r,onChange:c=>n(c.target.value)}),a?s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):s.jsxs("div",{className:"grid gap-3",children:[o.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum cliente encontrado."}),o.map(c=>s.jsx(Q,{children:s.jsxs(X,{className:"p-4 flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-semibold",children:c.name}),s.jsx(pe,{variant:c.is_active&&c.status==="active"?"default":"outline",children:c.status}),s.jsx(pe,{variant:"outline",className:"capitalize",children:c.plan})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[c.contact_name??"Sem responsável"," · ",c.contact_email??"sem e-mail"," · ",c.contact_phone??"sem telefone"]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.contact_email&&s.jsx(P,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs("a",{href:`mailto:${c.contact_email}?subject=Suporte Orange RH - ${encodeURIComponent(c.name)}`,children:[s.jsx(to,{className:"w-4 h-4 mr-2"})," E-mail"]})}),c.contact_phone&&s.jsx(P,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs("a",{href:`https://wa.me/${c.contact_phone.replace(/\D/g,"")}`,target:"_blank",rel:"noreferrer",children:[s.jsx(Fl,{className:"w-4 h-4 mr-2"})," WhatsApp"]})}),s.jsx(P,{size:"sm",variant:"ghost",asChild:!0,children:s.jsxs(me,{to:`/admin/clientes/${c.id}`,children:[s.jsx(ng,{className:"w-4 h-4 mr-2"})," Inspecionar"]})})]})]})},c.id))]})]})},Lc={tenant:{label:"Cliente",icon:At},lead:{label:"Solicitação",icon:Wj},job:{label:"Vaga",icon:Mt},application:{label:"Candidatura",icon:Qj}},B6=e=>
547new Date(e).toLocaleString("pt-BR",{dateStyle:"short",timeStyle:"short"}),V6=()=>{const[e,t]=h.useState([]),[r,n]=h.useState("all"),[a,i]=h.useState(!0);h.useEffect(()=>{(async()=>{const[l,c,u,d]=await Promise.all([T.from("tenants").select("id,name,plan,status,created_at").order("created_at",{ascending:!1}).limit(50),T.from("onboarding_leads").select("id,company_name,status,contact_email,created_at").order("created_at",{ascending:!1}).limit(50),T.from("jobs").select("id,title,status,created_at").order("created_at",{ascending:!1}).limit(50),T.from("job_applications").select("id,status,created_at,job_id").order("created_at",{ascending:!1}).limit(50)]),f=[...(l.data??[]).map(m=>({id:`t-${m.id}`,kind:"tenant",title:m.name,detail:`Plano ${m.plan} · ${m.status}`,at:m.created_at})),...(c.data??[]).map(m=>({id:`l-${m.id}`,kind:"lead",title:m.company_name,detail:`${m.contact_email} · ${m.status}`,at:m.created_at})),...(u.data??[]).map(m=>({id:`j-${m.id}`,kind:"job",title:m.title,detail:`Status ${m.status}`,at:m.created_at})),...(d.data??[]).map(m=>({id:`a-${m.id}`,kind:"application",title:"Nova candidatura",detail:`Status ${m.status}`,at:m.created_at}))].sort((m,p)=>+new Date(p.at)-+new Date(m.at));t(f),i(!1)})()},[]);const o=r==="all"?e:e.filter(l=>l.kind===r);return s.jsxs("div",{className:"space-y-6 max-w-5xl",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Logs de atividade"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Eventos recentes da plataforma em todos os clientes."})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(P,{size:"sm",variant:r==="all"?"default":"outline",onClick:()=>n("all"),children:"Tudo"}
547),Object.keys(Lc).map(l=>s.jsx(P,{size:"sm",variant:r===l?"default":"outline",onClick:()=>n(l),children:Lc[l].label},l))]}),a?s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):s.jsx(Q,{children:s.jsxs(X,{className:"p-0 divide-y",children:[o.length===0&&s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Nenhum evento registrado."}),o.slice(0,120).map(l=>{const c=Lc[l.kind].icon;return s.jsxs("div",{className:"flex items-start gap-3 p-4",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:s.jsx(c,{className:"w-4 h-4 text-primary"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-medium text-sm",children:l.title}),s.jsx(pe,{variant:"outline",className:"text-[10px]",children:Lc[l.kind].label})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:l.detail})]}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:B6(l.at)})]},l.id)})]})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Precisa de detalhes de um cliente? Acesse ",s.jsx(me,{className:"underline",to:"/admin/clientes",children:"Clientes"}),"."]})]})},q6=()=>{const[e,t]=h.useState(null);return h.useEffect(()=>{(async()=>{const[{error:r,count:n},{data:a}]=await Promise.all([T.from("tenants").select("id",{count:"exact",head:!0}),T.auth.getSession()]);let i=null,o="Não verificado";try{const{error:l}=await T.functions.invoke("match-resume",{body:{}});i=!0,o="Função publicada e respondendo"}catch{i=!1,o="Função indisponÃvel"}t([{name:"Banco de dados",description:"Postgres multi-tenant com RLS por tenant_id.",icon:zT,ok:!r,info:r?r.message:`${n??0} cliente(s) registrados`},{name:"Autenticação",description:"Login por e-mail/senha e Google para Orange ID.",icon:ro,ok:!0,info:a.session?"Sessão ativa neste navegador":"Serviço ativo"},{name:"IA de match",description:"Análise de currÃculo e respostas versus requisitos da vaga.",icon:Ft,ok:i,info:o},{name:"Armazenamento",description:"Fotos de candidatos e logos dos clientes.",icon:qT,ok:!0,info:"Bucket candidate-photos configurado"}])})()},[]),e?s.jsxs("div",{className:"space-y-6 max-w-4xl",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Integrações"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Status dos serviços que sustentam a plataforma."})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:e.map(r=>s.jsxs(Q,{children:[s.jsxs(ye,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsxs(we,{className:"text-base flex items-center gap-2",children:[s.jsx(r.icon,{className:"w-4 h-4 text-primary"})," ",r.name]}),s.jsx(pe,{variant:r.ok?"default":"destructive",children:r.ok?"Operacional":"Falha"})]}),s.jsxs(X,{className:"space-y-1",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),s.jsx("p",{className:"text-xs",children:r.info})]})]},r.name))}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Novas integrações (SMTP próprio, WhatsApp e agenda) entram no roadmap de polimento."})]}):s.jsx("div",{className:"flex justify-center py-20",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})})},H6=()=>{const{user:e}=it(),[t,r]=h.useState([]),[n,a]=h.useState(!0),[i,o]=h.useState(!1),l=h.useCallback(async()=>{a(!0);const{data:u}=await T.from("user_roles").select("user_id").eq("role","super_admin"),d=[...new Set((u??[]).map(m=>m.user_id))];let f=[];if(d.length){const{data:m}=await T.from("profiles").select("id,full_name,email").in("id",d);f=m??[]}r(d.map(m=>{const p=f.find(b=>b.id===m);return{user_id:m,name:(p==null?void 0:p.full_name)||(p==null?void 0:p.email)||m.slice(0,8),email:(p==null?void 0:p.email)??null}})),a(!1)},[]);h.useEffect(()=>{l()},[l]);const c=async()=>{o(!0);const{data:u,error:d}=await T.rpc("claim_super_admin");if(o(!1),d)return M.error(d.message);M[u?"success":"info"](u?"Você agora é super administrador.":"Já existe um super administrador nesta plataforma."),l()};return s.jsxs("div",{className:"space-y-6 max-w-3xl",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Configurações"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Identidade da plataforma e controle de acesso global."})]}),s.jsxs(Q,{children:[s.jsx(ye,{children:s.jsxs(we,{className:"text-base flex items-center gap-2",children:[s.jsx(ro,{className:"w-4 h-4 text-primary"})," Super administradores"]})}),s.jsxs(X,{className:"space-y-3",children:[n?s.jsx(le,{className:"w-5 h-5 animate-spin text-primary"}):t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum super administrador definido ainda."}):t.map(u=>s.jsxs("div",{className:"flex items-center justify-between border-b last:border-0 py-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:u.name}),s.jsx("div",{className:"text-xs text-muted-foreground",children:u.email??"â"})]}),u.user_id===(e==null?void 0:e.id)&&s.jsx(pe,{variant:"outline",children:"você"})]},u.user_id)),!n&&t.length===0&&s.jsxs(s.Fragment,{children:[s.jsxs(P,{variant:"outline",size:"sm",onClick:c,disabled:i,children:[i?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(dR,{className:"w-4 h-4 mr-2"}),"Reivindicar super admin"]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"DisponÃvel apenas enquanto não houver nenhum super administrador. Novos administradores são atribuÃdos diretamente no cadastro do cliente."})]})]})]}),s.jsxs(Q,{children:[s.jsx(ye,{children:s.jsx(we,{className:"text-base",children:"Identidade da plataforma"})}),s.jsxs(X,{className:"text-sm space-y-2",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Nome"}),s.jsx("span",{children:"Orange RH"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"DomÃnio"}),s.jsx("span",{children:"www.orangerh.com.br"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Modelo"}),s.jsx("span",{children:"SaaS White Label multi-tenant"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Isolamento"}),s.jsx("span",{children:"RLS por tenant_id"})]})]})]})]})};function W6(){var n;const e=A1(),{user:t}
547=it(),r=(n=e==null?void 0:e.tenant)==null?void 0:n.id;h.useEffect(()=>{if(!r||!t)return;const a=`tc:${r}:${t.id}`;sessionStorage.getItem(a)||(sessionStorage.setItem(a,"1"),T.from("tenant_candidates").upsert({tenant_id:r,candidate_id:t.id,source:"signup"},{onConflict:"tenant_id,candidate_id",ignoreDuplicates:!0}).then(()=>{}))},[r,t])}const Ak=()=>{const e=`${Ct()}/minha-area`,[t,r]=h.useState(!1);W6();const n=[{to:e,label:"Visão geral",icon:wd,end:!0},{to:`${e}/vagas`,label:"Buscar vagas",icon:kr},{to:`${e}/recomendacoes`,label:"Recomendadas por IA",icon:Ft},{to:`${e}/candidaturas`,label:"Minhas candidaturas",icon:eo},{to:`${e}/perfil`,label:"Meu currÃculo",icon:Zj}],a=s.jsx("nav",{className:"flex flex-col gap-1",children:n.map(i=>s.jsxs(Bl,{to:i.to,end:i.end,onClick:()=>r(!1),className:({isActive:o})=>`flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${o?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[s.jsx(i.icon,{className:"w-4 h-4 shrink-0"}),i.label]},i.to))});return s.jsxs("div",{className:"container mx-auto px-4 py-8",children:[s.jsxs("div",{className:"lg:hidden mb-4",children:[s.jsxs(P,{variant:"outline",size:"sm",onClick:()=>r(i=>!i),children:[s.jsx(ZT,{className:"w-4 h-4 mr-2"})," Menu do candidato"]}),t&&s.jsx("div",{className:"mt-3 rounded-xl border bg-card p-2",children:a})]}),s.jsxs("div",{className:"grid gap-8 lg:grid-cols-[240px_1fr]",children:[s.jsxs("aside",{className:"hidden lg:block lg:sticky lg:top-24 h-max rounded-xl border bg-card p-3",children:[s.jsx("p",{className:"px-3 pb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Minha área"}),a]}),s.jsx("div",{className:"min-w-0",children:s.jsx(Od,{})})]})]})},Pk={home_badge:"",home_headline:"",home_subheadline:"",home_highlights:[],about_title:"",about_body:"",about_services:[],media:[]};function K6(e){return{home_badge:(e==null?void 0:e.home_badge)??"",home_headline:(e==null?void 0:e.home_headline)??"",home_subheadline:(e==null?void 0:e.home_subheadline)??"",home_highlights:Array.isArray(e==null?void 0:e.home_highlights)?e.home_highlights:[],about_title:(e==null?void 0:e.about_title)??"",about_body:(e==null?void 0:e.about_body)??"",about_services:Array.isArray(e==null?void 0:e.about_services)?e.about_services:[],media:Array.isArray(e==null?void 0:e.media)?e.media:[]}}function Ok(e){const[t,r]=h.useState(null),[n,a]=h.useState(!0);return h.useEffect(()=>{if(!e){r(null),a(!1);return}let i=!0;return a(!0),T.from("tenant_pages").select("*").eq("tenant_id",e).maybeSingle().then(({data:o})=>{i&&(r(o?K6(o):Pk),a(!1))}),()=>{i=!1}},[e]),{pages:t,loading:n}}const tp=()=>{var o,l,c,u;const{tenant:e}=xt(),t=Ct(),{pages:r}=Ok(e==null?void 0:e.id),[n,a]=h.useState(null);if(h.useEffect(()=>{e&&T.from("jobs").select("id",{count:"exact",head:!0}).eq("tenant_id",e.id).eq("status","published").then(({count:d})=>a(d??0))},[e]),!e)return null;const i=e.tenant_type==="agency";return s.jsxs("div",{children:[s.jsx("section",{className:"gradient-subtle border-b border-border",children:s.jsxs("div",{className:"container mx-auto px-4 py-20 md:py-28 max-w-4xl text-center",children:[s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full bg-primary/10 text-primary px-3 py-1 text-xs font-semibold mb-6",children:[s.jsx(og,{className:"w-3.5 h-3.5"})," ",((o=r==null?void 0:r.home_badge)==null?void 0:o.trim())||(i?"Recrutamento e seleção":"Trabalhe conosco")]}),s.jsx("h1",{className:"text-4xl md:text-6xl font-extrabold tracking-tight mb-5",children:(l=r==null?void 0:r.home_headline)!=null&&l.trim()?r.home_headline:s.jsx(s.Fragment,{children:i?s.jsxs(s.Fragment,{children:["Encontre sua próxima oportunidade com a ",s.jsx("span",{className:"text-primary",children:e.name})]}):s.jsxs(s.Fragment,{children:["Construa o futuro com a ",s.jsx("span",{className:"text-primary",children:e.name})]})})}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto mb-8",children:(c=r==null?void 0:r.home_subheadline)!=null&&c.trim()?r.home_subheadline:i?"Recrutamos e selecionamos profissionais para empresas de diversos setores. Explore as vagas que conduzimos e candidate-se em poucos minutos.":"Encontre op
547ortunidades que combinam com você. Explore nossas vagas abertas e faça parte do nosso time."}),s.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[s.jsx(P,{asChild:!0,size:"lg",children:s.jsxs(me,{to:`${t}/vagas`,children:["Ver ",n??"todas as"," vagas abertas ",s.jsx(Mn,{className:"w-4 h-4 ml-2"})]})}),s.jsx(P,{asChild:!0,size:"lg",variant:"outline",children:s.jsx(me,{to:i?`${t}/empresas`:`${t}/sobre`,children:i?"Empresas que atendemos":"Sobre a empresa"})})]})]})}),s.jsx("section",{className:"container mx-auto px-4 py-16 grid gap-6 md:grid-cols-3",children:((u=r==null?void 0:r.home_highlights)!=null&&u.length?r.home_highlights.map(d=>({icon:Mt,title:d.title,desc:d.desc})):i?[{icon:Mt,title:"Vagas de várias empresas",desc:"Um só cadastro para concorrer a todos os processos que conduzimos."},{icon:ur,title:"Especialistas em pessoas",desc:"Triagem cuidadosa e feedback ao longo do processo."},{icon:Fx,title:"Sigilo quando necessário",desc:"Alguns processos preservam o nome da empresa contratante."}]:[{icon:Mt,title:"Oportunidades reais",desc:"Vagas atualizadas com processo transparente."},{icon:ur,title:"Time diverso",desc:"Um ambiente inclusivo, colaborativo e humano."},{icon:Fx,title:"Cuidado com pessoas",desc:"BenefÃcios e desenvolvimento contÃnuo."}]).map(({icon:d,title:f,desc:m})=>s.jsx(Q,{className:"shadow-card",children:s.jsxs(X,{className:"p-6",children:[s.jsx("div",{className:"w-11 h-11 rounded-xl bg-primary/10 text-primary flex items-center justify-center mb-4",children:s.jsx(d,{className:"w-5 h-5"})}),s.jsx("h3",{className:"font-semibold text-lg mb-1",children:f}),s.jsx("p",{className:"text-sm text-muted-foreground",children:m})]})},f))})]})},Ql=e=>{const[t,r]=h.useState([]),[n,a]=h.useState(!0);return h.useEffect(()=>{if(!e){r([]),a(!1);return}a(!0),T.rpc("get_public_companies",{_agency_id:e}).then(({data:i})=>{r(i??[]),a(!1)})},[e]),{companies:t,loading:n}},G6={clt:"CLT",pj:"PJ",freelance:"Freela",estagio:"Estágio",temporario:"Temporário",trainee:"Trainee"},Ik=()=>{const{tenant:e}=xt(),t=Ct(),r=(e==null?void 0:e.tenant_type)==="agency",{companies:n}=Ql(r?e==null?void 0:e.id:null),[a,i]=h.useState([]),[o,l]=h.useState(!0),[c,u]=h.useState(""),d=m=>r&&m.company_tenant_id&&m.disclose_company?n.find(p=>p.id===m.company_tenant_id)??null:null;h.useEffect(()=>{e&&(l(!0),T.from("jobs").select("id,title,slug,department,location,is_remote,employment_type,published_at,company_tenant_id,disclose_company").eq("tenant_id",e.id).eq("status","published").order("published_at",{ascending:!1,nullsFirst:!1}).then(({data:m})=>{i(m??[]),l(!1)}))},[e]);const f=h.useMemo(()=>{const m=c.trim().toLowerCase();return m?a.filter(p=>[p.title,p.department,p.location].filter(Boolean).some(b=>b.toLowerCase().includes(m))):a},[c,a]);return s.jsxs("div",{className:"container mx-auto px-4 py-12 max-w-5xl",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-3xl md:text-4xl font-extrabold mb-2",children:"Vagas abertas"}),s.jsx("p",{className:"text-muted-foreground",children:r?"Oportunidades que recrutamos para as empresas que atendemos.":"Encontre a oportunidade certa para você."})]}),s.jsxs("div",{className:"relative mb-8 max-w-lg",children:[s.jsx(kr,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(q,{placeholder:"Buscar por cargo, área ou localidade",value:c,onChange:m=>u(m.target.value),className:"pl-9"})]}),o?s.jsx("div",{className:"py-20 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):f.length===0?s.jsx(Q,{children:s.jsx(X,{className:"py-16 text-center text-muted-foreground",children:"Nenhuma vaga aberta no momento."})}):s.jsx("div",{className:"grid gap-4",children:f.map(m=>{const p=d(m),b=(p==null?void 0:p.logo_url)??(r?null:(e==null?void 0:e.logo_url)??null);return s.jsx(me,{to:`${t}/vagas/${m.slug}`,className:"group",children:s.jsx(Q,{className:"shadow-card hover:shadow-card-hover transition-shadow",children:s.jsxs(X,{className:"p-5 flex items-center gap-5",children:[s.jsx("div",{className:"hidden sm:flex w-11 h-11 rounded-xl bg-primary/10 text-primary items-center justify-center flex-shrink-0 overflow-hidden",children:b?s.jsx("img",{src:b,alt:`Logo ${(p==null?void 0:p.name)??(e==null?void 0:e.name)??""}`,className:"w-full h-full object-contain bg-background"}):s.jsx(Mt,{className:"w-5 h-5"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-semibold text-lg group-hover:text-primary transition-colors",children:m.title}),s.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground mt-1",children:[r&&s.jsx("span",{className:"font-medium text-foreground
547/80",children:p?p.name:m.company_tenant_id&&m.disclose_company?"Empresa cliente":"Empresa confidencial"}),m.department&&s.jsx("span",{children:m.department}),(m.location||m.is_remote)&&s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(Ra,{className:"w-3.5 h-3.5"}),m.is_remote?"Remoto":m.location]}),s.jsx(pe,{variant:"secondary",className:"text-xs",children:G6[m.employment_type]||m.employment_type})]})]}),s.jsx(Mn,{className:"w-5 h-5 text-muted-foreground group-hover:text-primary group-hover:translate-x-1 transition-all flex-shrink-0"})]})})},m.id)})})]})},Lk=()=>{const{tenant:e}=xt(),t=Ct(),{jobSlug:r}=Aa(),n=(e==null?void 0:e.tenant_type)==="agency",{companies:a}=Ql(n?e==null?void 0:e.id:null),[i,o]=h.useState(null),[l,c]=h.useState(!0);if(h.useEffect(()=>{!e||!r||T.from("jobs").select("*").eq("tenant_id",e.id).eq("slug",r).eq("status","published").maybeSingle().then(({data:f})=>{o(f),c(!1)})},[e,r]),l)return s.jsx("div",{className:"py-24 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})});if(!i)return s.jsxs("div",{className:"container mx-auto px-4 py-20 text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Vaga não encontrada"}),s.jsx(P,{asChild:!0,variant:"outline",className:"mt-4",children:s.jsx(me,{to:`${t}/vagas`,children:"Ver outras vagas"})})]});const u=i.show_salary&&(i.salary_min||i.salary_max)?`${i.salary_currency} ${i.salary_min??""}${i.salary_max?" â "+i.salary_max:""}`:null,d=i.company_tenant_id&&i.disclose_company?a.find(f=>f.id===i.company_tenant_id):null;return s.jsxs("div",{className:"container mx-auto px-4 py-12 max-w-3xl",children:[s.jsxs(me,{to:`${t}/vagas`,className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-6",children:[s.jsx(Mi,{className:"w-4 h-4"})," Voltar para vagas"]}),s.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[((d==null?void 0:d.logo_url)||!n&&(e==null?void 0:e.logo_url))&&s.jsx("div",{className:"w-14 h-14 rounded-2xl border bg-background flex items-center justify-center overflow-hidden shrink-0",children:s.jsx("img",{src:(d==null?void 0:d.logo_url)??(e==null?void 0:e.logo_url),alt:`Logo ${(d==null?void 0:d.name)??(e==null?void 0:e.name)??""}`,className:"w-full h-full object-contain"})}),s.jsx("h1",{className:"text-3xl md:text-4xl font-extrabold",children:i.title})]}),n&&s.jsxs("p",{className:"text-sm text-muted-foreground mb-4 flex items-center gap-1.5",children:[s.jsx(At,{className:"w-4 h-4"}),d?s.jsxs(s.Fragment,{children:["Vaga para"," ",s.jsx(me,{to:`${t}/empresas/${d.slug}`,className:"text-primary font-medium hover:underline",children:d.name})]}):"Processo conduzido por nós para uma empresa confidencial."]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-8",children:[i.department&&s.jsxs(pe,{variant:"secondary",children:[s.jsx(Mt,{className:"w-3 h-3 mr-1"}),i.department]}),(i.location||i.is_remote)&&s.jsxs(pe,{variant:"secondary",children:[s.jsx(Ra,{className:"w-3 h-3 mr-1"}),i.is_remote?"Remoto":i.location]}),u&&s.jsxs(pe,{variant:"secondary",children:[s.jsx(UT,{className:"w-3 h-3 mr-1"}),u]})]}),s.jsx(Q,{children:s.jsxs(X,{className:"p-8 space-y-8 whitespace-pre-wrap",children:[i.description&&s.jsxs("section",{children:[s.jsx("h2",{className:"text-lg font-bold mb-2",children:"Sobre a vaga"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed",children:i.description})]}),i.requirements&&s.jsxs("section",{children:[s.jsx("h2",{className:"text-lg font-bold mb-2",children:"Requisitos"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed",children:i.requirements})]}),i.benefits&&s.jsxs("section",{children:[s.jsx("h2",{className:"text-lg font-bold mb-2",children:"BenefÃcios"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed",children:i.benefits})]})]})}),s.jsx("div",{className:"mt-8 flex justify-center",children:s.jsx(P,{asChild:!0,size:"lg",children:s.jsx(me,{to:`${t}/vagas/${i.slug}/aplicar`,children:"Candidatar-se agora"})})})]})},$k=()=>{const{tenant:e}=xt(),{user:t}=it(),{jobSlug:r}=Aa(),n=Ct(),a=pr(),[i,o]=h.useState(null),[l,c]=h.useState(null),[u,d]=h.useState(!0),[f,m]=h.useState(!1),[p,b]=h.useState(""),[v,x]=h.useState([]),[w,g]=h.useState({}),y=`${n}/vagas/${r}/aplicar`;h.useEffect(()=>{!e||!r||(async()=>{d(!0);const{data:_}=await T.from("jobs").select("id,title").eq("tenant_id",e.id).eq("slug",r).eq("status","published").maybeSingle();if(o(_),_!=null&&_.id){const{data:S}=await T.from("job_questions").select("*").eq("job_id",_.id).order("sort_order"),N=S??[];x(N),g(E=>{const R={...E};
547return N.forEach(I=>{I.field_type==="boolean"&&R[I.id]===void 0&&(R[I.id]="Não")}),R})}else x([]);if(t){const{data:S}=await T.from("candidate_resumes").select("*").eq("user_id",t.id).maybeSingle();c(S??null)}d(!1)})()},[e,r,t]);const j=async _=>{if(_.preventDefault(),!t){a(`${n}/auth?next=${encodeURIComponent(y)}`);return}if(!i||!e)return;if(!(l!=null&&l.is_complete)){a(`${n}/curriculo?next=${encodeURIComponent(y)}`);return}const S=v.find(I=>I.is_required&&!(w[I.id]??"").trim());if(S){M.error(`Responda: ${S.label}`);return}const N=Object.fromEntries(v.filter(I=>(w[I.id]??"").trim()).map(I=>[I.id,{label:I.label,type:I.field_type,value:w[I.id]}]));m(!0);const{data:E,error:R}=await T.from("job_applications").insert({tenant_id:e.id,job_id:i.id,candidate_id:t.id,cover_letter:p||null,resume_url:l.portfolio_url||l.linkedin_url||null,resume_snapshot:l,custom_answers:N}).select("id").maybeSingle();if(R){m(!1),R.code==="23505"?M.error("Você já se candidatou a esta vaga."):M.error(R.message);return}if(E!=null&&E.id){const{error:I}=await T.functions.invoke("match-resume",{body:{application_id:E.id}});I&&console.warn("Falha ao calcular match",I)}m(!1),M.success("Candidatura enviada com sucesso!"),a(`${n}/vagas/${r}`)};return u?s.jsx("div",{className:"py-24 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):i?s.jsx("div",{className:"container mx-auto px-4 py-12 max-w-2xl",children:s.jsxs(Q,{children:[s.jsxs(ye,{children:[s.jsxs(we,{children:["Candidatar-se a: ",i.title]}),s.jsx(bt,{children:t?l!=null&&l.is_complete?"Seu currÃculo será enviado junto com a candidatura e analisado automaticamente.":"Antes de continuar, monte seu currÃculo em uma conversa rápida de poucos minutos.":s.jsxs(s.Fragment,{children:["à necessário"," ",s.jsx(me,{to:`${n}/auth?next=${encodeURIComponent(y)}`,className:"text-primary underline",children:"entrar ou criar uma conta"})," ","para se candidatar."]})})]}),s.jsxs(X,{className:"space-y-5",children:[t&&!(l!=null&&l.is_complete)&&s.jsxs("div",{className:"rounded-lg border bg-muted/40 p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(mm,{className:"w-4 h-4 text-primary"})," CurrÃculo por conversa"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Responda perguntas simples em formato de chat e nós montamos seu currÃculo com foto, experiências, competências e redes sociais."}),s.jsx(P,{asChild:!0,children:s.jsx(me,{to:`${n}/curriculo?next=${encodeURIComponent(y)}`,children:"Preencher currÃculo"})})]}),t&&(l==null?void 0:l.is_complete)&&s.jsxs("div",{className:"rounded-lg border p-4 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[s.jsx(wn,{className:"w-4 h-4"})," CurrÃculo pronto"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:l.headline??"Perfil completo"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:l.skills.slice(0,8).map(_=>s.jsx(pe,{variant:"secondary",children:_},_))}),s.jsx(P,{asChild:!0,variant:"ghost",size:"sm",className:"px-0",children:s.jsx(me,{to:`${n}/curriculo?next=${encodeURIComponent(y)}`,children:"Atualizar currÃculo"})})]}),s.jsxs("form",{onSubmit:j,className:"space-y-4",children:[t&&(l==null?void 0:l.is_complete)&&v.length>0&&s.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm font-medium",children:["Perguntas da ",e==null?void 0:e.name]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Estas respostas valem apenas para esta candidatura."})]}),v.map(_=>s.jsxs("div",{className:"space-y-2",children:[s.jsxs(U,{htmlFor:`q-${_.id}`,children:[_.label,_.is_required&&s.jsx("span",{className:"text-destructive",children:" *"})]}),_.field_type==="textarea"?s.jsx(ct,{id:`q-${_.id}`,rows:3,value:w[_.id]??"",onChange:S=>g(N=>({...N,[_.id]:S.target.value}))}):_.field_type==="select"?s.jsxs(gt,{value:w[_.id]??"",onValueChange:S=>g(N=>({...N,[_.id]:S})),children:[s.jsx(ut,{id:`q-${_.id}`,children:s.jsx(vt,{placeholder:"Selecione"})}),s.jsx(dt,{children:(_.options??[]).map(S=>s.jsx(ke,{value:S,children:S},S))})]}
547):_.field_type==="boolean"?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_r,{id:`q-${_.id}`,checked:w[_.id]==="Sim",onCheckedChange:S=>g(N=>({...N,[_.id]:S?"Sim":"Não"}))}),s.jsx("span",{className:"text-sm text-muted-foreground",children:w[_.id]==="Sim"?"Sim":"Não"})]}):s.jsx(q,{id:`q-${_.id}`,type:_.field_type==="number"?"number":"text",value:w[_.id]??"",onChange:S=>g(N=>({...N,[_.id]:S.target.value}))}),_.help_text&&s.jsx("p",{className:"text-xs text-muted-foreground",children:_.help_text})]},_.id))]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"cover",children:"Carta de apresentação (opcional)"}),s.jsx(ct,{id:"cover",rows:6,placeholder:"Conte por que você é a pessoa certa para esta vaga...",value:p,onChange:_=>b(_.target.value)})]}),s.jsxs(P,{type:"submit",className:"w-full",disabled:f,children:[f&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),t?l!=null&&l.is_complete?"Enviar candidatura":"Preencher currÃculo":"Entrar para candidatar-se"]})]})]})]})}):s.jsx("div",{className:"py-24 text-center",children:"Vaga não encontrada."})};function J6(e){const t=e.match(/(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([\w-]{6,})/);if(t)return`https://www.youtube.com/embed/${t[1]}`;const r=e.match(/vimeo\.com\/(\d+)/);return r?`https://player.vimeo.com/video/${r[1]}`:null}const Q6=({items:e,title:t="Nossa empresa"})=>e!=null&&e.length?s.jsxs("section",{className:"mt-12",children:[s.jsx("h2",{className:"text-xl font-bold mb-4",children:t}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:e.map((r,n)=>{const a=r.type==="video"?J6(r.url):null;return s.jsxs(Q,{className:"overflow-hidden shadow-card",children:[s.jsx("div",{className:"aspect-video bg-muted",children:r.type==="image"?s.jsx("img",{src:r.url,alt:r.caption||`Foto da empresa ${n+1}`,loading:"lazy",className:"w-full h-full object-cover"}):a?s.jsx("iframe",{src:a,title:r.caption||`VÃdeo ${n+1}`,allowFullScreen:!0,className:"w-full h-full"}):s.jsx("video",{src:r.url,controls:!0,className:"w-full h-full object-cover"})}),r.caption&&s.jsx(X,{className:"p-3 text-sm text-muted-foreground",children:r.caption})]},`${r.url}-${n}`)})})]}):null,Dk=()=>{var c,u,d;const{tenant:e}=xt(),t=Ct(),{pages:r}=Ok(e==null?void 0:e.id);if(!e)return null;const n=e.tenant_type==="agency",a=[{icon:kr,title:"Recrutamento e seleção",desc:"Hunting ativo, triagem e entrevistas para cada perfil solicitado."},{icon:ur,title:"Banco de talentos",desc:"Base própria de profissionais qualificados e prontos para novas oportunidades."},{icon:At,title:"Processos sob medida",desc:"Conduzimos a seleção com a marca e os critérios de cada empresa cliente."}],o=((c=r==null?void 0:r.about_services)!=null&&c.length?r.about_services.map(f=>({icon:At,title:f.title,desc:f.desc})):null)??a,l=(u=r==null?void 0:r.about_body)!=null&&u.trim()?r.about_body.split(` 548`).filter(f=>f.trim()):null;return s.jsxs("div",{className:"container mx-auto px-4 py-16 max-w-3xl",children:[s.jsx("h1",{className:"text-3xl md:text-4xl font-extrabold mb-6",children:((d=r==null?void 0:r.about_title)==null?void 0:d.trim())||`Sobre a ${e.name}`}),l?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-muted-foreground space-y-4",children:l.map((f,m)=>s.jsx("p",{children:f},m))}),o.length>0&&s.jsx("div",{className:"grid gap-4 sm:grid-cols-3 mt-8",children:o.map(({icon:f,title:m,desc:p})=>s.jsx(Q,{className:"shadow-card",children:s.jsxs(X,{className:"p-5",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 text-primary flex items-center justify-center mb-3",children:s.jsx(f,{className:"w-5 h-5"})}),s.jsx("h3",{className:"font-semibold mb-1",children:m}),s.jsx("p",{className:"text-sm text-muted-foreground",children:p})]})},m))}),s.jsxs("div",{className:"mt-8 flex flex-wrap gap-3",children:[s.jsx(P,{asChild:!0,children:s.jsx(me,{to:`${t}/vagas`,children:"Ver vagas abertas"})}),n&&s.jsx(P,{asChild:!0,variant:"outline",children:s.jsx(me,{to:`${t}/empresas`,children:"Empresas que atendemos"})})]})]}):n?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"text-muted-foreground space-y-4",children:[s.jsx("p",{children:"Somos uma consultoria de recrutamento e seleção. Conduzimos processos seletivos para empresas de diferentes setores, conectando profissionais à s vagas certas."}),s.jsx("p",{children:"As vagas publicadas aqui pertencem à s empresas que atendemos. Em alguns processos o nome da empresa é mantido em sigilo até as etapas finais."})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-3 mt-8",children:o.map(({icon:f,title:m,desc:p})=>s.jsx(Q,{className:"shadow-card",children:s.jsxs(X,{className:"p-5",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 text-primary flex items-center justify-center mb-3",children:s.jsx(f,{className:"w-5 h-5"})}),s.jsx("h3",{className:"font-semibold mb-1",children:m}),s.jsx("p",{className:"text-sm text-muted-foreground",children:p})]})},m))}),s.jsxs("div",{className:"mt-8 flex flex-wrap gap-3",children:[s.jsx(P,{asChild:!0,children:s.jsx(me,{to:`${t}/vagas`,children:"Ver vagas abertas"})}),s.jsx(P,{asChild:!0,variant:"outline",children:s.jsx(me,{to:`${t}/empresas`,children:"Empresas que atendemos"})})]})]}):s.jsxs("div",{className:"text-muted-foreground space-y-4",children:[s.jsx("p",{children:"Somos uma organização comprometida com pessoas. Buscamos profissionais talentosos, curiosos e apaixonados por fazer a diferença."}),s.jsx("p",{children:"Nossa cultura valoriza colaboração, transparência e crescimento contÃnuo."})]}),s.jsx(Q6,{items:(r==null?void 0:r.media)??[],title:`Conheça a ${e.name}`})]})},Mk=()=>{const{tenant:e}=xt(),t=Ct(),{companies:r,loading:n}=Ql(e==null?void 0:e.id);return e?s.jsxs("div",{className:"container mx-auto px-4 py-12 max-w-5xl",children:[s.jsxs("div",{className:"mb-8 flex flex-wrap items-end justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl md:text-4xl font-extrabold mb-2",children:"Empresas que atendemos"}),s.jsx("p",{className:"text-muted-foreground",children:"Conduzimos os processos seletivos destas organizações. Clique para conhecer a empresa e suas vagas."})]}),s.jsx(P,{asChild:!0,children:s.jsx(me,{to:`${t}/empresas/cadastro`,children:"Cadastrar minha empresa"})})]}),n?s.jsx("div",{className:"py-20 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):r.length===0?s.jsx(Q,{children:s.jsx(X,{className:"py-16 text-center text-muted-foreground",children:"Nenhuma empresa divulgada no momento."})}):s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:r.map(a=>s.jsx(me,{to:`${t}/empresas/${a.slug}`,className:"group",children:s.jsx(Q,{className:"shadow-card hover:shadow-card-hover transition-shadow h-full",children:s.jsxs(X,{className:"p-5 flex items-center gap-4",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 text-primary flex items-center justify-center overflow-hidden shrink-0",children:a.logo_url?s.jsx("img",{src:a.logo_url,alt:`Logo ${a.name}`,className:"w-full h-full object-contain"}):s.jsx(At,{className:"w-5 h-5"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-semibold group-hover:text-primary transition-colors truncate",children:a.name}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Ver perfil e vagas"})]}),s.jsx(Mn,{className:"w-5 h-5 text-muted-foreground group-hover:text-primary transition-colors"})]})})},a.id))})]}):null},Z6=ql({company_name:Qe().trim().min(2,"Informe o nome da empresa").max(160),cnpj:Qe().trim().max(20).optional(),contact_name:Qe().trim().min(2,"Informe o responsável").max(120),contact_phone:Qe().trim().max(30).optional(),contact_email:Qe().trim().email("E-mail inválido").max(255),city:Qe().trim().max(120).optional(),state:Qe().trim().max(60).optional(),jobs_per_month:Km.number().int().min(0).max(1e5).optional(),message:Qe().trim().max(1e3).optional()}),Fk=()=>{const{tenant:e}=xt(),t=Ct(),[r,n]=h.useState(!1),[a,i]=h.useState(!1);if(!e)return null;if(e.tenant_type!=="agency")return s.jsx("div",{className:"container mx-auto px-4 py-16 max-w-2xl text-center text-muted-foreground",children:"Este portal não recebe cadastro de empresas parceiras."});const o=async l=>{var m;l.preventDefault();const c=new FormData(l.currentTarget),u=Z6.safeParse({company_name:String(c.get("company_name")||""),cnpj:String(c.get("cnpj")||""),contact_name:String(c.get("contact_name")||""),contact_phone:String(c.get("contact_phone")||""),contact_email:String(c.get("contact_email")||""),city:String(c.get("city")||""),state:String(c.get("state")||""),jobs_per_month:c.get("jobs_per_month")?Number(c.get("jobs_per_month")):void 0,message:String(c.get("message")||"")});if(!u.success){M.error(((m=u.error.issues[0])==null?void 0:m.message)??"Verifique os dados informados");return}const d=u.data;n(!0);const{error:f}=await T.from("onboarding_leads").insert({client_type:"company",agency_tenant_id:e.id,company_name:d.company_name,cnpj:d.cnpj||null,contact_name:d.contact_name,contact_phone:d.contact_phone||null,contact_email:d.contact_email,city:d.city||null,state:d.state||null,jobs_per_month:d.jobs_per_month??null,has_own_domain:!1,message:d.message||null,status:"pending_agency_approval"});if(n(!1),f){M.error("Não foi possÃvel enviar sua solicitação. Tente novamente.");return}i(!0),M.success("Solicitação enviada! Aguarde a aprovação da agência.")};return s.jsxs("div",{className:"container mx-auto px-4 py-12 max-w-3xl",children:[s.jsxs("header",{className:"mb-8",children:[s.jsxs("div",{className:"inline-flex items-center gap-2 text-xs font-semibold uppercase tracking-widest text-primary mb-3",children:[s.jsx(At,{className:"w-4 h-4"})," Seja empresa parceira"]}),s.jsxs("h1",{className:"text-3xl md:text-4xl font-extrabold tracking-tight",children:["Cadastre sua empresa na ",e.name]}),s.jsxs("p",{className:"mt-3 text-muted-foreground",children:["Envie os dados da sua empresa. A equipe da ",e.name," analisa a solicitação e, após a aprovação, seu portal de vagas é criado e vinculado à agência."]})]}),a?s.jsxs(Q,{className:"text-center",children:[s.jsxs(ye,{children:[s.jsx("div",{className:"mx-auto w-14 h-14 roun
548ded-2xl bg-primary text-primary-foreground flex items-center justify-center",children:s.jsx(wn,{className:"w-7 h-7"})}),s.jsx(we,{className:"mt-4",children:"Solicitação recebida!"}),s.jsxs(bt,{children:["A ",e.name," vai revisar seu cadastro e entrar em contato pelo e-mail informado."]})]}),s.jsx(X,{children:s.jsx(P,{asChild:!0,variant:"secondary",children:s.jsx(me,{to:`${t}`,children:"Voltar ao inÃcio"})})})]}):s.jsx(Q,{children:s.jsx(X,{className:"pt-6",children:s.jsxs("form",{onSubmit:o,className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"sm:col-span-2",children:[s.jsx(U,{htmlFor:"company_name",children:"Nome da empresa *"}),s.jsx(q,{id:"company_name",name:"company_name",required:!0,maxLength:160})]}),s.jsxs("div",{children:[s.jsx(U,{htmlFor:"cnpj",children:"CNPJ"}),s.jsx(q,{id:"cnpj",name:"cnpj",maxLength:20})]}),s.jsxs("div",{children:[s.jsx(U,{htmlFor:"jobs_per_month",children:"Vagas por mês"}),s.jsx(q,{id:"jobs_per_month",name:"jobs_per_month",type:"number",min:0})]}),s.jsxs("div",{children:[s.jsx(U,{htmlFor:"contact_name",children:"Responsável *"}),s.jsx(q,{id:"contact_name",name:"contact_name",required:!0,maxLength:120})]}),s.jsxs("div",{children:[s.jsx(U,{htmlFor:"contact_email",children:"E-mail *"}),s.jsx(q,{id:"contact_email",name:"contact_email",type:"email",required:!0,maxLength:255})]}),s.jsxs("div",{children:[s.jsx(U,{htmlFor:"contact_phone",children:"Telefone / WhatsApp"}),s.jsx(q,{id:"contact_phone",name:"contact_phone",maxLength:30})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx(U,{htmlFor:"city",children:"Cidade"}),s.jsx(q,{id:"city",name:"city",maxLength:120})]}),s.jsxs("div",{children:[s.jsx(U,{htmlFor:"state",children:"UF"}),s.jsx(q,{id:"state",name:"state",maxLength:60})]})]}),s.jsxs("div",{className:"sm:col-span-2",children:[s.jsx(U,{htmlFor:"message",children:"Conte sobre suas necessidades"}),s.jsx(ct,{id:"message",name:"message",rows:4,maxLength:1e3})]}),s.jsxs("div",{className:"sm:col-span-2",children:[s.jsxs(P,{type:"submit",className:"w-full",disabled:r,children:[r&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"})," Enviar solicitação"]}),s.jsxs("p",{className:"mt-3 text-xs text-muted-foreground text-center",children:["Ao enviar, você autoriza a ",e.name," a tratar os dados informados para análise comercial, conforme a LGPD."]})]})]})})})]})},zk=()=>{const{tenant:e}=xt(),{companySlug:t}=Aa(),r=Ct(),{companies:n,loading:a}=Ql(e==null?void 0:e.id),i=n.find(d=>d.slug===t),[o,l]=h.useState([]),[c,u]=h.useState(!0);return h.useEffect(()=>{!e||!i||(u(!0),T.from("jobs").select("id,title,slug,department,location,is_remote").eq("status","published").eq("disclose_company",!0).or(`company_tenant_id.eq.${i.id},tenant_id.eq.${i.id}`).order("published_at",{ascending:!1,nullsFirst:!1}).then(({data:d})=>{l(d??[]),u(!1)}))},[e,i]),a?s.jsx("div",{className:"py-24 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):i?s.jsxs("div",{className:"container mx-auto px-4 py-12 max-w-3xl",children:[s.jsxs(me,{to:`${r}/empresas`,className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-6",children:[s.jsx(Mi,{className:"w-4 h-4"})," Voltar para empresas"]}),s.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[s.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 text-primary flex items-center justify-center overflow-hidden shrink-0",children:i.logo_url?s.jsx("img",{src:i.logo_url,alt:`Logo ${i.name}`,className:"w-full h-full object-contain"}):s.jsx(At,{className:"w-7 h-7"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-extrabold tracking-tight",children:i.name}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Processo seletivo conduzido por ",e==null?void 0:e.name]})]})]}),s.jsx(Q,{className:"mb-8",children:s.jsxs(X,{className:"p-6 space-y-2 text-sm text-muted-foreground",children:[s.jsxs("p",{children:[i.name," é uma das empresas parceiras que confiam em ",e==null?void 0:e.name," para atrair e selecionar talentos. Confira abaixo as oportunidades abertas nesta empresa."]}),i.contact_email&&s.jsxs("p",{className:"flex items-center gap-2",children:[s.jsx(to,{className:"w-4 h-4"}),i.contact_email]}),i.contact_phone&&s.jsxs("p",{className:"flex items-center gap-2",children:[s.jsx(Fl,{className:"w-4 h-4"}),i.contact_phone]})]})}),s.jsx("h2",{className:"text-xl font-bold mb-4",children:"Vagas nesta empresa"}),c?s.jsx("div",{className:"py-10 flex justify-center",children:s.jsx(le,{className:"w-5 h-5 animate-spin text-primary"})}):o.length===0?s.jsx(Q,{children:s.jsx(X,{className:"py-12 text-center text-muted-foreground",children:"Nenhuma vaga aberta nesta empresa."})}):s.jsx("div",{className:"grid gap-3",children:o.map(d=>s.jsx(me,{to:`${r}/vagas/${d.slug}`,className:"group",children:s.jsx(Q,{className:"shadow-card hover:shadow-card-hover transition-shadow",children:s.jsxs(X,{className:"p-4 flex items-center gap-4",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-semibold group-hover:text-primary transition-colors",children:d.title}),s.jsxs("div",{className:"flex flex-wrap gap-3 text-sm text-muted-foreground mt-1",children:[d.department&&s.jsx("span",{children:d.department}),(d.location||d.is_remote)&&s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(Ra,{className:"w-3.5 h-3.5"}),d.is_remote?"Remoto":d.location]})]})]}),s.jsx(Mn,{className:"w-5 h-5 text-muted-foreground group-hover:text-primary transition-colors"})]})})},d.id))}),s.jsx("div",{className:"mt-8",children:s.jsxs(pe,{variant:"secondary",children:["Recrutamento e seleção por ",e==null?void 0:e.name]})})]}):s.jsxs("div",{className:"container mx-auto px-4 py-20 text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Empresa não encontrada"}),s.jsx(P,{asChild:!0,variant:"outline",children:s.jsx(me,{to:`${r}/empresas`,children:"Ver empresas"})})]})},Uk=()=>{const{tenant:e}=xt();return e?s.jsxs("div",{className:"container mx-auto px-4 py-16 max-w-2xl",children:[s.jsxs("h1",{className:"text-3xl md:text-4xl font-extrabold mb-6",children:["Fale com a ",e.name]}),s.jsx(Q,{children:s.jsxs(X,{className:"p-6 space-y-4 text-sm",children:[e.contact_email&&s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(to,{className:"w-4 h-4 text-primary"}),s.jsx("a",{href:`mailto:${e.contact_email}`,className:"hover:underline",children:e.contact_email})]}),e.contact_phone&&s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Fl,{className:"w-4 h-4 text-primary"}),e.contact_phone]}),!e.contact_email&&!e.contact_phone&&s.jsx("p",{className:"text-muted-foreground",children:"Em breve, canais de contato oficiais."})]})})]}):null},Bk=()=>{const{tenant:e}=xt();return e?s.jsxs("div",{className:"container mx-auto px-4 py-16 max-w-3xl",children:[s.jsx("h1",{className:"text-3xl md:text-4xl font-extrabold mb-6",children:"PolÃtica de Privacidade (LGPD)"}),s.jsxs("div",{className:"text-muted-foreground space-y-4 text-sm leading-relaxed",children:[s.jsxs("p",{children:["A ",e.name," respeita a sua privacidade e cumpre a Lei Geral de Proteção de Dados (Lei nº 13.709/2018). Os dados coletados por meio deste portal são utilizados exclusivamente para fins de recrutamento e seleção."]}),s.jsxs("p",{children:[s.jsx("strong",{className:"text-foreground",children:"Dados coletados:"})," nome, e-mail, telefone, currÃculo e informações fornecidas voluntariamente."]}),s.jsxs("p",{children:[s.jsx("strong",{className:"text-foreground",children:"Finalidade:"})," avaliação de candidaturas e composição de banco de talentos."]}),s.jsxs("p",{children:[s.jsx("strong",{className:"text-foreground",children:"Direitos do titular:"})," acesso, correção ou exclusão dos seus dados a qualquer momento."]})]})]}):null},Vk=ql({email:Qe().email("E-mail inválido"),password:Qe().min(6,"MÃnimo de 6 caracteres")}),Y6=Vk.extend({fullName:Qe().min(2,"Informe seu nome completo").max(120)}),rp=()=>{const{tenant:e}=xt(),t=Ct(),r=pr(),[n]=Ng(),{user:a,loading:i,rolesLoaded:o,roles:l}=it(),[c,u]=h.useState(!1),[d,f]=h.useState("signin"),[m,p]=h.useState("candidate"),b=Bg(n.get("next")),v=b??`${t}
548/minha-area`;h.useEffect(()=>{i||!a||!o||r(kl(l,{tenantBase:t,next:b}),{replace:!0})},[a,i,o,l,r,t,b]);const x=async y=>{y.preventDefault();const j=new FormData(y.currentTarget),_=Vk.safeParse({email:j.get("email"),password:j.get("password")});if(!_.success)return M.error(_.error.issues[0].message);u(!0);const{data:S,error:N}=await T.auth.signInWithPassword({email:_.data.email,password:_.data.password});if(N){u(!1),M.error(N.message==="Invalid login credentials"?"E-mail ou senha inválidos":N.message);return}const{data:E}=await T.from("user_roles").select("role").eq("user_id",S.user.id);u(!1),M.success("Bem-vindo de volta!");const R=(E??[]).map(I=>I.role);r(kl(R,{tenantBase:t,next:b}),{replace:!0})},w=async y=>{y.preventDefault();const j=new FormData(y.currentTarget),_=Y6.safeParse({email:j.get("email"),password:j.get("password"),fullName:j.get("fullName")});if(!_.success)return M.error(_.error.issues[0].message);u(!0);const{error:S}=await T.auth.signUp({email:_.data.email,password:_.data.password,options:{emailRedirectTo:`${window.location.origin}${v}`,data:{full_name:_.data.fullName}}});if(u(!1),S){M.error(S.message.includes("already registered")?"Este e-mail já está cadastrado":S.message);return}M.success("Conta criada! Confirme seu e-mail para continuar.")},g=async()=>{u(!0),(await tS.auth.signInWithOAuth("google",{redirect_uri:`${window.location.origin}${t}/auth?next=${encodeURIComponent(v)}`})).error&&(u(!1),M.error("Não foi possÃvel entrar com o Google"))};return s.jsx("div",{className:"container mx-auto px-4 py-14 flex justify-center",children:s.jsxs("div",{className:"w-full max-w-md",children:[s.jsxs("div",{className:"flex flex-col items-center text-center mb-8 gap-3",children:[e!=null&&e.logo_url?s.jsx("img",{src:e.logo_url,alt:e.name,className:"h-14 w-14 rounded-xl object-cover"}):s.jsx("div",{className:"h-14 w-14 rounded-xl bg-primary text-primary-foreground flex items-center justify-center",children:s.jsx(Mt,{className:"w-6 h-6"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xl font-extrabold tracking-tight",children:e==null?void 0:e.name}),s.jsx("div",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:m==="company"?"Ãrea da empresa":"Ãrea do candidato"})]})]}),s.jsx(El,{value:m,onValueChange:y=>{p(y),f("signin")},className:"mb-4",children:s.jsxs(Gi,{className:"grid w-full grid-cols-2",children:[s.jsx(ar,{value:"candidate",children:"Sou candidato"}),s.jsx(ar,{value:"company",children:"Sou empresa"})]})}),s.jsxs(Q,{className:"border-border/60 shadow-xl",children:[s.jsxs(ye,{children:[s.jsx(we,{className:"text-2xl",children:"Acesse sua conta"}),s.jsx(bt,{children:m==="company"?`Acesso da equipe e das empresas parceiras ao painel de recrutamento de ${e==null?void 0:e.name}.`:`Use sua conta para acompanhar candidaturas em ${e==null?void 0:e.name}.`})]}),s.jsxs(X,{children:[s.jsxs(El,{value:d,onValueChange:y=>f(y),children:[s.jsxs(Gi,{className:`grid w-full mb-6 ${m==="company"?"grid-cols-1":"grid-cols-2"}`,children:[s.jsx(ar,{value:"signin",children:"Entrar"}),m==="candidate"&&s.jsx(ar,{value:"signup",children:"Criar conta"})]}),s.jsx(Hr,{value:"signin",children:s.jsxs("form",{onSubmit:x,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"t-signin-email",children:"E-mail"}),s.jsx(q,{id:"t-signin-email",name:"email",type:"email",autoComplete:"email",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"t-signin-password",children:"Senha"}),s.jsx(q,{id:"t-signin-password",name:"password",type:"password",autoComplete:"current-password",required:!0})]}),s.jsxs(P,{type:"submit",className:"w-full",disabled:c,children:[c&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),"Entrar"]})]})}),s.jsx(Hr,{value:"signup",children:s.jsxs("form",{onSubmit:w,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"t-signup-name",children:"Nome completo"}),s.jsx(q,{id:"t-signup-name",name:"fullName",type:"text",autoComplete:"name",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"t-signup-email",children:"E-mail"}),s.jsx(q,{id:"t-signup-email",name:"email",type:"email",autoComplete:"email",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"t-signup-password",children:"Senha"}),s.jsx(q,{id:"t-signup-password",name:"password",type:"password",autoComplete:"new-password",minLength:6,required:!0})]}
548),s.jsxs(P,{type:"submit",className:"w-full",disabled:c,children:[c&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),"Criar conta"]})]})})]}),s.jsxs("div",{className:"relative my-6",children:[s.jsx("div",{className:"absolute inset-0 flex items-center",children:s.jsx("span",{className:"w-full border-t border-border"})}),s.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:s.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"ou continue com"})})]}),s.jsxs(P,{type:"button",variant:"outline",className:"w-full",onClick:g,disabled:c,children:[s.jsxs("svg",{className:"w-4 h-4 mr-2",viewBox:"0 0 24 24",children:[s.jsx("path",{fill:"#4285F4",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"}),s.jsx("path",{fill:"#34A853",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"}),s.jsx("path",{fill:"#FBBC05",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"}),s.jsx("path",{fill:"#EA4335",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"})]}),"Google"]})]})]})]})})};var hv="Progress",fv=100,[X6,HF]=er(hv),[eF,tF]=X6(hv),qk=h.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:a,getValueLabel:i=rF,...o}=e;(a||a===0)&&!A0(a)&&console.error(nF(`${a}`,"Progress"));const l=A0(a)?a:fv;n!==null&&!P0(n,l)&&console.error(sF(`${n}`,"Progress"));const c=P0(n,l)?n:null,u=Yu(c)?i(c,l):void 0;return s.jsx(eF,{scope:r,value:c,max:l,children:s.jsx(ve.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Yu(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":Kk(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});qk.displayName=hv;var Hk="ProgressIndicator",Wk=h.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,a=tF(Hk,r);return s.jsx(ve.div,{"data-state":Kk(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:t})});Wk.displayName=Hk;function rF(e,t){return`${Math.round(e/t*100)}%`}function Kk(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Yu(e){return typeof e=="number"}function A0(e){return Yu(e)&&!isNaN(e)&&e>0}function P0(e,t){return Yu(e)&&!isNaN(e)&&e<=t&&e>=0}function nF(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${fv}\`.`}function sF(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: 549 - a positive number 550 - less than the value passed to \`max\` (or ${fv} if no \`max\` prop is set) 551 - \`null\` or \`undefined\` if the progress is indeterminate. 552 553Defaulting to \`null\`.`}var Gk=qk,aF=Wk;const mv=h.forwardRef(({className:e,value:t,...r},n)=>s.jsx(Gk,{ref:n,className:Y("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:s.jsx(aF,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));mv.displayName=Gk.displayName;const Jk={new:"Recebida",screening:"Triagem",interview:"Entrevista",offer:"Proposta",hired:"Contratado",rejected:"Não selecionado",withdrawn:"Retirada"},np=["new","screening","interview","offer"],iF=e=>{var r,n,a;if(!e)return 0;const t=[!!e.headline,!!e.summary,!!e.location,!!e.phone,(((r=e.skills)==null?void 0:r.length)??0)>0,(((n=e.experiences)==null?void 0:n.length)??0)>0,(((a=e.education)==null?void 0:a.length)??0)>0,!!e.photo_url];return Math.round(t.filter(Boolean).length/t.length*100)},Qk=()=>{const{tenant:e}=xt(),{user:t}=it(),r=Ct(),[n,a]=h.useState([]),[i,o]=h.useState(null),[l,c]=h.useState(0),[u,d]=h.useState(!0);if(h.useEffect(()=>{!e||!t||(async()=>{d(!0);const[{data:b},{data:v},{count:x}]=await Promise.all([T.from("job_applications").select("id,status,created_at,jobs(title,slug)").eq("tenant_id",e.id).eq("candidate_id",t.id).order("created_at",{ascending:!1}),T.from("candidate_resumes").select("*").eq("user_id",t.id).maybeSingle(),T.from("jobs").select("id",{count:"exact",head:!0}).eq("tenant_id",e.id).eq("status","published")]);
553a(b??[]),o(v??null),c(x??0),d(!1)})()},[e,t]),u)return s.jsx("div",{className:"py-24 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})});const f=iF(i),m=n.filter(b=>np.includes(b.status)).length,p=[{label:"Candidaturas",value:n.length,icon:eo},{label:"Em andamento",value:m,icon:wn},{label:"Vagas abertas",value:l,icon:Mt}];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-extrabold tracking-tight",children:"Meu painel"}),s.jsxs("p",{className:"text-muted-foreground",children:["Acompanhe seus processos em ",e==null?void 0:e.name," e mantenha seu currÃculo em dia."]})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:p.map(b=>s.jsx(Q,{children:s.jsxs(X,{className:"p-5 flex items-center gap-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 text-primary flex items-center justify-center",children:s.jsx(b.icon,{className:"w-5 h-5"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-bold leading-none",children:b.value}),s.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:b.label})]})]})},b.label))}),s.jsxs(Q,{children:[s.jsxs(ye,{className:"flex-row items-start justify-between gap-4 space-y-0",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs(we,{className:"text-lg",children:["CurrÃculo ",f,"% completo"]}),s.jsx(bt,{children:f===100?"Seu currÃculo está completo. Ãtimo para aumentar seu match nas vagas.":"Complete seu currÃculo para melhorar sua compatibilidade com as vagas."})]}),s.jsx(P,{asChild:!0,size:"sm",children:s.jsx(me,{to:`${r}/curriculo`,children:i!=null&&i.is_complete?"Atualizar":"Preencher"})})]}),s.jsx(X,{children:s.jsx(mv,{value:f})})]}),s.jsxs(Q,{children:[s.jsxs(ye,{className:"flex-row items-center justify-between gap-4 space-y-0",children:[s.jsx(we,{className:"text-lg",children:"Ãltimas candidaturas"}),s.jsx(P,{asChild:!0,variant:"ghost",size:"sm",children:s.jsx(me,{to:`${r}/minha-area/candidaturas`,children:"Ver todas"})})]}),s.jsx(X,{className:"space-y-3",children:n.length===0?s.jsxs("div",{className:"text-sm text-muted-foreground flex items-center gap-2",children:["Você ainda não se candidatou.",s.jsx(P,{asChild:!0,size:"sm",variant:"outline",children:s.jsxs(me,{to:`${r}/minha-area/vagas`,children:[s.jsx(kr,{className:"w-3.5 h-3.5 mr-1"})," Buscar vagas"]})})]}):n.slice(0,5).map(b=>{var v;return s.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium truncate",children:((v=b.jobs)==null?void 0:v.title)??"Vaga"}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Enviada em ",new Date(b.created_at).toLocaleDateString("pt-BR")]})]}),s.jsx(pe,{variant:"secondary",children:Jk[b.status]??b.status})]},b.id)})})]})]})},O0={clt:"CLT",pj:"PJ",freelance:"Freela",estagio:"Estágio",temporario:"Temporário",trainee:"Trainee"},Zk=()=>{const{tenant:e}=xt(),{user:t}=it(),r=Ct(),n=(e==null?void 0:e.tenant_type)==="agency",{companies:a}=Ql(n?e==null?void 0:e.id:null),[i,o]=h.useState([]),[l,c]=h.useState([]),[u,d]=h.useState(!0),[f,m]=h.useState(""),[p,b]=h.useState("all"),[v,x]=h.useState("all");h.useEffect(()=>{e&&(async()=>{d(!0);const[{data:g},{data:y}]=await Promise.all([T.from("jobs").select("id,title,slug,department,location,is_remote,employment_type,published_at,company_tenant_id,disclose_company").eq("tenant_id",e.id).eq("status","published").order("published_at",{ascending:!1,nullsFirst:!1}),t?T.from("job_applications").select("job_id").eq("tenant_id",e.id).eq("candidate_id",t.id):Promise.resolve({data:[]})]);o(g??[]),c((y??[]).map(j=>j.job_id)),d(!1)})()},[e,t]);const w=h.useMemo(()=>{const g=f.trim().toLowerCase();return i.filter(y=>!(p!=="all"&&y.employment_type!==p||v==="remote"&&!y.is_remote||v==="onsite"&&y.is_remote||g&&![y.title,y.department,y.location].filter(Boolean).some(j=>j.toLowerCase().includes(g))))},[i,f,p,v]);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-extrabold tracking-tight",children:"Buscar vagas"}),s.jsx("p",{className:"text-muted-foreground",children:n?"Oportunidades que recrutamos para as empresas atendidas.":`Oportunidades abertas em ${(e==null?void 0:e.name)??""}.`})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(kr,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(q,{className:"pl-9",placeholder:"Cargo, área ou cidade",value:f,onChange:g=>m(g.target.value)})]}),s.jsxs(gt,{value:p,onValueChange:b,children:[s.jsx(ut,{className:"sm:w-40",children:s.jsx(vt,{placeholder:"Contrato"})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"all",children:"Todos contratos"}),Object.entries(O0).map(([g,y])=>s.jsx(ke,{value:g,children:y},g))]})]}),s.jsxs(gt,{value:v,onValueChange:x,children:[s.jsx(ut,{className:"sm:w-40",children:s.jsx(vt,{placeholder:"Modelo"})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"all",children:"Todos modelos"}),s.jsx(ke,{value:"remote",children:"Remoto"}),s.jsx(ke,{value:"onsite",children:"Presencial/HÃbrido"})]})]})]}),u?s.jsx("div",{className:"py-20 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):w.length===0?s.jsx(Q,{children:s.jsx(X,{className:"py-16 text-center text-muted-foreground",children:"Nenhuma vaga encontrada com esses filtros."})}):s.jsx("div",{className:"grid gap-3",children:w.map(g=>{var j;const y=l.includes(g.id);return s.jsx(Q,{className:"shadow-card hover:shadow-card-hover transition-shadow",children:s.jsxs(X,{className:"p-4 flex items-center gap-4",children:[s.jsx("div",{className:"hidden sm:flex w-10 h-10 rounded-xl bg-primary/10 text-primary items-center justify-center shrink-0",children:s.jsx(Mt,{className:"w-5 h-5"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-semibold truncate",children:g.title}),s.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground mt-1",children:[n&&s.jsx("span",{className:"font-medium text-foreground
553/80",children:g.company_tenant_id&&g.disclose_company?((j=a.find(_=>_.id===g.company_tenant_id))==null?void 0:j.name)??"Empresa cliente":"Empresa confidencial"}),g.department&&s.jsx("span",{children:g.department}),(g.location||g.is_remote)&&s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(Ra,{className:"w-3 h-3"}),g.is_remote?"Remoto":g.location]}),s.jsx(pe,{variant:"secondary",className:"text-[10px]",children:O0[g.employment_type]||g.employment_type})]})]}),y?s.jsxs(pe,{className:"shrink-0 gap-1",children:[s.jsx(ya,{className:"w-3 h-3"})," Inscrito"]}):s.jsx(P,{asChild:!0,size:"sm",className:"shrink-0",children:s.jsx(me,{to:`${r}/vagas/${g.slug}`,children:"Ver vaga"})})]})},g.id)})})]})},Yk=()=>{const e=Ct(),{tenant:t}=xt(),{user:r}=it(),[n,a]=h.useState([]),[i,o]=h.useState(!1),[l,c]=h.useState(""),[u,d]=h.useState(!1),[f,m]=h.useState(!1);h.useEffect(()=>{r&&T.from("candidate_resumes").select("phone, whatsapp_opt_in").eq("user_id",r.id).maybeSingle().then(({data:y})=>{const j=y;c((j==null?void 0:j.phone)??""),d(!!(j!=null&&j.whatsapp_opt_in))})},[r]);const p=async()=>{if(!t)return;o(!0);const{data:y,error:j}=await T.functions.invoke("recommend-jobs",{body:{tenant_id:t.id}});if(o(!1),j)return M.error("Não foi possÃvel gerar recomendações agora.");
553if(y!=null&&y.error)return M.error(y.error);const _=(y==null?void 0:y.recommendations)??[];a(_),_.length===0&&M.info("Nenhuma vaga aderente ao seu perfil no momento.")},b=async y=>{if(!r)return;d(y),m(!0);const{error:j}=await T.from("candidate_resumes").update({phone:l||null,whatsapp_opt_in:y,whatsapp_opt_in_at:y?new Date().toISOString():null}).eq("user_id",r.id);if(m(!1),j)return d(!y),M.error("Não foi possÃvel salvar sua permissão.");M.success(y?"Permissão para WhatsApp ativada":"Permissão para WhatsApp desativada")},v=l.replace(/\D/g,""),x=v.length>11?v:`55${v}`,w=u&&v.length>=10&&n.length>0,g=()=>{const y=n.map((_,S)=>`${S+1}. ${_.job.title} (${_.score}% de aderência) 554${_.reason} 555${window.location.origin}${e}/vagas/${_.job.slug}`),j=`Olá! Estas são as vagas recomendadas para você em ${(t==null?void 0:t.name)??"nosso portal"}: 556 557${y.join(` 558 559`)}`;window.open(`https://wa.me/${x}?text=${encodeURIComponent(j)}`,"_blank","noopener")};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-extrabold tracking-tight",children:"Vagas recomendadas por IA"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"A IA compara seu currÃculo com as vagas abertas e explica por que cada uma combina com você."})]}),s.jsxs(P,{onClick:p,disabled:i||!t,children:[i?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(Ft,{className:"w-4 h-4 mr-2"}),n.length?"Atualizar recomendações":"Gerar recomendações"]})]}),s.jsxs(Q,{children:[s.jsx(ye,{className:"pb-3",children:s.jsxs(we,{className:"text-base flex items-center gap-2",children:[s.jsx(mm,{className:"w-4 h-4 text-primary"})," Receber recomendações por WhatsApp"]})}),s.jsxs(X,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"wa-phone",children:"WhatsApp (com DDD)"}),s.jsx(q,{id:"wa-phone",value:l,onChange:y=>c(y.target.value),onBlur:()=>u&&b(!0),placeholder:"(11) 99999-9999"})]}),s.jsxs("div",{className:"flex items-center gap-3 pb-1",children:[s.jsx(_r,{checked:u,disabled:f,onCheckedChange:b,id:"wa-consent"}),s.jsx(U,{htmlFor:"wa-consent",className:"text-sm",children:"Autorizo o envio"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Só enviamos recomendações por WhatsApp com a sua autorização. Você pode desativar quando quiser."}),s.jsxs(P,{variant:"secondary",disabled:!w,onClick:g,children:[s.jsx(mm,{className:"w-4 h-4 mr-2"})," Enviar recomendações no WhatsApp"]}),!u&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Ative a autorização para liberar o envio."})]})]}),i?s.jsx("div",{className:"py-16 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):n.length===0?s.jsx(Q,{children:s.jsx(X,{className:"py-14 text-center text-muted-foreground text-sm",children:"Clique em âGerar recomendaçõesâ para a IA analisar seu currÃculo e sugerir as vagas mais aderentes."})}):s.jsx("div",{className:"grid gap-4",children:n.map(y=>s.jsx(Q,{className:"shadow-card",children:s.jsxs(X,{className:"p-5 space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-semibold text-lg",children:y.job.title}),s.jsxs("div",{className:"flex flex-wrap gap-3 text-sm text-muted-foreground mt-1",children:[y.job.department&&s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(Mt,{className:"w-3.5 h-3.5"}),y.job.department]}),(y.job.location||y.job.is_remote)&&s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(Ra,{className:"w-3.5 h-3.5"}),y.job.is_remote?"Remoto":y.job.location]})]})]}),s.jsxs(pe,{variant:"secondary",children:[y.score,"% de aderência"]})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:y.reason}),y.highlights.length>0&&s.jsx("ul",{className:"text-sm list-disc pl-5 space-y-1 text-muted-foreground",children:y.highlights.map((j,_)=>s.jsx("li",{children:j},_))}),s.jsx("div",{className:"pt-1",children:s.jsx(P,{asChild:!0,size:"sm",variant:"outline",children:s.jsxs(me,{to:`${e}/vagas/${y.job.slug}`,children:["Ver vaga ",s.jsx(Mn,{className:"w-4 h-4 ml-2"})]})})})]})},y.job.id))})]})},Xk=()=>{const{tenant:e}=xt(),{user:t}=it(),r=Ct(),[n,a]=h.useState([]),[i,o]=h.useState(!0),[l,c]=h.useState(""),[u,d]=h.useState("all");h.useEffect(()=>{!e||!t||(o(!0),T.from("job_applications").select("id,status,created_at,jobs(title,slug,location,is_remote)").eq("tenant_id",e.id).eq("candidate_id",t.id).order("created_at",{ascending:!1}).then(({data:m})=>{a(m??[]),o(!1)}))},[e,t]);const f=h.useMemo(()=>{const m=l.trim().toLowerCase();return n.filter(p=>{var b;return!(u==="active"&&!np.includes(p.status)||u==="closed"&&np.includes(p.status)||m&&!(((b=p.jobs)==null?void 0:b.title)??"").toLowerCase().includes(m))})},[n,l,u]);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-extrabold tracking-tight",children:"Minhas candidaturas"}),s.jsx("p",{className:"text-muted-foreground",children:"Acompanhe o status de cada processo seletivo."})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(kr,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(q,{className:"pl-9",placeholder:"Buscar por vaga",value:l,onCh
559ange:m=>c(m.target.value)})]}),s.jsxs(gt,{value:u,onValueChange:d,children:[s.jsx(ut,{className:"sm:w-48",children:s.jsx(vt,{})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"all",children:"Todas"}),s.jsx(ke,{value:"active",children:"Em andamento"}),s.jsx(ke,{value:"closed",children:"Encerradas"})]})]})]}),i?s.jsx("div",{className:"py-20 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):f.length===0?s.jsx(Q,{children:s.jsxs(X,{className:"py-14 text-center text-muted-foreground space-y-3",children:[s.jsx("p",{children:"Nenhuma candidatura encontrada."}),s.jsx(P,{asChild:!0,size:"sm",children:s.jsx(me,{to:`${r}/minha-area/vagas`,children:"Buscar vagas"})})]})}):s.jsx("div",{className:"grid gap-3",children:f.map(m=>{var p,b,v,x;return s.jsx(Q,{children:s.jsxs(X,{className:"p-4 flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-semibold truncate",children:((p=m.jobs)==null?void 0:p.title)??"Vaga"}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[(b=m.jobs)!=null&&b.is_remote?"Remoto":((v=m.jobs)==null?void 0:v.location)??"â"," · Enviada em"," ",new Date(m.created_at).toLocaleDateString("pt-BR")]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsx(pe,{variant:"secondary",children:Jk[m.status]??m.status}),((x=m.jobs)==null?void 0:x.slug)&&s.jsx(P,{asChild:!0,variant:"ghost",size:"sm",children:s.jsx(me,{to:`${r}/vagas/${m.jobs.slug}`,children:"Ver vaga"})})]})]})},m.id)})})]})},I0=e=>[{url:e.linkedin_url,icon:GT,label:"LinkedIn"},{url:e.github_url,icon:VT,label:"GitHub"},{url:e.instagram_url,icon:HT,label:"Instagram"},{url:e.portfolio_url,icon:qj,label:"Portfólio"}].filter(t=>!!t.url),eC=({resume:e,name:t,email:r})=>{var l,c;const[n,a]=h.useState(null);if(h.useEffect(()=>{Qu(e==null?void 0:e.photo_url).then(a)},[e==null?void 0:e.photo_url]),!e)return s.jsx("p",{className:"text-sm text-muted-foreground",children:"Este candidato ainda não preencheu o currÃculo."});const i=e.experiences??[],o=e.education??[];return s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsxs(Gd,{className:"w-20 h-20",children:[n&&s.jsx(Jd,{src:n,alt:`Foto de ${t}`}),s.jsx(Qd,{children:t.slice(0,2).toUpperCase()})]}),s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("h3",{className:"text-lg font-bold leading-tight",children:t}),e.headline&&s.jsx("p",{className:"text-sm text-muted-foreground",children:e.headline}),s.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground pt-1",children:[r&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(to,{className:"w-3 h-3"}),r]}),e.phone&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Fl,{className:"w-3 h-3"}),e.phone]}),e.location&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Ra,{className:"w-3 h-3"}),e.location]})]})]})]}),I0(e).length>0&&s.jsx("div",{className:"flex flex-wrap gap-2",children:I0(e).map(u=>s.jsx(P,{asChild:!0,size:"sm",variant:"secondary",children:s.jsxs("a",{href:u.url,target:"_blank",rel:"noreferrer",children:[s.jsx(u.icon,{className:"w-4 h-4 mr-2"}),u.label]})},u.label))}),e.summary&&s.jsxs(s.Fragment,{children:[s.jsx(Cl,{}),s.jsxs("section",{className:"space-y-1",children:[s.jsx("h4",{className:"text-sm font-semibold",children:"Resumo"}),s.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:e.summary})]})]}),((l=e.skills)==null?void 0:l.length)>0&&s.jsxs("section",{className:"space-y-2",children:[s.jsx("h4",{className:"text-sm font-semibold",children:"Competências"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.skills.map(u=>s.jsx(pe,{variant:"secondary",children:u},u))})]}),((c=e.languages)==null?void 0:c.length)>0&&s.jsxs("section",{className:"space-y-2",children:[s.jsx("h4",{className:"text-sm font-semibold",children:"Idiomas"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.languages.map(u=>s.jsx(pe,{variant:"outline",children:u},u))})]}),i.length>0&&s.jsxs("section",{className:"space-y-3",children:[s.jsx("h4",{className:"text-sm font-semibold",children:"Experiência profissional"}),i.map((u,d)=>s.jsxs("div",{className:"border-l-2 border-primary/40 pl-3 space-y-0.5",children:[s.jsx("p",{className:"text-sm font-medium",children:u.role}),s.jsx("p",{className:"text-xs text-muted-foreground",children:[u.company,u.period].filter(
559Boolean).join(" ⢠")}),u.description&&s.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:u.description})]},d))]}),o.length>0&&s.jsxs("section",{className:"space-y-3",children:[s.jsx("h4",{className:"text-sm font-semibold",children:"Formação"}),o.map((u,d)=>s.jsxs("div",{className:"border-l-2 border-muted pl-3 space-y-0.5",children:[s.jsx("p",{className:"text-sm font-medium",children:u.course}),s.jsx("p",{className:"text-xs text-muted-foreground",children:[u.school,u.period].filter(Boolean).join(" ⢠")})]},d))]})]})},pv=({areas:e,value:t,onChange:r,by:n="id",suggested:a=[]})=>{const i=o=>r(t.includes(o)?t.filter(l=>l!==o):[...t,o]);return s.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map(o=>{const l=n==="id"?o.id:o.key,c=t.includes(l),u=!c&&a.includes(l);return s.jsx("button",{type:"button",onClick:()=>i(l),children:s.jsxs(pe,{variant:c?"default":"outline",className:Y("cursor-pointer gap-1 transition-colors",u&&"border-primary/60 text-primary"),children:[c&&s.jsx(ya,{className:"w-3 h-3"}),o.name,u&&s.jsx("span",{className:"text-[10px] opacity-70",children:"sugerido"})]})},o.id)})})},oF={photo_url:null,headline:null,summary:null,location:null,phone:null,linkedin_url:null,github_url:null,instagram_url:null,portfolio_url:null,skills:[],languages:[],experiences:[],education:[],is_complete:!1,interest_areas:[]},lF=({resume:e,name:t,onCancel:r,onSaved:n})=>{const{user:a}=it(),i=h.useRef(null),{areas:o}=ch(),[l,c]=h.useState({...oF,...e??{}}),[u,d]=h.useState(t),[f,m]=h.useState(((e==null?void 0:e.skills)??[]).join(", ")),[p,b]=h.useState(((e==null?void 0:e.languages)??[]).join(", ")),[v,x]=h.useState((e==null?void 0:e.interest_areas)??[]),[w,g]=h.useState((e==null?void 0:e.experiences)??[]),[y,j]=h.useState((e==null?void 0:e.education)??[]),[_,S]=h.useState(null),[N,E]=h.useState(!1),[R,I]=h.useState(!1);h.useEffect(()=>{Qu(l.photo_url).then(S)},[l.photo_url]);const A=(z,B)=>c(K=>({...K,[z]:B||null})),C=async z=>{var k;if(!a)return;if(z.size>5*1024*1024){M.error("A foto deve ter no máximo 5MB.");return}E(!0);const B=((k=z.name.split(".").pop())==null?void 0:k.toLowerCase())??"jpg",K=`${a.id}/perfil-${Date.now()}.${B}`,{error:O}=await T.storage.from(qg).upload(K,z,{upsert:!0});if(E(!1),O){M.error(O.message);return}c(L=>({...L,photo_url:K})),M.success("Foto atualizada â lembre-se de salvar.")},F=async()=>{if(!a)return;I(!0);const z={user_id:a.id,photo_url:l.photo_url,headline:l.headline,summary:l.summary,location:l.location,phone:l.phone,linkedin_url:l.linkedin_url,github_url:l.github_url,instagram_url:l.instagram_url,portfolio_url:l.portfolio_url,skills:f.split(",").map(K=>K.trim()).filter(Boolean),languages:p.split(",").map(K=>K.trim()).filter(Boolean),interest_areas:v,experiences:w.filter(K=>K.role||K.company),education:y.filter(K=>K.course||K.school),is_complete:!0},{error:B}=await T.from("candidate_resumes").upsert(z,{onConflict:"user_id"});if(B||await T.from("profiles").update({full_name:u||null,phone:l.phone}).eq("id",a.id),I(!1),B){M.error(B.message);return}M.success("CurrÃculo atualizado!"),n()},D=(u||"C").slice(0,2).toUpperCase();return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs(Gd,{className:"w-20 h-20",children:[_&&s.jsx(Jd,{src:_,alt:"Foto do currÃculo"}),s.jsx(Qd,{children:D})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("input",{ref:i,type:"file",accept:"image/*",className:"hidden",onChange:z=>{var K;const B=(K=z.target.files)==null?void 0:K[0];B&&C(B),z.target.value=""}}),s.jsxs(P,{variant:"secondary",size:"sm",onClick:()=>{var z;return(z=i.current)==null?void 0:z.click()},disabled:N,children:[N?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(sg,{className:"w-4 h-4 mr-2"}),l.photo_url?"Trocar foto":"Enviar foto"]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"JPG ou PNG quadrada, 400x400px, até 5MB."})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Nome completo"}),s.jsx(q,{value:u,onChange:z=>d(z.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"TÃtulo profissional"}),s.jsx(q,{value:l.headline??"",onChange:z=>A("headline",z.target.value),placeholder:"Ex: Analista de Marketing"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Cidade / Estado"}),s.jsx(q,{value:l.location??"",onChange:z=>A("location",z.target.value),placeholder:"Ex: São Paulo - SP"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Telefone / WhatsApp"}),s.jsx(q,{value:l.phone??"",onChange:z=>A("phone",z.target.value),placeholder:"(11) 99999-9999"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Resumo profissional"}),s.jsx(ct,{rows:5,value:l.summary??"",onChange:z=>A("summary",z.target.value)})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Competências (separadas por vÃrgula)"}),s.jsx(ct,{rows:2,value:f,onChange:z=>m(z.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Idiomas (separados por vÃrgula)"}),s.jsx(ct,{rows:2,value:p,onChange:z=>b(z.target.value)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Ãreas de interesse"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Elas orientam a classificação do seu currÃculo no banco de talentos e no marketplace."}
559),s.jsx(pv,{areas:o,value:v,onChange:x,by:"key"})]}),s.jsx(Cl,{}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"font-semibold",children:"Experiências"}),s.jsxs(P,{variant:"outline",size:"sm",onClick:()=>g(z=>[...z,{role:"",company:"",period:"",description:""}]),children:[s.jsx(mn,{className:"w-4 h-4 mr-2"})," Adicionar"]})]}),w.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma experiência cadastrada."}),w.map((z,B)=>s.jsx(Q,{children:s.jsxs(X,{className:"p-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(q,{placeholder:"Cargo",value:z.role,onChange:K=>g(O=>O.map((k,L)=>L===B?{...k,role:K.target.value}:k))}),s.jsx(q,{placeholder:"Empresa",value:z.company,onChange:K=>g(O=>O.map((k,L)=>L===B?{...k,company:K.target.value}:k))}),s.jsx(q,{placeholder:"PerÃodo (01/2022 - atual)",value:z.period,onChange:K=>g(O=>O.map((k,L)=>L===B?{...k,period:K.target.value}:k))})]}),s.jsx(ct,{rows:3,placeholder:"Atividades e resultados",value:z.description,onChange:K=>g(O=>O.map((k,L)=>L===B?{...k,description:K.target.value}:k))}),s.jsxs(P,{variant:"ghost",size:"sm",className:"text-destructive",onClick:()=>g(K=>K.filter((O,k)=>k!==B)),children:[s.jsx(Vn,{className:"w-4 h-4 mr-2"})," Remover"]})]})},B))]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"font-semibold",children:"Formação"}),s.jsxs(P,{variant:"outline",size:"sm",onClick:()=>j(z=>[...z,{course:"",school:"",period:""}]),children:[s.jsx(mn,{className:"w-4 h-4 mr-2"})," Adicionar"]})]}),y.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma formação cadastrada."}),y.map((z,B)=>s.jsx(Q,{children:s.jsxs(X,{className:"p-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(q,{placeholder:"Curso",value:z.course,onChange:K=>j(O=>O.map((k,L)=>L===B?{...k,course:K.target.value}:k))}),s.jsx(q,{placeholder:"Instituição",value:z.school,onChange:K=>j(O=>O.map((k,L)=>L===B?{...k,school:K.target.value}:k))}),s.jsx(q,{placeholder:"PerÃodo",value:z.period,onChange:K=>j(O=>O.map((k,L)=>L===B?{...k,period:K.target.value}:k))})]}),s.jsxs(P,{variant:"ghost",size:"sm",className:"text-destructive",onClick:()=>j(K=>K.filter((O,k)=>k!==B)),children:[s.jsx(Vn,{className:"w-4 h-4 mr-2"})," Remover"]})]})},B))]}),s.jsx(Cl,{}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"LinkedIn"}),s.jsx(q,{value:l.linkedin_url??"",onChange:z=>A("linkedin_url",z.target.value),placeholder:"https://linkedin.com/in/..."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"GitHub"}),s.jsx(q,{value:l.github_url??"",onChange:z=>A("github_url",z.target.value),placeholder:"https://github.com/..."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Instagram"}),s.jsx(q,{value:l.instagram_url??"",onChange:z=>A("instagram_url",z.target.value),placeholder:"https://instagram.com/..."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Portfólio / site"}),s.jsx(q,{value:l.portfolio_url??"",onChange:z=>A("portfolio_url",z.target.value),placeholder:"https://..."})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[s.jsxs(P,{onClick:F,disabled:R,children:[R?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(sR,{className:"w-4 h-4 mr-2"}),"Salvar currÃculo"]}),s.jsxs(P,{variant:"ghost",onClick:r,disabled:R,children:[s.jsx(zl,{className:"w-4 h-4 mr-2"})," Cancelar"]})]})]})},cF=()=>{const{user:e}=it(),[t,r]=h.useState([]),[n,a]=h.useState({}),[i,o]=h.useState(!1),[l,c]=h.useState(!1),[u,d]=h.useState(null),f=async()=>{if(!e)return;const{data:x}=await T.from("marketplace_candidates").select("id,agency_tenant_id,consent,is_active").eq("candidate_id",e.id);r(x??[]);const{data:w}=await T.from("candidate_resumes").select("marketplace_consent").eq("user_id",e.id).maybeSingle();o(!!(w!=null&&w.marketplace_consent));const{data:g}=await T.rpc("get_public_tenants");a(Object.fromEntries((g??[]).map(y=>[y.id,y.name])))};h.useEffect(()=>{f()},[e==null?void 0:e.id]);const m=async(x,w)=>{c(!0),r(y=>y.map(j=>j.id===x.id?{...j,consent:w}:j));const{error:g}=await T.from("marketplace_candidates").update({consent:w,consent_at:w?new Date().toISOString():null}).eq("id",x.id);if(c(!1),g)return r(y=>y.map(j=>j.id===x.id?{...j,consent:!w}:j)),M.error("Não foi possÃvel atualizar seu consentimento");M.success(w?`Compartilhamento autorizado para ${n[x.agency_tenant_id]??"a agência"}`:`Compartilhamento revogado para ${n[x.agency_tenant_id]??"a agência"}`)},p=async x=>{if(!e)return;c(!0),o(x);const{data:w,error:g}=await T.from("candidate_resumes").update({marketplace_consent:x,marketplace_consent_at:x?new Date().toISOString():null}).eq("user_id",e.id).select("marketplace_consent");if(c(!1),g||!(w!=null&&w.length))return o(!x),M.error(!(w!=null&&w.length)&&!g?"Preencha seu currÃculo antes de autorizar o compartilhamento":"Não foi possÃvel salvar sua autorização");M.success(x?"Pronto! Seu currÃculo agora aparece no Marketplace de Talentos":"Pronto! Seu currÃculo foi removido do Marketplace de Talentos")},b=()=>{u&&(u.kind==="global"?p(u.next):m(u.row,u.next),d(null))},v=(u==null?void 0:u.next)??!1;return s.jsxs(Q,{className:"md:col-span-2 border-primary/20",children:[s.jsxs(ye,{children:[s.jsxs(we,{className:"flex items-center gap-2 text-base",children:[s.jsx(ro,{className:"w-4 h-4 text-primary"})," Marketplace de Talentos"]}),s.jsx(bt,{children:"Autorize (ou revogue quando quiser) o compartilhamento do seu currÃculo com empresas e agências parceiras."})]}),s.jsxs(X,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border p-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(U,{htmlFor:"mkt-consent",className:"text-sm font-medium",children:"Permitir que meu currÃculo apareça no Mar
559ketplace de Talentos"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Seus dados de contato só ficam visÃveis para empresas participantes enquanto esta opção estiver ativa (LGPD)."}),s.jsx(pe,{variant:i?"default":"outline",children:i?"Compartilhamento ativo":"Não compartilhado"})]}),s.jsx(_r,{id:"mkt-consent",checked:i,disabled:l,onCheckedChange:x=>d({kind:"global",next:x})})]}),t.length>0&&s.jsx("p",{className:"text-xs font-medium text-muted-foreground pt-1",children:"Autorizações por agência"}),t.map(x=>s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border p-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-medium text-sm",children:n[x.agency_tenant_id]??"Agência"}),s.jsx(pe,{variant:x.consent?"default":"outline",children:x.consent?"Autorizado":"Pendente"})]}),s.jsx(P,{size:"sm",disabled:l,variant:x.consent?"outline":"default",onClick:()=>d({kind:"row",row:x,next:!x.consent}),children:x.consent?"Revogar":"Autorizar"})]},x.id))]}),s.jsx(cv,{open:!!u,onOpenChange:x=>!x&&d(null),children:s.jsxs(eh,{children:[s.jsxs(th,{children:[s.jsx(nh,{children:v?"Autorizar compartilhamento?":"Revogar compartilhamento?"}),s.jsx(sh,{children:v?"Seu currÃculo ficará visÃvel para empresas e agências parceiras no Marketplace de Talentos. Você pode revogar a qualquer momento.":"Seu currÃculo deixará de aparecer no Marketplace imediatamente e as empresas parceiras não terão mais acesso aos seus dados."})]}),s.jsxs(rh,{children:[s.jsx(ih,{children:"Cancelar"}),s.jsx(ah,{onClick:b,children:v?"Sim, autorizar":"Sim, revogar"})]})]})})]})},tC=()=>{const{user:e}=it(),t=Ct(),[r,n]=h.useState(null),[a,i]=h.useState(""),[o,l]=h.useState(!0),[c,u]=h.useState(!1),[d,f]=h.useState(0);return h.useEffect(()=>{e&&(async()=>{l(!0);const[{data:m},{data:p}]=await Promise.all([T.from("candidate_resumes").select("*").eq("user_id",e.id).maybeSingle(),T.from("profiles").select("full_name").eq("id",e.id).maybeSingle()]);n(m??null),i((p==null?void 0:p.full_name)??e.email??"Candidato"),l(!1)})()},[e,d]),o?s.jsx("div",{className:"py-24 flex justify-center",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-extrabold tracking-tight",children:"Meu currÃculo"}),s.jsx("p",{className:"text-muted-foreground",children:"Seu perfil é único e pode ser usado em qualquer processo seletivo."})]}),!c&&s.jsxs(P,{onClick:()=>u(!0),children:[s.jsx(Ml,{className:"w-4 h-4 mr-2"})," ",r?"Atualizar currÃculo":"Preencher currÃculo"]})]}),s.jsxs(Q,{children:[s.jsxs(ye,{children:[s.jsx(we,{className:"text-lg",children:c?"Editar currÃculo":"Perfil"}),s.jsx(bt,{children:c?"Altere qualquer informação e salve â nada é apagado.":"Assim as empresas veem você."})]}),s.jsx(X,{children:c?s.jsx(lF,{resume:r,name:a,onCancel:()=>u(!1),onSaved:()=>{u(!1),f(m=>m+1)}}):s.jsx(eC,{resume:r,name:a,email:e==null?void 0:e.email})})]}),!c&&s.jsxs(Q,{children:[s.jsxs(ye,{children:[s.jsx(we,{className:"text-lg",children:"Outras formas de atualizar"}),s.jsx(bt,{children:"Importe um arquivo ou refaça o currÃculo conversando com a IA."})]}),s.jsxs(X,{className:"space-y-4",children:[s.jsx(fS,{onSaved:()=>f(m=>m+1)}),s.jsx(P,{asChild:!0,variant:"outline",children:s.jsxs(me,{to:`${t}/curriculo`,children:[s.jsx(YT,{className:"w-4 h-4 mr-2"})," Refazer conversando com a IA"]})})]})]}),s.jsx(cF,{})]})};function uF(){return s.jsxs("div",{className:"min-h-screen flex flex-col bg-background text-foreground",children:[s.jsx(Tg,{}),s.jsx("main",{className:"flex-1",children:s.jsxs(n1,{children:[s.jsx(oe,{index:!0,element:s.jsx(tp,{})}),s.jsx(oe,{path:"vagas",element:s.jsx(Ik,{})}),s.jsx(oe,{path:"vagas/:jobSlug",element:s.jsx(Lk,{})}),s.jsx(oe,{path:"vagas/:jobSlug/aplicar",element:s.jsx($k,{})}),s.jsx(oe,{path:"sobre",element:s.jsx(Dk,{})}),s.jsx(oe,{path:"empresas",element:s.jsx(Mk,{})}),s.jsx(oe,{path:"empresas/cadastro",element:s.jsx(Fk,{})}),s.jsx(oe,{path:"empresas/:companySlug",element:s.jsx(zk,{})}),s.jsx(oe,{path:"contato",element:s.jsx(Uk,{})}),s.jsx(oe,{path:"lgpd",element:s.jsx(Bk,{})}),s.jsx(oe,{path:"auth",element:s.jsx(rp,{})}),s.jsxs(oe,{path:"minha-area",element:s.jsx(ls,{children:s.jsx(Ak,{})}),children:[s.jsx(oe,{index:!0,element:s.jsx(Qk,{})}),s.jsx(oe,{path:"vagas",element:s.jsx(Zk,{})}),s.jsx(oe,{path:"recomendacoes",element:s.jsx(Yk,{})}),s.jsx(oe,{path:"candidaturas",element:s.jsx(Xk,{})}),s.jsx(oe,{path:"perfil",element:s.jsx(tC,{})})]}),s.jsx(oe,{path:"curriculo",element:s.jsx(ls,{children:s.jsx(eu,{})})}),s.jsx(oe,{path:"*",element:s.jsx(Dg,{})})]})}),s.jsx(Rg,{})]})}function dF(){const{tenant:e,loading:t}=xt(),r=mr();return t?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx(le,{className:"w-8 h-8 animate-spin text-primary"})}):e?s.jsx(uF,{}):r.pathname==="/"?s.jsx(eN,{}):s.jsx(Dg,{})}function hF(){return s.jsx(Cg,{children:s.jsx(dF,{})})}const fF=()=>{const{tenant:e,loading:t,error:r}=xt();return t?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx(le,{className:"w-8 h-8 animate-spin text-primary"})}):e?s.jsxs("div",{className:"min-h-screen flex flex-col bg-background text-foreground",children:[s.jsx(Tg,{}),s.jsx("main",{className:"flex-1",children:s.jsx(Od,{})}),s.jsx(Rg,{})]}):s.jsx("div",{className:"min-h-screen flex items-center justify-center px-4",children:s.jsxs("div",{className:"max-w-md text-center space-y-3",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Portal indisponÃvel"}),s.jsx("p",{className:"text-muted-foreground",children:r||"Este portal não está disponÃvel no momento."})]})})},mF=()=>s.jsx(Cg,{children:s.jsx(fF,{})}),pF=[{title:"Dashboard",url:"/painel",icon:wd,end:!0},{title:"Vagas",url:"/painel/vagas",icon:Mt},{title:"Pipeline",url:"/painel/pipeline",icon:lR},{title:"Banco de Talentos",url:"/painel/talentos",icon:ur}
559],gF=({tenantName:e,logoUrl:t,isAgency:r})=>{const{state:n}=uo(),a=n==="collapsed",{pathname:i}=mr(),o=[...pF,...r?[{title:"Empresas",url:"/painel/empresas",icon:At}]:[],{title:"Marketplace",url:"/painel/marketplace",icon:cg},{title:"Páginas do portal",url:"/painel/paginas",icon:KT},{title:"Configurações",url:"/painel/configuracoes",icon:Jj}];return s.jsx(ev,{collapsible:"icon",children:s.jsxs(rv,{children:[s.jsxs("div",{className:"px-3 py-4 flex items-center gap-2.5",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center shrink-0 overflow-hidden",children:t?s.jsx("img",{src:t,alt:`Logo ${e??"cliente"}`,className:"w-full h-full object-contain"}):s.jsx(At,{className:"w-4 h-4 text-primary"})}),!a&&s.jsxs("div",{className:"leading-tight min-w-0",children:[s.jsx("div",{className:"text-sm font-bold tracking-tight truncate",children:e??"Painel"}),s.jsx("div",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:"Recrutamento"})]})]}),s.jsxs(nv,{children:[s.jsx(sv,{children:"Gestão"}),s.jsx(av,{children:s.jsx(iv,{children:o.map(l=>{const c=l.end?i===l.url:i.startsWith(l.url);return s.jsx(ov,{children:s.jsx(lv,{asChild:!0,isActive:c,children:s.jsxs(Bl,{to:l.url,end:l.end,className:"flex items-center gap-2",children:[s.jsx(l.icon,{className:"h-4 w-4"}),!a&&s.jsx("span",{children:l.title})]})})},l.title)})})})]})]})})},L0="id,name,slug,logo_url,primary_color,custom_domain,contact_email,contact_phone,job_limit,plan,tenant_type,parent_agency_id,marketplace_opt_in,marketplace_subscribed,marketplace_commission",vF=()=>{const{user:e,roles:t}=it(),[r,n]=h.useState(null),[a,i]=h.useState(!0),o=async()=>{var f;if(!e){n(null),i(!1);return}i(!0);let l=null;const c=typeof window<"u"?new URLSearchParams(window.location.search).get("tenant"):null;if(c&&t.includes("super_admin")){const{data:m}=await T.from("tenants").select(L0).eq("slug",c).maybeSingle();n(m??null),i(!1);return}const{data:u}=await T.from("user_roles").select("tenant_id, role").eq("user_id",e.id).not("tenant_id","is",null);if(l=((f=u==null?void 0:u[0])==null?void 0:f.tenant_id)??null,!l){const{data:m}=await T.from("profiles").select("tenant_id").eq("id",e.id).maybeSingle();l=(m==null?void 0:m.tenant_id)??null}if(!l){n(null),i(!1);return}const{data:d}=await T.from("tenants").select(L0).eq("id",l).maybeSingle();n(d??null),i(!1)};return h.useEffect(()=>{o()},[e==null?void 0:e.id,t.join(",")]),{tenant:r,loading:a,reload:o}},rC=h.createContext(void 0),Zn=()=>{const e=h.useContext(rC);if(!e)throw new Error("usePortal deve ser usado dentro do PortalLayout");return e},xF=()=>{const e=pr(),{signOut:t,user:r}=it(),{tenant:n,loading:a,reload:i}=vF();h.useEffect(()=>{if(!(n!=null&&n.primary_color))return;const c=R1(n.primary_color);if(!c)return;const u=document.documentElement;return u.style.setProperty("--primary",c),u.style.setProperty("--ring",c),()=>{u.style.removeProperty("--primary"),u.style.removeProperty("--ring")}},[n]);const o=n?B$(n):"",l=async()=>{await t(),e(`${o}/auth`,{replace:!0})};return a?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx(le,{className:"w-8 h-8 animate-spin text-primary"})}):n?s.jsx(rC.Provider,{value:{tenant:n,reload:i},children:s.jsx(Xg,{children:s.jsxs("div",{className:"min-h-screen flex w-full bg-muted/30",children:[s.jsx(gF,{tenantName:n.name,logoUrl:n.logo_url,isAgency:n.tenant_type==="agency",marketplace:n.marketplace_subscribed||n.marketplace_opt_in}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsxs("header",{className:"h-14 flex items-center justify-between border-b bg-background px-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(tv,{}),s.jsx("span",{className:"text-sm text-muted-foreground hidden sm:inline",children:"Painel de Recrutamento"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(P,{asChild:!0,variant:"ghost",size:"sm",children:s.jsxs("a",{href:o||"/",target:"_blank",rel:"noreferrer",children:[s.jsx(yd,{className:"w-4 h-4 mr-2"})," Ver portal"]})}),s.jsx("span",{className:"text-xs text-muted-foreground hidden md:inline",children:r==null?void 0:r.email}),s.jsxs(P,{variant:"ghost",size:"sm",onClick:l,children:[s.jsx(ig,{className:"w-4 h-4 mr-2"})," Sair"]})]})]}),s.jsx("main",{className:"flex-1 p-6",children:s.jsx(Od,{})})]})]})})}):s.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",children:s.jsxs("div",{className:"max-w-md text-center space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Nenhum cliente vinculado"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Sua conta ainda não está associada a um cliente. Peça ao administrador da plataforma para vincular seu usuário a uma empresa."}),s.jsx(P,{asChild:!0,variant:"secondary",children:s.jsx(me,{to:"/app",children:"Voltar para minha área"})})]})})},yF=()=>{const{tenant:e}=Zn(),[t,r]=h.useState({jobs:0,published:0,applications:0,newApps:0});h.useEffect(()=>{(async()=>{const[i,o,l,c]=await Promise.all([T.from("jobs").select("id",{count:"exact",head:!0}).eq("tenant_id",e.id),T.from("jobs").select("id",{count:"exact",head:!0}).eq("tenant_id",e.id).eq("status","published"),T.from("job_applications").select("id",{count:"exact",head:!0}).eq("tenant_id",e.id),T.from("job_applications").select("id",{count:"exact",head:!0}).eq("tenant_id",e.id).eq("status","new")]);r({jobs:i.count??0,published:o.count??0,applications:l.count??0,newApps:c.count??0})})()},[e.id]);const n=[{label:"Vagas cadastradas",value:t.jobs,icon:Mt},{label:"Vagas publicadas",value:t.published,icon:wn},{label:"Candidaturas",value:t.applications,icon:eo},{label:"Novas candidaturas",value:t.newApps,icon:ur}];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl font-bold",children:["Olá, ",e.name]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Visão geral do seu processo de recrutamento ⢠plano ",e.plan]})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:n.map(a=>s.jsxs(Q,{children:[s.jsxs(ye,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(we,{className:"text-sm font-medium text-muted-foreground",children:a.label}),s.jsx(a.icon,{className:"w-4 h-4 text-primary"})]}),s.jsx(X,{children:s.jsx("div",{className:"text-3xl font-bold",children:a.value})})]},a.label))}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsxs(Q,{children:[s.jsx(ye,{children:s.jsx(we,{className:"text-base",children:"Publicar uma vaga"})}),s.jsx(X,{children:s.jsx(P,{asChild:!0,size:"sm",children:s.jsxs(me,{to:"/painel/vagas",children:["Gerenciar vagas ",s.jsx(Mn,{className:"w-4 h-4 ml-2"})]})})})]}),s.jsxs(Q,{children:[s.jsx(ye,{children:s.jsx(we,{className:"text-base",children:"Avaliar candidatos"})}),s.jsx(X,{children:s.jsx(P,{asChild:!0,size:"sm",variant:"secondary",children:s.jsxs(me,{to:"/painel/pipeline",children:["Abrir pipeline ",s.jsx(Mn,{className:"w-4 h-4 ml-2"})]})})})]}),s.jsxs(Q,{children:[s.jsx(ye,{children:s.jsx(we,{className:"text-base",children:"Banco de talentos"})}),s.jsx(X,{children:s.jsx(P,{asChild:!0,size:"sm",variant:"secondary",children:s.jsxs(me,{to:"/painel/talentos",children:["Ver talentos ",s.jsx(Mn,{className:"w-4 h-4 ml-2"})]})})})]})]})]})},wF={text:"Texto curto",textarea:"Texto longo",select:"Escolha única",boolean:"Sim / Não",number:"Número"},bF=({jobId:e,jobTitle:t,tenantId:r,open:n,onOpenChange:a})=>{const[i,o]=h.useState([]),[l,c]=h.useState([]),[u,d]=h.useState(!1),[f,m]=h.useState(!1);h.useEffect(()=>{!n||!e||(async()=>{d(!0),c([]);const{data:w}=await T.from("job_questions").select("*").eq("job_id",e).order("sort_order");o((w??[]).map(g=>({id:g.id,label:g.label,help_text:g.help_text,field_type:g.field_type,options:g.options??[],is_required:g.is_required,sort_order:g.sort_order}))),d(!1)})()},[n,e]);const p=(w,g)=>o(y=>y.map((j,_)=>_===w?{...j,...g}:j)),b=()=>o(w=>[...w,{label:"",help_text:null,field_type:"text",options:[],is_required:!1,sort_order:w.length}]),v=w=>{const g=i[w];g.id&&c(y=>[...y,g.id]),o(y=>y.filter((j,_)=>_!==w))},x=async()=>
559{if(!e)return;if(i.some(y=>!y.label.trim())){M.error("Toda pergunta precisa de um tÃtulo.");return}if(i.some(y=>y.field_type==="select"&&y.options.filter(Boolean).length<2)){M.error("Perguntas de escolha única precisam de ao menos 2 opções.");return}m(!0),l.length&&await T.from("job_questions").delete().in("id",l);const w=i.map((y,j)=>({...y.id?{id:y.id}:{},tenant_id:r,job_id:e,label:y.label.trim(),help_text:y.help_text||null,field_type:y.field_type,options:y.field_type==="select"?y.options.filter(Boolean):[],is_required:y.is_required,sort_order:j})),{error:g}=w.length?await T.from("job_questions").upsert(w):{error:null};if(m(!1),g){M.error(g.message);return}M.success("Perguntas salvas."),a(!1)};return s.jsx(Kn,{open:n,onOpenChange:a,children:s.jsxs(gn,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(vn,{children:[s.jsx(yn,{children:"Perguntas da candidatura"}),s.jsxs(zs,{children:["Informações extras que os candidatos responderão ao se inscrever",t?` em "${t}"`:"",". As respostas ficam apenas nesta candidatura e não alteram o currÃculo do candidato."]})]}),u?s.jsx("div",{className:"py-10 flex justify-center",children:s.jsx(le,{className:"w-5 h-5 animate-spin text-primary"})}):s.jsxs("div",{className:"space-y-4",children:[i.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma pergunta cadastrada. Exemplos: CNH, NR35, disponibilidade, turno, pretensão salarial."}),i.map((w,g)=>s.jsx("div",{className:"rounded-lg border p-4 space-y-3",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Hj,{className:"w-4 h-4 mt-2.5 text-muted-foreground shrink-0"}),s.jsxs("div",{className:"flex-1 space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-[1fr_170px]",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(U,{htmlFor:`q-label-${g}`,children:"Pergunta"}),s.jsx(q,{id:`q-label-${g}`,value:w.label,placeholder:"Ex.: Possui CNH categoria B?",onChange:y=>p(g,{label:y.target.value})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(U,{children:"Tipo"}),s.jsxs(gt,{value:w.field_type,onValueChange:y=>p(g,{field_type:y}),children:[s.jsx(ut,{children:s.jsx(vt,{})}),s.jsx(dt,{children:Object.entries(wF).map(([y,j])=>s.jsx(ke,{value:y,children:j},y))})]})]})]}),w.field_type==="select"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(U,{htmlFor:`q-opts-${g}`,children:"Opções (separadas por vÃrgula)"}),s.jsx(q,{id:`q-opts-${g}`,value:w.options.join(", "),placeholder:"Manhã, Tarde, Noite",onChange:y=>p(g,{options:y.target.value.split(",").map(j=>j.trim())})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(U,{htmlFor:`q-help-${g}`,children:"Texto de ajuda (opcional)"}),s.jsx(q,{id:`q-help-${g}`,value:w.help_text??"",onChange:y=>p(g,{help_text:y.target.value})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_r,{id:`q-req-${g}`,checked:w.is_required,onCheckedChange:y=>p(g,{is_required:y})}),s.jsx(U,{htmlFor:`q-req-${g}`,children:"Obrigatória"})]}),s.jsxs(P,{variant:"ghost",size:"sm",onClick:()=>v(g),children:[s.jsx(Vn,{className:"w-4 h-4 mr-2"})," Remover"]})]})]})]})},w.id??`new-${g}`)),s.jsxs(P,{variant:"outline",onClick:b,className:"w-full",children:[s.jsx(mn,{className:"w-4 h-4 mr-2"})," Adicionar pergunta"]})]}),s.jsxs(xn,{children:[s.jsx(P,{variant:"ghost",onClick:()=>a(!1),children:"Cancelar"}),s.jsxs(P,{onClick:x,disabled:f||u,children:[f&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),"Salvar perguntas"]})]})]})})},$0={draft:"Rascunho",published:"Publicada",paused:"Pausada",closed:"Encerrada"},D0={clt:"CLT",pj:"PJ",freelance:"Freelance",estagio:"Estágio",temporario:"Temporário",trainee:"Trainee"},pf=e=>e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60),M0={title:"",slug:"",department:"",location:"",is_remote:!1,employment_type:"clt",status:"draft",description:"",requirements:"",benefits:"",salary_min:"",salary_max:"",show_salary:!1,company_tenant_id:"",disclose_company:!0},jF=()=>{const{tenant:e}=Zn(),[t,r]=h.useState([]),[n,a]=h.useState(!0),[i,o]=h.useState(""),[l,c]=h.useState(!1),[u,d]=h.useState(null),[f,m]=h.useState(!1),[p,b]=h.useState(M0),[v,x]=h.useState(null),[w,g]=h.useState({}),[y,j]=h.useState([]),[_,S]=h.useState(""),[N,E]=h.useState(!1),[R,I]=h.useState([]),A=e.tenant_type==="agency",C=async()=>{var H,te;if(!p.title.trim()){M.error("Informe o tÃtulo da vaga para a IA começar");return}E(!0);const{data:k,error:L}=await T.functions.invoke("job-assist",{body:{title:p.title,notes:_,department:p.department,location:p.location,employment_type:p.employment_type,is_remote:p.is_remote,company_name:A?((H=y.find(ne=>ne.id===p.company_tenant_id))==null?void 0:H.name)??"":e.name}});if(E(!1),L){M.error("Não foi possÃvel gerar com IA. Tente novamente.");return}const $=k;b(ne=>({...ne,description:$.description||ne.description,requirements:$.requirements||ne.requirements,benefits:$.benefits||ne.benefits})),I($.questions??[]),M.success("Conteúdo gerado pela IA",{description:(te=$.questions)!=null&&te.length?`${$.questions.length} perguntas de triagem sugeridas serão criadas ao salvar.`:"Revise e ajuste antes de publicar."})};h.useEffect(()=>{if(!A){j([]);return}T.from("tenants").select("id,name").eq("parent_agency_id",e.id).eq("is_active",!0).order("name").then(({data:k})=>j(k??[]))},[e.id,A]);const F=async()=>{a(!0);const{data:k,error:L}=await T.from("jobs").select("*").eq("tenant_id",e.id).order("created_at",{ascending:!1});L&&M.error(L.message),r(k??[]),a(!1);const{data:$}=await T.from("job_questions").select("job_id").eq("tenant_id",e.id),H={};
559($??[]).forEach(te=>{H[te.job_id]=(H[te.job_id]??0)+1}),g(H)};h.useEffect(()=>{F()},[e.id]);const D=()=>{d(null),b(M0),c(!0)},z=k=>{var L,$;d(k),b({title:k.title,slug:k.slug,department:k.department??"",location:k.location??"",is_remote:k.is_remote,employment_type:k.employment_type,status:k.status,description:k.description??"",requirements:k.requirements??"",benefits:k.benefits??"",salary_min:((L=k.salary_min)==null?void 0:L.toString())??"",salary_max:(($=k.salary_max)==null?void 0:$.toString())??"",show_salary:k.show_salary,company_tenant_id:k.company_tenant_id??"",disclose_company:k.disclose_company??!0}),c(!0)},B=async()=>{if(!p.title.trim()){M.error("Informe o tÃtulo da vaga");return}m(!0);const k={tenant_id:e.id,title:p.title.trim(),slug:(p.slug||pf(p.title)).trim(),department:p.department||null,location:p.location||null,is_remote:p.is_remote,employment_type:p.employment_type,status:p.status,description:p.description||null,requirements:p.requirements||null,benefits:p.benefits||null,salary_min:p.salary_min?Number(p.salary_min):null,salary_max:p.salary_max?Number(p.salary_max):null,show_salary:p.show_salary,company_tenant_id:A&&p.company_tenant_id?p.company_tenant_id:null,disclose_company:p.disclose_company,published_at:p.status==="published"?(u==null?void 0:u.published_at)??new Date().toISOString():(u==null?void 0:u.published_at)??null},{data:L,error:$}=u?await T.from("jobs").update(k).eq("id",u.id).select("id,title").maybeSingle():await T.from("jobs").insert(k).select("id,title").maybeSingle();if(m(!1),$){M.error($.message);return}if(c(!1),F(),L&&R.length){const{count:H}=await T.from("job_questions").select("id",{count:"exact",head:!0}).eq("job_id",L.id);H||(await T.from("job_questions").insert(R.map((te,ne)=>({tenant_id:e.id,job_id:L.id,label:te.label,field_type:te.field_type,options:te.options??[],is_required:te.is_required,sort_order:ne}))),M.success(`${R.length} perguntas de triagem criadas pela IA`),F())}I([]),S(""),!u&&L?M.success("Vaga criada",{description:"Quer adicionar perguntas exclusivas na candidatura?",action:{label:"Configurar perguntas",onClick:()=>x({id:L.id,title:L.title})}}):M.success("Vaga atualizada")},K=async k=>{if(!confirm(`Excluir a vaga "${k.title}"? Esta ação não pode ser desfeita.`))return;const{error:L}=await T.from("jobs").delete().eq("id",k.id);if(L){M.error(L.message);return}M.success("Vaga excluÃda"),F()},O=t.filter(k=>[k.title,k.department,k.location].join(" ").toLowerCase().includes(i.toLowerCase()));return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Vagas"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," de ",e.job_limit," vagas do seu plano"]})]}),s.jsxs(P,{onClick:D,children:[s.jsx(mn,{className:"w-4 h-4 mr-2"})," Nova vaga"]})]}),s.jsxs("div",{className:"relative max-w-sm",children:[s.jsx(kr,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(q,{className:"pl-9",placeholder:"Buscar por tÃtulo, área ou local",value:i,onChange:k=>o(k.target.value)})]}),n?s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):O.length===0?s.jsx(Q,{children:s.jsxs(X,{className:"py-16 text-center space-y-3",children:[s.jsx(Mt,{className:"w-8 h-8 mx-auto text-muted-foreground"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma vaga encontrada."}),s.jsx(P,{size:"sm",onClick:D,children:"Criar primeira vaga"})]})}):s.jsx("div",{className:"grid gap-3",children:O.map(k=>{var L;return s.jsx(Q,{children:s.jsxs(X,{className:"p-4 flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-semibold",children:k.title}),s.jsx(pe,{variant:k.status==="published"?"default":"secondary",children:$0[k.status]}),s.jsx(pe,{variant:"outline",children:D0[k.employment_type]}),A&&k.company_tenant_id&&s.jsxs(pe,{variant:"secondary",children:[((L=y.find($=>
559$.id===k.company_tenant_id))==null?void 0:L.name)??"Empresa cliente",!k.disclose_company&&" (sigilosa)"]})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:[k.department,k.is_remote?"Remoto":k.location].filter(Boolean).join(" ⢠")||"â"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(P,{asChild:!0,size:"sm",variant:"secondary",children:s.jsxs(me,{to:`/painel/vagas/${k.id}/candidatos`,children:[s.jsx(ur,{className:"w-4 h-4 mr-2"})," Candidatos"]})}),s.jsxs(P,{size:"sm",variant:"outline",title:"Perguntas exclusivas da candidatura",onClick:()=>x({id:k.id,title:k.title}),children:[s.jsx(zx,{className:"w-4 h-4 mr-2"}),"Perguntas",w[k.id]?` (${w[k.id]})`:""]}),s.jsx(P,{size:"sm",variant:"ghost",onClick:()=>z(k),children:s.jsx(Ml,{className:"w-4 h-4"})}),s.jsx(P,{size:"sm",variant:"ghost",onClick:()=>K(k),children:s.jsx(Vn,{className:"w-4 h-4"})})]})]})},k.id)})}),s.jsx(Kn,{open:l,onOpenChange:c,children:s.jsxs(gn,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(vn,{children:[s.jsx(yn,{children:u?"Editar vaga":"Nova vaga"}),s.jsx(zs,{children:"Preencha as informações que aparecerão no portal público."})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"sm:col-span-2 rounded-lg border border-primary/30 bg-primary/5 p-3 space-y-2",children:[s.jsxs(U,{htmlFor:"ainotes",className:"flex items-center gap-2 text-primary",children:[s.jsx(Ft,{className:"w-4 h-4"})," Assistente de IA"]}),s.jsx(ct,{id:"ainotes",rows:2,placeholder:"Conte em poucas palavras o que a vaga exige (ex: atendimento ao cliente, escala 6x1, experiência com CRM)",value:_,onChange:k=>S(k.target.value)}),s.jsxs(P,{type:"button",size:"sm",onClick:C,disabled:N,children:[N?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Gerar descrição, requisitos e perguntas"]})]}),s.jsxs("div",{className:"sm:col-span-2 space-y-2",children:[s.jsx(U,{htmlFor:"title",children:"TÃtulo *"}),s.jsx(q,{id:"title",value:p.title,onChange:k=>b(L=>({...L,title:k.target.value,slug:u?L.slug:pf(k.target.value)}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"slug",children:"Slug (URL)"}),s.jsx(q,{id:"slug",value:p.slug,onChange:k=>b(L=>({...L,slug:pf(k.target.value)}))})]}),A&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Empresa contratante"}),s.jsxs(gt,{value:p.company_tenant_id||"none",onValueChange:k=>b(L=>({...L,company_tenant_id:k==="none"?"":k})),children:[s.jsx(ut,{children:s.jsx(vt,{placeholder:"Selecione a empresa"})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"none",children:"Vaga própria da agência"}),y.map(k=>s.jsx(ke,{value:k.id,children:k.name},k.id))]})]})]}),s.jsxs("div",{className:"sm:col-span-2 flex items-center gap-3",children:[s.jsx(_r,{id:"disclose",checked:p.disclose_company,onCheckedChange:k=>b(L=>({...L,disclose_company:k})),disabled:!p.company_tenant_id}),s.jsx(U,{htmlFor:"disclose",children:"Divulgar o nome da empresa contratante no portal público"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"department",children:"Ãrea / Departamento"}),s.jsx(q,{id:"department",value:p.department,onChange:k=>b(L=>({...L,department:k.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"location",children:"Localização"}),s.jsx(q,{id:"location",value:p.location,onChange:k=>b(L=>({...L,location:k.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Contratação"}),s.jsxs(gt,{value:p.employment_type,onValueChange:k=>b(L=>({...L,employment_type:k})),children:[s.jsx(ut,{children:s.jsx(vt,{})}),s.jsx(dt,{children:Object.entries(D0).map(([k,L])=>s.jsx(ke,{value:k,children:L},k))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Status"}),s.jsxs(gt,{value:p.status,onValueChange:k=>b(L=>({...L,status:k})),children:[s.jsx(ut,{children:s.jsx(vt,{})}),s.jsx(dt,{children:Object.entries($0).map(([k,L])=>s.jsx(ke,{value:k,children:L},k))})]})]}),s.jsxs("div",{className:"flex items-center gap-3 pt-6",children:[s.jsx(_r,{id:"remote",checked:p.is_remote,onCheckedChange:k=>b(L=>({...L,is_remote:k}))}),s.jsx(U,{htmlFor:"remote",children:"Vaga remota"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"smin",children:"Salário mÃnimo (R$)"}),s.jsx(q,{id:"smin",type:"number",value:p.salary_min,onChange:k=>b(L=>({...L,salary_min:k.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"smax",children:"Salário máximo (R$)"}),s.jsx(q,{id:"smax",type:"number",value:p.salary_max,onChange:k=>b(L=>({...L,salary_max:k.target.value}))})]}),s.jsxs("div",{className:"flex items-center gap-3 sm:col-span-2",children:[s.jsx(_r,{id:"showsalary",checked:p.show_salary,onCheckedChange:k=>b(L=>({...L,show_salary:k}))}
559),s.jsx(U,{htmlFor:"showsalary",children:"Exibir faixa salarial no portal"})]}),s.jsxs("div",{className:"sm:col-span-2 space-y-2",children:[s.jsx(U,{htmlFor:"desc",children:"Descrição"}),s.jsx(ct,{id:"desc",rows:4,value:p.description,onChange:k=>b(L=>({...L,description:k.target.value}))})]}),s.jsxs("div",{className:"sm:col-span-2 space-y-2",children:[s.jsx(U,{htmlFor:"req",children:"Requisitos"}),s.jsx(ct,{id:"req",rows:3,value:p.requirements,onChange:k=>b(L=>({...L,requirements:k.target.value}))})]}),s.jsxs("div",{className:"sm:col-span-2 space-y-2",children:[s.jsx(U,{htmlFor:"ben",children:"BenefÃcios"}),s.jsx(ct,{id:"ben",rows:3,value:p.benefits,onChange:k=>b(L=>({...L,benefits:k.target.value}))})]})]}),s.jsxs(xn,{children:[u&&s.jsxs(P,{variant:"outline",className:"mr-auto",onClick:()=>x({id:u.id,title:u.title}),children:[s.jsx(zx,{className:"w-4 h-4 mr-2"})," Configurar perguntas da candidatura"]}),s.jsx(P,{variant:"ghost",onClick:()=>c(!1),children:"Cancelar"}),s.jsxs(P,{onClick:B,disabled:f,children:[f&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"})," Salvar"]})]})]})}),s.jsx(bF,{jobId:(v==null?void 0:v.id)??null,jobTitle:v==null?void 0:v.title,tenantId:e.id,open:!!v,onOpenChange:k=>!k&&x(null)})]})},_F={new:"Novo",screening:"Triagem",interview:"Entrevista",offer:"Proposta",hired:"Contratado",rejected:"Reprovado",withdrawn:"Desistiu"},F0={atende:"Atende",parcial:"Atende parcialmente",nao_atende:"Não atende",sem_resposta:"Sem resposta"},z0=e=>e==="atende"?"bg-primary/10 text-primary border-primary/20":e==="parcial"?"bg-amber-500/10 text-amber-600 border-amber-500/20":"bg-destructive/10 text-destructive border-destructive/20",gf=e=>Array.isArray(e.answers_review)?e.answers_review:[],U0=e=>e>=75?"text-primary":e>=50?"text-amber-600":"text-muted-foreground",NF=()=>{const{tenant:e}=Zn(),{jobId:t}=Aa(),[r,n]=h.useState(null),[a,i]=h.useState([]),[o,l]=h.useState(!0),[c,u]=h.useState(null),[d,f]=h.useState(!1),[m,p]=h.useState(null),[b,v]=h.useState(!1),x=h.useCallback(async()=>{if(!t)return;l(!0);const[{data:_},{data:S,error:N}]=await Promise.all([T.from("jobs").select("id,title,requirements").eq("id",t).eq("tenant_id",e.id).maybeSingle(),T.from("job_applications").select("*").eq("job_id",t).eq("tenant_id",e.id)]);N&&M.error(N.message),n(_??null);const E=S??[],R=[...new Set(E.map(C=>C.candidate_id))];let I=[],A=[];if(R.length){const[{data:C},{data:F}]=await Promise.all([T.from("profiles").select("id, full_name, email").in("id",R),T.from("candidate_resumes").select("*").in("user_id",R)]);I=C??[],A=F??[]}i(E.map(C=>{const F=I.find(D=>D.id===C.candidate_id);return{...C,name:(F==null?void 0:F.full_name)||(F==null?void 0:F.email)||"Candidato",email:(F==null?void 0:F.email)??null,resume:A.find(D=>D.user_id===C.candidate_id)??null}})),l(!1)},[t,e.id]);h.useEffect(()=>{x()},[x]),h.useEffect(()=>{if(o||b||d)return;const _=a.filter(S=>S.match_score===null);_.length&&(v(!0),(async()=>{f(!0);for(const S of _)await T.functions.invoke("match-resume",{body:{application_id:S.id}});f(!1),x()})())},[o,a,b,d,x]);const w=h.useMemo(()=>[...a].sort((_,S)=>(S.match_score??-1)-(_.match_score??-1)),[a]),g=async _=>{u(_);const{data:S,error:N}=await T.functions.invoke("match-resume",{body:{application_id:_}});if(u(null),N){M.error("Não foi possÃvel analisar este candidato agora.");return}if(S!=null&&S.error){M.error(S.error);return}M.success("Análise concluÃda"),x()},y=async()=>{const _=a.filter(S=>S.match_score===null);if(!_.length){M.info("Todos os candidatos já foram analisados.");return}f(!0);for(const S of _)await T.functions.invoke("match-resume",{body:{application_id:S.id}});f(!1),M.success("Ranking de match atualizado"),x()},j=async(_,S)=>{const N=a;i(R=>R.map(I=>I.id===_?{...I,status:S}:I));const{error:E}=await T.from("job_applications").update({status:S}).eq("id",_);E&&(i(N),M.error(E.message))};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx(P,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-2 mb-1",children:s.jsxs(me,{to:"/painel/vagas",children:[s.jsx(Mi,{className:"w-4 h-4 mr-2"})," Voltar para vagas"]})}),s.jsx("h1",{className:"text-2xl font-bold",children:(r==null?void 0:r.title)??"Processo seletivo"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.length," candidato(s) no processo, ordenados pela compatibilidade
559com os requisitos da vaga e as respostas das perguntas adicionais."]})]}),s.jsxs(P,{onClick:y,disabled:d||o,children:[d?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(Ft,{className:"w-4 h-4 mr-2"}),d?"Analisando com IA...":"Analisar match com IA"]})]}),o?s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):w.length===0?s.jsx(Q,{children:s.jsxs(X,{className:"py-16 text-center space-y-2",children:[s.jsx(ur,{className:"w-8 h-8 mx-auto text-muted-foreground"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum candidato nesta vaga ainda."})]})}):s.jsx("div",{className:"grid gap-3",children:w.map((_,S)=>{var N,E,R,I,A;return s.jsx(Q,{children:s.jsxs(X,{className:"p-4 space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs(pe,{variant:"outline",children:["#",S+1]}),s.jsx("button",{className:"font-semibold hover:underline text-left",onClick:()=>p(_),children:_.name}),((N=_.resume)==null?void 0:N.headline)&&s.jsx("span",{className:"text-xs text-muted-foreground",children:_.resume.headline})]}),_.match_summary&&s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-2xl",children:_.match_summary}),_.answers_score!==null&&_.answers_score!==void 0&&s.jsxs("p",{className:"text-xs mt-1",children:[s.jsx("span",{className:"text-muted-foreground",children:"Triagem: "}),s.jsxs("span",{className:`font-semibold ${U0(_.answers_score)}`,children:[_.answers_score,"%"]}),s.jsx("span",{className:"text-muted-foreground",children:" de aderência nas respostas"})]})]}),s.jsx("div",{className:"w-40 shrink-0",children:_.match_score!==null?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-baseline justify-between",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Match"}),s.jsxs("span",{className:`text-lg font-bold ${U0(_.match_score)}`,children:[_.match_score,"%"]})]}),s.jsx(mv,{value:_.match_score,className:"h-1.5 mt-1"})]}):s.jsxs(P,{size:"sm",variant:"secondary",className:"w-full",onClick:()=>g(_.id),disabled:c===_.id,children:[c===_.id?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Calcular match"]})})]}),!!gf(_).length&&s.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 space-y-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Avaliação das perguntas de triagem (IA)"}),s.jsx("div",{className:"space-y-2",children:gf(_).map((C,F)=>s.jsxs("div",{className:"text-xs",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(pe,{variant:"outline",className:z0(C.verdict??"parcial"),children:F0[C.verdict??"parcial"]??"Atende parcialmente"}),s.jsx("span",{className:"font-medium",children:C.label})]}),C.comment&&s.jsx("p",{className:"text-muted-foreground mt-0.5 pl-1",children:C.comment})]},F))})]}),(((E=_.match_strengths)==null?void 0:E.length)||((R=_.match_gaps)==null?void 0:R.length))&&s.jsxs("div",{className:"grid sm:grid-cols-2 gap-2 text-xs",children:[!!((I=_.match_strengths)!=null&&I.length)&&s.jsxs("div",{children:[s.jsx("p",{className:"font-medium mb-1",children:"Pontos fortes"}),s.jsx("ul",{className:"list-disc pl-4 text-muted-foreground space-y-0.5",children:_.match_strengths.map((C,F)=>s.jsx("li",{children:C},F))})]}),!!((A=_.match_gaps)!=null&&A.length)&&s.jsxs("div",{children:[s.jsx("p",{className:"font-medium mb-1",children:"Lacunas"}),s.jsx("ul",{className:"list-disc pl-4 text-muted-foreground space-y-0.5",children:_.match_gaps.map((C,F)=>s.jsx("li",{children:C},F))})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(gt,{value:_.status,onValueChange:C=>j(_.id,C),children:[s.jsx(ut,{className:"w-44 h-8 text-xs",children:s.jsx(vt,{})}),s.jsx(dt,{children:Object.entries(_F).map(([C,F])=>s.jsx(ke,{value:C,children:F},C))})]}),s.jsxs(P,{size:"sm",variant:"ghost",onClick:()=>p(_),children:[s.jsx(eo,{className:"w-4 h-4 mr-2"})," Ver currÃculo"]}),_.match_score!==null&&s.jsxs(P,{size:"sm",variant:"ghost",onClick:()=>g(_.id),disabled:c===_.id,children:[c===_.id?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Recalcular"]})]})]})},_.id)})}),s.jsx(Qg,{open:!!m,onOpenChange:_=>!_&&p(null),children:s.jsxs(Xd,{className:"w-full sm:max-w-lg overflow-y-auto",children:[s.jsx(Zg,{className:"mb-4",children:s.jsx(Yg,{children:"CurrÃculo do candidato"})}),m&&s.jsxs("div",{className:"space-y-6",children:[s.jsx(eC,{resume:m.resume_snapshot??m.resume,name:m.name,email:m.email}),m.custom_answers&&Object.keys(m.custom_answers).length>0&&s.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[s.jsx("p",{className:"text-sm font-semibold",children:"Respostas de
559sta candidatura"}),Object.entries(m.custom_answers).map(([_,S])=>{const N=gf(m).find(E=>E.question_id===_||E.label===S.label);return s.jsxs("div",{className:"text-sm",children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:S.label}),s.jsx("div",{children:S.value}),N&&s.jsxs("div",{className:"mt-1 flex items-start gap-2",children:[s.jsx(pe,{variant:"outline",className:z0(N.verdict??"parcial"),children:F0[N.verdict??"parcial"]??"Atende parcialmente"}),N.comment&&s.jsx("span",{className:"text-xs text-muted-foreground",children:N.comment})]})]},_)})]})]})]})})]})},SF=[{status:"new",label:"Novos"},{status:"screening",label:"Triagem"},{status:"interview",label:"Entrevista"},{status:"offer",label:"Proposta"},{status:"hired",label:"Contratado"},{status:"rejected",label:"Reprovado"}],kF=()=>{const{tenant:e}=Zn(),[t,r]=h.useState([]),[n,a]=h.useState([]),[i,o]=h.useState("all"),[l,c]=h.useState(!0),[u,d]=h.useState(null),f=async()=>{c(!0);const[{data:b,error:v},{data:x}]=await Promise.all([T.from("job_applications").select("*, jobs(title)").eq("tenant_id",e.id).order("created_at",{ascending:!1}),T.from("jobs").select("id,title").eq("tenant_id",e.id).order("title")]);v&&M.error(v.message);const w=b??[],g=[...new Set(w.map(j=>j.candidate_id))];let y=new Map;if(g.length){const{data:j}=await T.from("profiles").select("id, full_name, email").in("id",g);y=new Map((j??[]).map(_=>[_.id,{full_name:_.full_name,email:_.email}]))}r(w.map(j=>({...j,job:j.jobs,candidate:y.get(j.candidate_id)??null}))),a(x??[]),c(!1)};h.useEffect(()=>{f()},[e.id]);const m=h.useMemo(()=>i==="all"?t:t.filter(b=>b.job_id===i),[t,i]),p=async(b,v)=>{const x=t;r(g=>g.map(y=>y.id===b?{...y,status:v}:y));const{error:w}=await T.from("job_applications").update({status:v}).eq("id",b);w&&(r(x),M.error(w.message))};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Pipeline de seleção"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Arraste os candidatos entre as etapas para atualizar o status."})]}),s.jsxs("div",{className:"space-y-1.5 w-full sm:w-64",children:[s.jsx(U,{children:"Filtrar por vaga"}),s.jsxs(gt,{value:i,onValueChange:o,children:[s.jsx(ut,{children:s.jsx(vt,{})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"all",children:"Todas as vagas"}),n.map(b=>s.jsx(ke,{value:b.id,children:b.title},b.id))]})]})]})]}),l?s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):s.jsx("div",{className:"flex gap-4 overflow-x-auto pb-4",children:SF.map(b=>{const v=m.filter(x=>x.status===b.status);return s.jsxs("div",{className:"w-72 shrink-0 rounded-xl bg-muted/60 border p-3 space-y-3",onDragOver:x=>x.preventDefault(),onDrop:()=>{u&&p(u,b.status),d(null)},children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-semibold",children:b.label}),s.jsx(pe,{variant:"secondary",children:v.length})]}),s.jsxs("div",{className:"space-y-2 min-h-16",children:[v.map(x=>{var w,g,y;return s.jsx(Q,{draggable:!0,onDragStart:()=>d(x.id),className:"cursor-grab active:cursor-grabbing",children:s.jsx(X,{className:"p-3",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Hj,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:((w=x.candidate)==null?void 0:w.full_name)||((g=x.candidate)==null?void 0:g.email)||"Candidato"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:((y=x.job)==null?void 0:y.title)??"Vaga"}),x.match_score!==null&&s.jsxs(pe,{variant:"outline",className:"mt-1 text-[10px]",children:["Match ",x.match_score,"%"]})]})]})})},x.id)}),v.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"Vazio"})]})]},b.status)})})]})},vf="__none__",CF=()=>{const{tenant:e}=Zn(),{areas:t}=ch(),[r,n]=h.useState([]),[a,i]=h.useState(!0),[o,l]=h.useState(""),[c,u]=h.useState([]),[d,f]=h.useState({}),[m,p]=h.useState({}),[b,v]=h.useState("all"),x=e.tenant_type==="agency",[w,g]=h.useState(null),[y,j]=h.useState([]),[_,S]=h.useState([]),[N,E]=h.useState(!1),[R,I]=h.useState(!1),A=h.useMemo(()=>Object.fromEntries(t.map($=>[$.id,$])),[t]),C=h.useMemo(()=>Object.fromEntries(t.map($=>[$.key,$])),[t]),F=h.useCallback(async()=>{var te;const{data:$}=await T.from("talent_classifications").select("candidate_id,area_id").eq("tenant_id",e.id),H={};for(const ne of $??[])(H[te=ne.candidate_id]??(H[te]=[])).push(ne.area_id);f(H)},[e.id]);h.useEffect(()=>{x&&T.from("marketplace_candidates").select("candidate_id").eq("agency_tenant_id",e.id).then(({data:$})=>u(($??[]).map(H=>H.candidate_id)))},[e.id,x]);const D=async $=>{const{error:H}=await T.from("marketplace_candidates").insert({agency_tenant_id:e.id,candidate_id:$.id,headline:$.lastJob,commission_rate:e.marketplace_commission??0,area_ids:d[$.id]??[]});if(H)return M.error("Não foi possÃvel compartilhar");u(te=>[...te,$.id]),M.success("Candidato enviado ao Marketplace. Aguardando consentimento LGPD.")};h.useEffect(()=>{(async()=>{var Ae,G;i(!0);const{data:H,error:te}=await T.from("job_applications").select("candidate_id, resume_url, created_at, jobs(title)").eq("tenant_id",e.id).order("created_at",{ascending:!1});te&&M.error(te.message);const ne=H??[],{data:Te}=await T.from("tenant_candidates").select("candidate_id, created_at").eq("tenant_id",e.id),Be=Te??[],re=[...new Set([...ne.map(W=>W.candidate_id),...Be.map(W=>W.candidate_id)])];let Pe=[];if(re.length){const[{data:W},{data:ae}]=await Promise.all([T.from("profiles").select("id, full_name, email, phone").in("id",re),T.from("candidate_resumes").select("user_id, interest_areas").in("user_id",re)]);Pe=W??[],p(Object.fromEntries((ae??[]).map(Ce=>[Ce.user_id,Ce.interest_areas??[]])))}const Fe=new Map;for(const W of Be){const ae=Pe.find(Ce=>Ce.id===W.candidate_id);Fe.set(W.candidate_id,{id:W.candidate_id,name:(ae==null?void 0:ae.full_name)||(ae==null?void 0:ae.email)||"Candidato",email:(ae==null?void 0:ae.email)??null,phone:(ae==null?void 0:ae.phone)??null,applications:0,lastJob:null,lastResume:null,lastDate:W.created_at})}for(const W of ne){const ae=Pe.find(ot=>ot.id===W.candidate_id),Ce=Fe.get(W.candidate_id);Ce?(Ce.applications+=1,Ce.lastResume||(Ce.lastResume=W.resume_url),Ce.lastJob||(Ce.lastJob=((Ae=W.jobs)==null?void 0:Ae.title)??null),W.created_at>Ce.lastDate&&(Ce.lastDate=W.created_at)):Fe.set(W.candidate_id,{id:W.candidate_id,name:(ae==null?void 0:ae.full_name)||(ae==null?void 0:ae.email)||"Candidato",email:(ae==null?void 0:ae.email)??null,phone:(ae==null?void 0:ae.phone)??null,applications:1,lastJob:((G=W.jobs)==null?void 0:G.t
559itle)??null,lastResume:W.resume_url,lastDate:W.created_at})}n([...Fe.values()]),await F(),i(!1)})()},[e.id,F]);const z=$=>{g($),S([]);const H=d[$.id]??[];if(H.length)j(H);else{const te=(m[$.id]??[]).map(ne=>{var Te;return(Te=C[ne])==null?void 0:Te.id}).filter(Boolean);j(te)}},B=async()=>{if(!w)return;E(!0);const{data:$,error:H}=await T.functions.invoke("classify-talent",{body:{candidate_id:w.id,tenant_id:e.id}});if(E(!1),H||$!=null&&$.error)return M.error(($==null?void 0:$.error)??"Não foi possÃvel gerar sugestões agora.");const te=(($==null?void 0:$.areas)??[]).map(ne=>{var Te;return(Te=C[ne.key])==null?void 0:Te.id}).filter(Boolean);if(!te.length)return M.info("A IA não identificou áreas claras neste currÃculo.");S(te),M.success("Sugestões da IA aplicadas como destaque â confirme ou ajuste.")},K=async()=>{if(!w)return;I(!0);const $=d[w.id]??[],H=$.filter(ne=>!y.includes(ne)),te=y.filter(ne=>!$.includes(ne));H.length&&await T.from("talent_classifications").delete().eq("tenant_id",e.id).eq("candidate_id",w.id).in("area_id",H),te.length&&await T.from("talent_classifications").insert(te.map(ne=>({tenant_id:e.id,candidate_id:w.id,area_id:ne,source:_.includes(ne)?"ai":"recruiter"}))),c.includes(w.id)&&await T.from("marketplace_candidates").update({area_ids:y}).eq("agency_tenant_id",e.id).eq("candidate_id",w.id),I(!1),f(ne=>({...ne,[w.id]:y})),g(null),M.success("Classificação atualizada.")},O=r.filter($=>{if(![$.name,$.email,$.lastJob].join(" ").toLowerCase().includes(o.toLowerCase()))return!1;if(b==="all")return!0;const te=d[$.id]??[];return b===vf?te.length===0:te.includes(b)}),k=h.useMemo(()=>{const $=[];for(const te of t){const ne=O.filter(Te=>(d[Te.id]??[]).includes(te.id));ne.length&&$.push({id:te.id,name:te.name,items:ne})}const H=O.filter(te=>(d[te.id]??[]).length===0);return H.length&&$.push({id:vf,name:"Sem classificação",items:H}),$},[t,O,d]),L=$=>s.jsx(Q,{children:s.jsxs(X,{className:"p-4 flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-semibold",children:$.name}),s.jsxs(pe,{variant:"secondary",children:[$.applications," candidatura(s)"]}),(d[$.id]??[]).map(H=>{var te;return s.jsxs(pe,{variant:"outline",className:"gap-1",children:[s.jsx(pm,{className:"w-3 h-3"})," ",((te=A[H])==null?void 0:te.name)??"Ãrea"]},H)})]}),s.jsxs("div",{className:"text-xs text-muted-foreground mt-1 flex flex-wrap gap-3",children:[$.email&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(to,{className:"w-3 h-3"}),$.email]}),$.phone&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Fl,{className:"w-3 h-3"}),$.phone]}),$.lastJob&&s.jsxs("span",{children:["Ãltima vaga: ",$.lastJob]}),!!(m[$.id]??[]).length&&s.jsxs("span",{children:["Interesse do candidato:"," ",(m[$.id]??[]).map(H=>{var te;return((te=C[H])==null?void 0:te.name)??H}).join(", ")]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(P,{size:"sm",variant:"outline",onClick:()=>z($),children:[s.jsx(pm,{className:"w-4 h-4 mr-2"})," Classificar"]}),$.lastResume&&s.jsx(P,{asChild:!0,size:"sm",variant:"secondary",children:s.jsxs("a",{href:$.lastResume,target:"_blank",rel:"noreferrer",children:[s.jsx(eo,{className:"w-4 h-4 mr-2"})," CurrÃculo"]})}),x&&s.jsxs(P,{size:"sm",variant:c.includes($.id)?"outline":"default",disabled:c.includes($.id),onClick:()=>D($),children:[s.jsx(cg,{className:"w-4 h-4 mr-2"}
559),c.includes($.id)?"No Marketplace":"Compartilhar"]})]})]})},$.id);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Banco de talentos"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.length," candidato(s) já se inscreveram nas suas vagas, agrupados por área de atuação."]})]}),s.jsxs("div",{className:"flex flex-wrap gap-3",children:[s.jsxs("div",{className:"relative max-w-sm flex-1 min-w-[220px]",children:[s.jsx(kr,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(q,{className:"pl-9",placeholder:"Buscar por nome, e-mail ou vaga",value:o,onChange:$=>l($.target.value)})]}),s.jsxs(gt,{value:b,onValueChange:v,children:[s.jsx(ut,{className:"w-[240px]",children:s.jsx(vt,{placeholder:"Ãrea de atuação"})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"all",children:"Todas as áreas"}),t.map($=>s.jsx(ke,{value:$.id,children:$.name},$.id)),s.jsx(ke,{value:vf,children:"Sem classificação"})]})]})]}),a?s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"})}):O.length===0?s.jsx(Q,{children:s.jsxs(X,{className:"py-16 text-center space-y-2",children:[s.jsx(ur,{className:"w-8 h-8 mx-auto text-muted-foreground"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum talento encontrado."})]})}):s.jsx("div",{className:"space-y-8",children:k.map($=>s.jsxs("section",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h2",{className:"font-semibold",children:$.name}),s.jsx(pe,{variant:"secondary",children:$.items.length})]}),s.jsx("div",{className:"grid gap-3",children:$.items.map(L)})]},$.id))}),s.jsx(Kn,{open:!!w,onOpenChange:$=>!$&&g(null),children:s.jsxs(gn,{className:"max-w-lg",children:[s.jsx(vn,{children:s.jsxs(yn,{children:["Classificar ",w==null?void 0:w.name]})}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"A definição final é sua. As áreas de interesse do candidato e a sugestão da IA aparecem apenas como apoio."}),!!(w&&(m[w.id]??[]).length)&&s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"text-muted-foreground",children:"Interesse do candidato: "}),(m[w.id]??[]).map($=>{var H;return((H=C[$])==null?void 0:H.name)??$}).join(", ")]}),s.jsxs(P,{variant:"outline",size:"sm",onClick:B,disabled:N,children:[N?s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Sugerir com IA"]}),s.jsx(pv,{areas:t,value:y,onChange:j,suggested:[..._,...((w?m[w.id]:[])??[]).map($=>{var H;return(H=C[$])==null?void 0:H.id}).filter(Boolean)]})]}),s.jsxs(xn,{children:[s.jsx(P,{variant:"outline",onClick:()=>g(null),children:"Cancelar"}),s.jsxs(P,{onClick:K,disabled:R,children:[R&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"})," Salvar classificação"]})]})]})})]})};function B0(e){return e?e.toLowerCase().replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\/.*$/,"").trim():""}const EF=()=>{const{tenant:e,reload:t}=Zn(),{roles:r}=it(),n=r.includes("super_admin"),[a,i]=h.useState({name:e.name,logo_url:e.logo_url??"",primary_color:e.primary_color??"#F97316",contact_email:e.contact_email??"",contact_phone:e.contact_phone??"",custom_domain:e.custom_domain??"",marketplace_opt_in:e.marketplace_opt_in??!1}),[o,l]=h.useState(!1),c=`https://pdxvmguwcqweyzhylhyg.supabase.co/functions/v1/share-redirect?slug=${e.slug}`,u=async()=>{await navigator.clipboard.writeText(c),M.success("Link de compartilhamento copiado")},d=async()=>{l(!0);const f={name:a.name.trim(),logo_url:a.logo_url||null,primary_color:a.primary_color||null,contact_email:a.contact_email||null,contact_phone:a.contact_phone||null,marketplace_opt_in:a.marketplace_opt_in,...n?{custom_domain:B0(a.custom_domain)||null}:{}},{error:m}=await T.from("tenants").update(f).eq("id",e.id);if(l(!1),m){M.error(m.message);return}M.success("Configurações salvas"),t()};return s.jsxs("div",{className:"space-y-6 max-w-2xl",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Configurações"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Identidade visual e contatos do seu portal de carreiras."})]}),s.jsxs(Q,{children:[s.jsxs(ye,{children:[s.jsx(we,{className:"text-base",children:"Marca"}),s.jsxs(bt,{children:["Aparecem no portal público em /t/",e.slug]})]}),s.jsxs(X,{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"sm:col-span-2 space-y-2",children:[s.jsx(U,{htmlFor:"name",children:"Nome da empresa"}),s.jsx(q,{id:"name",value:a.name,onChange:f=>i(m=>({...m,name:f.target.value}))})]}),s.jsx("div",{className:"sm:col-span-2 space-y-2",children:s.jsx(uv,{label:"Logo do portal (topo do site)",folder:e.id,value:a.logo_url,onChange:f=>i(m=>({...m,logo_url:f}))})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"color",children:"Cor primária"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(q,{id:"color",type:"color",className:"w-14 p-1 h-10",value:a.primary_color,onChange:f=>i(m=>({...m,primary_color:f.target.value}))}),s.jsx(q,{value:a.primary_color,onChange:f=>i(m=>({...m,primary_color:f.target.value}))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(U,{children:"DomÃnio personalizado"}),!n&&s.jsx(JT,{className:"w-3 h-3 text-muted-foreground"})]}),s.jsx(q,{value:a.custom_domain,onChange:f=>n&&i(m=>({...m,custom_domain:B0(f.target.value)})),readOnly:!n,disabled:!n,placeholder:"vagas.cliente.com.br"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:n?"Requer plano Pro/Business no Lovable. O cliente deve apontar @ e www para 185.158.133.1 e adicionar o domÃnio em Configurações do projeto â DomÃnios.":"O domÃnio próprio é configurado pela equipe Orange RH."})]})]})]}),s.jsxs(Q,{children:[s.jsxs(ye,{children:[s.jsxs(we,{className:"text-base flex items-center gap-2",children:[s.jsx(oR,{className:"w-4 h-4"})," Link de compartilhamento"]}),s.jsx(bt,{children:"Use este link ao divulgar seu portal no WhatsApp, LinkedIn ou redes sociais. A pré-visualização mostra o nome e a logo da sua empresa (não da Orange RH)."})]}),s.jsx(X,{className:"space-y-2",children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(q,{readOnly:!0,value:c,className:"font-mono text-xs"}),s.jsxs(P,{type:"button",variant:"outline",onClick:u,children:[s.jsx(MT,{className:"w-4 h-4 mr-2"})," Copiar"]})]})})]}),s.jsxs(Q,{children:[s.jsxs(ye,{children:[s.jsx(we,{className:"text-base",children:"Contato"}),s.jsx(bt,{children:"Exibido na página de contato do portal"})]}),s.jsxs(X,{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"cemail",children:"E-mail"}),s.jsx(q,{id:"cemail",type:"email",value:a.contact_email,onChange:f=>i(m=>({...m,contact_email:f.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{htmlFor:"cphone",children:"Telefone"}),s.jsx(q,{id:"cphone",value:a.contact_phone,onChange:f=>i(m=>({...m,contact_phone:f.target.value}))})]})]})]}),s.jsxs(Q,{children:[s.jsxs(ye,{children:[s.jsx(we,{className:"text-base",children:"Marketplace de Talentos"}),s.jsx(bt,{children:"Participe da rede de talentos compartilhados. Candidatos só são exibid
559os após consentimento LGPD."})]}),s.jsxs(X,{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border p-3",children:[s.jsxs("div",{children:[s.jsx(U,{htmlFor:"mkt",children:"Participar do marketplace"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Permite compartilhar candidatos do seu banco de talentos com outras empresas da rede."})]}),s.jsx(_r,{id:"mkt",checked:a.marketplace_opt_in,onCheckedChange:f=>i(m=>({...m,marketplace_opt_in:f}))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Busca de candidatos na rede: ",e.marketplace_subscribed?"contratada":"não contratada â fale com o suporte","."]})]})]}),s.jsxs(P,{onClick:d,disabled:o,children:[o&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"})," Salvar alterações"]})]})},TF=()=>{const{tenant:e}=Zn(),[t,r]=h.useState(Pk),[n,a]=h.useState(!0),[i,o]=h.useState(!1);h.useEffect(()=>{T.from("tenant_pages").select("*").eq("tenant_id",e.id).maybeSingle().then(({data:m})=>{m&&r({home_badge:m.home_badge??"",home_headline:m.home_headline??"",home_subheadline:m.home_subheadline??"",home_highlights:m.home_highlights??[],about_title:m.about_title??"",about_body:m.about_body??"",about_services:m.about_services??[],media:m.media??[]}),a(!1)})},[e.id]);const l=async()=>{o(!0);const{error:m}=await T.from("tenant_pages").upsert({tenant_id:e.id,home_badge:t.home_badge||null,home_headline:t.home_headline||null,home_subheadline:t.home_subheadline||null,home_highlights:t.home_highlights.filter(p=>{var b;return(b=p.title)==null?void 0:b.trim()}),about_title:t.about_title||null,about_body:t.about_body||null,about_services:t.about_services.filter(p=>{var b;return(b=p.title)==null?void 0:b.trim()}),media:t.media.filter(p=>{var b;return(b=p.url)==null?void 0:b.trim()})},{onConflict:"tenant_id"});if(o(!1),m)return M.error(m.message);M.success("Páginas atualizadas")},c=m=>({add:()=>r(p=>({...p,[m]:[...p[m],{title:"",desc:""}]})),remove:p=>r(b=>({...b,[m]:b[m].filter((v,x)=>x!==p)})),update:(p,b)=>r(v=>({...v,[m]:v[m].map((x,w)=>w===p?{...x,...b}:x)}))}),u=c("home_highlights"),d=c("about_services");if(n)return s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(le,{className:"w-6 h-6 animate-spin text-muted-foreground"})});const f=(m,p,b)=>s.jsxs("div",{className:"space-y-3",children:[m.map((v,x)=>s.jsxs("div",{className:"rounded-lg border p-3 space-y-2",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx(q,{placeholder:b.title,value:v.title,onChange:w=>p.update(x,{title:w.target.value})}),s.jsx(P,{variant:"ghost",size:"icon",onClick:()=>p.remove(x),"aria-label":"Remover",children:s.jsx(Vn,{className:"w-4 h-4 text-destructive"})})]}),s.jsx(ct,{placeholder:b.desc,rows:2,value:v.desc,onChange:w=>p.update(x,{desc:w.target.value})})]},x)),s.jsxs(P,{variant:"outline",size:"sm",onClick:p.add,children:[s.jsx(mn,{className:"w-4 h-4 mr-1"})," Adicionar"]})]});return s.jsxs("div",{className:"space-y-6 max-w-3xl",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Páginas do portal"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Personalize os textos da home, a página Sobre e a galeria de fotos e vÃdeos."})]}),s.jsx(P,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(me,{to:`/t/${e.slug}`,target:"_blank",children:["Ver portal ",s.jsx(yd,{className:"w-3.5 h-3.5 ml-1"})]})})]}),s.jsxs(Q,{children:[s.jsxs(ye,{children:[s.jsx(we,{className:"text-base",children:"Home"}),s.jsx(bt,{children:"Deixe em branco para usar os textos padrão."})]}),s.jsxs(X,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Selo (badge)"}),s.jsx(q,{placeholder:"Trabalhe conosco",value:t.home_badge??"",onChange:m=>r(p=>({...p,home_badge:m.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"TÃtulo principal"}),s.jsx(q,{placeholder:`Construa o futuro com a ${e.name}`,value:t.home_headline??"",onChange:m=>r(p=>({...p,home_headline:m.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"SubtÃtulo"}),s.jsx(ct,{rows:3,value:t.home_subheadline??"",onChange:m=>r(p=>({...p,home_subheadline:m.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Destaques"}),f(t.home_highlights,u,{title:"TÃtulo do destaque",desc:"Descrição"})]})]})]}),s.jsxs(Q,{children:[s.jsxs(ye,{children:[s.jsx(we,{className:"text-base",children:"Sobre"}),s.jsx(bt,{children:"Conte sobre a empresa e os serviços prestados."})]}),s.jsxs(X,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"TÃtulo"}),s.jsx(q,{placeholder:`Sobre a ${e.name}`,value:t.about_title??"",onChange:m=>r(p=>({...p,about_title:m.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Texto"}),s.jsx(ct,{rows:6,placeholder:"Um parágrafo por linha",value:t.about_body??"",onChange:m=>r(p=>({...p,about_body:m.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{children:"Serviços / diferenciais"}),f(t.about_services,d,{title:"TÃtulo do serviço",desc:"Descrição"})]})]})]}),s.jsxs(Q,{children:[s.jsxs(ye,{children:[s.jsx(we,{className:"text-base",children:"Fotos e vÃdeos"}),s.jsx(bt,{children:"Aparecem na página Sobre. Aceita links de imagem, YouTube, Vimeo ou MP4."})]}),s.jsxs(X,{className:"space-y-3",children:[t.media.map((m,p)=>s.jsxs("div",{className:"rounded-lg border p-3 space-y-2",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(gt,{value:m.type,onValueChange:b=>r(v=>({...v,media:v.media.map((x,w)=>w===p?{...x,type:b}:x)})),children:[s.jsx(ut,{className:"w-32",children:s.jsx(vt,{})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"image",children:"Foto"}),s.jsx(ke,{value:"video",children:"VÃdeo"})]})]}),s.jsx(q,{placeholder:"https://...",value:m.url,onChange:b=>r(v=>({...v,media:v.media.map((x,w)=>w===p?{...x,url:b.target.value}:x)}))}),s.jsx(P,{variant:"ghost",size:"icon","aria-label":"Remover mÃdia",onClick:()=>r(b=>({...b,media:b.media.filter((v,x)=>x!==p)})),children:s.jsx(Vn,{className:"w-4 h-4 text-destructive"})})]}),s.jsx(q,{placeholder:"Legenda (opcional)",value:m.caption??"",onChange:b=>r(v=>({...v,media:v.media.map((x,w)=>w===p?{...x,caption:b.target.value}:x)}))})]},p)),s.jsxs(P,{variant:"outline",size:"sm",onClick:()=>r(m=>({...m,media:[...m.media,{type:"image",url:"",caption:""}]})),children:[s.jsx(mn,{className:"w-4 h-4 mr-1"})," Adicionar mÃdia"]})]})]}),s.jsxs(P,{onClick:l,disabled:i,children:[i&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"})," Salvar páginas"]})]})},RF=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40),AF=()=>{const{tenant:e}=Zn(),[t,r]=h.useState([]),[n,a]=h.useState([]),[i,o]=h.useState(!0),[l,c]=h.useState(null),[u,d]=h.useState(""),[f,m]=h.useState(null),[p,b]=h.useState(""),[v,x]=h.useState(!1),w=async()=>{o(!0);const[{data:S},{data:N}]=await Promise.all([T.from("tenants").select("id,name,slug,is_active,status,contact_email,logo_url").eq("parent_agency_id",e.id).order("created_at",{ascending:!1}),T.from("onboarding_leads").select("*").eq("agency_tenant_id",e.id).is("tenant_id",null).order("created_at",{ascending:!1})]);r(S??[]),a(N??[]),o(!1)};h.useEffect(()=>{w()},[e.id]);const g=async(S,N)=>{if(S.trim().length<2)return M.error("Informe o nome da empresa");c((N==null?void 0:N.id)??"new");const E=`${RF(S)||"empresa"}-${Math.random().toString(36).slice(2,6)}`,{data:R,error:I}=await T.from("tenants").insert({name:S.trim(),slug:E,parent_agency_id:e.id,tenant_type:"company",contact_name:(N==null?void 0:N.contact_name)??null,contact_email:(N==null?void 0:N.contact_email)??null,contact_phone:(N==null?void 0:N.contact_phone)??null,status:"trial",is_active:!0}).select("id,slug").single();if(I||!R)return c(null),M.error("Não foi possÃvel criar a empresa");N&&await T.from("onboarding_leads").update({tenant_id:R.id,status:"active",approved_at:new Date().toISOString()}).eq("id",N.id),c(null),d(""),M.success(`Empresa aprovada: /t/${R.slug}`),w()},y=async S=>{const{error:N}=await T.from("tenants").update({is_active:!S.is_active}).eq("id",S.id);if(N)return M.error("Não foi possÃvel atualizar");r(E=>E.map(R=>R.id===S.id?{...R,is_active:!R.is_active}:R))},j=S=>{m(S),b(S.logo_url??"")},_=async()=>
559{if(!f)return;x(!0);const{error:S}=await T.from("tenants").update({logo_url:p||null}).eq("id",f.id);if(x(!1),S)return M.error("Não foi possÃvel salvar a logo");r(N=>N.map(E=>E.id===f.id?{...E,logo_url:p||null}:E)),m(null),M.success("Logo da empresa atualizada")};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Empresas da agência"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Aprove solicitações e gerencie as empresas vinculadas à ",e.name,"."]})]}),s.jsxs(Q,{children:[s.jsx(ye,{className:"pb-2",children:s.jsxs(we,{className:"text-base",children:["Solicitações aguardando aprovação (",n.length,")"]})}),s.jsxs(X,{className:"space-y-2",children:[i&&s.jsx(le,{className:"w-5 h-5 animate-spin text-primary"}),!i&&n.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground py-2",children:"Nenhuma solicitação pendente."}),n.map(S=>s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border p-4",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-semibold",children:S.company_name}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[S.contact_name," · ",S.contact_email]})]}),s.jsxs(P,{size:"sm",disabled:l===S.id,onClick:()=>g(S.company_name,S),children:[s.jsx(wn,{className:"w-4 h-4 mr-2"})," Aprovar e criar portal"]})]},S.id))]})]}),s.jsxs(Q,{children:[s.jsx(ye,{className:"pb-2",children:s.jsx(we,{className:"text-base",children:"Nova empresa"})}),s.jsxs(X,{className:"flex flex-wrap gap-2",children:[s.jsx(q,{className:"max-w-xs",placeholder:"Nome da empresa",value:u,onChange:S=>d(S.target.value),maxLength:160}),s.jsxs(P,{disabled:l==="new",onClick:()=>g(u),children:[s.jsx(mn,{className:"w-4 h-4 mr-2"})," Criar"]})]})]}),s.jsxs(Q,{children:[s.jsx(ye,{className:"pb-2",children:s.jsxs(we,{className:"text-base",children:["Empresas vinculadas (",t.length,")"]})}),s.jsxs(X,{className:"space-y-2",children:[!i&&t.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground py-2",children:"Nenhuma empresa vinculada ainda."}),t.map(S=>s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:"w-9 h-9 rounded-lg border bg-muted/40 flex items-center justify-center overflow-hidden shrink-0",children:S.logo_url?s.jsx("img",{src:S.logo_url,alt:`Logo ${S.name}`,className:"w-full h-full object-contain"}):s.jsx(At,{className:"w-4 h-4 text-primary"})}),s.jsx("span",{className:"font-semibold truncate",children:S.name}),s.jsx(pe,{variant:S.is_active?"default":"outline",children:S.is_active?"Ativa":"Inativa"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(P,{size:"sm",variant:"ghost",onClick:()=>j(S),children:[s.jsx(sg,{className:"w-4 h-4 mr-2"})," Logo"]}),s.jsx(P,{asChild:!0,size:"sm",variant:"ghost",children:s.jsxs("a",{href:`/t/${S.slug}`,target:"_blank",rel:"noreferrer",children:[s.jsx(yd,{className:"w-4 h-4 mr-2"})," Portal"]})}),s.jsx(P,{size:"sm",variant:"secondary",onClick:()=>y(S),children:S.is_active?"Desativar":"Ativar"})]})]},S.id))]})]}),s.jsx(Kn,{open:!!f,onOpenChange:S=>!S&&m(null),children:s.jsxs(gn,{children:[s.jsxs(vn,{children:[s.jsxs(yn,{children:["Logo de ",f==null?void 0:f.name]}),s.jsx(zs,{children:"A logo aparece no topo do portal da empresa, nos cards de vagas e na página exclusiva dela."})]}),s.jsx(uv,{label:"Logo da empresa",folder:(f==null?void 0:f.id)??"empresas",value:p,onChange:b}),s.jsxs(xn,{children:[s.jsx(P,{variant:"ghost",onClick:()=>m(null),children:"Cancelar"}),s.jsxs(P,{onClick:_,disabled:v,children:[v&&s.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"})," Salvar"]})]})]})})]})},So=e=>{const t=e.area_ids??[];return e.primary_area_id?[e.primary_area_id,...t.filter(r=>r!==e.primary_area_id)]:t},PF=()=>{const{tenant:e}=Zn(),{areas:t}=ch(),r=e.tenant_type==="agency",n=e.marketplace_subscribed,[a,i]=h.useState([]),[o,l]=h.useState([]),[c,u]=h.useState([]),[d,f]=h.useState({}),[m,p]=h.useState(!0),[b,v]=h.useState(""),[x,w]=h.useState("all"),g=h.useMemo(()=>Object.fromEntries(t.map(A=>[A.id,A.name])),[t]),y="__none__",j=async()=>{p(!0);const[{data:A},{data:C},{data:F}]=await Promise.all([r?T.from("marketplace_candidates").select("*").eq("agency_tenant_id",e.id):Promise.resolve({data:[]}),n?T.from("marketplace_candidates").select("*").eq("is_active",!0).eq("consent",!0):Promise.resolve({data:[]}),T.rpc("get_public_tenants")]);i(A??[]);
559const D=(C??[]).filter(B=>B.agency_tenant_id!==e.id);l(D),f(Object.fromEntries((F??[]).map(B=>[B.id,B.name])));const z=D.map(B=>B.candidate_id);if(z.length){const{data:B}=await T.from("candidate_resumes").select("user_id,headline,summary,location,skills").in("user_id",z);u(B??[])}else u([]);p(!1)};h.useEffect(()=>{j()},[e.id]);const _=async(A,C)=>{const{error:F}=await T.from("marketplace_candidates").update({[C]:!A[C]}).eq("id",A.id);if(F)return M.error("Não foi possÃvel atualizar");i(D=>D.map(z=>z.id===A.id?{...z,[C]:!z[C]}:z))},S=async(A,C)=>{const F=A.primary_area_id?[A.primary_area_id,...C.filter(z=>z!==A.primary_area_id)]:C;i(z=>z.map(B=>B.id===A.id?{...B,area_ids:F}:B));const{error:D}=await T.from("marketplace_candidates").update({area_ids:F}).eq("id",A.id);D&&M.error("Não foi possÃvel salvar as áreas")},N=async(A,C)=>{const F=(A.area_ids??[]).filter(B=>B!==A.primary_area_id&&B!==C),D=C?[C,...F]:F;i(B=>B.map(K=>K.id===A.id?{...K,area_ids:D,primary_area_id:C}:K));const{error:z}=await T.from("marketplace_candidates").update({area_ids:D,primary_area_id:C}).eq("id",A.id);z?M.error("Não foi possÃvel salvar a área principal"):M.success("Ãrea principal atualizada")},E=h.useMemo(()=>{const A=b.trim().toLowerCase();return o.filter(C=>{const F=So(C);if(x===y&&F.length||x!=="all"&&x!==y&&!F.includes(x))return!1;if(!A)return!0;const D=c.find(z=>z.user_id===C.candidate_id);return[C.headline,D==null?void 0:D.headline,D==null?void 0:D.summary,D==null?void 0:D.location,((D==null?void 0:D.skills)??[]).join(" "),F.map(z=>g[z]).join(" ")].filter(Boolean).join(" ").toLowerCase().includes(A)})},[o,c,b,x,g]),R=h.useMemo(()=>{const A=[];for(const F of t){const D=E.filter(z=>So(z).includes(F.id)).sort((z,B)=>+(B.primary_area_id===F.id)-+(z.primary_area_id===F.id));D.length&&A.push({id:F.id,name:F.name,items:D})}const C=E.filter(F=>!So(F).length);return C.length&&A.push({id:y,name:"Sem classificação",items:C}),A},[t,E]),I=A=>{var F;const C=c.find(D=>D.user_id===A.candidate_id);return s.jsx(Q,{children:s.jsxs(X,{className:"p-4 space-y-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"font-semibold",children:A.headline||(C==null?void 0:C.headline)||"Candidato disponÃvel"}),s.jsxs(pe,{variant:"secondary",children:["Origem: ",d[A.agency_tenant_id]??"Agência"]}),s.jsxs(pe,{variant:"outline",className:"gap-1",children:[s.jsx(ro,{className:"w-3 h-3"})," Consentimento LGPD"]})]}),!!So(A).length&&s.jsx("div",{className:"flex flex-wrap gap-1.5",children:So(A).map(D=>D===A.primary_area_id?s.jsxs(pe,{className:"gap-1",children:[s.jsx(lg,{className:"w-3 h-3"})," ",g[D]??"Ãrea"," · Principal"]},D):s.jsxs(pe,{variant:"secondary",className:"gap-1",children:[s.jsx(pm,{className:"w-3 h-3"})," ",g[D]??"Ãrea"]},D))}),(C==null?void 0:C.location)&&s.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(Ra,{className:"w-3 h-3"})," ",C.location]}),(C==null?void 0:C.summary)&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3",children:C.summary}),!!((F=C==null?void 0:C.skills)!=null&&F.length)&&s.jsx("div",{className:"flex flex-wrap gap-1.5",children:C.skills.slice(0,10).map(D=>s.jsx(pe,{variant:"outline",children:D},D))}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Contato intermediado pela agência fornecedora."})]})},`${A.id}`)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Marketplace de Talentos"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Candidatos compartilhados por agências, sempre com consentimento LGPD e origem identificada."})]}),s.jsxs(El,{defaultValue:n?"search":"mine",children:[s.jsxs(Gi,{children:[n&&s.jsx(ar,{value:"search",children:"Pesquisar candidatos"}),r&&s.jsx(ar,{value:"mine",children:"Meus compartilhamentos"})]}),n&&s.jsxs(Hr,{value:"search",className:"space-y-4 pt-4",children:[s.jsxs("div",{className:"flex flex-wrap gap-3",children:[s.jsxs("div",{className:"relative max-w-sm flex-1 min-w-[220px]",children:[s.jsx(kr,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(q,{className:"pl-9",placeholder:"Buscar por área, competência, cargo ou cidade",value:b,onChange:A=>v(A.target.value)})]}),s.jsxs(gt,{value:x,onValueChange:w,children:[s.jsx(ut,{className:"w-[240px]",children:s.jsx(vt,{placeholder:"Ãrea de atuação"})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"all",children:"Todas as áreas"}),t.map(A=>s.jsx(ke,{value:A.id,children:A.name},A.id)),s.jsx(ke,{value:y,children:"Sem classificação"})]})]})]}),m?s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"}):E.length===0?s.jsx(Q,{children:s.jsxs(X,{className:"py-16 text-center space-y-2",children:[s.jsx(cg,{className:"w-8 h-8 mx-auto text-muted-foreground"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum candidato disponÃvel no marketplace no momento."})]})}):s.jsx("div",{className:"space-y-8",children:R.map(A=>s.jsxs("section",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h2",{className:"font-semibold",children:A.name}),s.jsx(pe,{variant:"secondary",children:A.items.length})]}),s.jsx("div",{className:"grid gap-3",children:A.items.map(I)})]},A.id))})]}),r&&s.jsx(Hr,{value:"mine",className:"space-y-3 pt-4",children:m?s.jsx(le,{className:"w-6 h-6 animate-spin text-primary"}):a.length===0?s.jsx(Q,{children:s.jsx(X,{className:"py-16 text-center text-sm text-muted-foreground",children:"Nenhum candidato compartilhado. Use o Banco de Talentos para compartilhar."})}):a.map(A=>s.jsx(Q,{children:s.jsxs(X,{className:"p-4 space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:A.headline||"Candidato"}),s.jsxs("div",{className:"text-xs text-muted-foreground flex gap-2 mt-1",children:[s.jsx(pe,{variant:A.consent?"default":"outline",children:A.consent?"Consentimento dado":"Aguardando consentimento"}),s.jsx(pe,{variant:A.is_active?"secondary":"outline",children:A.is_active?"Ativo":"Pausado"})]})]}),s.jsx(P,{size:"sm",variant:"secondary",onClick:()=>_(A,"is_active"),children:A.is_active?"Pausar":"Reativar"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Ãrea principal (prioridade)"}),s.jsxs(gt,{value:A.primary_area_id??"__none__",onValueChange:C=>N(A,C==="__none__"?null:C),children:[s.jsx(ut,{className:"w-[260px]",children:s.jsx(vt,{placeholder:"Escolha a área principal"})}),s.jsxs(dt,{children:[s.jsx(ke,{value:"__none__",children:"Sem área principal"}),t.map(C=>s.jsx(ke,{value:C.id,children:C.name},C.id))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Ãreas secundárias exibidas no marketplace (múltipla escolha)"}),s.jsx(pv,{areas:t,value:(A.area_ids??[]).filter(C=>C!==A.primary_area_id),onChange:C=>S(A,C)})]})]})},A.id))})]}),!n&&s.jsxs(Q,{children:[s.jsx(ye,{children:s.jsx(we,{className:"text-base",children:"Busca no marketplace não contratada"})}),s.jsx(X,{className:"text-sm text-muted-foreground",children:"Fale com o suporte para habilitar a pesquisa no Mar
559ketplace de Talentos."})]})]})},OF=new _O,IF=()=>s.jsx(SO,{client:OF,children:s.jsxs(F_,{children:[s.jsx(GR,{}),s.jsx(kA,{}),s.jsx(_4,{children:s.jsx(U$,{children:s.jsxs(n1,{children:[s.jsx(oe,{path:"/",element:s.jsx(ef,{tenant:s.jsx(tp,{}),system:s.jsx(eN,{}),shell:!0})}),s.jsx(oe,{path:"/planos",element:s.jsx(x3,{})}),s.jsx(oe,{path:"/demo",element:s.jsx(b3,{})}),s.jsx(oe,{path:"/quero-minha-plataforma",element:s.jsx(yD,{})}),s.jsx(oe,{path:"/auth",element:s.jsx(ef,{tenant:s.jsx(rp,{}),system:s.jsx($D,{}),shell:!0})}),s.jsxs(oe,{path:"/t/:slug",element:s.jsx(mF,{}),children:[s.jsx(oe,{index:!0,element:s.jsx(tp,{})}),s.jsx(oe,{path:"vagas",element:s.jsx(Ik,{})}),s.jsx(oe,{path:"vagas/:jobSlug",element:s.jsx(Lk,{})}),s.jsx(oe,{path:"vagas/:jobSlug/aplicar",element:s.jsx($k,{})}),s.jsx(oe,{path:"sobre",element:s.jsx(Dk,{})}),s.jsx(oe,{path:"empresas",element:s.jsx(Mk,{})}),s.jsx(oe,{path:"empresas/cadastro",element:s.jsx(Fk,{})}),s.jsx(oe,{path:"empresas/:companySlug",element:s.jsx(zk,{})}),s.jsx(oe,{path:"contato",element:s.jsx(Uk,{})}),s.jsx(oe,{path:"lgpd",element:s.jsx(Bk,{})}),s.jsx(oe,{path:"auth",element:s.jsx(rp,{})}),s.jsxs(oe,{path:"minha-area",element:s.jsx(ls,{children:s.jsx(Ak,{})}),children:[s.jsx(oe,{index:!0,element:s.jsx(Qk,{})}),s.jsx(oe,{path:"vagas",element:s.jsx(Zk,{})}),s.jsx(oe,{path:"recomendacoes",element:s.jsx(Yk,{})}),s.jsx(oe,{path:"candidaturas",element:s.jsx(Xk,{})}),s.jsx(oe,{path:"perfil",element:s.jsx(tC,{})})]}),s.jsx(oe,{path:"curriculo",element:s.jsx(ls,{children:s.jsx(eu,{})})})]}),s.jsx(oe,{path:"/app",element:s.jsx(DD,{})}),s.jsx(oe,{path:"/curriculo",element:s.jsx(ef,{tenant:s.jsx(ls,{children:s.jsx(eu,{})}),system:s.jsx(ls,{children:s.jsx(eu,{})}),shell:!0})}),s.jsxs(oe,{path:"/painel",element:s.jsx(ls,{roles:["tenant_admin","recruiter","super_admin"],children:s.jsx(xF,{})}),children:[s.jsx(oe,{index:!0,element:s.jsx(yF,{})}),s.jsx(oe,{path:"vagas",element:s.jsx(jF,{})}),s.jsx(oe,{path:"vagas/:jobId/candidatos",element:s.jsx(NF,{})}),s.jsx(oe,{path:"pipeline",element:s.jsx(kF,{})}),s.jsx(oe,{path:"talentos",element:s.jsx(CF,{})}),s.jsx(oe,{path:"empresas",element:s.jsx(AF,{})}),s.jsx(oe,{path:"marketplace",element:s.jsx(PF,{})}),s.jsx(oe,{path:"paginas",element:s.jsx(TF,{})}),s.jsx(oe,{path:"configuracoes",element:s.jsx(EF,{})})]}),s.jsx(oe,{path:"/admin/bootstrap",element:s.jsx(BM,{})}),s.jsxs(oe,{path:"/admin",element:s.jsx(ls,{roles:["super_admin"],children:s.jsx(zM,{})}),children:[s.jsx(oe,{index:!0,element:s.jsx(VM,{})}),s.jsx(oe,{path:"clientes",element:s.jsx(u6,{})}),s.jsx(oe,{path:"clientes/:tenantId",element:s.jsx(k6,{})}),s.jsx(oe,{path:"usuarios",element:s.jsx(R6,{})}),s.jsx(oe,{path:"solicitacoes",element:s.jsx(E6,{})}),s.jsx(oe,{path:"planos",element:s.jsx(D6,{})}),s.jsx(oe,{path:"areas",element:s.jsx(F6,{})}),s.jsx(oe,{path:"financeiro",element:s.jsx(z6,{})}),s.jsx(oe,{path:"suporte",element:s.jsx(U6,{})}),s.jsx(oe,{path:"logs",element:s.jsx(V6,{})}),s.jsx(oe,{path:"integracoes",element:s.jsx(q6,{})}),s.jsx(oe,{path:"configuracoes",element:s.jsx(H6,{})})]}),s.jsx(oe,{path:"/*",element:s.jsx(hF,{})}),s.jsx(oe,{path:"*",element:s.jsx(Dg,{})})]})})})]})});dj(document.getElementById("root")).render(s.jsx(IF,{}));
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.