PageSourceSearch

https://trievents.ca/static/js/main.2dca2070.js

js trievents.ca collected 2026-10-07 00:44:57 UTC 1,358,437 bytes, 3 lines download raw bytes

1/*! For license information please see main.2dca2070.js.LICENSE.txt */
2(()=>{var e={3337(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){e.done?a(e.value):new n(function(t){t(e.value)}).then(i,o)}l((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},s=this;Object.defineProperty(t,"__esModule",{value:!0});var i=n(1159),o="browser-tabs-lock-key",l={key:function(e){return r(s,void 0,void 0,function(){return a(this,function(e){throw new Error("Unsupported")})})},getItem:function(e){return r(s,void 0,void 0,function(){return a(this,function(e){throw new Error("Unsupported")})})},clear:function(){return r(s,void 0,void 0,function(){return a(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return r(s,void 0,void 0,function(){return a(this,function(e){throw new Error("Unsupported")})})},setItem:function(e,t){return r(s,void 0,void 0,function(){return a(this,function(e){throw new Error("Unsupported")})})},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function c(e){return new Promise(function(t){return setTimeout(t,e)})}function u(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",r=0;r<e;r++){n+=t[Math.floor(61*Math.random())]}return n}var d=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=t,void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(t,n){return void 0===n&&(n=5e3),r(this,void 0,void 0,function(){var r,s,i,d,f,h,p;return a(this,function(a){switch(a.label){case 0:r=Date.now()+u(4),s=Date.now()+n,i=o+"-"+t,d=void 0===this.storageHandler?l:this.storageHandler,a.label=1;case 1:return Date.now()<s?[4,c(30)]:[3,8];case 2:return a.sent(),null!==d.getItemSync(i)?[3,5]:(f=this.id+"-"+t+"-"+r,[4,c(Math.floor(25*Math.random()))]);case 3:return a.sent(),d.setItemSync(i,JSON.stringify({id:this.id,iat:r,timeoutKey:f,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,c(30)];case 4:return a.sent(),null!==(h=d.getItemSync(i))&&(p=JSON.parse(h)).id===this.id&&p.iat===r?(this.acquiredIatSet.add(r),this.refreshLockWhileAcquired(i,r),[2,!0]):[3,7];case 5:return e.lockCorrector(void 0===this.storageHandler?l:this.storageHandler),[4,this.waitForSomethingToChange(s)];case 6:a.sent(),a.label=7;case 7:return r=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(e,t){return r(this,void 0,void 0,function(){var n=this;return a(this,function(s){return setTimeout(function(){return r(n,void 0,void 0,function(){var n,r,s;return a(this,function(a){switch(a.label){case 0:return[4,i.default().lock(t)];case 1:return a.sent(),this.acquiredIatSet.has(t)?(n=void 0===this.storageHandler?l:this.storageHandler,null===(r=n.getItemSync(e))?(i.default().unlock(t),[2]):((s=JSON.parse(r)).timeRefreshed=Date.now(),n.setItemSync(e,JSON.stringify(s)),i.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(i.default().unlock(t),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return r(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var r=!1,a=Date.now(),s=!1;
2function i(){if(s||(window.removeEventListener("storage",i),e.removeFromWaiting(i),clearTimeout(o),s=!0),!r){r=!0;var t=50-(Date.now()-a);t>0?setTimeout(n,t):n(null)}}window.addEventListener("storage",i),e.addToWaiting(i);var o=setTimeout(i,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return r(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return r(this,void 0,void 0,function(){var n,r,s,c;return a(this,function(a){switch(a.label){case 0:return n=void 0===this.storageHandler?l:this.storageHandler,r=o+"-"+t,null===(s=n.getItemSync(r))?[2]:(c=JSON.parse(s)).id!==this.id?[3,2]:[4,i.default().lock(c.iat)];case 1:a.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(r),i.default().unlock(c.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,a=[],s=0;;){var i=r.keySync(s);if(null===i)break;a.push(i),s++}for(var l=!1,c=0;c<a.length;c++){var u=a[c];if(u.includes(o)){var d=r.getItemSync(u);if(null!==d){var f=JSON.parse(d);(void 0===f.timeRefreshed&&f.timeAcquired<n||void 0!==f.timeRefreshed&&f.timeRefreshed<n)&&(r.removeItemSync(u),l=!0)}}}l&&e.notifyWaiters()},e.waiters=void 0,e}();t.default=d},1159(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())})},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()}},2740(e){"use strict";e.exports=function(e,t,n,r,a,s,i,o){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,s,i,o],u=0;(l=new Error(t.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},2123(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}}()?Object.assign:function(e,a){for(var s,i,o=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in s=Object(arguments[l]))n.call(s,c)&&(o[c]=s[c]);if(t){i=t(s);for(var u=0;u<i.length;u++)r.call(s,i[u])&&(o[i[u]]=s[i[u]])}}return o}},1497(e,t,n){"use strict";var r=n(3218);function a(){}function s(){}s.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,s,i){if(i!==r){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol
vendor: 4,734 bytes, line 2
2:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:a};return n.PropTypes=n,n}},5173(e,t,n){e.exports=n(1497)()},3218(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2730(e,t,n){"use strict";var r=n(5043),a=n(8853);function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,o={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(o[e]=t,e=0;e<t.length;e++)i.add(t[e])}var u=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},p={};function m(e,t,n,r,a,s,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){g[e]=new m(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){g[e]=new m(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){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){g[e]=new m(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){g[e]=new m(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){g[e]=new m(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}function y(e,t,n,r){var a=g.hasOwnProperty(t)?g[t]:null;(null!==a?0!==a.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,a,r)&&(n=null),r||null===a?function(e){return!!d.call(p,e)||!d.call(h,e)&&(f.test(e)?p[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=null===n?3!==a.type&&"":n:(t=a.attributeName,r=a.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(a=a.type)||4===a&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"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
2-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(v,x);g[t]=new m(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(v,x);g[t]=new m(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(v,x);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)}),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)});var b=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),_=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),R=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var O=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var A=Symbol.iterator;function D(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=A&&e[A]||e["@@iterator"])?e:null}var M,F=Object.assign;function L(e){if(void 0===M)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);M=t&&t[1]||""}return"\n"+M+e}var U=!1;function H(e,t){if(!e||U)return"";U=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&"string"===typeof c.stack){for(var a=c.stack.split("\n"),s=r.stack.split("\n"),i=a.length-1,o=s.length-1;1<=i&&0<=o&&a[i]!==s[o];)o--;for(;1<=i&&0<=o;i--,o--)if(a[i]!==s[o]){if(1!==i||1!==o)do{if(i--,0>--o||a[i]!==s[o]){var l="\n"+a[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=i&&0<=o);break}}}finally{U=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?L(e):""}function z(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=H(e.type,!1);case 11:return e=H(e.type.render,!1);case 1:return e=H(e.type,!0);default:return""}}function B(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case k:return"Fragment";case _:return"Portal";case N:return"Profiler";case j:return"StrictMode";case T:return"Suspense";case I:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case S:return(e._context.displayName||"Context")+".Provider";case E:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case P:return null!==(t=e.displayName||null)?t:B(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return B(e(t))}catch(n){}}return null}function W(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=(e=t.render).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 B(t);case 8:return t===j?"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("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function q(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function V(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function $(e){e._valueTracker||(e._valueTracker=function(e){var t=V(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var a=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function G(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=V(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Y(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function K(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Z(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=q(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function J(e,t){null!=(t=t.checked)&&y(e,"checked",t,!1)}function X(e,t){J(e,t);var n=q(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,q(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Q(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&Y(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+q(n),t=null,a=0;a<e.length;a++){if(e[a].value===n)return e[a].selected=!0,void(r&&(e[a].defaultSelected=!0));null!==t||e[a].disabled||(t=e[a])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(s(91));return F({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ae(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(s(92));
vendor: 9,198 bytes, line 2
2if(te(n)){if(1<n.length)throw Error(s(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:q(n)}}function se(e,t){var n=q(t.value),r=q(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ie(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function oe(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 le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?oe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,ue,de=(ue=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return ue(e,t)})}:ue);function fe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var he={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},pe=["Webkit","ms","Moz","O"];function me(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||he.hasOwnProperty(e)&&he[e]?(""+t).trim():t+"px"}function ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=me(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}Object.keys(he).forEach(function(e){pe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),he[t]=he[e]})});var ve=F({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 xe(e,t){if(t){if(ve[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(s(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(s(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(s(62))}}function ye(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;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 be=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var _e=null,ke=null,je=null;function Ne(e){if(e=ya(e)){if("function"!==typeof _e)throw Error(s(280));var t=e.stateNode;t&&(t=wa(t),_e(e.stateNode,e.type,t))}}function Se(e){ke?je?je.push(e):je=[e]:ke=e}function Ce(){if(ke){var e=ke,t=je;if(je=ke=null,Ne(e),t)for(e=0;e<t.length;e++)Ne(t[e])}}function Ee(e,t){return e(t)}function Te(){}var Ie=!1;function Pe(e,t,n){if(Ie)return e(t,n);Ie=!0;try{return Ee(e,t,n)}finally{Ie=!1,(null!==ke||null!==je)&&(Te(),Ce())}}function Re(e,t){var n=e.stateNode;if(null===n)return null;var r=wa(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(s(231,t,typeof n));return n}var Oe=!1;if(u)try{var Ae={};Object.defineProperty(Ae,"passive",{get:function(){Oe=!0}}),window.addEventListener("test",Ae,Ae),window.removeEventListener("test",Ae,Ae)}catch(ue){Oe=!1}function De(e,t,n,r,a,s,i,o,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Me=!1,Fe=null,Le=!1,Ue=null,He={onError:function(e){Me=!0,Fe=e}};function ze(e,t,n,r,a,s,i,o,l){Me=!1,Fe=null,De.apply(He,arguments)}function Be(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function We(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function qe(e){if(Be(e)!==e)throw Error(s(188))}function Ve(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Be(e)))throw Error(s(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var i=a.alternate;if(null===i){if(null!==(r=a.return)){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return qe(a),e;if(i===r)return qe(a),t;i=i.sibling}throw Error(s(188))}if(n.return!==r.return)n=a,r=i;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(3!==n.tag)throw Error(s(188));return n.stateNode.current===n?e:t}(e))?$e(e):null}function $e(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=$e(e);if(null!==t)return t;e=e.sibling}return null}var Ge=a.unstable_scheduleCallback,Ye=a.unstable_cancelCallback,Ke=a.unstable_shouldYield,Ze=a.unstable_requestPaint,Je=a.unstable_now,Xe=a.unstable_getCurrentPriorityLevel,Qe=a.unstable_ImmediatePriority,et=a.unstable_UserBlockingPriority,tt=a.unstable_NormalPriority,nt=a.unstable_LowPriority,rt=a.unstable_IdlePriority,at=null,st=null;var it=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(ot(e)/lt|0)|0},ot=Math.log,lt=Math.LN2;var ct=64,ut=4194304;function dt(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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ft(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,a=e.suspendedLanes,s=e.pingedLanes,i=268435455&n;if(0!==i){var o=i&~a;0!==o?r=dt(o):0!==(s&=i)&&(r=dt(s))}else 0!==(i=n&~a)?r=dt(i):0!==s&&(r=dt(s));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&a)&&((a=r&-r)>=(s=t&-t)||16===a&&0!==(4194240&s)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)a=1<<(n=31-it(t)),r|=e[n],t&=~a;return r}function ht(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;default:return-1}}function pt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function mt(){var e=ct;return 0===(4194240&(ct<<=1))&&(ct=64),e}function gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-it(t)]=n}function xt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-it(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var yt=0;function bt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var wt,_t,kt,jt,Nt,St=!1,Ct=[],Et=null,Tt=null,It=null,Pt=new Map,Rt=new Map,Ot=[],At="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 Dt(e,t){switch(e){case"focusin":case"focusout":Et=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":It=null;break;case"pointerover":case"pointerout":Pt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rt.delete(t.pointerId)}}function Mt(e,t,n,r,a,s){return null===e||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[a]},null!==t&&(null!==(t=ya(t))&&_t(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==a&&-1===t.indexOf(a)&&t.pu
vendor: 5,438 bytes, line 2
2sh(a),e)}function Ft(e){var t=xa(e.target);if(null!==t){var n=Be(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=We(n)))return e.blockedOn=t,void Nt(e.priority,function(){kt(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Lt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Kt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ya(n))&&_t(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);be=r,n.target.dispatchEvent(r),be=null,t.shift()}return!0}function Ut(e,t,n){Lt(e)&&n.delete(t)}function Ht(){St=!1,null!==Et&&Lt(Et)&&(Et=null),null!==Tt&&Lt(Tt)&&(Tt=null),null!==It&&Lt(It)&&(It=null),Pt.forEach(Ut),Rt.forEach(Ut)}function zt(e,t){e.blockedOn===t&&(e.blockedOn=null,St||(St=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Ht)))}function Bt(e){function t(t){return zt(t,e)}if(0<Ct.length){zt(Ct[0],e);for(var n=1;n<Ct.length;n++){var r=Ct[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Et&&zt(Et,e),null!==Tt&&zt(Tt,e),null!==It&&zt(It,e),Pt.forEach(t),Rt.forEach(t),n=0;n<Ot.length;n++)(r=Ot[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Ot.length&&null===(n=Ot[0]).blockedOn;)Ft(n),null===n.blockedOn&&Ot.shift()}var Wt=b.ReactCurrentBatchConfig,qt=!0;function Vt(e,t,n,r){var a=yt,s=Wt.transition;Wt.transition=null;try{yt=1,Gt(e,t,n,r)}finally{yt=a,Wt.transition=s}}function $t(e,t,n,r){var a=yt,s=Wt.transition;Wt.transition=null;try{yt=4,Gt(e,t,n,r)}finally{yt=a,Wt.transition=s}}function Gt(e,t,n,r){if(qt){var a=Kt(e,t,n,r);if(null===a)qr(e,t,r,Yt,n),Dt(e,r);else if(function(e,t,n,r,a){switch(t){case"focusin":return Et=Mt(Et,e,t,n,r,a),!0;case"dragenter":return Tt=Mt(Tt,e,t,n,r,a),!0;case"mouseover":return It=Mt(It,e,t,n,r,a),!0;case"pointerover":var s=a.pointerId;return Pt.set(s,Mt(Pt.get(s)||null,e,t,n,r,a)),!0;case"gotpointercapture":return s=a.pointerId,Rt.set(s,Mt(Rt.get(s)||null,e,t,n,r,a)),!0}return!1}(a,e,t,n,r))r.stopPropagation();else if(Dt(e,r),4&t&&-1<At.indexOf(e)){for(;null!==a;){var s=ya(a);if(null!==s&&wt(s),null===(s=Kt(e,t,n,r))&&qr(e,t,r,Yt,n),s===a)break;a=s}null!==a&&r.stopPropagation()}else qr(e,t,r,null,n)}}var Yt=null;function Kt(e,t,n,r){if(Yt=null,null!==(e=xa(e=we(r))))if(null===(t=Be(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=We(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Yt=e,null}function Zt(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(Xe()){case Qe:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Jt=null,Xt=null,Qt=null;function en(){if(Qt)return Qt;var e,t,n=Xt,r=n.length,a="value"in Jt?Jt.value:Jt.textContent,s=a.length;for(e=0;e<r&&n[e]===a[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===a[s-t];t++);return Qt=a.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function an(e){function t(t,n,r,a,s){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=a,this.target=s,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(a):a[i]);return this.isDefaultPrevented=(null!=a.defaultPrevented?a.defaultPrevented:!1===a.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return F(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var sn,on,ln,cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},un=an(cn),dn=F({},cn,{view:0,detail:0}),fn=an(dn),hn=F({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.from
vendor: 9,184 bytes, line 2
2Element===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ln&&(ln&&"mousemove"===e.type?(sn=e.screenX-ln.screenX,on=e.screenY-ln.screenY):on=sn=0,ln=e),sn)},movementY:function(e){return"movementY"in e?e.movementY:on}}),pn=an(hn),mn=an(F({},hn,{dataTransfer:0})),gn=an(F({},dn,{relatedTarget:0})),vn=an(F({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),xn=F({},cn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yn=an(xn),bn=an(F({},cn,{data:0})),wn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_n={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"},kn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=kn[e])&&!!t[e]}function Nn(){return jn}var Sn=F({},dn,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?_n[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Cn=an(Sn),En=an(F({},hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Tn=an(F({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),In=an(F({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Pn=F({},hn,{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}),Rn=an(Pn),On=[9,13,27,32],An=u&&"CompositionEvent"in window,Dn=null;u&&"documentMode"in document&&(Dn=document.documentMode);var Mn=u&&"TextEvent"in window&&!Dn,Fn=u&&(!An||Dn&&8<Dn&&11>=Dn),Ln=String.fromCharCode(32),Un=!1;function Hn(e,t){switch(e){case"keyup":return-1!==On.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Bn=!1;var Wn={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 qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Wn[e.type]:"textarea"===t}function Vn(e,t,n,r){Se(r),0<(t=$r(t,"onChange")).length&&(n=new un("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var $n=null,Gn=null;function Yn(e){Lr(e,0)}function Kn(e){if(G(ba(e)))return e}function Zn(e,t){if("change"===e)return t}var Jn=!1;if(u){var Xn;if(u){var Qn="oninput"in document;if(!Qn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Qn="function"===typeof er.oninput}Xn=Qn}else Xn=!1;Jn=Xn&&(!document.documentMode||9<document.documentMode)}function tr(){$n&&($n.detachEvent("onpropertychange",nr),Gn=$n=null)}function nr(e){if("value"===e.propertyName&&Kn(Gn)){var t=[];Vn(t,Gn,e,we(e)),Pe(Yn,t)}}function rr(e,t,n){"focusin"===e?(tr(),Gn=n,($n=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function ar(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Kn(Gn)}function sr(e,t){if("click"===e)return Kn(t)}function ir(e,t){if("input"===e||"change"===e)return Kn(t)}var or="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function lr(e,t){if(or(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!d.call(t,a)||!or(e[a],t[a]))return!1}return!0}function cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ur(e,t){var n,r=cr(e);for(e=0;r;){if(3===r.nodeType){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=cr(r)}}function dr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function fr(){for(var e=window,t=Y();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Y((e=t.contentWindow).document)}return t}function hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function pr(e){var t=fr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dr(n.ownerDocument.documentElement,n)){if(null!==r&&hr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var a=n.textContent.length,s=Math.min(r.start,a);r=void 0===r.end?s:Math.min(r.end,a),!e.extend&&s>r&&(a=r,r=s,s=a),a=ur(n,s);var i=ur(n,r);a&&i&&(1!==e.rangeCount||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&((t=t.createRange()).setStart(a.node,a.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mr=u&&"documentMode"in document&&11>=document.documentMode,gr=null,vr=null,xr=null,yr=!1;function br(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;yr||null==gr||gr!==Y(r)||("selectionStart"in(r=gr)&&hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},xr&&lr(xr,r)||(xr=r,0<(r=$r(vr,"onSelect")).length&&(t=new un("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gr)))}function wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _r={animationend:wr("Animation","AnimationEnd"),animationiteration:wr("Animation","AnimationIteration"),animationstart:wr("Animation","AnimationStart"),transitionend:wr("Transition","TransitionEnd")},kr={},jr={};function Nr(e){if(kr[e])return kr[e];if(!_r[e])return e;var t,n=_r[e];for(t in n)if(n.hasOwnProperty(t)&&t in jr)return kr[e]=n[t];return e}u&&(jr=document.createElement("div").style,"AnimationEvent"in window||(delete _r.animationend.animation,delete _r.animationiteration.animation,delete _r.animationstart.animation),"TransitionEvent"in window||delete _r.transitionend.transition);var Sr=Nr("animationend"),Cr=Nr("animationiteration"),Er=Nr("animationstart"),Tr=Nr("transitionend"),Ir=new Map,Pr="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 Rr(e,t){Ir.set(e,t),l(t,[e])}for(var Or=0;Or<Pr.length;Or++){var Ar=Pr[Or];Rr(Ar.toLowerCase(),"on"+(Ar[0].toUpperCase()+Ar.slice(1)))}Rr(Sr,"onAnimationEnd"),Rr(Cr,"onAnimationIteration"),Rr(Er,"onAnimationStart"),Rr("dblclick","onDoubleClick"),Rr("focusin","onFocus"),Rr("focusout","onBlur"),Rr(Tr,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focu
2sin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dr="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(" "),Mr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Dr));function Fr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,a,i,o,l,c){if(ze.apply(this,arguments),Me){if(!Me)throw Error(s(198));var u=Fe;Me=!1,Fe=null,Le||(Le=!0,Ue=u)}}(r,t,void 0,e),e.currentTarget=null}function Lr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var o=r[i],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==s&&a.isPropagationStopped())break e;Fr(a,o,c),s=l}else for(i=0;i<r.length;i++){if(l=(o=r[i]).instance,c=o.currentTarget,o=o.listener,l!==s&&a.isPropagationStopped())break e;Fr(a,o,c),s=l}}}if(Le)throw e=Ue,Le=!1,Ue=null,e}function Ur(e,t){var n=t[ma];void 0===n&&(n=t[ma]=new Set);var r=e+"__bubble";n.has(r)||(Wr(t,e,2,!1),n.add(r))}function Hr(e,t,n){var r=0;t&&(r|=4),Wr(n,e,r,t)}var zr="_reactListening"+Math.random().toString(36).slice(2);function Br(e){if(!e[zr]){e[zr]=!0,i.forEach(function(t){"selectionchange"!==t&&(Mr.has(t)||Hr(t,!1,e),Hr(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[zr]||(t[zr]=!0,Hr("selectionchange",!1,t))}}function Wr(e,t,n,r){switch(Zt(t)){case 1:var a=Vt;break;case 4:a=$t;break;default:a=Gt}n=a.bind(null,t,n,e),a=void 0,!Oe||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(a=!0),r?void 0!==a?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):void 0!==a?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function qr(e,t,n,r,a){var s=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var o=r.stateNode.containerInfo;if(o===a||8===o.nodeType&&o.parentNode===a)break;if(4===i)for(i=r.return;null!==i;){var l=i.tag;if((3===l||4===l)&&((l=i.stateNode.containerInfo)===a||8===l.nodeType&&l.parentNode===a))return;i=i.return}for(;null!==o;){if(null===(i=xa(o)))return;if(5===(l=i.tag)||6===l){r=s=i;continue e}o=o.parentNode}}r=r.return}Pe(function(){var r=s,a=we(n),i=[];e:{var o=Ir.get(e);if(void 0!==o){var l=un,c=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":l=Cn;break;case"focusin":c="focus",l=gn;break;case"focusout":c="blur",l=gn;break;case"beforeblur":case"afterblur":l=gn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=pn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=mn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Tn;break;case Sr:case Cr:case Er:l=vn;break;case Tr:l=In;break;case"scroll":l=fn;break;case"wheel":l=Rn;break;case"copy":case"cut":case"paste":l=yn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=En}var u=0!==(4&t),d=!u&&"scroll"===e,f=u?null!==o?o+"Capture":null:o;u=[];for(var h,p=r;null!==p;){var m=(h=p).stateNode;if(5===h.tag&&null!==m&&(h=m,null!==f&&(null!=(m=Re(p,f))&&u.push(Vr(p,m,h)))),d)break;p=p.return}0<u.length&&(o=new l(o,c,null,n,a),i.push({event:o,listeners:u}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(o="mouseover"===e||"pointerover"===e)||n===be||!(c=n.relatedTarget||n.fromElement)||!xa(c)&&!c[pa])&&(l||o)&&(o=a.window===a?a:(o=a.ownerDocument)?o.defaultView||o.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?xa(c):null)&&(c!==(d=Be(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=pn,m="onMouseLeave",f="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(u=En,m="onPointerLeave",f="onPointerEnter",p="pointer"),d=null==l?o:ba(l),h=null==c?o:ba(c),(o=new u(m,p+"leave",l,n,a)).target=d,o.relatedTarget=h,m=null,xa(a)===r&&((u=new u(f,p+"enter",c,n,a)).target=h,u.relatedTarget=d,m=u),d=m,l&&c)e:{for(f=c,p=0,h=u=l;h;h=Gr(h))p++;for(h=0,m=f;m;m=Gr(m))h++;for(;0<p-h;)u=Gr(u),p--;for(;0<h-p;)f=Gr(f),h--;for(;p--;){if(u===f||null!==f&&u===f.alternate)break e;u=Gr(u),f=Gr(f)}u=null}else u=null;null!==l&&Yr(i,o,l,u,!1),null!==c&&null!==d&&Yr(i,d,c,u,!0)}if("select"===(l=(o=r?ba(r):window).nodeName&&o.nodeName.toLowerCase())||"input"===l&&"file"===o.type)var g=Zn;else if(qn(o))if(Jn)g=ir;else{g=ar;var v=rr}else(l=o.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(g=sr);switch(g&&(g=g(e,r))?Vn(i,g,n,a):(v&&v(e,o,r),"focusout"===e&&(v=o._wrapperState)&&v.controlled&&"number"===o.type&&ee(o,"number",o.value)),v=r?ba(r):window,e){case"focusin":(qn(v)||"true"===v.contentEditable)&&(gr=v,vr=r,xr=null);break;case"focusout":xr=vr=gr=null;break;case"mousedown":yr=!0;break;case"contextmenu":case"mouseup":case"dragend":yr=!1,br(i,n,a);break;case"selectionchange":if(mr)break;case"keydown":case"keyup":br(i,n,a)}var x;if(An)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else Bn?Hn(e,n)&&(y="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(y="onCompositionStart");y&&(Fn&&"ko"!==n.locale&&(Bn||"onCompositionStart"!==y?"onCompositionEnd"===y&&Bn&&(x=en()):(Xt="value"in(Jt=a)?Jt.value:Jt.textContent,Bn=!0)),0<(v=$r(r,y)).length&&(y=new bn(y,e,null,n,a),i.push({event:y,listeners:v}),x?y.data=x:null!==(x=zn(n))&&(y.data=x))),(x=Mn?function(e,t){switch(e){case"compositionend":return zn(t);case"keypress":return 32!==t.which?null:(Un=!0,Ln);case"textInput":return(e=t.data)===Ln&&Un?null:e;default:return null}}(e,n):function(e,t){if(Bn)return"compositionend"===e||!An&&Hn(e,t)?(e=en(),Qt=Xt=Jt=null,Bn=!1,e):null;switch(e){case"paste":default: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;
vendor: 85,728 bytes, line 2
2case"compositionend":return Fn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=$r(r,"onBeforeInput")).length&&(a=new bn("onBeforeInput","beforeinput",null,n,a),i.push({event:a,listeners:r}),a.data=x))}Lr(i,t)})}function Vr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $r(e,t){for(var n=t+"Capture",r=[];null!==e;){var a=e,s=a.stateNode;5===a.tag&&null!==s&&(a=s,null!=(s=Re(e,n))&&r.unshift(Vr(e,s,a)),null!=(s=Re(e,t))&&r.push(Vr(e,s,a))),e=e.return}return r}function Gr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Yr(e,t,n,r,a){for(var s=t._reactName,i=[];null!==n&&n!==r;){var o=n,l=o.alternate,c=o.stateNode;if(null!==l&&l===r)break;5===o.tag&&null!==c&&(o=c,a?null!=(l=Re(n,s))&&i.unshift(Vr(n,l,o)):a||null!=(l=Re(n,s))&&i.push(Vr(n,l,o))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var Kr=/\r\n?/g,Zr=/\u0000|\uFFFD/g;function Jr(e){return("string"===typeof e?e:""+e).replace(Kr,"\n").replace(Zr,"")}function Xr(e,t,n){if(t=Jr(t),Jr(e)!==t&&n)throw Error(s(425))}function Qr(){}var ea=null,ta=null;function na(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ra="function"===typeof setTimeout?setTimeout:void 0,aa="function"===typeof clearTimeout?clearTimeout:void 0,sa="function"===typeof Promise?Promise:void 0,ia="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof sa?function(e){return sa.resolve(null).then(e).catch(oa)}:ra;function oa(e){setTimeout(function(){throw e})}function la(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&8===a.nodeType)if("/$"===(n=a.data)){if(0===r)return e.removeChild(a),void Bt(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=a}while(n);Bt(t)}function ca(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ua(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var da=Math.random().toString(36).slice(2),fa="__reactFiber$"+da,ha="__reactProps$"+da,pa="__reactContainer$"+da,ma="__reactEvents$"+da,ga="__reactListeners$"+da,va="__reactHandles$"+da;function xa(e){var t=e[fa];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pa]||n[fa]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ua(e);null!==e;){if(n=e[fa])return n;e=ua(e)}return t}n=(e=n).parentNode}return null}function ya(e){return!(e=e[fa]||e[pa])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ba(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(s(33))}function wa(e){return e[ha]||null}var _a=[],ka=-1;function ja(e){return{current:e}}function Na(e){0>ka||(e.current=_a[ka],_a[ka]=null,ka--)}function Sa(e,t){ka++,_a[ka]=e.current,e.current=t}var Ca={},Ea=ja(Ca),Ta=ja(!1),Ia=Ca;function Pa(e,t){var n=e.type.contextTypes;if(!n)return Ca;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a,s={};for(a in n)s[a]=t[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ra(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Oa(){Na(Ta),Na(Ea)}function Aa(e,t,n){if(Ea.current!==Ca)throw Error(s(168));Sa(Ea,t),Sa(Ta,n)}function Da(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(s(108,W(e)||"Unknown",a));return F({},n,r)}function Ma(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ca,Ia=Ea.current,Sa(Ea,e),Sa(Ta,Ta.current),!0}function Fa(e,t,n){var r=e.stateNode;if(!r)throw Error(s(169));n?(e=Da(e,t,Ia),r.__reactInternalMemoizedMergedChildContext=e,Na(Ta),Na(Ea),Sa(Ea,e)):Na(Ta),Sa(Ta,n)}var La=null,Ua=!1,Ha=!1;function za(e){null===La?La=[e]:La.push(e)}function Ba(){if(!Ha&&null!==La){Ha=!0;var e=0,t=yt;try{var n=La;for(yt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}La=null,Ua=!1}catch(a){throw null!==La&&(La=La.slice(e+1)),Ge(Qe,Ba),a}finally{yt=t,Ha=!1}}return null}var Wa=[],qa=0,Va=null,$a=0,Ga=[],Ya=0,Ka=null,Za=1,Ja="";function Xa(e,t){Wa[qa++]=$a,Wa[qa++]=Va,Va=e,$a=t}function Qa(e,t,n){Ga[Ya++]=Za,Ga[Ya++]=Ja,Ga[Ya++]=Ka,Ka=e;var r=Za;e=Ja;var a=32-it(r)-1;r&=~(1<<a),n+=1;var s=32-it(t)+a;if(30<s){var i=a-a%5;s=(r&(1<<i)-1).toString(32),r>>=i,a-=i,Za=1<<32-it(t)+a|n<<a|r,Ja=s+e}else Za=1<<s|n<<a|r,Ja=e}function es(e){null!==e.return&&(Xa(e,1),Qa(e,1,0))}function ts(e){for(;e===Va;)Va=Wa[--qa],Wa[qa]=null,$a=Wa[--qa],Wa[qa]=null;for(;e===Ka;)Ka=Ga[--Ya],Ga[Ya]=null,Ja=Ga[--Ya],Ga[Ya]=null,Za=Ga[--Ya],Ga[Ya]=null}var ns=null,rs=null,as=!1,ss=null;function is(e,t){var n=Ic(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function os(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ns=e,rs=ca(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ns=e,rs=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Ka?{id:Za,overflow:Ja}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Ic(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ns=e,rs=null,!0);default:return!1}}function ls(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function cs(e){if(as){var t=rs;if(t){var n=t;if(!os(e,t)){if(ls(e))throw Error(s(418));t=ca(n.nextSibling);var r=ns;t&&os(e,t)?is(r,n):(e.flags=-4097&e.flags|2,as=!1,ns=e)}}else{if(ls(e))throw Error(s(418));e.flags=-4097&e.flags|2,as=!1,ns=e}}}function us(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ns=e}function ds(e){if(e!==ns)return!1;if(!as)return us(e),as=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!na(e.type,e.memoizedProps)),t&&(t=rs)){if(ls(e))throw fs(),Error(s(418));for(;t;)is(e,t),t=ca(t.nextSibling)}if(us(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){rs=ca(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}rs=null}}else rs=ns?ca(e.stateNode.nextSibling):null;return!0}function fs(){for(var e=rs;e;)e=ca(e.nextSibling)}function hs(){rs=ns=null,as=!1}function ps(e){null===ss?ss=[e]:ss.push(e)}var ms=b.ReactCurrentBatchConfig;function gs(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(s(309));var r=n.stateNode}if(!r)throw Error(s(147,e));var a=r,i=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=a.refs;null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!==typeof e)throw Error(s(284));if(!n._owner)throw Error(s(290,e))}return e}function vs(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xs(e){return(0,e._init)(e._payload)}function ys(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function a(e,t){return(e=Rc(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function o(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Mc(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function c(e,t,n,r){var s=n.type;return s===k?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===s||"object"===typeof s&&null!==s&&s.$$typeof===R&&xs(s)===t.type)?((r=a(t,n.props)).ref=gs(e,t,n),r.return=e,r):((r=Oc(n.type,n.key,n.props,null,e.mode,r)).ref=gs(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Fc(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function d(e,t,n,r,s){return null===t||7!==t.tag?((t=Ac(n,e.mode,r,s)).return=e,t):((t=a(t,n)).return=e,t)}function f(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Mc(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case w:return(n=Oc(t.type,t.key,t.props,null,e.mode,n)).ref=gs(e,null,t),n.return=e,n;case _:return(t=Fc(t,e.mode,n)).return=e,t;case R:return f(e,(0,t._init)(t._payload),n)}if(te(t)||D(t))return(t=Ac(t,e.mode,n,null)).return=e,t;vs(e,t)}return null}function h(e,t,n,r){var a=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n)return null!==a?null:l(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===a?c(e,t,n,r):null;case _:return n.key===a?u(e,t,n,r):null;case R:return h(e,t,(a=n._init)(n._payload),r)}if(te(n)||D(n))return null!==a?null:d(e,t,n,r,null);vs(e,n)}return null}function p(e,t,n,r,a){if("string"===typeof r&&""!==r||"number"===typeof r)return l(t,e=e.get(n)||null,""+r,a);if("object"===typeof r&&null!==r){switch(r.$$typeof){case w:return c(t,e=e.get(null===r.key?n:r.key)||null,r,a);case _:return u(t,e=e.get(null===r.key?n:r.key)||null,r,a);case R:return p(e,t,n,(0,r._init)(r._payload),a)}if(te(r)||D(r))return d(t,e=e.get(n)||null,r,a,null);vs(t,r)}return null}function m(a,s,o,l){for(var c=null,u=null,d=s,m=s=0,g=null;null!==d&&m<o.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var v=h(a,d,o[m],l);if(null===v){null===d&&(d=g);break}e&&d&&null===v.alternate&&t(a,d),s=i(v,s,m),null===u?c=v:u.sibling=v,u=v,d=g}if(m===o.length)return n(a,d),as&&Xa(a,m),c;if(null===d){for(;m<o.length;m++)null!==(d=f(a,o[m],l))&&(s=i(d,s,m),null===u?c=d:u.sibling=d,u=d);return as&&Xa(a,m),c}for(d=r(a,d);m<o.length;m++)null!==(g=p(d,a,m,o[m],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),s=i(g,s,m),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(a,e)}),as&&Xa(a,m),c}function g(a,o,l,c){var u=D(l);if("function"!==typeof u)throw Error(s(150));if(null==(l=u.call(l)))throw Error(s(151));for(var d=u=null,m=o,g=o=0,v=null,x=l.next();null!==m&&!x.done;g++,x=l.next()){m.index>g?(v=m,m=null):v=m.sibling;var y=h(a,m,x.value,c);if(null===y){null===m&&(m=v);break}e&&m&&null===y.alternate&&t(a,m),o=i(y,o,g),null===d?u=y:d.sibling=y,d=y,m=v}if(x.done)return n(a,m),as&&Xa(a,g),u;if(null===m){for(;!x.done;g++,x=l.next())null!==(x=f(a,x.value,c))&&(o=i(x,o,g),null===d?u=x:d.sibling=x,d=x);return as&&Xa(a,g),u}for(m=r(a,m);!x.done;g++,x=l.next())null!==(x=p(m,a,g,x.value,c))&&(e&&null!==x.alternate&&m.delete(null===x.key?g:x.key),o=i(x,o,g),null===d?u=x:d.sibling=x,d=x);return e&&m.forEach(function(e){return t(a,e)}),as&&Xa(a,g),u}return function e(r,s,i,l){if("object"===typeof i&&null!==i&&i.type===k&&null===i.key&&(i=i.props.children),"object"===typeof i&&null!==i){switch(i.$$typeof){case w:e:{for(var c=i.key,u=s;null!==u;){if(u.key===c){if((c=i.type)===k){if(7===u.tag){n(r,u.sibling),(s=a(u,i.props.children)).return=r,r=s;break e}}else if(u.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===R&&xs(c)===u.type){n(r,u.sibling),(s=a(u,i.props)).ref=gs(r,u,i),s.return=r,r=s;break e}n(r,u);break}t(r,u),u=u.sibling}i.type===k?((s=Ac(i.props.children,r.mode,l,i.key)).return=r,r=s):((l=Oc(i.type,i.key,i.props,null,r.mode,l)).ref=gs(r,s,i),l.return=r,r=l)}return o(r);case _:e:{for(u=i.key;null!==s;){if(s.key===u){if(4===s.tag&&s.stateNode.containerInfo===i.containerInfo&&s.stateNode.implementation===i.implementation){n(r,s.sibling),(s=a(s,i.children||[])).return=r,r=s;break e}n(r,s);break}t(r,s),s=s.sibling}(s=Fc(i,r.mode,l)).return=r,r=s}return o(r);case R:return e(r,s,(u=i._init)(i._payload),l)}if(te(i))return m(r,s,i,l);if(D(i))return g(r,s,i,l);vs(r,i)}return"string"===typeof i&&""!==i||"number"===typeof i?(i=""+i,null!==s&&6===s.tag?(n(r,s.sibling),(s=a(s,i)).return=r,r=s):(n(r,s),(s=Mc(i,r.mode,l)).return=r,r=s),o(r)):n(r,s)}}var bs=ys(!0),ws=ys(!1),_s=ja(null),ks=null,js=null,Ns=null;function Ss(){Ns=js=ks=null}function Cs(e){var t=_s.current;Na(_s),e._currentValue=t}function Es(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ts(e,t){ks=e,Ns=js=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(yo=!0),e.firstContext=null)}function Is(e){var t=e._currentValue;if(Ns!==e)if(e={context:e,memoizedValue:t,next:null},null===js){if(null===ks)throw Error(s(308));js=e,ks.dependencies={lanes:0,firstContext:e}}else js=js.next=e;return t}var Ps=null;function Rs(e){null===Ps?Ps=[e]:Ps.push(e)}function Os(e,t,n,r){var a=t.interleaved;return null===a?(n.next=n,Rs(t)):(n.next=a.next,a.next=n),t.interleaved=n,As(e,r)}function As(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ds=!1;function Ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fs(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 Ls(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Us(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&Cl)){var a=r.pending;return null===a?t.next=t:(t.next=a.next,a.next=t),r.pending=t,As(e,n)}return null===(a=r.interleaved)?(t.next=t,Rs(r)):(t.next=a.next,a.next=t),r.interleaved=t,As(e,n)}function Hs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,xt(e,n)}}function zs(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var a=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===s?a=s=i:s=s.next=i,n=n.next}while(null!==n);null===s?a=s=t:s=s.next=t}else a=s=t;return n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Bs(e,t,n,r){var a=e.updateQueue;Ds=!1;var s=a.firstBaseUpdate,i=a.lastBaseUpdate,o=a.shared.pending;if(null!==o){a.shared.pending=null;var l=o,c=l.next;l.next=null,null===i?s=c:i.next=c,i=l;var u=e.alternate;null!==u&&((o=(u=u.updateQueue).lastBaseUpdate)!==i&&(null===o?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(null!==s){var d=a.baseState;for(i=0,u=c=l=null,o=s;;){var f=o.lane,h=o.eventTime;if((r&f)===f){null!==u&&(u=u.next={eventTime:h,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,m=o;switch(f=t,h=n,m.tag){case 1:if("function"===typeof(p=m.payload)){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null===(f="function"===typeof(p=m.payload)?p.call(h,d,f):p)||void 0===f)break e;d=F({},d,f);break e;case 2:Ds=!0}}null!==o.callback&&0!==o.lane&&(e.flags|=64,null===(f=a.effects)?a.effects=[o]:f.push(o))}else h={eventTime:h,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===u?(c=u=h,l=d):u=u.next=h,i|=f;if(null===(o=o.next)){if(null===(o=a.shared.pending))break;o=(f=o).next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}if(null===u&&(l=d),a.baseState=l,a.firstBaseUpdate=c,a.lastBaseUpdate=u,null!==(t=a.shared.interleaved)){a=t;do{i|=a.lane,a=a.next}while(a!==t)}else null===s&&(a.shared.lanes=0);Dl|=i,e.lanes=i,e.memoizedState=d}}function Ws(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(null!==a){if(r.callback=null,r=n,"function"!==typeof a)throw Error(s(191,a));a.call(r)}}}var qs={},Vs=ja(qs),$s=ja(qs),Gs=ja(qs);function Ys(e){if(e===qs)throw Error(s(174));return e}function Ks(e,t){switch(Sa(Gs,t),Sa($s,e),Sa(Vs,qs),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Na(Vs),Sa(Vs,t)}function Zs(){Na(Vs),Na($s),Na(Gs)}function Js(e){Ys(Gs.current);var t=Ys(Vs.current),n=le(t,e.type);t!==n&&(Sa($s,e),Sa(Vs,n))}function Xs(e){$s.current===e&&(Na(Vs),Na($s))}var Qs=ja(0);function ei(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ti=[];function ni(){for(var e=0;e<ti.length;e++)ti[e]._workInProgressVersionPrimary=null;ti.length=0}var ri=b.ReactCurrentDispatcher,ai=b.ReactCurrentBatchConfig,si=0,ii=null,oi=null,li=null,ci=!1,ui=!1,di=0,fi=0;function hi(){throw Error(s(321))}function pi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!or(e[n],t[n]))return!1;return!0}function mi(e,t,n,r,a,i){if(si=i,ii=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ri.current=null===e||null===e.memoizedState?Xi:Qi,e=n(r,a),ui){i=0;do{if(ui=!1,di=0,25<=i)throw Error(s(301));i+=1,li=oi=null,t.updateQueue=null,ri.current=eo,e=n(r,a)}while(ui)}if(ri.current=Ji,t=null!==oi&&null!==oi.next,si=0,li=oi=ii=null,ci=!1,t)throw Error(s(300));return e}function gi(){var e=0!==di;return di=0,e}function vi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===li?ii.memoizedState=li=e:li=li.next=e,li}function xi(){if(null===oi){var e=ii.alternate;e=null!==e?e.memoizedState:null}else e=oi.next;var t=null===li?ii.memoizedState:li.next;if(null!==t)li=t,oi=e;else{if(null===e)throw Error(s(310));e={memoizedState:(oi=e).memoizedState,baseState:oi.baseState,baseQueue:oi.baseQueue,queue:oi.queue,next:null},null===li?ii.memoizedState=li=e:li=li.next=e}return li}function yi(e,t){return"function"===typeof t?t(e):t}function bi(e){var t=xi(),n=t.queue;if(null===n)throw Error(s(311));n.lastRenderedReducer=e;var r=oi,a=r.baseQueue,i=n.pending;if(null!==i){if(null!==a){var o=a.next;a.next=i.next,i.next=o}r.baseQueue=a=i,n.pending=null}if(null!==a){i=a.next,r=r.baseState;var l=o=null,c=null,u=i;do{var d=u.lane;if((si&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=f,o=r):c=c.next=f,ii.lanes|=d,Dl|=d}u=u.next}while(null!==u&&u!==i);null===c?o=r:c.next=l,or(r,t.memoizedState)||(yo=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(null!==(e=n.interleaved)){a=e;do{i=a.lane,ii.lanes|=i,Dl|=i,a=a.next}while(a!==e)}else null===a&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function wi(e){var t=xi(),n=t.queue;if(null===n)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(null!==a){n.pending=null;var o=a=a.next;do{i=e(i,o.action),o=o.next}while(o!==a);or(i,t.memoizedState)||(yo=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function _i(){}function ki(e,t){var n=ii,r=xi(),a=t(),i=!or(r.memoizedState,a);if(i&&(r.memoizedState=a,yo=!0),r=r.queue,Di(Si.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||null!==li&&1&li.memoizedState.tag){if(n.flags|=2048,Ii(9,Ni.bind(null,n,r,a,t),void 0,null),null===El)throw Error(s(349));0!==(30&si)||ji(n,t,a)}return a}function ji(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ii.updateQueue)?(t={lastEffect:null,stores:null},ii.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ni(e,t,n,r){t.value=n,t.getSnapshot=r,Ci(t)&&Ei(e)}function Si(e,t,n){return n(function(){Ci(t)&&Ei(e)})}function Ci(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!or(e,n)}catch(r){return!0}}function Ei(e){var t=As(e,1);null!==t&&tc(t,e,1,-1)}function Ti(e){var t=vi();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yi,lastRenderedState:e},t.queue=e,e=e.dispatch=Gi.bind(null,ii,e),[t.memoizedState,e]}function Ii(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ii.updateQueue)?(t={lastEffect:null,stores:null},ii.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Pi(){return xi().memoizedState}function Ri(e,t,n,r){var a=vi();ii.flags|=e,a.memoizedState=Ii(1|t,n,void 0,void 0===r?null:r)}function Oi(e,t,n,r){var a=xi();r=void 0===r?null:r;var s=void 0;if(null!==oi){var i=oi.memoizedState;if(s=i.destroy,null!==r&&pi(r,i.deps))return void(a.memoizedState=Ii(t,n,s,r))}ii.flags|=e,a.memoizedState=Ii(1|t,n,s,r)}function Ai(e,t){return Ri(8390656,8,e,t)}function Di(e,t){return Oi(2048,8,e,t)}function Mi(e,t){return Oi(4,2,e,t)}function Fi(e,t){return Oi(4,4,e,t)}function Li(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ui(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Oi(4,4,Li.bind(null,t,e),n)}function Hi(){}function zi(e,t){var n=xi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&pi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Bi(e,t){var n=xi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&pi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Wi(e,t,n){return 0===(21&si)?(e.baseState&&(e.baseState=!1,yo=!0),e.memoizedState=n):(or(n,t)||(n=mt(),ii.lanes|=n,Dl|=n,e.baseState=!0),t)}function qi(e,t){var n=yt;yt=0!==n&&4>n?n:4,e(!0);var r=ai.transition;ai.transition={};try{e(!1),t()}finally{yt=n,ai.transition=r}}function Vi(){return xi().memoizedState}function $i(e,t,n){var r=ec(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Yi(e))Ki(t,n);else if(null!==(n=Os(e,t,n,r))){tc(n,e,r,Ql()),Zi(n,t,r)}}function Gi(e,t,n){var r=ec(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Yi(e))Ki(t,a);else{var s=e.alternate;if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var i=t.lastRenderedState,o=s(i,n);if(a.hasEagerState=!0,a.eagerState=o,or(o,i)){var l=t.interleaved;return null===l?(a.next=a,Rs(t)):(a.next=l.next,l.next=a),void(t.interleaved=a)}}catch(c){}null!==(n=Os(e,t,a,r))&&(tc(n,e,r,a=Ql()),Zi(n,t,r))}}function Yi(e){var t=e.alternate;return e===ii||null!==t&&t===ii}function Ki(e,t){ui=ci=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zi(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,xt(e,n)}}var Ji={readContext:Is,useCallback:hi,useContext:hi,useEffect:hi,useImperativeHandle:hi,useInsertionEffect:hi,useLayoutEffect:hi,useMemo:hi,useReducer:hi,useRef:hi,useState:hi,useDebugValue:hi,useDeferredValue:hi,useTransition:hi,useMutableSource:hi,useSyncExternalStore:hi,useId:hi,unstable_isNewReconciler:!1},Xi={readContext:Is,useCallback:function(e,t){return vi().memoizedState=[e,void 0===t?null:t],e},useContext:Is,useEffect:Ai,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Ri(4194308,4,Li.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ri(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ri(4,2,e,t)},useMemo:function(e,t){var n=vi();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=vi();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=$i.bind(null,ii,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},vi().memoizedState=e},useState:Ti,useDebugValue:Hi,useDeferredValue:function(e){return vi().memoizedState=e},useTransition:function(){var e=Ti(!1),t=e[0];return e=qi.bind(null,e[1]),vi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ii,a=vi();if(as){if(void 0===n)throw Error(s(407));n=n()}else{if(n=t(),null===El)throw Error(s(349));0!==(30&si)||ji(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,Ai(Si.bind(null,r,i,e),[e]),r.flags|=2048,Ii(9,Ni.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=vi(),t=El.identifierPrefix;if(as){var n=Ja;t=":"+t+"R"+(n=(Za&~(1<<32-it(Za)-1)).toString(32)+n),0<(n=di++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=fi++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Qi={readContext:Is,useCallback:zi,useContext:Is,useEffect:Di,useImperativeHandle:Ui,useInsertionEffect:Mi,useLayoutEffect:Fi,useMemo:Bi,useReducer:bi,useRef:Pi,useState:function(){return bi(yi)},useDebugValue:Hi,useDeferredValue:function(e){return Wi(xi(),oi.memoizedState,e)},useTransition:function(){return[bi(yi)[0],xi().memoizedState]},useMutableSource:_i,useSyncExternalStore:ki,useId:Vi,unstable_isNewReconciler:!1},eo={readContext:Is,useCallback:zi,useContext:Is,useEffect:Di,useImperativeHandle:Ui,useInsertionEffect:Mi,useLayoutEffect:Fi,useMemo:Bi,useReducer:wi,useRef:Pi,useState:function(){return wi(yi)},useDebugValue:Hi,useDeferredValue:function(e){var t=xi();return null===oi?t.memoizedState=e:Wi(t,oi.memoizedState,e)},useTransition:function(){return[wi(yi)[0],xi().memoizedState]},useMutableSource:_i,useSyncExternalStore:ki,useId:Vi,unstable_isNewReconciler:!1};function to(e,t){if(e&&e.defaultProps){for(var n in t=F({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function no(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:F({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ro={isMounted:function(e){return!!(e=e._reactInternals)&&Be(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ql(),a=ec(e),s=Ls(r,a);s.payload=t,void 0!==n&&null!==n&&(s.callback=n),null!==(t=Us(e,s,a))&&(tc(t,e,a,r),Hs(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ql(),a=ec(e),s=Ls(r,a);s.tag=1,s.payload=t,void 0!==n&&null!==n&&(s.callback=n),null!==(t=Us(e,s,a))&&(tc(t,e,a,r),Hs(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ql(),r=ec(e),a=Ls(n,r);a.tag=2,void 0!==t&&null!==t&&(a.callback=t),null!==(t=Us(e,a,r))&&(tc(t,e,r,n),Hs(t,e,r))}};function ao(e,t,n,r,a,s,i){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,s,i):!t.prototype||!t.prototype.isPureReactComponent||(!lr(n,r)||!lr(a,s))}function so(e,t,n){var r=!1,a=Ca,s=t.contextType;return"object"===typeof s&&null!==s?s=Is(s):(a=Ra(t)?Ia:Ea.current,s=(r=null!==(r=t.contextTypes)&&void 0!==r)?Pa(e,a):Ca),t=new t(n,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ro,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=s),t}function io(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ro.enqueueReplaceState(t,t.state,null)}function oo(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},Ms(e);var s=t.contextType;"object"===typeof s&&null!==s?a.context=Is(s):(s=Ra(t)?Ia:Ea.current,a.context=Pa(e,s)),a.state=e.memoizedState,"function"===typeof(s=t.getDerivedStateFromProps)&&(no(e,t,s,n),a.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof a.getSnapshotBeforeUpdate||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||(t=a.state,"function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),t!==a.state&&ro.enqueueReplaceState(a,a.state,null),Bs(e,n,a,r),a.state=e.memoizedState),"function"===typeof a.componentDidMount&&(e.flags|=4194308)}function lo(e,t){try{var n="",r=t;do{n+=z(r),r=r.return}while(r);var a=n}catch(s){a="\nError generating stack: "+s.message+"\n"+s.stack}return{value:e,source:t,stack:a,digest:null}}function co(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function uo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var fo="function"===typeof WeakMap?WeakMap:Map;function ho(e,t,n){(n=Ls(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Wl||(Wl=!0,ql=r),uo(0,t)},n}function po(e,t,n){(n=Ls(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){uo(0,t)}}var s=e.stateNode;return null!==s&&"function"===typeof s.componentDidCatch&&(n.callback=function(){uo(0,t),"function"!==typeof r&&(null===Vl?Vl=new Set([this]):Vl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function mo(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new fo;var a=new Set;r.set(t,a)}else void 0===(a=r.get(t))&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=jc.bind(null,e,t,n),t.then(e,e))}function go(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function vo(e,t,n,r,a){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Ls(-1,1)).tag=2,Us(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var xo=b.ReactCurrentOwner,yo=!1;function bo(e,t,n,r){t.child=null===e?ws(t,null,n,r):bs(t,e.child,n,r)}function wo(e,t,n,r,a){n=n.render;var s=t.ref;return Ts(t,a),r=mi(e,t,n,r,s,a),n=gi(),null===e||yo?(as&&n&&es(t),t.flags|=1,bo(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Wo(e,t,a))}function _o(e,t,n,r,a){if(null===e){var s=n.type;return"function"!==typeof s||Pc(s)||void 0!==s.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Oc(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,ko(e,t,s,r,a))}if(s=e.child,0===(e.lanes&a)){var i=s.memoizedProps;if((n=null!==(n=n.compare)?n:lr)(i,r)&&e.ref===t.ref)return Wo(e,t,a)}return t.flags|=1,(e=Rc(s,r)).ref=t.ref,e.return=t,t.child=e}function ko(e,t,n,r,a){if(null!==e){var s=e.memoizedProps;if(lr(s,r)&&e.ref===t.ref){if(yo=!1,t.pendingProps=r=s,0===(e.lanes&a))return t.lanes=e.lanes,Wo(e,t,a);0!==(131072&e.flags)&&(yo=!0)}}return So(e,t,n,r,a)}function jo(e,t,n){var r=t.pendingProps,a=r.children,s=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Sa(Rl,Pl),Pl|=n;else{if(0===(1073741824&n))return e=null!==s?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Sa(Rl,Pl),Pl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==s?s.baseLanes:n,Sa(Rl,Pl),Pl|=r}else null!==s?(r=s.baseLanes|n,t.memoizedState=null):r=n,Sa(Rl,Pl),Pl|=r;return bo(e,t,a,n),t.child}function No(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function So(e,t,n,r,a){var s=Ra(n)?Ia:Ea.current;return s=Pa(t,s),Ts(t,a),n=mi(e,t,n,r,s,a),r=gi(),null===e||yo?(as&&r&&es(t),t.flags|=1,bo(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Wo(e,t,a))}function Co(e,t,n,r,a){if(Ra(n)){var s=!0;Ma(t)}else s=!1;if(Ts(t,a),null===t.stateNode)Bo(e,t),so(t,n,r),oo(t,n,r,a),r=!0;else if(null===e){var i=t.stateNode,o=t.memoizedProps;i.props=o;var l=i.context,c=n.contextType;"object"===typeof c&&null!==c?c=Is(c):c=Pa(t,c=Ra(n)?Ia:Ea.current);var u=n.getDerivedStateFromProps,d="function"===typeof u||"function"===typeof i.getSnapshotBeforeUpdate;d||"function"!==typeof i.UNSAFE_componentWillReceiveProps&&"function"!==typeof i.componentWillReceiveProps||(o!==r||l!==c)&&io(t,i,r,c),Ds=!1;var f=t.memoizedState;i.state=f,Bs(t,r,i,a),l=t.memoizedState,o!==r||f!==l||Ta.current||Ds?("function"===typeof u&&(no(t,n,u,r),l=t.memoizedState),(o=Ds||ao(t,n,o,r,f,l,c))?(d||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||("function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"===typeof i.componentDidMount&&(t.flags|=4194308)):("function"===typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),i.props=r,i.state=l,i.context=c,r=o):("function"===typeof i.componentDidMount&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Fs(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:to(t.type,o),i.props=c,d=t.pendingProps,f=i.context,"object"===typeof(l=n.contextType)&&null!==l?l=Is(l):l=Pa(t,l=Ra(n)?Ia:Ea.current);var h=n.getDerivedStateFromProps;(u="function"===typeof h||"function"===typeof i.getSnapshotBeforeUpdate)||"function"!==typeof i.UNSAFE_componentWillReceiveProps&&"function"!==typeof i.componentWillReceiveProps||(o!==d||f!==l)&&io(t,i,r,l),Ds=!1,f=t.memoizedState,i.state=f,Bs(t,r,i,a);var p=t.memoizedState;o!==d||f!==p||Ta.current||Ds?("function"===typeof h&&(no(t,n,h,r),p=t.memoizedState),(c=Ds||ao(t,n,c,r,f,p,l)||!1)?(u||"function"!==typeof i.UNSAFE_componentWillUpdate&&"function"!==typeof i.componentWillUpdate||("function"===typeof i.componentWillUpdate&&i.componentWillUpdate(r,p,l),"function"===typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,p,l)),"function"===typeof i.componentDidUpdate&&(t.flags|=4),"function"===typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof i.componentDidUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof i.getSnapshotBeforeUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),i.props=r,i.state=p,i.context=l,r=c):("function"!==typeof i.componentDidUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof i.getSnapshotBeforeUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Eo(e,t,n,r,s,a)}function Eo(e,t,n,r,a,s){No(e,t);var i=0!==(128&t.flags);if(!r&&!i)return a&&Fa(t,n,!1),Wo(e,t,s);r=t.stateNode,xo.current=t;var o=i&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&i?(t.child=bs(t,e.child,null,s),t.child=bs(t,null,o,s)):bo(e,t,o,s),t.memoizedState=r.state,a&&Fa(t,n,!0),t.child}function To(e){var t=e.stateNode;t.pendingContext?Aa(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Aa(0,t.context,!1),Ks(e,t.containerInfo)}function Io(e,t,n,r,a){return hs(),ps(a),t.flags|=256,bo(e,t,n,r),t.child}var Po,Ro,Oo,Ao={dehydrated:null,treeContext:null,retryLane:0};function Do(e){return{baseLanes:e,cachePool:null,transitions:null}}function Mo(e,t,n){var r,a=t.pendingProps,i=Qs.current,o=!1,l=0!==(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!==(2&i)),r?(o=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),Sa(Qs,1&i),null===e)return cs(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=a.children,e=a.fallback,o?(a=t.mode,o=t.child,l={mode:"hidden",children:l},0===(1&a)&&null!==o?(o.childLanes=0,o.pendingProps=l):o=Dc(l,a,0,null),e=Ac(e,a,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Do(n),t.memoizedState=Ao,e):Fo(t,l));if(null!==(i=e.memoizedState)&&null!==(r=i.dehydrated))return function(e,t,n,r,a,i,o){if(n)return 256&t.flags?(t.flags&=-257,Lo(e,t,o,r=co(Error(s(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=Dc({mode:"visible",children:r.children},a,0,null),(i=Ac(i,a,o,null)).flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,0!==(1&t.mode)&&bs(t,e.child,null,o),t.child.memoizedState=Do(o),t.memoizedState=Ao,i);if(0===(1&t.mode))return Lo(e,t,o,null);if("$!"===a.data){if(r=a.nextSibling&&a.nextSibling.dataset)var l=r.dgst;return r=l,Lo(e,t,o,r=co(i=Error(s(419)),r,void 0))}if(l=0!==(o&e.childLanes),yo||l){if(null!==(r=El)){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}0!==(a=0!==(a&(r.suspendedLanes|o))?0:a)&&a!==i.retryLane&&(i.retryLane=a,As(e,a),tc(r,e,a,-1))}return pc(),Lo(e,t,o,r=co(Error(s(421))))}return"$?"===a.data?(t.flags|=128,t.child=e.child,t=Sc.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,rs=ca(a.nextSibling),ns=t,as=!0,ss=null,null!==e&&(Ga[Ya++]=Za,Ga[Ya++]=Ja,Ga[Ya++]=Ka,Za=e.id,Ja=e.overflow,Ka=t),t=Fo(t,r.children),t.flags|=4096,t)}(e,t,l,a,r,i,n);if(o){o=a.fallback,l=t.mode,r=(i=e.child).sibling;var c={mode:"hidden",children:a.children};return 0===(1&l)&&t.child!==i?((a=t.child).childLanes=0,a.pendingProps=c,t.deletions=null):(a=Rc(i,c)).subtreeFlags=14680064&i.subtreeFlags,null!==r?o=Rc(r,o):(o=Ac(o,l,n,null)).flags|=2,o.return=t,a.return=t,a.sibling=o,t.child=a,a=o,o=t.child,l=null===(l=e.child.memoizedState)?Do(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~n,t.memoizedState=Ao,a}return e=(o=e.child).sibling,a=Rc(o,{mode:"visible",children:a.children}),0===(1&t.mode)&&(a.lanes=n),a.return=t,a.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=a,t.memoizedState=null,a}function Fo(e,t){return(t=Dc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Lo(e,t,n,r){return null!==r&&ps(r),bs(t,e.child,null,n),(e=Fo(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Uo(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Es(e.return,t,n)}function Ho(e,t,n,r,a){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=a)}function zo(e,t,n){var r=t.pendingProps,a=r.revealOrder,s=r.tail;if(bo(e,t,r.children,n),0!==(2&(r=Qs.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Uo(e,n,t);else if(19===e.tag)Uo(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Sa(Qs,r),0===(1&t.mode))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===ei(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Ho(t,!1,a,n,s);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===ei(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Ho(t,!0,n,null,s);break;case"together":Ho(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Bo(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wo(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Dl|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(s(153));if(null!==t.child){for(n=Rc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Rc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function qo(e,t){if(!as)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Vo(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=14680064&a.subtreeFlags,r|=14680064&a.flags,a.return=e,a=a.sibling;else for(a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function $o(e,t,n){var r=t.pendingProps;switch(ts(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vo(t),null;case 1:case 17:return Ra(t.type)&&Oa(),Vo(t),null;case 3:return r=t.stateNode,Zs(),Na(Ta),Na(Ea),ni(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(ds(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==ss&&(sc(ss),ss=null))),Vo(t),null;case 5:Xs(t);var a=Ys(Gs.current);if(n=t.type,null!==e&&null!=t.stateNode)Ro(e,t,n,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(s(166));return Vo(t),null}if(e=Ys(Vs.current),ds(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[fa]=t,r[ha]=i,e=0!==(1&t.mode),n){case"dialog":Ur("cancel",r),Ur("close",r);break;case"iframe":case"object":case"embed":Ur("load",r);break;case"video":case"audio":for(a=0;a<Dr.length;a++)Ur(Dr[a],r);break;case"source":Ur("error",r);break;case"img":case"image":case"link":Ur("error",r),Ur("load",r);break;case"details":Ur("toggle",r);break;case"input":Z(r,i),Ur("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ur("invalid",r);break;case"textarea":ae(r,i),Ur("invalid",r)}for(var l in xe(n,i),a=null,i)if(i.hasOwnProperty(l)){var c=i[l];"children"===l?"string"===typeof c?r.textContent!==c&&(!0!==i.suppressHydrationWarning&&Xr(r.textContent,c,e),a=["children",c]):"number"===typeof c&&r.textContent!==""+c&&(!0!==i.suppressHydrationWarning&&Xr(r.textContent,c,e),a=["children",""+c]):o.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Ur("scroll",r)}switch(n){case"input":$(r),Q(r,i,!0);break;case"textarea":$(r),ie(r);break;case"select":case"option":break;default:"function"===typeof i.onClick&&(r.onclick=Qr)}r=a,t.updateQueue=r,null!==r&&(t.flags|=4)}else{l=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=oe(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[fa]=t,e[ha]=r,Po(e,t),t.stateNode=e;e:{switch(l=ye(n,r),n){case"dialog":Ur("cancel",e),Ur("close",e),a=r;break;case"iframe":case"object":case"embed":Ur("load",e),a=r;break;case"video":case"audio":for(a=0;a<Dr.length;a++)Ur(Dr[a],e);a=r;break;case"source":Ur("error",e),a=r;break;case"img":case"image":case"link":Ur("error",e),Ur("load",e),a=r;break;case"details":Ur("toggle",e),a=r;break;case"input":Z(e,r),a=K(e,r),Ur("invalid",e);break;case"option":default:a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=F({},r,{value:void 0}),Ur("invalid",e);break;case"textarea":ae(e,r),a=re(e,r),Ur("invalid",e)}for(i in xe(n,a),c=a)if(c.hasOwnProperty(i)){var u=c[i];"style"===i?ge(e,u):"dangerouslySetInnerHTML"===i?null!=(u=u?u.__html:void 0)&&de(e,u):"children"===i?"string"===typeof u?("textarea"!==n||""!==u)&&fe(e,u):"number"===typeof u&&fe(e,""+u):"suppressContentEditableWarning"!==i&&"suppressHydrationWarning"!==i&&"autoFocus"!==i&&(o.hasOwnProperty(i)?null!=u&&"onScroll"===i&&Ur("scroll",e):null!=u&&y(e,i,u,l))}switch(n){case"input":$(e),Q(e,r,!1);break;case"textarea":$(e),ie(e);break;case"option":null!=r.value&&e.setAttribute("value",""+q(r.value));break;case"select":e.multiple=!!r.multiple,null!=(i=r.value)?ne(e,!!r.multiple,i,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof a.onClick&&(e.onclick=Qr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Vo(t),null;case 6:if(e&&null!=t.stateNode)Oo(0,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(s(166));if(n=Ys(Gs.current),Ys(Vs.current),ds(t)){if(r=t.stateNode,n=t.memoizedProps,r[fa]=t,(i=r.nodeValue!==n)&&null!==(e=ns))switch(e.tag){case 3:Xr(r.nodeValue,n,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Xr(r.nodeValue,n,0!==(1&e.mode))}i&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[fa]=t,t.stateNode=r}return Vo(t),null;case 13:if(Na(Qs),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(as&&null!==rs&&0!==(1&t.mode)&&0===(128&t.flags))fs(),hs(),t.flags|=98560,i=!1;else if(i=ds(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(s(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(s(317));i[fa]=t}else hs(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Vo(t),i=!1}else null!==ss&&(sc(ss),ss=null),i=!0;if(!i)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&Qs.current)?0===Ol&&(Ol=3):pc())),null!==t.updateQueue&&(t.flags|=4),Vo(t),null);case 4:return Zs(),null===e&&Br(t.stateNode.containerInfo),Vo(t),null;case 10:return Cs(t.type._context),Vo(t),null;case 19:if(Na(Qs),null===(i=t.memoizedState))return Vo(t),null;if(r=0!==(128&t.flags),null===(l=i.rendering))if(r)qo(i,!1);else{if(0!==Ol||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=ei(e))){for(t.flags|=128,qo(i,!1),null!==(r=l.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(i=n).flags&=14680066,null===(l=i.alternate)?(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=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Sa(Qs,1&Qs.current|2),t.child}e=e.sibling}null!==i.tail&&Je()>zl&&(t.flags|=128,r=!0,qo(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ei(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),qo(i,!0),null===i.tail&&"hidden"===i.tailMode&&!l.alternate&&!as)return Vo(t),null}else 2*Je()-i.renderingStartTime>zl&&1073741824!==n&&(t.flags|=128,r=!0,qo(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=i.last)?n.sibling=l:t.child=l,i.last=l)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Je(),t.sibling=null,n=Qs.current,Sa(Qs,r?1&n|2:1&n),t):(Vo(t),null);case 22:case 23:return uc(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&Pl)&&(Vo(t),6&t.subtreeFlags&&(t.flags|=8192)):Vo(t),null;case 24:case 25:return null}throw Error(s(156,t.tag))}function Go(e,t){switch(ts(t),t.tag){case 1:return Ra(t.type)&&Oa(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Zs(),Na(Ta),Na(Ea),ni(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Xs(t),null;case 13:if(Na(Qs),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(s(340));hs()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Na(Qs),null;case 4:return Zs(),null;case 10:return Cs(t.type._context),null;case 22:case 23:return uc(),null;default:return null}}Po=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ro=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Ys(Vs.current);var s,i=null;switch(n){case"input":a=K(e,a),r=K(e,r),i=[];break;case"select":a=F({},a,{value:void 0}),r=F({},r,{value:void 0}),i=[];break;case"textarea":a=re(e,a),r=re(e,r),i=[];break;default:"function"!==typeof a.onClick&&"function"===typeof r.onClick&&(e.onclick=Qr)}for(u in xe(n,r),n=null,a)if(!r.hasOwnProperty(u)&&a.hasOwnProperty(u)&&null!=a[u])if("style"===u){var l=a[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(o.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(l=null!=a?a[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(i||(i=[]),i.push(u,n)),n=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(i=i||[]).push(u,c)):"children"===u?"string"!==typeof c&&"number"!==typeof c||(i=i||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(o.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&Ur("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}},Oo=function(e,t,n,r){n!==r&&(t.flags|=4)};var Yo=!1,Ko=!1,Zo="function"===typeof WeakSet?WeakSet:Set,Jo=null;function Xo(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){kc(e,t,r)}else n.current=null}function Qo(e,t,n){try{n()}catch(r){kc(e,t,r)}}var el=!1;function tl(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var a=r=r.next;do{if((a.tag&e)===e){var s=a.destroy;a.destroy=void 0,void 0!==s&&Qo(t,n,s)}a=a.next}while(a!==r)}}function nl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function rl(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function al(e){var t=e.alternate;null!==t&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[fa],delete t[ha],delete t[ma],delete t[ga],delete t[va])),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 sl(e){return 5===e.tag||3===e.tag||4===e.tag}function il(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||sl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ol(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Qr));else if(4!==r&&null!==(e=e.child))for(ol(e,t,n),e=e.sibling;null!==e;)ol(e,t,n),e=e.sibling}function ll(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(ll(e,t,n),e=e.sibling;null!==e;)ll(e,t,n),e=e.sibling}var cl=null,ul=!1;function dl(e,t,n){for(n=n.child;null!==n;)fl(e,t,n),n=n.sibling}function fl(e,t,n){if(st&&"function"===typeof st.onCommitFiberUnmount)try{st.onCommitFiberUnmount(at,n)}catch(o){}switch(n.tag){case 5:Ko||Xo(n,t);case 6:var r=cl,a=ul;cl=null,dl(e,t,n),ul=a,null!==(cl=r)&&(ul?(e=cl,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):cl.removeChild(n.stateNode));break;case 18:null!==cl&&(ul?(e=cl,n=n.stateNode,8===e.nodeType?la(e.parentNode,n):1===e.nodeType&&la(e,n),Bt(e)):la(cl,n.stateNode));break;case 4:r=cl,a=ul,cl=n.stateNode.containerInfo,ul=!0,dl(e,t,n),cl=r,ul=a;break;case 0:case 11:case 14:case 15:if(!Ko&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){a=r=r.next;do{var s=a,i=s.destroy;s=s.tag,void 0!==i&&(0!==(2&s)||0!==(4&s))&&Qo(n,t,i),a=a.next}while(a!==r)}dl(e,t,n);break;case 1:if(!Ko&&(Xo(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){kc(n,t,o)}dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:1&n.mode?(Ko=(r=Ko)||null!==n.memoizedState,dl(e,t,n),Ko=r):dl(e,t,n);break;default:dl(e,t,n)}}function hl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Zo),t.forEach(function(t){var r=Cc.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function pl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var a=n[r];try{var i=e,o=t,l=o;e:for(;null!==l;){switch(l.tag){case 5:cl=l.stateNode,ul=!1;break e;case 3:case 4:cl=l.stateNode.containerInfo,ul=!0;break e}l=l.return}if(null===cl)throw Error(s(160));fl(i,o,a),cl=null,ul=!1;var c=a.alternate;null!==c&&(c.return=null),a.return=null}catch(u){kc(a,t,u)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)ml(t,e),t=t.sibling}function ml(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pl(t,e),gl(e),4&r){try{tl(3,e,e.return),nl(3,e)}catch(g){kc(e,e.return,g)}try{tl(5,e,e.return)}catch(g){kc(e,e.return,g)}}break;case 1:pl(t,e),gl(e),512&r&&null!==n&&Xo(n,n.return);break;case 5:if(pl(t,e),gl(e),512&r&&null!==n&&Xo(n,n.return),32&e.flags){var a=e.stateNode;try{fe(a,"")}catch(g){kc(e,e.return,g)}}if(4&r&&null!=(a=e.stateNode)){var i=e.memoizedProps,o=null!==n?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===i.type&&null!=i.name&&J(a,i),ye(l,o);var u=ye(l,i);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];"style"===d?ge(a,f):"dangerouslySetInnerHTML"===d?de(a,f):"children"===d?fe(a,f):y(a,d,f,u)}switch(l){case"input":X(a,i);break;case"textarea":se(a,i);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;null!=p?ne(a,!!i.multiple,p,!1):h!==!!i.multiple&&(null!=i.defaultValue?ne(a,!!i.multiple,i.defaultValue,!0):ne(a,!!i.multiple,i.multiple?[]:"",!1))}a[ha]=i}catch(g){kc(e,e.return,g)}}break;case 6:if(pl(t,e),gl(e),4&r){if(null===e.stateNode)throw Error(s(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(g){kc(e,e.return,g)}}break;case 3:if(pl(t,e),gl(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Bt(t.containerInfo)}catch(g){kc(e,e.return,g)}break;case 4:default:pl(t,e),gl(e);break;case 13:pl(t,e),gl(e),8192&(a=e.child).flags&&(i=null!==a.memoizedState,a.stateNode.isHidden=i,!i||null!==a.alternate&&null!==a.alternate.memoizedState||(Hl=Je())),4&r&&hl(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Ko=(u=Ko)||d,pl(t,e),Ko=u):pl(t,e),gl(e),8192&r){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!d&&0!==(1&e.mode))for(Jo=e,d=e.child;null!==d;){for(f=Jo=d;null!==Jo;){switch(p=(h=Jo).child,h.tag){case 0:case 11:case 14:case 15:tl(4,h,h.return);break;case 1:Xo(h,h.return);var m=h.stateNode;if("function"===typeof m.componentWillUnmount){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){kc(r,n,g)}}break;case 5:Xo(h,h.return);break;case 22:if(null!==h.memoizedState){bl(f);continue}}null!==p?(p.return=h,Jo=p):bl(f)}d=d.sibling}e:for(d=null,f=e;;){if(5===f.tag){if(null===d){d=f;try{a=f.stateNode,u?"function"===typeof(i=a.style).setProperty?i.setProperty("display","none","important"):i.display="none":(l=f.stateNode,o=void 0!==(c=f.memoizedProps.style)&&null!==c&&c.hasOwnProperty("display")?c.display:null,l.style.display=me("display",o))}catch(g){kc(e,e.return,g)}}}else if(6===f.tag){if(null===d)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){kc(e,e.return,g)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===e)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;null===f.sibling;){if(null===f.return||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:pl(t,e),gl(e),4&r&&hl(e);case 21:}}function gl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(sl(n)){var r=n;break e}n=n.return}throw Error(s(160))}switch(r.tag){case 5:var a=r.stateNode;32&r.flags&&(fe(a,""),r.flags&=-33),ll(e,il(e),a);break;case 3:case 4:var i=r.stateNode.containerInfo;ol(e,il(e),i);break;default:throw Error(s(161))}}catch(o){kc(e,e.return,o)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function vl(e,t,n){Jo=e,xl(e,t,n)}function xl(e,t,n){for(var r=0!==(1&e.mode);null!==Jo;){var a=Jo,s=a.child;if(22===a.tag&&r){var i=null!==a.memoizedState||Yo;if(!i){var o=a.alternate,l=null!==o&&null!==o.memoizedState||Ko;o=Yo;var c=Ko;if(Yo=i,(Ko=l)&&!c)for(Jo=a;null!==Jo;)l=(i=Jo).child,22===i.tag&&null!==i.memoizedState?wl(a):null!==l?(l.return=i,Jo=l):wl(a);for(;null!==s;)Jo=s,xl(s,t,n),s=s.sibling;Jo=a,Yo=o,Ko=c}yl(e)}else 0!==(8772&a.subtreeFlags)&&null!==s?(s.return=a,Jo=s):yl(e)}}function yl(e){for(;null!==Jo;){var t=Jo;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Ko||nl(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Ko)if(null===n)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:to(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;null!==i&&Ws(t,i,r);break;case 3:var o=t.updateQueue;if(null!==o){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Ws(t,o,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var d=u.memoizedState;if(null!==d){var f=d.dehydrated;null!==f&&Bt(f)}}}break;default:throw Error(s(163))}Ko||512&t.flags&&rl(t)}catch(h){kc(t,t.return,h)}}if(t===e){Jo=null;break}if(null!==(n=t.sibling)){n.return=t.return,Jo=n;break}Jo=t.return}}function bl(e){for(;null!==Jo;){var t=Jo;if(t===e){Jo=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Jo=n;break}Jo=t.return}}function wl(e){for(;null!==Jo;){var t=Jo;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{nl(4,t)}catch(l){kc(t,n,l)}break;case 1:var r=t.stateNode;if("function"===typeof r.componentDidMount){var a=t.return;try{r.componentDidMount()}catch(l){kc(t,a,l)}}var s=t.return;try{rl(t)}catch(l){kc(t,s,l)}break;case 5:var i=t.return;try{rl(t)}catch(l){kc(t,i,l)}}}catch(l){kc(t,t.return,l)}if(t===e){Jo=null;break}var o=t.sibling;if(null!==o){o.return=t.return,Jo=o;break}Jo=t.return}}var _l,kl=Math.ceil,jl=b.ReactCurrentDispatcher,Nl=b.ReactCurrentOwner,Sl=b.ReactCurrentBatchConfig,Cl=0,El=null,Tl=null,Il=0,Pl=0,Rl=ja(0),Ol=0,Al=null,Dl=0,Ml=0,Fl=0,Ll=null,Ul=null,Hl=0,zl=1/0,Bl=null,Wl=!1,ql=null,Vl=null,$l=!1,Gl=null,Yl=0,Kl=0,Zl=null,Jl=-1,Xl=0;function Ql(){return 0!==(6&Cl)?Je():-1!==Jl?Jl:Jl=Je()}function ec(e){return 0===(1&e.mode)?1:0!==(2&Cl)&&0!==Il?Il&-Il:null!==ms.transition?(0===Xl&&(Xl=mt()),Xl):0!==(e=yt)?e:e=void 0===(e=window.event)?16:Zt(e.type)}function tc(e,t,n,r){if(50<Kl)throw Kl=0,Zl=null,Error(s(185));vt(e,n,r),0!==(2&Cl)&&e===El||(e===El&&(0===(2&Cl)&&(Ml|=n),4===Ol&&ic(e,Il)),nc(e,r),1===n&&0===Cl&&0===(1&t.mode)&&(zl=Je()+500,Ua&&Ba()))}function nc(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-it(s),o=1<<i,l=a[i];-1===l?0!==(o&n)&&0===(o&r)||(a[i]=ht(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}}(e,t);var r=ft(e,e===El?Il:0);if(0===r)null!==n&&Ye(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ye(n),1===t)0===e.tag?function(e){Ua=!0,za(e)}(oc.bind(null,e)):za(oc.bind(null,e)),ia(function(){0===(6&Cl)&&Ba()}),n=null;else{switch(bt(r)){case 1:n=Qe;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=Ec(n,rc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function rc(e,t){if(Jl=-1,Xl=0,0!==(6&Cl))throw Error(s(327));var n=e.callbackNode;if(wc()&&e.callbackNode!==n)return null;var r=ft(e,e===El?Il:0);if(0===r)return null;if(0!==(30&r)||0!==(r&e.expiredLanes)||t)t=mc(e,r);else{t=r;var a=Cl;Cl|=2;var i=hc();for(El===e&&Il===t||(Bl=null,zl=Je()+500,dc(e,t));;)try{vc();break}catch(l){fc(e,l)}Ss(),jl.current=i,Cl=a,null!==Tl?t=0:(El=null,Il=0,t=Ol)}if(0!==t){if(2===t&&(0!==(a=pt(e))&&(r=a,t=ac(e,a))),1===t)throw n=Al,dc(e,0),ic(e,r),nc(e,Je()),n;if(6===t)ic(e,r);else{if(a=e.current.alternate,0===(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var a=n[r],s=a.getSnapshot;a=a.value;try{if(!or(s(),a))return!1}catch(o){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(a)&&(2===(t=mc(e,r))&&(0!==(i=pt(e))&&(r=i,t=ac(e,i))),1===t))throw n=Al,dc(e,0),ic(e,r),nc(e,Je()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(s(345));case 2:case 5:bc(e,Ul,Bl);break;case 3:if(ic(e,r),(130023424&r)===r&&10<(t=Hl+500-Je())){if(0!==ft(e,0))break;if(((a=e.suspendedLanes)&r)!==r){Ql(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=ra(bc.bind(null,e,Ul,Bl),t);break}bc(e,Ul,Bl);break;case 4:if(ic(e,r),(4194240&r)===r)break;for(t=e.eventTimes,a=-1;0<r;){var o=31-it(r);i=1<<o,(o=t[o])>a&&(a=o),r&=~i}if(r=a,10<(r=(120>(r=Je()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kl(r/1960))-r)){e.timeoutHandle=ra(bc.bind(null,e,Ul,Bl),r);break}bc(e,Ul,Bl);break;default:throw Error(s(329))}}}return nc(e,Je()),e.callbackNode===n?rc.bind(null,e):null}function ac(e,t){var n=Ll;return e.current.memoizedState.isDehydrated&&(dc(e,t).flags|=256),2!==(e=mc(e,t))&&(t=Ul,Ul=n,null!==t&&sc(t)),e}function sc(e){null===Ul?Ul=e:Ul.push.apply(Ul,e)}function ic(e,t){for(t&=~Fl,t&=~Ml,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-it(t),r=1<<n;e[n]=-1,t&=~r}}function oc(e){if(0!==(6&Cl))throw Error(s(327));wc();var t=ft(e,0);if(0===(1&t))return nc(e,Je()),null;var n=mc(e,t);if(0!==e.tag&&2===n){var r=pt(e);0!==r&&(t=r,n=ac(e,r))}if(1===n)throw n=Al,dc(e,0),ic(e,t),nc(e,Je()),n;if(6===n)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bc(e,Ul,Bl),nc(e,Je()),null}function lc(e,t){var n=Cl;Cl|=1;try{return e(t)}finally{0===(Cl=n)&&(zl=Je()+500,Ua&&Ba())}}function cc(e){null!==Gl&&0===Gl.tag&&0===(6&Cl)&&wc();var t=Cl;Cl|=1;var n=Sl.transition,r=yt;try{if(Sl.transition=null,yt=1,e)return e()}finally{yt=r,Sl.transition=n,0===(6&(Cl=t))&&Ba()}}function uc(){Pl=Rl.current,Na(Rl)}function dc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,aa(n)),null!==Tl)for(n=Tl.return;null!==n;){var r=n;switch(ts(r),r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&Oa();break;case 3:Zs(),Na(Ta),Na(Ea),ni();break;case 5:Xs(r);break;case 4:Zs();break;case 13:case 19:Na(Qs);break;case 10:Cs(r.type._context);break;case 22:case 23:uc()}n=n.return}if(El=e,Tl=e=Rc(e.current,null),Il=Pl=t,Ol=0,Al=null,Fl=Ml=Dl=0,Ul=Ll=null,null!==Ps){for(t=0;t<Ps.length;t++)if(null!==(r=(n=Ps[t]).interleaved)){n.interleaved=null;var a=r.next,s=n.pending;if(null!==s){var i=s.next;s.next=a,r.next=i}n.pending=r}Ps=null}return e}function fc(e,t){for(;;){var n=Tl;try{if(Ss(),ri.current=Ji,ci){for(var r=ii.memoizedState;null!==r;){var a=r.queue;null!==a&&(a.pending=null),r=r.next}ci=!1}if(si=0,li=oi=ii=null,ui=!1,di=0,Nl.current=null,null===n||null===n.return){Ol=1,Al=t,Tl=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=Il,l.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var u=c,d=l,f=d.tag;if(0===(1&d.mode)&&(0===f||11===f||15===f)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=go(o);if(null!==p){p.flags&=-257,vo(p,o,l,0,t),1&p.mode&&mo(i,u,t),c=u;var m=(t=p).updateQueue;if(null===m){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}if(0===(1&t)){mo(i,u,t),pc();break e}c=Error(s(426))}else if(as&&1&l.mode){var v=go(o);if(null!==v){0===(65536&v.flags)&&(v.flags|=256),vo(v,o,l,0,t),ps(lo(c,l));break e}}i=c=lo(c,l),4!==Ol&&(Ol=2),null===Ll?Ll=[i]:Ll.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t,zs(i,ho(0,c,t));break e;case 1:l=c;var x=i.type,y=i.stateNode;if(0===(128&i.flags)&&("function"===typeof x.getDerivedStateFromError||null!==y&&"function"===typeof y.componentDidCatch&&(null===Vl||!Vl.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t,zs(i,po(i,l,t));break e}}i=i.return}while(null!==i)}yc(n)}catch(b){t=b,Tl===n&&null!==n&&(Tl=n=n.return);continue}break}}function hc(){var e=jl.current;return jl.current=Ji,null===e?Ji:e}function pc(){0!==Ol&&3!==Ol&&2!==Ol||(Ol=4),null===El||0===(268435455&Dl)&&0===(268435455&Ml)||ic(El,Il)}function mc(e,t){var n=Cl;Cl|=2;var r=hc();for(El===e&&Il===t||(Bl=null,dc(e,t));;)try{gc();break}catch(a){fc(e,a)}if(Ss(),Cl=n,jl.current=r,null!==Tl)throw Error(s(261));return El=null,Il=0,Ol}function gc(){for(;null!==Tl;)xc(Tl)}function vc(){for(;null!==Tl&&!Ke();)xc(Tl)}function xc(e){var t=_l(e.alternate,e,Pl);e.memoizedProps=e.pendingProps,null===t?yc(e):Tl=t,Nl.current=null}function yc(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(n=$o(n,t,Pl)))return void(Tl=n)}else{if(null!==(n=Go(n,t)))return n.flags&=32767,void(Tl=n);if(null===e)return Ol=6,void(Tl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Tl=t);Tl=t=e}while(null!==t);0===Ol&&(Ol=5)}function bc(e,t,n){var r=yt,a=Sl.transition;try{Sl.transition=null,yt=1,function(e,t,n,r){do{wc()}while(null!==Gl);if(0!==(6&Cl))throw Error(s(327));n=e.finishedWork;var a=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-it(n),s=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~s}}(e,i),e===El&&(Tl=El=null,Il=0),0===(2064&n.subtreeFlags)&&0===(2064&n.flags)||$l||($l=!0,Ec(tt,function(){return wc(),null})),i=0!==(15990&n.flags),0!==(15990&n.subtreeFlags)||i){i=Sl.transition,Sl.transition=null;var o=yt;yt=1;var l=Cl;Cl|=4,Nl.current=null,function(e,t){if(ea=qt,hr(e=fr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch(w){n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||0!==a&&3!==f.nodeType||(l=o+a),f!==i||0!==r&&3!==f.nodeType||(c=o+r),3===f.nodeType&&(o+=f.nodeValue.length),null!==(p=f.firstChild);)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===a&&(l=o),h===i&&++d===r&&(c=o),null!==(p=f.nextSibling))break;h=(f=h).parentNode}f=p}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(ta={focusedElem:e,selectionRange:n},qt=!1,Jo=t;null!==Jo;)if(e=(t=Jo).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Jo=e;else for(;null!==Jo;){t=Jo;try{var m=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,v=m.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:to(t.type,g),v);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(s(163))}}catch(w){kc(t,t.return,w)}if(null!==(e=t.sibling)){e.return=t.return,Jo=e;break}Jo=t.return}m=el,el=!1}(e,n),ml(n,e),pr(ta),qt=!!ea,ta=ea=null,e.current=n,vl(n,e,a),Ze(),Cl=l,yt=o,Sl.transition=i}else e.current=n;if($l&&($l=!1,Gl=e,Yl=a),i=e.pendingLanes,0===i&&(Vl=null),function(e){if(st&&"function"===typeof st.onCommitFiberRoot)try{st.onCommitFiberRoot(at,e,void 0,128===(128&e.current.flags))}catch(t){}}(n.stateNode),nc(e,Je()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Wl)throw Wl=!1,e=ql,ql=null,e;0!==(1&Yl)&&0!==e.tag&&wc(),i=e.pendingLanes,0!==(1&i)?e===Zl?Kl++:(Kl=0,Zl=e):Kl=0,Ba()}(e,t,n,r)}finally{Sl.transition=a,yt=r}return null}function wc(){if(null!==Gl){var e=bt(Yl),t=Sl.transition,n=yt;try{if(Sl.transition=null,yt=16>e?16:e,null===Gl)var r=!1;else{if(e=Gl,Gl=null,Yl=0,0!==(6&Cl))throw Error(s(331));var a=Cl;for(Cl|=4,Jo=e.current;null!==Jo;){var i=Jo,o=i.child;if(0!==(16&Jo.flags)){var l=i.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(Jo=u;null!==Jo;){var d=Jo;switch(d.tag){case 0:case 11:case 15:tl(8,d,i)}var f=d.child;if(null!==f)f.return=d,Jo=f;else for(;null!==Jo;){var h=(d=Jo).sibling,p=d.return;if(al(d),d===u){Jo=null;break}if(null!==h){h.return=p,Jo=h;break}Jo=p}}}var m=i.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}Jo=i}}if(0!==(2064&i.subtreeFlags)&&null!==o)o.return=i,Jo=o;else e:for(;null!==Jo;){if(0!==(2048&(i=Jo).flags))switch(i.tag){case 0:case 11:case 15:tl(9,i,i.return)}var x=i.sibling;if(null!==x){x.return=i.return,Jo=x;break e}Jo=i.return}}var y=e.current;for(Jo=y;null!==Jo;){var b=(o=Jo).child;if(0!==(2064&o.subtreeFlags)&&null!==b)b.return=o,Jo=b;else e:for(o=y;null!==Jo;){if(0!==(2048&(l=Jo).flags))try{switch(l.tag){case 0:case 11:case 15:nl(9,l)}}catch(_){kc(l,l.return,_)}if(l===o){Jo=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,Jo=w;break e}Jo=l.return}}if(Cl=a,Ba(),st&&"function"===typeof st.onPostCommitFiberRoot)try{st.onPostCommitFiberRoot(at,e)}catch(_){}r=!0}return r}finally{yt=n,Sl.transition=t}}return!1}function _c(e,t,n){e=Us(e,t=ho(0,t=lo(n,t),1),1),t=Ql(),null!==e&&(vt(e,1,t),nc(e,t))}function kc(e,t,n){if(3===e.tag)_c(e,e,n);else for(;null!==t;){if(3===t.tag){_c(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Vl||!Vl.has(r))){t=Us(t,e=po(t,e=lo(n,e),1),1),e=Ql(),null!==t&&(vt(t,1,e),nc(t,e));break}}t=t.return}}function jc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Ql(),e.pingedLanes|=e.suspendedLanes&n,El===e&&(Il&n)===n&&(4===Ol||3===Ol&&(130023424&Il)===Il&&500>Je()-Hl?dc(e,0):Fl|=n),nc(e,t)}function Nc(e,t){0===t&&(0===(1&e.mode)?t=1:(t=ut,0===(130023424&(ut<<=1))&&(ut=4194304)));var n=Ql();null!==(e=As(e,t))&&(vt(e,t,n),nc(e,n))}function Sc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Nc(e,n)}function Cc(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(s(314))}null!==r&&r.delete(t),Nc(e,n)}function Ec(e,t){return Ge(e,t)}function Tc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ic(e,t,n,r){return new Tc(e,t,n,r)}function Pc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Rc(e,t){var n=e.alternate;return null===n?((n=Ic(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Oc(e,t,n,r,a,i){var o=2;if(r=e,"function"===typeof e)Pc(e)&&(o=1);else if("string"===typeof e)o=5;else e:switch(e){case k:return Ac(n.children,a,i,t);case j:o=8,a|=8;break;case N:return(e=Ic(12,n,t,2|a)).elementType=N,e.lanes=i,e;case T:return(e=Ic(13,n,t,a)).elementType=T,e.lanes=i,e;case I:return(e=Ic(19,n,t,a)).elementType=I,e.lanes=i,e;case O:return Dc(n,a,i,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case S:o=10;break e;case C:o=9;break e;case E:o=11;break e;case P:o=14;break e;case R:o=16,r=null;break e}throw Error(s(130,null==e?e:typeof e,""))}return(t=Ic(o,n,t,a)).elementType=e,t.type=r,t.lanes=i,t}function Ac(e,t,n,r){return(e=Ic(7,e,r,t)).lanes=n,e}function Dc(e,t,n,r){return(e=Ic(22,e,r,t)).elementType=O,e.lanes=n,e.stateNode={isHidden:!1},e}function Mc(e,t,n){return(e=Ic(6,e,null,t)).lanes=n,e}function Fc(e,t,n){return(t=Ic(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Lc(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Uc(e,t,n,r,a,s,i,o,l){return e=new Lc(e,t,n,o,l),1===t?(t=1,!0===s&&(t|=8)):t=0,s=Ic(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ms(s),e}function Hc(e){if(!e)return Ca;e:{if(Be(e=e._reactInternals)!==e||1!==e.tag)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ra(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(s(171))}if(1===e.tag){var n=e.type;if(Ra(n))return Da(e,n,t)}return t}function zc(e,t,n,r,a,s,i,o,l){return(e=Uc(n,r,!0,e,0,s,0,o,l)).context=Hc(null),n=e.current,(s=Ls(r=Ql(),a=ec(n))).callback=void 0!==t&&null!==t?t:null,Us(n,s,a),e.current.lanes=a,vt(e,a,r),nc(e,r),e}function Bc(e,t,n,r){var a=t.current,s=Ql(),i=ec(a);return n=Hc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Ls(s,i)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Us(a,t,i))&&(tc(e,a,i,s),Hs(e,a,i)),i}function Wc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function qc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Vc(e,t){qc(e,t),(e=e.alternate)&&qc(e,t)}_l=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Ta.current)yo=!0;else{if(0===(e.lanes&n)&&0===(128&t.flags))return yo=!1,function(e,t,n){switch(t.tag){case 3:To(t),hs();break;case 5:Js(t);break;case 1:Ra(t.type)&&Ma(t);break;case 4:Ks(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;Sa(_s,r._currentValue),r._currentValue=a;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Sa(Qs,1&Qs.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Mo(e,t,n):(Sa(Qs,1&Qs.current),null!==(e=Wo(e,t,n))?e.sibling:null);Sa(Qs,1&Qs.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(128&e.flags)){if(r)return zo(e,t,n);t.flags|=128}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null,a.lastEffect=null),Sa(Qs,Qs.current),r)break;return null;case 22:case 23:return t.lanes=0,jo(e,t,n)}return Wo(e,t,n)}(e,t,n);yo=0!==(131072&e.flags)}else yo=!1,as&&0!==(1048576&t.flags)&&Qa(t,$a,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Bo(e,t),e=t.pendingProps;var a=Pa(t,Ea.current);Ts(t,n),a=mi(null,t,r,e,a,n);var i=gi();return t.flags|=1,"object"===typeof a&&null!==a&&"function"===typeof a.render&&void 0===a.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ra(r)?(i=!0,Ma(t)):i=!1,t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,Ms(t),a.updater=ro,t.stateNode=a,a._reactInternals=t,oo(t,r,e,n),t=Eo(null,t,r,!0,i,n)):(t.tag=0,as&&i&&es(t),bo(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Bo(e,t),e=t.pendingProps,r=(a=r._init)(r._payload),t.type=r,a=t.tag=function(e){if("function"===typeof e)return Pc(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===E)return 11;if(e===P)return 14}return 2}(r),e=to(r,e),a){case 0:t=So(null,t,r,e,n);break e;case 1:t=Co(null,t,r,e,n);break e;case 11:t=wo(null,t,r,e,n);break e;case 14:t=_o(null,t,r,to(r.type,e),n);break e}throw Error(s(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,So(e,t,r,a=t.elementType===r?a:to(r,a),n);case 1:return r=t.type,a=t.pendingProps,Co(e,t,r,a=t.elementType===r?a:to(r,a),n);case 3:e:{if(To(t),null===e)throw Error(s(387));r=t.pendingProps,a=(i=t.memoizedState).element,Fs(e,t),Bs(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated){if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,256&t.flags){t=Io(e,t,r,n,a=lo(Error(s(423)),t));break e}if(r!==a){t=Io(e,t,r,n,a=lo(Error(s(424)),t));break e}for(rs=ca(t.stateNode.containerInfo.firstChild),ns=t,as=!0,ss=null,n=ws(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(hs(),r===a){t=Wo(e,t,n);break e}bo(e,t,r,n)}t=t.child}return t;case 5:return Js(t),null===e&&cs(t),r=t.type,a=t.pendingProps,i=null!==e?e.memoizedProps:null,o=a.children,na(r,a)?o=null:null!==i&&na(r,i)&&(t.flags|=32),No(e,t),bo(e,t,o,n),t.child;case 6:return null===e&&cs(t),null;case 13:return Mo(e,t,n);case 4:return Ks(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=bs(t,null,r,n):bo(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,wo(e,t,r,a=t.elementType===r?a:to(r,a),n);case 7:return bo(e,t,t.pendingProps,n),t.child;case 8:case 12:return bo(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,Sa(_s,r._currentValue),r._currentValue=o,null!==i)if(or(i.value,o)){if(i.children===a.children&&!Ta.current){t=Wo(e,t,n);break e}}else for(null!==(i=t.child)&&(i.return=t);null!==i;){var l=i.dependencies;if(null!==l){o=i.child;for(var c=l.firstContext;null!==c;){if(c.context===r){if(1===i.tag){(c=Ls(-1,n&-n)).tag=2;var u=i.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,null!==(c=i.alternate)&&(c.lanes|=n),Es(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(10===i.tag)o=i.type===t.type?null:i.child;else if(18===i.tag){if(null===(o=i.return))throw Error(s(341));o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Es(o,n,t),o=i.sibling}else o=i.child;if(null!==o)o.return=i;else for(o=i;null!==o;){if(o===t){o=null;break}if(null!==(i=o.sibling)){i.return=o.return,o=i;break}o=o.return}i=o}bo(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Ts(t,n),r=r(a=Is(a)),t.flags|=1,bo(e,t,r,n),t.child;case 14:return a=to(r=t.type,t.pendingProps),_o(e,t,r,a=to(r.type,a),n);case 15:return ko(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:to(r,a),Bo(e,t),t.tag=1,Ra(r)?(e=!0,Ma(t)):e=!1,Ts(t,n),so(t,r,a),oo(t,r,a,n),Eo(null,t,r,!0,e,n);case 19:return zo(e,t,n);case 22:return jo(e,t,n)}throw Error(s(156,t.tag))};var $c="function"===typeof reportError?reportError:function(e){console.error(e)};function Gc(e){this._internalRoot=e}function Yc(e){this._internalRoot=e}function Kc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Zc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Jc(){}function Xc(e,t,n,r,a){var s=n._reactRootContainer;if(s){var i=s;if("function"===typeof a){var o=a;a=function(){var e=Wc(i);o.call(e)}}Bc(t,i,e,a)}else i=function(e,t,n,r,a){if(a){if("function"===typeof r){var s=r;r=function(){var e=Wc(i);s.call(e)}}var i=zc(t,r,e,0,null,!1,0,"",Jc);return e._reactRootContainer=i,e[pa]=i.current,Br(8===e.nodeType?e.parentNode:e),cc(),i}for(;a=e.lastChild;)e.removeChild(a);if("function"===typeof r){var o=r;r=function(){var e=Wc(l);o.call(e)}}var l=Uc(e,0,!1,null,0,!1,0,"",Jc);return e._reactRootContainer=l,e[pa]=l.current,Br(8===e.nodeType?e.parentNode:e),cc(function(){Bc(t,l,n,r)}),l}(n,t,e,a,r);return Wc(i)}Yc.prototype.render=Gc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(s(409));Bc(e,t,null,null)},Yc.prototype.unmount=Gc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;cc(function(){Bc(null,e,null,null)}),t[pa]=null}},Yc.prototype.unstable_scheduleHydration=function(e){if(e){var t=jt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ot.length&&0!==t&&t<Ot[n].priority;n++);Ot.splice(n,0,e),0===n&&Ft(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dt(t.pendingLanes);0!==n&&(xt(t,1|n),nc(t,Je()),0===(6&Cl)&&(zl=Je()+500,Ba()))}break;case 13:cc(function(){var t=As(e,1);if(null!==t){var n=Ql();tc(t,e,1,n)}}),Vc(e,1)}},_t=function(e){if(13===e.tag){var t=As(e,134217728);if(null!==t)tc(t,e,134217728,Ql());Vc(e,134217728)}},kt=function(e){if(13===e.tag){var t=ec(e),n=As(e,t);if(null!==n)tc(n,e,t,Ql());Vc(e,t)}},jt=function(){return yt},Nt=function(e,t){var n=yt;try{return yt=e,t()}finally{yt=n}},_e=function(e,t,n){switch(t){case"input":if(X(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=wa(r);if(!a)throw Error(s(90));G(r),X(r,a)}}}break;case"textarea":se(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Ee=lc,Te=cc;var Qc={usingClientEntryPoint:!1,Events:[ya,ba,wa,Se,Ce,lc]},eu={findFiberByHostInstance:xa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},tu={bundleType:eu.bundleType,version:eu.version,rendererPackageName:eu.rendererPackageName,rendererConfig:eu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ve(e))?null:e.stateNode},findFiberByHostInstance:eu.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nu.isDisabled&&nu.supportsFiber)try{at=nu.inject(tu),st=nu}catch(ue){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Qc,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Kc(t))throw Error(s(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:_,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Kc(e))throw Error(s(299));var n=!1,r="",a=$c;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(a=t.onRecoverableError)),t=Uc(e,1,!1,null,0,n,0,r,a),e[pa]=t.current,Br(8===e.nodeType?e.parentNode:e),new Gc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(s(188));throw e=Object.keys(e).join(","),Error(s(268,e))}return e=null===(e=Ve(t))?null:e.stateNode},t.flushSync=function(e){return cc(e)}
2,t.hydrate=function(e,t,n){if(!Zc(t))throw Error(s(200));return Xc(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Kc(e))throw Error(s(405));var r=null!=n&&n.hydratedSources||null,a=!1,i="",o=$c;if(null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(a=!0),void 0!==n.identifierPrefix&&(i=n.identifierPrefix),void 0!==n.onRecoverableError&&(o=n.onRecoverableError)),t=zc(t,null,e,1,null!=n?n:null,a,0,i,o),e[pa]=t.current,Br(e),r)for(e=0;e<r.length;e++)a=(a=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Yc(t)},t.render=function(e,t,n){if(!Zc(t))throw Error(s(200));return Xc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Zc(e))throw Error(s(40));return!!e._reactRootContainer&&(cc(function(){Xc(null,null,e,!1,function(){e._reactRootContainer=null,e[pa]=null})}),!0)},t.unstable_batchedUpdates=lc,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Zc(n))throw Error(s(200));if(null==e||void 0===e._reactInternals)throw Error(s(38));return Xc(e,t,n,!1,r)},t.version="18.3.1-next-f1338f8080-20240426"},4391(e,t,n){"use strict";var r=n(7950);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},7950(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(2730)},6366(e){var t="undefined"!==typeof Element,n="function"===typeof Map,r="function"===typeof Set,a="function"===typeof ArrayBuffer&&!!ArrayBuffer.isView;function s(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var o,l,c,u;if(Array.isArray(e)){if((o=e.length)!=i.length)return!1;for(l=o;0!==l--;)if(!s(e[l],i[l]))return!1;return!0}if(n&&e instanceof Map&&i instanceof Map){if(e.size!==i.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!i.has(l.value[0]))return!1;for(u=e.entries();!(l=u.next()).done;)if(!s(l.value[1],i.get(l.value[0])))return!1;return!0}if(r&&e instanceof Set&&i instanceof Set){if(e.size!==i.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!i.has(l.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(i)){if((o=e.length)!=i.length)return!1;for(l=o;0!==l--;)if(e[l]!==i[l])return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"===typeof e.valueOf&&"function"===typeof i.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString&&"function"===typeof e.toString&&"function"===typeof i.toString)return e.toString()===i.toString();if((o=(c=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(l=o;0!==l--;)if(!Object.prototype.hasOwnProperty.call(i,c[l]))return!1;if(t&&e instanceof Element)return!1;for(l=o;0!==l--;)if(("_owner"!==c[l]&&"__v"!==c[l]&&"__o"!==c[l]||!e.$$typeof)&&!s(e[c[l]],i[c[l]]))return!1;return!0}return e!==e&&i!==i}e.exports=function(e,t){try{return s(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},8161(e,t,n){"use strict";var r,a=n(5043),s=(r=a)&&"object"===typeof r&&"default"in r?r.default:r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=!("undefined"===typeof window||!window.document||!window.document.createElement);e.exports=function(e,t,n){if("function"!==typeof e)throw new Error("Expected reducePropsToState to be a function.");if("function"!==typeof t)throw new Error("Expected handleStateChangeOnClient to be a function.");if("undefined"!==typeof n&&"function"!==typeof n)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(r){if("function"!==typeof r)throw new Error("Expected WrappedComponent to be a React component.");var l,c=[];function u(){l=e(c.map(function(e){return e.props})),d.canUseDOM?t(l):n&&(l=n(l))}var d=function(e){var t,n;function a(){return e.apply(this,arguments)||this}n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,a.peek=function(){return l},a.rewind=function(){if(a.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var e=l;return l=void 0,c=[],e};var i=a.prototype;return i.UNSAFE_componentWillMount=function(){c.push(this),u()},i.componentDidUpdate=function(){u()},i.componentWillUnmount=function(){var e=c.indexOf(this);c.splice(e,1),u()},i.render=function(){return s.createElement(r,this.props)},a}
vendor: 4,454 bytes, line 2
2(a.PureComponent);return i(d,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(r)+")"),i(d,"canUseDOM",o),d}}},1153(e,t,n){"use strict";var r=n(5043),a=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,s={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:a,type:e,key:c,ref:u,props:s,_owner:o.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},4202(e,t){"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}function x(){}function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)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")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=v.prototype;var b=y.prototype=new x;b.constructor=y,m(b,v.prototype),b.isPureReactComponent=!0;var w=Array.isArray,_=Object.prototype.hasOwnProperty,k={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function N(e,t,r){var a,s={},i=null,o=null;if(null!=t)for(a in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(i=""+t.key),t)_.call(t,a)&&!j.hasOwnProperty(a)&&(s[a]=t[a]);var l=arguments.length-2;if(1===l)s.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(a in l=e.defaultProps)void 0===s[a]&&(s[a]=l[a]);return{$$typeof:n,type:e,key:i,ref:o,props:s,_owner:k.current}}function S(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var C=/\/+/g;function E(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function T(e,t,a,s,i){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0}}if(l)return i=i(l=e),e=""===s?"."+E(l,0):s,w(i)?(a="",null!=e&&(a=e.replace(C,"$&/")+"/"),T(i,t,a,"",function(e){return e})):null!=i&&(S(i)&&(i=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,a+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(C,"$&/")+"/")+e)),t.push(i)),1;if(l=0,s=""===s?".":s+":",w(e))for(var c=0;c<e.length;c++){var u=s+E(o=e[c],c);l+=T(o,t,a,u,i)}else if(u=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=h&&e[h]||e["@@iterator"])?e:null}(e),"function"===typeof u)for(e=u.call(e),c=0;!(o=e.next()).done;)l+=T(o=o.value,t,a,u=s+E(o,c++),i);else if("object"===o)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function I(e,t,n){if(null==e)return e;var r=[],a=0;return T(e,r,"","",function(e){return t.call(n,e,a++)}),r}function P(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var R={current:null},O={transition:null},A={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:O,ReactCurrentOwner:k};function D(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 6,773 bytes, line 2
2t.Children={map:I,forEach:function(e,t,n){I(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return I(e,function(){t++}),t},toArray:function(e){return I(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=a,t.Profiler=i,t.PureComponent=y,t.StrictMode=s,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,t.act=D,t.cloneElement=function(e,t,r){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a=m({},e.props),s=e.key,i=e.ref,o=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,o=k.current),void 0!==t.key&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)_.call(t,c)&&!j.hasOwnProperty(c)&&(a[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)a.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}return{$$typeof:n,type:e.type,key:s,ref:i,props:a,_owner:o}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=N,t.createFactory=function(e){var t=N.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=S,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:P}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=O.transition;O.transition={};try{e()}finally{O.transition=t}},t.unstable_act=D,t.useCallback=function(e,t){return R.current.useCallback(e,t)},t.useContext=function(e){return R.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return R.current.useDeferredValue(e)},t.useEffect=function(e,t){return R.current.useEffect(e,t)},t.useId=function(){return R.current.useId()},t.useImperativeHandle=function(e,t,n){return R.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return R.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return R.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return R.current.useMemo(e,t)},t.useReducer=function(e,t,n){return R.current.useReducer(e,t,n)},t.useRef=function(e){return R.current.useRef(e)},t.useState=function(e){return R.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return R.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return R.current.useTransition()},t.version="18.3.1"},5043(e,t,n){"use strict";e.exports=n(4202)},579(e,t,n){"use strict";e.exports=n(1153)},7234(e,t){"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<s(a,t)))break e;e[r]=t,e[n]=a,n=r}}function r(e){return 0===e.length?null:e[0]}function a(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length,i=a>>>1;r<i;){var o=2*(r+1)-1,l=e[o],c=o+1,u=e[c];if(0>s(l,n))c<a&&0>s(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[o]=n,r=o);else{if(!(c<a&&0>s(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,x="function"===typeof clearTimeout?clearTimeout:null,y="undefined"!==typeof setImmediate?setImmediate:null;function b(e){for(var t=r(u);null!==t;){if(null===t.callback)a(u);else{if(!(t.startTime<=e))break;a(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function w(e){if(g=!1,b(e),!m)if(null!==r(c))m=!0,O(_);else{var t=r(u);null!==t&&A(w,t.startTime-e)}}function _(e,n){m=!1,g&&(g=!1,x(S),S=-1),p=!0;var s=h;try{for(b(n),f=r(c);null!==f&&(!(f.expirationTime>n)||e&&!T());){var i=f.callback;if("function"===typeof i){f.callback=null,h=f.priorityLevel;var o=i(f.expirationTime<=n);n=t.unstable_now(),"function"===typeof o?f.callback=o:f===r(c)&&a(c),b(n)}else a(c);f=r(c)}if(null!==f)var l=!0;else{var d=r(u);null!==d&&A(w,d.startTime-n),l=!1}return l}finally{f=null,h=s,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k,j=!1,N=null,S=-1,C=5,E=-1;function T(){return!(t.unstable_now()-E<C)}function I(){if(null!==N){var e=t.unstable_now();E=e;var n=!0;try{n=N(!0,e)}finally{n?k():(j=!1,N=null)}}else j=!1}if("function"===typeof y)k=function(){y(I)};else if("undefined"!==typeof MessageChannel){var P=new MessageChannel,R=P.port2;P.port1.onmessage=I,k=function(){R.postMessage(null)}}else k=function(){v(I,0)};function O(e){N=e,j||(j=!0,k())}function A(e,n){S=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||p||(m=!0,O(_))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},t.unstable_scheduleCallback=function(e,a,s){var i=t.unstable_now();switch("object"===typeof s&&null!==s?s="number"===typeof(s=s.delay)&&0<s?i+s:i:s=i,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return e={id:d++,callback:a,priorityLevel:e,startTime:s,expirationTime:o=s+o,sortIndex:-1},s>i?(e.sortIndex=s,n(u,e),null===r(c)&&e===r(u)&&(g?(x(S),S=-1):g=!0,A(w,s-i))):(e.sortIndex=o,n(c,e),m||p||(m=!0,O(_))),e},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},8853(e,t,n){"use strict";e.exports=n(7234)},7324(e){e.exports=function(e,t,n,r){var a=n?n.call(r,e,t):void 0;if(void 0!==a)return!!a;if(e===t)return!0;
2if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),l=0;l<s.length;l++){var c=s[l];if(!o(c))return!1;var u=e[c],d=t[c];if(!1===(a=n?n.call(r,u,d,c):void 0)||void 0===a&&u!==d)return!1}return!0}},8252(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(8279))},2129(e,t,n){"use strict";var r=n(660);t.normaliseAuthRecipe=function(e){return r.normaliseRecipeModuleConfig(e)},t.selectComponentsToCoverAllFirstFactors=function e(t,n){if(0!==n.length)for(var a=function(a){var s=t[a],i=n.filter(function(e){return!s.factorIds.includes(e)});if(0===i.length)return{value:[s]};var o=t.filter(function(e){return e.factorIds.every(function(e){return i.includes(e)})});if(0!==o.length){var l=e(o,i);if(void 0!==l)return{value:r.__spreadArray([s],l,!0)}}},s=0;s<t.length;++s){var i=a(s);if("object"===typeof i)return i.value}}},1291(e,t,n){"use strict";var r=n(660),a=n(9135),s=n(3633),i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.getAuthRecipeDefaultRedirectionURL=function(e){return r.__awaiter(t,void 0,void 0,function(){return r.__generator(this,function(e){throw new Error("Should never come here")})})},t.signOut=function(e){return r.__awaiter(t,void 0,void 0,function(){return r.__generator(this,function(t){switch(t.label){case 0:return[4,s.Session.getInstanceOrThrow().signOut({userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)})];case 1:return[2,t.sent()]}})})},t.doesSessionExist=function(e){return r.__awaiter(t,void 0,void 0,function(){return r.__generator(this,function(t){switch(t.label){case 0:return[4,s.Session.getInstanceOrThrow().doesSessionExist({userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)})];case 1:return[2,t.sent()]}})})},t}return r.__extends(t,e),t}(a.RecipeModule);t.AuthRecipe=i},7958(e,t,n){"use strict";var r=n(660).createGenericComponentsOverrideContext(),a=r[0],s=r[1];t.Provider=s,t.useContext=a},2549(e,t,n){"use strict";var r=n(660),a=n(7143),s=n(1291),i=n(3633),o=n(5696),l=n(2129),c=n(823);function u(e){return e&&e.__esModule?e:{default:e}}var d=u(a);function f(e){void 0===e&&(e={});var t=function(e){void 0===e&&(e={});var t=function(e){void 0===e&&(e={});var t=[h(),p()],n=[];void 0!==e.formFields&&(n=e.formFields);var r=m(t,n),a=void 0!==e.style?e.style:"";return{style:a,formFields:r}}(e.signUpForm),n=function(e,t){void 0===t&&(t={});var n=[];void 0!==t.formFields&&(n=t.formFields.filter(function(e){return o.MANDATORY_FORM_FIELDS_ID_ARRAY.includes(e.id)}).map(function(e){return r.__assign(r.__assign({},e),{optional:!1})}));var a=m(e,n),s=void 0!==t.style?t.style:"";return{style:s,formFields:a}}(t.formFields.reduce(function(e,t){return"email"===t.id?r.__spreadArray(r.__spreadArray([],e,!0),[t],!1):"password"===t.id?r.__spreadArray(r.__spreadArray([],e,!0),[r.__assign(r.__assign({},t),{autoComplete:"current-password",validate:c.defaultLoginPasswordValidator})],!1):e},[]),e.signInForm);return{signUpForm:t,signInForm:n}}(e.signInAndUpFeature),n=t.signUpForm.formFields.find(function(e){return"password"===e.id}),a=t.signUpForm.formFields.find(function(e){return"email"===e.id}),s=function(e,t,n){void 0===n&&(n={});var a=!0===n.disableDefaultUI,s=void 0!==n.submitNewPasswordForm&&void 0!==n.submitNewPasswordForm.style?n.submitNewPasswordForm.style:"",i={style:s,formFields:[{id:"password",label:"EMAIL_PASSWORD_NEW_PASSWORD_LABEL",placeholder:"EMAIL_PASSWORD_NEW_PASSWORD_PLACEHOLDER",validate:e,optional:!1,autoComplete:"new-password"},{id:"confirm-password",label:"EMAIL_PASSWORD_CONFIRM_PASSWORD_LABEL",placeholder:"EMAIL_PASSWORD_CONFIRM_PASSWORD_PLACEHOLDER",validate:e,optional:!1,autoComplete:"new-password"}]},o=void 0!==n.enterEmailForm&&void 0!==n.enterEmailForm.style?n.enterEmailForm.style:"",l={style:o,formFields:[r.__assign(r.__assign({},h()),{validate:t.validate,placeholder:"",autofocus:!0})]};return{disableDefaultUI:a,submitNewPasswordForm:i,enterEmailForm:l}}(n.validate,a,e.resetPasswordUsingTokenFeature),i=r.__assign({functions:function(e){return e}},e.override);return r.__assign(r.__assign({},l.normaliseAuthRecipe(e)),{signInAndUpFeature:t,resetPasswordUsingTokenFeature:s,override:i})}function h(){return{id:"email",label:"EMAIL_PASSWORD_EMAIL_LABEL",placeholder:"EMAIL_PASSWORD_EMAIL_PLACEHOLDER",validate:c.defaultEmailValidator,optional:!1,autoComplete:"email"}}function p(){return{id:"password",label:"EMAIL_PASSWORD_PASSWORD_LABEL",placeholder:"EMAIL_PASSWORD_PASSWORD_PLACEHOLDER",validate:c.defaultPasswordValidator,optional:!1,autoComplete:"new-password"}}function m(e,t){for(var n=e,a=0;a<t.length;a++){for(var s=t[a],i=!0,l=0;l<n.length;l++){var u=n[l];if(s.id===u.id){var d=u.optional;void 0!==s.optional&&(d=s.optional),o.MANDATORY_FORM_FIELDS_ID_ARRAY.includes(s.id
2)&&(d=!1),n[l]=r.__assign(r.__assign(r.__assign({},n[l]),s),{optional:d}),i=!1;break}}i&&n.push(r.__assign({optional:!1,placeholder:s.label,validate:c.defaultValidate},s))}return n.map(function(e){return function(e){var t=this;if(!1===e.optional&&""===e.nonOptionalErrorMsg)throw new Error("nonOptionalErrorMsg for field ".concat(e.id," cannot be an empty string"));return r.__assign(r.__assign({},e),{validate:function(n){return r.__awaiter(t,void 0,void 0,function(){return r.__generator(this,function(t){switch(t.label){case 0:return""===n&&!1===e.optional?void 0!==e.nonOptionalErrorMsg?[2,e.nonOptionalErrorMsg]:[2,"ERROR_NON_OPTIONAL"]:[4,e.validate(n)];case 1:return[2,t.sent()]}})})}})}(e)})}var g=function(e){function t(n,a){void 0===a&&(a=d.default);var s=e.call(this,n)||this;return s.webJSRecipe=a,s.recipeID=t.RECIPE_ID,s.firstFactorIds=[i.FactorIds.EMAILPASSWORD],s.getDefaultRedirectionURL=function(e){return r.__awaiter(s,void 0,void 0,function(){return r.__generator(this,function(t){return"RESET_PASSWORD"===e.action?[2,r.getDefaultRedirectionURLForPath(this.config,o.DEFAULT_RESET_PASSWORD_PATH,e)]:[2,this.getAuthRecipeDefaultRedirectionURL(e)]})})},s}return r.__extends(t,e),t.prototype.getFirstFactorsForAuthPage=function(){return this.firstFactorIds},t.init=function(e){var n=f(e);return{recipeID:t.RECIPE_ID,authReact:function(e){return t.instance=new t(r.__assign(r.__assign({},n),{appInfo:e,recipeId:t.RECIPE_ID})),t.instance},webJS:d.default.init(r.__assign(r.__assign({},n),{override:{functions:function(e,t){var a,s=(a=n.onHandleEvent,function(e){return r.__assign(r.__assign({},e),{submitNewPassword:function(t){return r.__awaiter(this,void 0,void 0,function(){var n;return r.__generator(this,function(s){switch(s.label){case 0:return[4,e.submitNewPassword(r.__assign(r.__assign({},t),{formFields:[t.formFields[0]]}))];case 1:return"OK"===(n=s.sent()).status&&a({action:"PASSWORD_RESET_SUCCESSFUL",userContext:t.userContext}),[2,n]}})})},sendPasswordResetEmail:function(t){return r.__awaiter(this,void 0,void 0,function(){var n;return r.__generator(this,function(r){switch(r.label){case 0:return[4,e.sendPasswordResetEmail(t)];case 1:return"OK"===(n=r.sent()).status&&a({action:"RESET_PASSWORD_EMAIL_SENT",email:t.formFields.find(function(e){return"email"===e.id}).value,userContext:t.userContext}),[2,n]}})})},signUp:function(t){return r.__awaiter(this,void 0,void 0,function(){var n,s,o;return r.__generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,i.Session.getInstanceOrThrow().getAccessTokenPayloadSecurely({userContext:t.userContext})];case 1:return n=r.sent(),[3,3];case 2:return r.sent(),n=void 0,[3,3];case 3:return[4,e.signUp(t)];case 4:if("OK"!==(s=r.sent()).status)return[3,9];o=void 0,r.label=5;case 5:return r.trys.push([5,7,,8]),[4,i.Session.getInstanceOrThrow().getAccessTokenPayloadSecurely({userContext:t.userContext})];case 6:return o=r.sent(),[3,8];case 7:return r.sent(),o=void 0,[3,8];case 8:a({action:"SUCCESS",isNewRecipeUser:!0,createdNewSession:void 0!==o&&(void 0===n||n.sessionHandle!==o.sessionHandle),user:s.user,userContext:t.userContext}),r.label=9;case 9:return[2,s]}})})},signIn:function(t){return r.__awaiter(this,void 0,void 0,function(){var n,s,o;return r.__generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,i.Session.getInstanceOrThrow().getAccessTokenPayloadSecurely({userContext:t.userContext})];case 1:return n=r.sent(),[3,3];case 2:return r.sent(),n=void 0,[3,3];case 3:return[4,e.signIn(t)];case 4:if("OK"!==(s=r.sent()).status)return[3,9];o=void 0,r.label=5;case 5:return r.trys.push([5,7,,8]),[4,i.Session.getInstanceOrThrow().getAccessTokenPayloadSecurely({userContext:t.userContext})];case 6:return o=r.sent(),[3,8];case 7:return r.sent(),o=void 0,[3,8];case 8:a({action:"SUCCESS",isNewRecipeUser:!1,createdNewSession:void 0!==o&&(void 0===n||n.sessionHandle!==o.sessionHandle),user:s.user,userContext:t.userContext}),r.label=9;case 9:return[2,s]}})})}})});return t.override(s),t.override(n.override.functions),e}}}))}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Make sure to call the EmailPassword.init method.See https://supertokens.io/docs/emailpassword/quick-setup/frontend";throw"undefined"===typeof window&&(e+=r.SSR_ERROR),Error(e)}return t.instance},t.reset=function(){r.isTest()&&(t.instance=void 0)},t.RECIPE_ID="emailpassword",t}(s.AuthRecipe);t.EmailPassword=g},5696(e,t){"use strict";t.DEFAULT_RESET_PASSWORD_PATH="/reset-password",t.MANDATORY_FORM_FIELDS_ID_ARRAY=["email","password"]},823(e,t,n){"use strict";var r=n(660);t.defaultEmailValidator=function(e){return r.__awaiter(this,void 0,void 0,function(){var t;return r.__generator(this,function(n){return"string"!==typeof e?[2,"ERROR_EMAIL_NON_STRING"]:(e=e.trim(),t=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,null===e.match(t)?[2,"ERROR_EMAIL_INVALID"]:[2,void 0])})})},t.defaultLoginPasswordValidator=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return"string"!==typeof e?[2,"ERROR_PASSWORD_NON_STRING"]:[2,void 0]})})},t.defaultPasswordValidator=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return"string"!==typeof e?[2,"ERROR_PASSWORD_NON_STRING"]:e.length<8?[2,"ERROR_PASSWORD_TOO_SHORT"]:e.length>=100?[2,"ERROR_PASSWORD_TOO_LONG"]:null===e.match(/^.*[A-Za-z]+.*$/)?[2,"ERROR_PASSWORD_NO_ALPHA"]:null===e.match(/^.*[0-9]+.*$/)?[2,"ERROR_PASSWORD_NO_NUM"]:[2,void 0]})})},t.defaultValidate=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,void 0]})})}},1358(e,t,n){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0});var r=n(660),a=n(7958),s=n(2549);n(2086),n(3921),n(9801),n(9927),n(8033),n(6032),n(5043),n(7691),n(5547),n(3892),n(579),n(7143),n(1291),n(9135),n(3633),n(5946),n(763),n(9040),n(5696),n(2129),n(823);var i=function(){function e(){}return e.init=function(e){return s.EmailPassword.init(e)},e.signOut=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,s.EmailPassword.getInstanceOrThrow().signOut({userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)})]})})},e.submitNewPassword=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,s.EmailPassword.getInstanceOrThrow().webJSRecipe.submitNewPassword(r.__assign(r.__assign({},e),{userContext:r.getNormalisedUserContext(e.userContext)}))]})})},e.sendPasswordResetEmail=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,s.EmailPassword.getInstanceOrThrow().webJSRecipe.sendPasswordResetEmail(r.__assign(r.__assign({},e),{userContext:r.getNormalisedUserContext(e.userContext)}))]})})},e.signUp=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,s.EmailPassword.getInstanceOrThrow().webJSRecipe.signUp(r.__assign(r.__assign({},e),{userContext:r.getNormalisedUserContext(e.userContext)}))]})})},e.signIn=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,s.EmailPassword.getInstanceOrThrow().webJSRecipe.signIn(r.__assign(r.__assign({},e),{userContext:r.getNormalisedUserContext(e.userContext)}))]})})},e.doesEmailExist=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,s.EmailPassword.getInstanceOrThrow().webJSRecipe.doesEmailExist(r.__assign(r.__assign({},e),{userContext:r.getNormalisedUserContext(e.userContext)}))]})})},e.getResetPasswordTokenFromURL=function(e){return s.EmailPassword.getInstanceOrThrow().webJSRecipe.getResetPasswordTokenFromURL(r.__assign(r.__assign({},e),{userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)}))},e.ComponentsOverrideProvider=a.Provider,e}(),o=i.init,l=i.signOut,c=i.submitNewPassword,u=i.sendPasswordResetEmail,d=i.signUp,f=i.signIn,h=i.doesEmailExist,p=i.getResetPasswordTokenFromURL,m=i.ComponentsOverrideProvider;t.EmailPasswordComponentsOverrideProvider=m,t.default=i,t.doesEmailExist=h,t.getResetPasswordTokenFromURL=p,t.init=o,t.sendPasswordResetEmail=u,t.signIn=f,t.signOut=l,t.signUp=d,t.submitNewPassword=c},660(e,t,n){"use strict";var r=n(2086),a=n(3921),s=n(9801),i=n(9927),o=n(8033),l=n(6032),c=n(5043),u=n(7691),d=n(5547),f=n(3892),h=n(579);function p(e){return e&&e.__esModule?e:{default:e}}var m=p(r),g=p(o),v=p(c),x=p(u),y=p(d),b=p(f),w=function(e,t){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},w(e,t)};function _(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function k(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})}function j(e,t){var n,r,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"===typeof Iterator?Iterator:Object).prototype);return i.next=o(0),i.throw=o(1),i.return=o(2),"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(o){return function(l){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,o[0]&&(s=0)),s;)try{if(n=1,r&&(a=2&o[0]?r.return:o[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;switch(r=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(a=(a=s.trys).length>0&&a[a.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){s.label=o[1];break}if(6===o[0]&&s.label<a[1]){s.label=a[1],a=o;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(o);break}a[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(l){o=[6,l],r=0}finally{n=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}t.__assign=function(){return t.__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},t.__assign.apply(this,arguments)},"function"===typeof SuppressedError&&SuppressedError;var N="tenantId",S="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook.",C=!1;function E(e){C&&console.log("".concat("com.supertokens.auth-react",' {t: "').concat((new Date).toISOString(),'", message: "').concat(e,'", supertokens-auth-react-ver: "').concat("0.49.1",'"}'))}function T(e){for(var t=new URL(i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHref()),n=0,r=e;n<r.length;n++){var a=r[n];t.searchParams.delete(a)}i.WindowHandlerReference.getReferenceOrThrow().windowHandler.history.replaceState(i.WindowHandlerReference.getReferenceOrThrow().windowHandler.history.getState(),"",t.toString())}function I(e){return new URLSearchParams(i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e)}function P(){var e;return null!==(e=I(N))&&void 0!==e?e:void 0}function R(){try{return!1}catch(e){return!1}}function O(e,t){return void 0!==t?new b.default(t):new b.default(e)}function A(){return new b.default(i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getPathName())}function D(){return A().getAsStringDangerous()+i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()+i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash()}function M(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach(function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)}),n.href}catch(s){var r=e.startsWith("/")?"http://localhost":"http://localhost/",a=new URL("".concat(r).concat(e));return Object.entries(t).forEach(function(e){var t=e[0],n=e[1];a.searchParams.set(t,n)}),"".concat(a.pathname).concat(a.search).concat(a.hash)}}function F(e){""===e.trim()&&(e="/"),i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.setHref(e)}function L(e){var t=function(e){(e=e.trim().toLowerCase()).startsWith(".")&&(e=e.substr(1)),e.startsWith("http://")||e.startsWith("https://")||(e="http://"+e);
2try{return(e=new URL(e).hostname).startsWith(".")&&(e=e.substr(1)),e}catch(t){throw new Error("Please provide a valid cookie scope")}}(e);return"localhost"===t||/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(t)?t:e.startsWith(".")?"."+t:t}function U(){try{return L(i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHostName())}catch(e){return}}function H(e){return k(this,void 0,void 0,function(){var t,n,r,s,i;return j(this,function(o){switch(o.label){case 0:return n="; ",[4,a.CookieHandlerReference.getReferenceOrThrow().cookieHandler.getCookie()];case 1:return t=n+o.sent(),(r=t.split("; "+e+"=")).length>=2&&void 0!==(s=r.pop())?void 0===(i=s.split(";").shift())?[2,null]:[2,i]:[2,null]}})})}function z(e,t,n){return k(this,void 0,void 0,function(){var r,s;return j(this,function(o){switch(o.label){case 0:return r="Thu, 01 Jan 1970 00:00:01 GMT",s="",void 0!==t&&(s=t,r=void 0),"localhost"!==n&&n!==i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHostName()&&void 0!==n?[3,5]:void 0===r?[3,2]:[4,a.CookieHandlerReference.getReferenceOrThrow().cookieHandler.setCookie("".concat(e,"=").concat(s,";expires=").concat(r,";path=/;samesite=lax"))];case 1:return o.sent(),[3,4];case 2:return[4,a.CookieHandlerReference.getReferenceOrThrow().cookieHandler.setCookie("".concat(e,"=").concat(s,";expires=Fri, 31 Dec 9999 23:59:59 GMT;path=/;samesite=lax"))];case 3:o.sent(),o.label=4;case 4:return[3,9];case 5:return void 0===r?[3,7]:[4,a.CookieHandlerReference.getReferenceOrThrow().cookieHandler.setCookie("".concat(e,"=").concat(s,";expires=").concat(r,";domain=").concat(n,";path=/;samesite=lax"))];case 6:return o.sent(),[3,9];case 7:return[4,a.CookieHandlerReference.getReferenceOrThrow().cookieHandler.setCookie("".concat(e,"=").concat(s,";domain=").concat(n,";expires=Fri, 31 Dec 9999 23:59:59 GMT;path=/;samesite=lax"))];case 8:o.sent(),o.label=9;case 9:return[2]}})})}function B(e){return void 0===e?{}:e}var W=function(e){this.config=e};function q(e){var n=this;void 0===e&&(e={});var r=e.onHandleEvent,a=e.getRedirectionURL,s=e.preAPIHook,i=e.postAPIHook;void 0===r&&(r=function(e){}),void 0===a&&(a=function(e){return k(n,void 0,void 0,function(){return j(this,function(e){return[2,void 0]})})}),void 0===s&&(s=function(e){return k(n,void 0,void 0,function(){return j(this,function(t){return[2,e]})})}),void 0===i&&(i=function(){return k(n,void 0,void 0,function(){return j(this,function(e){return[2]})})});var o=void 0===e.style?"":e.style;return t.__assign(t.__assign({},e),{getRedirectionURL:a,onHandleEvent:r,preAPIHook:s,postAPIHook:i,recipeRootStyle:o})}var V=function(e){function n(t,r){void 0===r&&(r=g.default);var a=e.call(this,t)||this;return a.webJSRecipe=r,a.recipeID=n.RECIPE_ID,a.dynamicLoginMethodsCache={},a}return _(n,e),n.prototype.getCurrentDynamicLoginMethods=function(e){var t;return k(this,void 0,void 0,function(){var r,a,s;return j(this,function(i){switch(i.label){case 0:return!1===K.usesDynamicLoginMethods?[2,void 0]:(r=l.getNormalisedUserContext(e.userContext),[4,n.getInstanceOrThrow().webJSRecipe.getTenantId()]);case 1:return a=null!==(t=i.sent())&&void 0!==t?t:"public",void 0===this.dynamicLoginMethodsCache[a]&&(this.dynamicLoginMethodsCache[a]=n.getDynamicLoginMethods({tenantId:a,userContext:r})),[4,this.dynamicLoginMethodsCache[a]];case 2:if(!function(e,t){return e.firstFactors.some(function(e){return t.some(function(t){return t.firstFactorIds.includes(e)})})}(s=i.sent(),K.getInstanceOrThrow().recipeList.filter(function(e){return"firstFactorIds"in e})))throw new Error("Initialized recipes have no overlap with core recipes or could not load login methods");return[2,s]}})})},n.getDynamicLoginMethods=function(e){return k(this,void 0,void 0,function(){var t,n,r;return j(this,function(a){switch(a.label){case 0:return[4,g.default.getLoginMethods(e)];case 1:return t=a.sent(),n=t.thirdParty,r=t.firstFactors,[2,{thirdparty:n,firstFactors:r}]}})})},n.init=function(e){var r=function(e){return t.__assign(t.__assign({},q(e)),{override:t.__assign({functions:function(e){return e}},null===e||void 0===e?void 0:e.override)})}(e);return{recipeID:n.RECIPE_ID,authReact:function(e){return n.instance=new n(t.__assign(t.__assign({},r),{appInfo:e,recipeId:n.RECIPE_ID})),n.instance},webJS:g.default.init(t.__assign({},r))}},n.getInstanceOrThrow=function(){if(void 0===n.instance){var e="No instance of Multitenancy found. Make sure to call the Multitenancy.init method.See https://supertokens.io/docs/multitenancy/quick-setup/frontend";throw"undefined"===typeof window&&(e+=S),Error(e)}return n.instance},n.reset=function(){R()&&(n.instance=void 0)},n.RECIPE_ID="multitenancy",n}(W),$=function(){function e(){this.handlers=new Map}return e.prototype.emit=function(e,t){for(var n=0,r=this.handlers.get(e)||[];n<r.length;n++){(0,r[n])(e,t)}},e.prototype.on=function(e,t){var n=this.handlers.get(e)||[];this.handlers.set(e,n.concat(t))},e.prototype.off=function(e,t){var n=this.handlers.get(e)||[];this.handlers.set(e,n.filter(function(e){return e!==t}))},e}(),G="sCurrLanguage";function Y(e,t){return k(this,void 0,void 0,function(){return j(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,z(G,e,t)];case 1:case 2:return n.sent(),[3,3];case 3:return[2]}})})}var K=function(){function e(t){var n,r,a,s,o=this;if(this.recipeList=[],this.changeLanguage=function(e){return k(o,void 0,void 0,function(){return j(this,function(t){switch(t.label){case 0:return[4,Y(e,this.languageTranslations.currentLanguageCookieScope)];case 1:return t.sent(),this.languageTranslations.translationEventSource.emit("LanguageChange",e),[2]}})})},this.redirectToAuth=function(e){return k(o,void 0,void 0,function(){var t,n;return j(this,function(r){switch(r.label){case 0:return t=void 0===e.queryParams?{}:e.queryParams,void 0!==e.show&&(t.show=e.show),!0===e.redirectBack&&(t.redirectToPath=D()),[4,this.getRedirectUrl({action:"TO_AUTH",showSignIn:"signin"===e.show,tenantIdFromQueryParams:P()},e.userContext)];case 1:return null===(n=r.sent())?(E("Skipping redirection because the user override returned null"),[2]):(n=M(n,t),[2,this.redirectToUrl(n,e.navigate)])}})})},this.redirectToUrl=function(e,t){return k(o,void 0,void 0,function(){return j(this,function(n){return function(e,t,n){try{new URL(t)}catch(r){if(new y.default(i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getOrigin()).getAsStringDangerous()!==e.websiteDomain.getAsStringDangerous())return void F(t="".concat(e.websiteDomain.getAsStringDangerous()).concat(t));if(void 0!==n)return void function(e,t){""===e.trim()&&(e="/"),"push"in t?t.push(e):t(e)}(t,n)}F(t)}(this.appInfo,e,t),[2]})})},this.redirect=function(t,n,r,a){return k(o,void 0,void 0,function(){var s;return j(this,function(i){switch(i.label){case 0:return[4,this.getRedirectUrl(t,B(a))];case 1:return null===(s=i.sent())?(E("Skipping redirection because the user override returned null for context ".concat(JSON.stringify(t,null,2))),[2]):(s=M(s,r),[2,e.getInstanceOrThrow().redirectToUrl(s,n)])}})})},this.appInfo=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");if(void 0===e.websiteDomain)throw new Error("Please provide your websiteDomain inside the appInfo object when calling supertokens.init");var t=new b.default("");return void 0!==e.apiGatewayPath&&(t=new b.default(e.apiGatewayPath)),{appName:e.appName,a
2piDomain:new y.default(e.apiDomain),websiteDomain:new y.default(e.websiteDomain),apiBasePath:t.appendPath(O("/auth",e.apiBasePath)),websiteBasePath:O("/auth",e.websiteBasePath)}}(t.appInfo),void 0===t.recipeList||0===t.recipeList.length)throw new Error("Please provide at least one recipe to the supertokens.init function call. See https://supertokens.io/docs/emailpassword/quick-setup/frontend");var l=void 0===t.languageTranslations?{}:t.languageTranslations;this.languageTranslations={defaultLanguage:void 0===l.defaultLanguage?"en":l.defaultLanguage,currentLanguageCookieScope:void 0!==l.currentLanguageCookieScope?L(l.currentLanguageCookieScope):U(),userTranslationStore:void 0!==l.translations?l.translations:{},translationEventSource:new $,userTranslationFunc:l.translationFunc};var c=Boolean(null===t||void 0===t?void 0:t.enableDebugLogs);c&&(C=!0),this.userGetRedirectionURL=t.getRedirectionURL,this.recipeList=t.recipeList.map(function(e){return(0,e.authReact)(o.appInfo,c)}),this.rootStyle=null!==(n=t.style)&&void 0!==n?n:"",this.privacyPolicyLink=t.privacyPolicyLink,this.termsOfServiceLink=t.termsOfServiceLink,this.useShadowDom=null===(r=t.useShadowDom)||void 0===r||r,this.defaultToSignUp=null!==(a=t.defaultToSignUp)&&void 0!==a&&a,this.disableAuthRoute=null!==(s=t.disableAuthRoute)&&void 0!==s&&s}return e.init=function(n){var r;if(a.CookieHandlerReference.init(n.cookieHandler),i.WindowHandlerReference.init(n.windowHandler),void 0===e.instance){e.usesDynamicLoginMethods=null!==(r=n.usesDynamicLoginMethods)&&void 0!==r&&r;var o=void 0!==n.recipeList.find(function(e){return e.recipeID===V.RECIPE_ID})?n.recipeList:n.recipeList.concat(V.init({}));m.default.init(t.__assign(t.__assign({},n),{recipeList:o.map(function(e){return e.webJS})})),e.instance=new e(t.__assign(t.__assign({},n),{recipeList:o})),s.PostSuperTokensInitCallbacks.runPostInitCallbacks()}else console.warn("SuperTokens was already initialized")},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="SuperTokens must be initialized before calling this method.";throw"undefined"===typeof window&&(t+=S),new Error(t)}return e.instance},e.prototype.getRecipeOrThrow=function(e){var t=this.recipeList.find(function(t){return t.config.recipeId===e});if(void 0===t)throw new Error("Missing recipe: ".concat(e));return t},e.prototype.loadTranslation=function(e){this.languageTranslations.translationEventSource.emit("TranslationLoaded",e)},e.prototype.getRedirectUrl=function(e,t){var n;return k(this,void 0,void 0,function(){var r,a,s,i;return j(this,function(o){switch(o.label){case 0:return this.userGetRedirectionURL?[4,this.userGetRedirectionURL(e,t)]:[3,2];case 1:if(void 0!==(r=o.sent()))return[2,r];o.label=2;case 2:if("TO_AUTH"===e.action)return a=this.appInfo.websiteBasePath.getAsStringDangerous(),s=(l=a).endsWith("/")?l:l+"/",e.tenantIdFromQueryParams?[2,M(s,(i={},i[N]=e.tenantIdFromQueryParams,i))]:[2,s];if("SUCCESS"===e.action)return[2,null!==(n=e.redirectToPath)&&void 0!==n?n:"/"];throw new Error("Should never come here: unexpected redirection context")}var l})})},e.reset=function(){R()&&(e.instance=void 0)},e.usesDynamicLoginMethods=!1,e}();t.BaseRecipeModule=W,t.Multitenancy=V,t.SSR_ERROR=S,t.ST_ROOT_ID="supertokens-root",t.SuperTokens=K,t.__awaiter=k,t.__extends=_,t.__generator=j,t.__rest=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},t.__spreadArray=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,s=t.length;a<s;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))},t.appendQueryParamsToURL=M,t.clearErrorQueryParam=function(){T(["error","message"])},t.clearQueryParams=T,t.createGenericComponentsOverrideContext=function(e){void 0===e&&(e={});var n=v.default.createContext(e);return[function(){return v.default.useContext(n)},function(e){var r=e.children,a=e.components;return h.jsx(n.Provider,t.__assign({value:a},{children:r}))},n.Consumer]},t.getCurrentLanguageFromCookie=function(){return k(this,void 0,void 0,function(){return j(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,H(G)];case 1:return[2,e.sent()];case 2:return e.sent(),[2,null];case 3:return[2]}})})},t.getCurrentNormalisedUrlPath=A,t.getCurrentNormalisedUrlPathWithQueryParamsAndFragments=D,t.getDefaultRedirectionURLForPath=function(e,t,n,r){var a=e.appInfo.websiteBasePath.appendPath(new b.default(t)).getAsStringDangerous(),s=new URLSearchParams;return void 0!==n.tenantIdFromQueryParams&&s.set(N,n.tenantIdFromQueryParams),void 0!==r&&Object.entries(r).forEach(function(e){var t=e[0],n=e[1];void 0!==n&&s.set(t,n)}),""!==s.toString()?"".concat(a,"?").concat(s.toString()):a},t.getLocalStorage=function(e){return k(this,void 0,void 0,function(){var t;return j(this,function(n){return null===(t=i.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.getItem(e))||void 0===t?[2,null]:[2,t]})})},t.getNormalisedUserContext=B,t.getQueryParams=I,t.getRedirectToPathFromURL=function(){var e=I("redirectToPath");if(null!==e)try{var t=void 0;try{t=new URL(e)}catch(s){var n=e.startsWith("/")?"http://localhost":"http://localhost/";t=new URL("".concat(n).concat(e))}
2var r=new b.default(e).getAsStringDangerous(),a=r+(t.search||"")+(t.hash||"");return 0===r.length&&a.length>0&&!a.startsWith("/")?"/"+a:a}catch(i){return}},t.getTenantIdFromQueryParams=P,t.getURLHash=function(){return i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substr(1)},t.handleCallAPI=function(e){var t=e.apiFields,n=e.fieldUpdates,r=e.callAPI;return k(void 0,void 0,void 0,function(){var e,a,s,i;return j(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,r(t||[],function(e,t){return n.push({id:e,value:t})})];case 1:return e=o.sent(),[3,3];case 2:if(i=o.sent(),x.default.isThisError(i))a=i;else{if(!(i instanceof Response))throw i;s=i}return[3,3];case 3:return[2,{result:e,generalError:a,fetchError:s}]}})})},t.isTest=R,t.logDebugMessage=E,t.matchRecipeIdUsingQueryParams=function(e){return function(){var t;return(t=i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch(),new URLSearchParams(t).get("rid"))===e}},t.mergeObjects=function e(n,r){var a=t.__assign({},n);for(var s in r)"object"===typeof a[s]&&"object"===typeof r[s]?a[s]=e(a[s],r[s]):a[s]=r[s];return a},t.normaliseRecipeModuleConfig=q,t.redirectWithFullPageReload=F,t.removeFromLocalStorage=function(e){return k(this,void 0,void 0,function(){return j(this,function(t){switch(t.label){case 0:return[4,i.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.removeItem(e)];case 1:return t.sent(),[2]}})})},t.setLocalStorage=function(e,t){return k(this,void 0,void 0,function(){return j(this,function(n){switch(n.label){case 0:return[4,i.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.setItem(e,t)];case 1:return n.sent(),[2]}})})},t.updateQueryParam=function(e,t){var n=new URL(i.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHref());n.searchParams.set(e,t),i.WindowHandlerReference.getReferenceOrThrow().windowHandler.history.replaceState(i.WindowHandlerReference.getReferenceOrThrow().windowHandler.history.getState(),"",n.toString())},t.useOnMountAPICall=function(e,t,n,r){void 0===r&&(r=!0);var a=c.useRef(),s=c.useState(void 0),i=s[0],o=s[1];if(c.useEffect(function(){var s;if(r){var i=new AbortController;return s=i.signal,k(void 0,void 0,void 0,function(){var r,i,l;return j(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,9]),void 0===a.current&&(a.current=e()),[4,a.current];case 1:return r=c.sent(),s.aborted||t(r),[3,9];case 2:if(i=c.sent(),s.aborted)return[3,8];if(void 0===n)return[3,7];c.label=3;case 3:return c.trys.push([3,5,,6]),[4,n(i,r)];case 4:return c.sent(),[3,6];case 5:return l=c.sent(),o(l),[3,6];case 6:return[3,8];case 7:o(i),c.label=8;case 8:return[3,9];case 9:return[2]}})}),function(){i.abort()}}},[o,a,e,t,n,r]),i)throw i},t.useRethrowInRender=function(){var e=c.useState(void 0),t=e[0],n=e[1];if(t)throw t;return n},t.validateForm=function(e,t){return k(this,void 0,void 0,function(){var n,r,a;return j(this,function(s){switch(s.label){case 0:if(n=[],t.length!==e.length)throw Error("Are you sending too many / too few formFields?");r=function(r){var a,s,i,o;return j(this,function(l){switch(l.label){case 0:return a=t[r],s=e.find(function(e){return e.id===a.id}),i=s.value,"email"===s.id&&(i=i.trim()),[4,a.validate(i)];case 1:return void 0!==(o=l.sent())&&n.push({error:o,id:a.id}),[2]}})},a=0,s.label=1;case 1:return a<t.length?[5,r(a)]:[3,4];case 2:s.sent(),s.label=3;case 3:return a++,[3,1];case 4:return[2,n]}})})}},8279(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(660);var r=n(7873),a=n(2929);n(2086),n(3921),n(9801),n(9927),n(8033),n(6032),n(5043),n(7691),n(5547),n(3892),n(579),n(7950),n(1464),n(9675),n(54),n(4257),n(9135),n(3633),n(5946),n(763),n(9040),n(2129),n(2221),t.SuperTokensWrapper=r.SuperTokensWrapper,t.changeLanguage=r.changeLanguage,t.default=r.SuperTokensAPIWrapper,t.init=r.init,t.loadTranslation=r.loadTranslation,t.redirectToAuth=r.redirectToAuth,t.useUserContext=r.useUserContext,t.useTranslation=a.useTranslation},7873(e,t,n){"use strict";var r=n(660),a=n(579),s=n(5043),i=n(3892),o=n(2929),l=n(9927),c=n(7950),u=n(1464),d=n(9675),f=n(3633),h=n(763),p=n(2129),m=n(2221);
2function g(e){return e&&e.__esModule?e:{default:e}}var v=g(s),x=g(i),y=g(m),b=v.default.createContext("IS_DEFAULT");function w(){return a.jsx("svg",r.__assign({version:"1.1",viewBox:"25 25 50 50","data-supertokens":"spinnerIcon"},{children:a.jsxs("circle",r.__assign({cx:"50",cy:"50",r:"20",fill:"none",stroke:"rgb(var(--palette-primary))",strokeWidth:"5",strokeLinecap:"round",strokeDashoffset:"0",strokeDasharray:"100, 200"},{children:[a.jsx("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:"0 50 50",to:"360 50 50",dur:"4s",repeatCount:"indefinite"}),a.jsx("animate",{attributeName:"stroke-dashoffset",values:"0;-30;-124",dur:"2s",repeatCount:"indefinite"}),a.jsx("animate",{attributeName:"stroke-dasharray",values:"0,200;110,200;110,200",dur:"2s",repeatCount:"indefinite"})]}))}))}var _=function(e,t){var n=e+"_Override";return t.displayName=n,function(e){var i=function(e){var t=s.useContext(b);if("IS_DEFAULT"===t)throw new Error("Cannot use component override outside ComponentOverrideContext provider.");var n=t[e];return void 0===n?null:n}(n);return null!==i?a.jsx(i,r.__assign({DefaultComponent:t},e)):a.jsx(t,r.__assign({},e))}},k=function(e){var t=e.children,n=e.userStyles;return a.jsxs(s.Fragment,{children:[t,a.jsxs("style",{children:['[data-supertokens~="container"] {\n    --palette-background: 255, 255, 255;\n    --palette-inputBackground: 250, 250, 250;\n    --palette-inputBorder: 224, 224, 224;\n    --palette-primary: 28, 34, 42;\n    --palette-primaryBorder: 45, 54, 68;\n    --palette-success: 65, 167, 0;\n    --palette-successBackground: 217, 255, 191;\n    --palette-error: 255, 23, 23;\n    --palette-errorBackground: 255, 241, 235;\n    --palette-textTitle: 0, 0, 0;\n    --palette-textLabel: 0, 0, 0;\n    --palette-textInput: 0, 0, 0;\n    --palette-textPrimary: 128, 128, 128;\n    --palette-textLink: 0, 122, 255;\n    --palette-buttonText: 255, 255, 255;\n    --palette-textGray: 54, 54, 54;\n    --palette-superTokensBrandingBackground: 242, 245, 246;\n    --palette-superTokensBrandingText: 173, 189, 196;\n    --palette-buttonGreyedOut: 221, 221, 221;\n    --palette-caution: 124, 96, 62;\n    --palette-errorDark: 207, 54, 68;\n\n    --font-size-0: 12px;\n    --font-size-1: 14px;\n    --font-size-2: 16px;\n    --font-size-3: 19px;\n    --font-size-4: 24px;\n    --font-size-5: 28px;\n}\n/*\n * Default styles.\n */\n@keyframes slideTop {\n    0% {\n        transform: translateY(-5px);\n    }\n    100% {\n        transform: translateY(0px);\n    }\n}\n@keyframes swing-in-top-fwd {\n    0% {\n        transform: rotateX(-100deg);\n        transform-origin: top;\n        opacity: 0;\n    }\n    100% {\n        transform: rotateX(0deg);\n        transform-origin: top;\n        opacity: 1;\n    }\n}\n[data-supertokens~="container"] {\n    font-family: "Arial", sans-serif;\n    margin: 12px auto;\n    margin-top: 26px;\n    margin-bottom: 26px;\n    width: 420px;\n    text-align: center;\n    border-radius: 8px;\n    box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.16);\n    background-color: rgb(var(--palette-background));\n}\n@media (max-width: 440px) {\n    [data-supertokens~="container"] {\n        width: 95vw;\n    }\n}\n[data-supertokens~="row"] {\n    margin: 0 auto;\n    width: 76%;\n    padding-top: 30px;\n    padding-bottom: 10px;\n}\n[data-supertokens~="superTokensBranding"] {\n    display: block;\n    margin: 10px auto 0;\n    background: rgb(var(--palette-superTokensBrandingBackground));\n    color: rgb(var(--palette-superTokensBrandingText));\n    text-decoration: none;\n    width: -webkit-fit-content;\n    width: fit-content;\n    border-radius: 6px 6px 0 0;\n    padding: 4px 9px;\n    font-weight: 400;\n    font-size: var(--font-size-0);\n    letter-spacing: 0.4px;\n}\n[data-supertokens~="generalError"] {\n    background: rgb(var(--palette-errorBackground));\n    padding-top: 10px;\n    padding-bottom: 10px;\n    margin-bottom: 10px;\n    margin-top: 24px;\n    padding-left: 18px;\n    padding-right: 18px;\n    letter-spacing: 0.2px;\n    font-size: var(--font-size-1);\n    border-radius: 8px;\n    color: rgb(var(--palette-error));\n    animation: swing-in-top-fwd 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;\n    word-wrap: break-word;\n}\n[data-supertokens~="headerTitle"] {\n    font-size: var(--font-size-4);\n    line-height: 27.6px;\n    letter-spacing: 0.58px;\n    font-weight: 700;\n    margin-bottom: 20px;\n    color: rgb(var(--palette-textTitle));\n}\n[data-supertokens~="headerSubtitle"] {\n    font-weight: 400;\n    color: rgb(var(--palette-textGray));\n    margin-bottom: 21px;\n}\n[data-supertokens~="headerSubtitle"][data-supertokens~="secondaryText"] {\n    color: rgb(var(--palette-textGray));\n    font-weight: 400;\n}\n[data-supertokens~="privacyPolicyAndTermsAndConditions"] {\n    max-width: 300px;\n    margin-top: 10px;\n}\n[data-supertokens~="privacyPolicyAndTermsAndConditions"] a {\n    line-height: 21px;\n}\n/* TODO: split the link style into separate things*/\n/* We add this before primary and secondary text, because if they are applied to the same element the other ones take priority */\n[data-supertokens~="link"] {\n    padding-left: 3px;\n    padding-right: 3px;\n    color: rgb(var(--palette-textLink));\n    font-size: var(--font-size-1);\n    cursor: pointer;\n    letter-spacing: 0.16px;
2\n    line-height: 26px;\n}\n[data-supertokens~="primaryText"] {\n    font-size: var(--font-size-2);\n    font-weight: 400;\n    letter-spacing: 0.4px;\n    line-height: 21px;\n    color: rgb(var(--palette-textLabel));\n}\n[data-supertokens~="secondaryText"] {\n    font-size: var(--font-size-1);\n    font-weight: 400;\n    letter-spacing: 0.4px;\n    color: rgb(var(--palette-textPrimary));\n}\n[data-supertokens~="secondaryText"] strong {\n    font-weight: 600;\n}\n[data-supertokens~="divider"] {\n    margin-top: 1.5em;\n    margin-bottom: 1.5em;\n    border-bottom: 0.3px solid #dddddd;\n    align-items: center;\n    padding-bottom: 5px;\n    flex: 3 3;\n}\n[data-supertokens~="headerTinyTitle"] {\n    margin-top: 24px;\n    font-size: var(--font-size-5);\n    letter-spacing: 1.1px;\n    font-weight: 700;\n    line-height: 28px;\n}\n[data-supertokens~="secondaryLinkWithArrow"] {\n    margin-top: 10px;\n    margin-bottom: 30px;\n    cursor: pointer;\n}\n[data-supertokens~="secondaryLinkWithArrow"]:hover {\n    position: relative;\n    left: 2px;\n    word-spacing: 4px;\n}\n[data-supertokens~="generalSuccess"] {\n    color: rgb(var(--palette-success));\n    font-size: var(--font-size-1);\n    background: rgb(var(--palette-successBackground));\n    animation: swing-in-top-fwd 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;\n    padding: 9px 15px 9px 15px;\n    border-radius: 6px;\n    display: inline-block;\n}\n[data-supertokens~="spinner"] {\n    width: 80px;\n    height: auto;\n    padding-top: 20px;\n    padding-bottom: 40px;\n    margin: 0 auto;\n}\n[data-supertokens~="error"] {\n    color: rgb(var(--palette-error));\n}\n[data-supertokens~="linkButton"] {\n    font-family: "Arial", sans-serif;\n    background-color: transparent;\n    border: 0;\n}\n[data-supertokens~="secondaryLinkWithLeftArrow"] {\n    color: rgb(var(--palette-textGray));\n    font-weight: 400;\n    margin-top: 10px;\n    margin-bottom: 40px;\n    cursor: pointer;\n}\n[data-supertokens~="secondaryLinkWithLeftArrow"] svg {\n    margin-right: 0.3em;\n}\n[data-supertokens~="secondaryLinkWithLeftArrow"]:hover svg {\n    position: relative;\n    left: -4px;\n}\n[data-supertokens~="button"] {\n    font-family: "Arial", sans-serif;\n    background-color: rgb(var(--palette-primary));\n    color: rgb(var(--palette-buttonText));\n    width: 100%;\n    height: 34px;\n    font-weight: 600;\n    border-width: 1px;\n    border-style: solid;\n    border-radius: 6px;\n    border-color: rgb(var(--palette-primaryBorder));\n    background-position: center;\n    transition: all 0.4s;\n    background-size: 12000%;\n    cursor: pointer;\n}\n[data-supertokens~="buttonGreyedOut"] {\n    background-color: rgb(var(--palette-buttonGreyedOut));\n    border-color: rgb(var(--palette-buttonGreyedOut));\n}\n[data-supertokens~="buttonWithIcon"] {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 8px;\n}\n[data-supertokens~="button"]:disabled {\n    border: none;\n    cursor: no-drop;\n}\n[data-supertokens~="button"]:active {\n    outline: none;\n    transition: all 0s;\n    background-size: 100%;\n    filter: brightness(0.85);\n}\n[data-supertokens~="button"]:focus {\n    outline: none;\n}\n[data-supertokens~="backButtonCommon"] {\n    width: 16px;\n    height: 13px;\n}\n[data-supertokens~="backButton"] {\n    cursor: pointer;\n    border: none;\n    background-color: transparent;\n    padding: 0px;\n}\n[data-supertokens~="backButtonPlaceholder"] {\n    display: block;\n}\n[data-supertokens~="delayedRender"] {\n    animation-duration: 0.1s;\n    animation-name: animate-fade;\n    animation-delay: 0.2s;\n    animation-fill-mode: backwards;\n}\n@keyframes animate-fade {\n    0% {\n        opacity: 0;\n    }\n    100% {\n        opacity: 1;\n    }\n}\n[data-supertokens~="footerLinkGroupVert"] {\n    display: flex;\n    flex-direction: column;\n    margin-top: 10px;\n    gap: 24px;\n}\n[data-supertokens~="footerLinkGroupVert"] > div {\n    cursor: pointer;\n    margin: 0;\n}\n[data-supertokens~="footerLinkGroupVert"] [data-supertokens~="secondaryText"] {\n    font-weight: 400;\n}\n[data-supertokens~="footerLinkGroupVert"] [data-supertokens~="secondaryLinkWithLeftArrow"] {\n    font-weight: 400;\n    position: relative;\n    left: -6px; /* half the width of the left arrow */\n}\n@media (max-width: 360px) {\n    [data-supertokens~="footerLinkGroupVert"] {\n        flex-direction: column;\n    }\n    [data-supertokens~="footerLinkGroupVert"] > div {\n        margin: 0 auto;\n    }\n}\n[data-supertokens~="footerLinkGroupVert"] div:only-child {\n    margin-left: auto;\n    margin-right: auto;\n    margin-top: 14px;\n}\n[data-supertokens~="withBackButton"] {\n    position: relative;\n    display: flex;\n    justify-content: space-between;
2\n    align-items: center;\n}\n[data-supertokens~="dividerWithOr"] {\n    padding-top: 5px;\n    display: flex;\n    flex-direction: row;\n    justify-content: space-between;\n    align-items: center;\n    color: rgb(var(--palette-textPrimary));\n}\n[data-supertokens~="dividerText"] {\n    flex: 1 1;\n    font-weight: 400;\n    font-size: var(--font-size-1);\n}\n[data-supertokens~="formLabelWithLinkWrapper"] {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n}\n[data-supertokens~="formLabelLinkBtn"] {\n    width: auto;\n    margin-top: 0;\n    line-height: 24px;\n    font-size: var(--font-size-0);\n}\n[data-supertokens~="formLabelLinkBtn"]:hover {\n    text-decoration: underline;\n}\n[data-supertokens~="formLabelLinkBtn"]:disabled {\n    color: rgb(var(--palette-textPrimary));\n    cursor: default;\n    text-decoration: none;\n}\n[data-supertokens~="authComponentList"] {\n    padding-bottom: 20px;\n}\n[data-supertokens~="authPageTitleOAuthClient"] {\n    color: rgb(var(--palette-textGray));\n    font-size: var(--font-size-1);\n    font-weight: 400;\n    margin: 10px 0 25px;\n}\n[data-supertokens~="authPageTitleOAuthClientUrl"] {\n    text-decoration: none;\n}\n[data-supertokens~="authPageTitleOAuthClientLogo"] {\n    width: 44px;\n    height: 44px;\n    margin-bottom: 10px;\n}\n[data-supertokens~="authPageTitleOAuthClient"] [data-supertokens~="authPageTitleOAuthClientName"] {\n    color: rgb(var(--palette-textTitle));\n}\n[data-supertokens~="buttonWithArrow"] {\n    border-radius: 6px;\n    border: 1px solid #d0d5dd;\n    width: 100%;\n    color: rgb(var(--palette-textGray));\n    display: flex;\n    justify-content: center;
2\n    align-items: center;\n    gap: 5px;\n    margin: 24px 0;\n    min-height: 48px;\n    cursor: pointer;\n}\n[data-supertokens~="buttonWithArrow"]:hover {\n    background-color: rgb(var(--palette-inputBackground));\n}\n[data-supertokens~="buttonWithArrow"] [data-supertokens~="secondaryText"] {\n    font-weight: 700;\n    font-size: var(--font-size-2);\n    color: rgb(var(--palette-textGray));\n    margin: 0;\n}\n[data-supertokens~="buttonWithArrow"]:hover [data-supertokens~="secondaryLinkWithRightArrow"] ~ svg {\n    position: relative;\n    left: 2px;\n}\n[data-supertokens~="buttonWithArrow"]:hover [data-supertokens~="secondaryLinkWithLeftArrow"] svg {\n    position: relative;\n    left: -2px;\n}\n[data-supertokens~="buttonWithArrow"] [data-supertokens~="secondaryLinkWithLeftArrow"] {\n    display: flex;\n    align-items: center;\n}\n',n.join("\n")]})]})},j=_("MultitenancyDynamicLoginMethodsSpinnerTheme",function(){return a.jsx("div",r.__assign({"data-supertokens":"container delayedRender"},{children:a.jsx("div",r.__assign({"data-supertokens":"row"},{children:a.jsx("div",r.__assign({"data-supertokens":"spinner delayedRender"},{children:a.jsx(w,{})}))}))}))}),N=function(e){var t=r.SuperTokens.getInstanceOrThrow().rootStyle;return a.jsx(k,r.__assign({userStyles:[t,e.config.recipeRootStyle]},{children:a.jsx(j,{})}))},S=function(){var e=r.Multitenancy.getInstanceOrThrow(),t=u.useContext();return a.jsx(b.Provider,r.__assign({value:t},{children:a.jsx(O,r.__assign({useShadowDom:r.SuperTokens.getInstanceOrThrow().useShadowDom},{children:a.jsx(N,{config:e.config})}))}))},C=v.default.createContext(void 0),E=function(e){var t=e.value,n=e.children,s=void 0===t?{loaded:!1}:{loaded:!0,loginMethods:t};return a.jsx(C.Provider,r.__assign({value:s},{children:n}))},T=v.default.createContext(void 0),I=function(){return v.default.useContext(T)},P=function(e){var t=e.children,n=e.userContext,i=s.useState(r.getNormalisedUserContext(n))[0];return a.jsx(T.Provider,r.__assign({value:i},{children:t}))};function R(e){var t=e.children,n=s.useRef(null),i=s.useState(),o=i[0],l=i[1];return s.useEffect(function(){n.current&&l(function(e){return e||n.current.shadowRoot||n.current.attachShadow({mode:"open",delegatesFocus:!1})})},[n]),a.jsx("div",r.__assign({id:r.ST_ROOT_ID,ref:n},{children:o&&c.createPortal(t,o)}))}function O(e){var t=e.children;return!1===e.useShadowDom?a.jsxs("div",r.__assign({id:r.ST_ROOT_ID},{children:[t,a.jsx(A,{})]})):a.jsxs(R,{children:[t,a.jsx(A,{})]})}function A(){return a.jsx("style",r.__assign({type:"text/css"},{children:"input.supertokens-input:-webkit-autofill,input.supertokens-input:-webkit-autofill:focus,input.supertokens-input:-webkit-autofill:hover,select:-webkit-autofill,select:-webkit-autofill:focus,select:-webkit-autofill:hover,textarea:-webkit-autofill,textarea:-webkit-autofill:focus,textarea:-webkit-autofill:hover{transition:background-color 5000s ease-in-out 0s}"}))}var D={en:{AUTH_PAGE_HEADER_TITLE_SIGN_IN_AND_UP:"Sign Up / Sign In",AUTH_PAGE_HEADER_TITLE_SIGN_IN:"Sign In",AUTH_PAGE_HEADER_TITLE_SIGN_UP:"Sign Up",AUTH_PAGE_HEADER_TITLE_SIGN_IN_UP_TO_APP:" to continue to ",AUTH_PAGE_HEADER_SUBTITLE_SIGN_IN_START:"Not registered yet?",AUTH_PAGE_HEADER_SUBTITLE_SIGN_IN_SIGN_UP_LINK:"Sign Up",AUTH_PAGE_HEADER_SUBTITLE_SIGN_IN_END:"",AUTH_PAGE_HEADER_SUBTITLE_SIGN_UP_START:"Already have an account?",AUTH_PAGE_HEADER_SUBTITLE_SIGN_UP_SIGN_IN_LINK:"Sign In",AUTH_PAGE_HEADER_SUBTITLE_SIGN_UP_END:"",AUTH_PAGE_FOOTER_START:"By continuing, you agree to our ",AUTH_PAGE_FOOTER_TOS:"Terms of Service",AUTH_PAGE_FOOTER_AND:" and ",AUTH_PAGE_FOOTER_PP:"Privacy Policy",AUTH_PAGE_FOOTER_END:"",DIVIDER_OR:"or",BRANDING_POWERED_BY_START:"Powered by ",BRANDING_POWERED_BY_END:"",SOMETHING_WENT_WRONG_ERROR:"Something went wrong. Please try again.",SOMETHING_WENT_WRONG_ERROR_RELOAD:"Something went wrong. Please try again later or reload the page."}},M=v.default.createContext({loading:!0,isDefault:!0}),F=function(){var e=v.default.useContext(M);if(!0===e.isDefault)throw new Error("Cannot use useSessionContext outside auth wrapper components.");return e},L=r.createGenericComponentsOverrideContext(),U=L[0],H=L[1];function z(){var e=o.useTranslation();return a.jsxs("a",r.__assign({"data-supertokens":"superTokensBranding",href:"https://supertokens.com?utm_campaign=p
2oweredby",target:"_blank"},{children:[e("BRANDING_POWERED_BY_START"),a.jsx("strong",{children:"SuperTokens"}),e("BRANDING_POWERED_BY_END")]}))}function B(e){return void 0!==e.userContext?a.jsx(P,r.__assign({userContext:e.userContext},{children:e.children})):a.jsx(T.Consumer,{children:function(t){return void 0===t?a.jsx(P,{children:e.children}):e.children}})}function W(e){var t=e.error,n=o.useTranslation();return a.jsx("div",r.__assign({"data-supertokens":"generalError"},{children:n(t)}))}var q=function(e){var t=e.children,n=e.userStyles;return a.jsxs(s.Fragment,{children:[t,a.jsxs("style",{children:['[data-supertokens~="container"] {\n    --palette-background: 255, 255, 255;\n    --palette-inputBackground: 250, 250, 250;\n    --palette-inputBorder: 224, 224, 224;\n    --palette-primary: 28, 34, 42;\n    --palette-primaryBorder: 45, 54, 68;\n    --palette-success: 65, 167, 0;\n    --palette-successBackground: 217, 255, 191;\n    --palette-error: 255, 23, 23;\n    --palette-errorBackground: 255, 241, 235;\n    --palette-textTitle: 0, 0, 0;\n    --palette-textLabel: 0, 0, 0;\n    --palette-textInput: 0, 0, 0;\n    --palette-textPrimary: 128, 128, 128;\n    --palette-textLink: 0, 122, 255;\n    --palette-buttonText: 255, 255, 255;\n    --palette-textGray: 54, 54, 54;\n    --palette-superTokensBrandingBackground: 242, 245, 246;\n    --palette-superTokensBrandingText: 173, 189, 196;\n    --palette-buttonGreyedOut: 221, 221, 221;\n    --palette-caution: 124, 96, 62;\n    --palette-errorDark: 207, 54, 68;\n\n    --font-size-0: 12px;\n    --font-size-1: 14px;\n    --font-size-2: 16px;\n    --font-size-3: 19px;\n    --font-size-4: 24px;\n    --font-size-5: 28px;\n}\n/*\n * Default styles.\n */\n@keyframes slideTop {\n    0% {\n        transform: translateY(-5px);\n    }\n    100% {\n        transform: translateY(0px);\n    }\n}\n@keyframes swing-in-top-fwd {\n    0% {\n        transform: rotateX(-100deg);\n        transform-origin: top;\n        opacity: 0;\n    }\n    100% {\n        transform: rotateX(0deg);\n        transform-origin: top;\n        opacity: 1;\n    }\n}\n[data-supertokens~="container"] {\n    font-family: "Arial", sans-serif;\n    margin: 12px auto;\n    margin-top: 26px;\n    margin-bottom: 26px;\n    width: 420px;\n    text-align: center;\n    border-radius: 8px;\n    box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.16);\n    background-color: rgb(var(--palette-background));\n}\n@media (max-width: 440px) {\n    [data-supertokens~="container"] {\n        width: 95vw;\n    }\n}\n[data-supertokens~="row"] {\n    margin: 0 auto;\n    width: 76%;\n    padding-top: 30px;\n    padding-bottom: 10px;\n}\n[data-supertokens~="superTokensBranding"] {\n    display: block;\n    margin: 10px auto 0;\n    background: rgb(var(--palette-superTokensBrandingBackground));\n    color: rgb(var(--palette-superTokensBrandingText));\n    text-decoration: none;\n    width: -webkit-fit-content;\n    width: fit-content;\n    border-radius: 6px 6px 0 0;\n    padding: 4px 9px;\n    font-weight: 400;\n    font-size: var(--font-size-0);\n    letter-spacing: 0.4px;\n}\n[data-supertokens~="generalError"] {\n    background: rgb(var(--palette-errorBackground));\n    padding-top: 10px;\n    padding-bottom: 10px;\n    margin-bottom: 10px;\n    margin-top: 24px;\n    padding-left: 18px;\n    padding-right: 18px;\n    letter-spacing: 0.2px;\n    font-size: var(--font-size-1);\n    border-radius: 8px;\n    color: rgb(var(--palette-error));\n    animation: swing-in-top-fwd 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;\n    word-wrap: break-word;\n}\n[data-supertokens~="headerTitle"] {\n    font-size: var(--font-size-4);\n    line-height: 27.6px;\n    letter-spacing: 0.58px;\n    font-weight: 700;\n    margin-bottom: 20px;\n    color: rgb(var(--palette-textTitle));\n}\n[data-supertokens~="headerSubtitle"] {\n    font-weight: 400;\n    color: rgb(var(--palette-textGray));\n    margin-bottom: 21px;\n}\n[data-supertokens~="headerSubtitle"][data-supertokens~="secondaryText"] {\n    color: rgb(var(--palette-textGray));\n    font-weight: 400;\n}\n[data-supertokens~="privacyPolicyAndTermsAndConditions"] {\n    max-width: 300px;\n    margin-top: 10px;\n}\n[data-supertokens~="privacyPolicyAndTermsAndConditions"] a {\n    line-height: 21px;\n}\n/* TODO: split the link style into separate things*/\n/* We add this before primary and secondary text, because if they are applied to the same element the other ones take priority */\n[data-supertokens~="link"] {\n    padding-left: 3px;\n    padding-right: 3px;\n    color: rgb(var(--palette-textLink));\n    font-size: var(--font-size-1);\n    cursor: pointer;\n    letter-spacing: 0.16px;
2\n    line-height: 26px;\n}\n[data-supertokens~="primaryText"] {\n    font-size: var(--font-size-2);\n    font-weight: 400;\n    letter-spacing: 0.4px;\n    line-height: 21px;\n    color: rgb(var(--palette-textLabel));\n}\n[data-supertokens~="secondaryText"] {\n    font-size: var(--font-size-1);\n    font-weight: 400;\n    letter-spacing: 0.4px;\n    color: rgb(var(--palette-textPrimary));\n}\n[data-supertokens~="secondaryText"] strong {\n    font-weight: 600;\n}\n[data-supertokens~="divider"] {\n    margin-top: 1.5em;\n    margin-bottom: 1.5em;\n    border-bottom: 0.3px solid #dddddd;\n    align-items: center;\n    padding-bottom: 5px;\n    flex: 3 3;\n}\n[data-supertokens~="headerTinyTitle"] {\n    margin-top: 24px;\n    font-size: var(--font-size-5);\n    letter-spacing: 1.1px;\n    font-weight: 700;\n    line-height: 28px;\n}\n[data-supertokens~="secondaryLinkWithArrow"] {\n    margin-top: 10px;\n    margin-bottom: 30px;\n    cursor: pointer;\n}\n[data-supertokens~="secondaryLinkWithArrow"]:hover {\n    position: relative;\n    left: 2px;\n    word-spacing: 4px;\n}\n[data-supertokens~="generalSuccess"] {\n    color: rgb(var(--palette-success));\n    font-size: var(--font-size-1);\n    background: rgb(var(--palette-successBackground));\n    animation: swing-in-top-fwd 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;\n    padding: 9px 15px 9px 15px;\n    border-radius: 6px;\n    display: inline-block;\n}\n[data-supertokens~="spinner"] {\n    width: 80px;\n    height: auto;\n    padding-top: 20px;\n    padding-bottom: 40px;\n    margin: 0 auto;\n}\n[data-supertokens~="error"] {\n    color: rgb(var(--palette-error));\n}\n[data-supertokens~="linkButton"] {\n    font-family: "Arial", sans-serif;\n    background-color: transparent;\n    border: 0;\n}\n[data-supertokens~="secondaryLinkWithLeftArrow"] {\n    color: rgb(var(--palette-textGray));\n    font-weight: 400;\n    margin-top: 10px;\n    margin-bottom: 40px;\n    cursor: pointer;\n}\n[data-supertokens~="secondaryLinkWithLeftArrow"] svg {\n    margin-right: 0.3em;\n}\n[data-supertokens~="secondaryLinkWithLeftArrow"]:hover svg {\n    position: relative;\n    left: -4px;\n}\n[data-supertokens~="button"] {\n    font-family: "Arial", sans-serif;\n    background-color: rgb(var(--palette-primary));\n    color: rgb(var(--palette-buttonText));\n    width: 100%;\n    height: 34px;\n    font-weight: 600;\n    border-width: 1px;\n    border-style: solid;\n    border-radius: 6px;\n    border-color: rgb(var(--palette-primaryBorder));\n    background-position: center;\n    transition: all 0.4s;\n    background-size: 12000%;\n    cursor: pointer;\n}\n[data-supertokens~="buttonGreyedOut"] {\n    background-color: rgb(var(--palette-buttonGreyedOut));\n    border-color: rgb(var(--palette-buttonGreyedOut));\n}\n[data-supertokens~="buttonWithIcon"] {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 8px;\n}\n[data-supertokens~="button"]:disabled {\n    border: none;\n    cursor: no-drop;\n}\n[data-supertokens~="button"]:active {\n    outline: none;\n    transition: all 0s;\n    background-size: 100%;\n    filter: brightness(0.85);\n}\n[data-supertokens~="button"]:focus {\n    outline: none;\n}\n[data-supertokens~="backButtonCommon"] {\n    width: 16px;\n    height: 13px;\n}\n[data-supertokens~="backButton"] {\n    cursor: pointer;\n    border: none;\n    background-color: transparent;\n    padding: 0px;\n}\n[data-supertokens~="backButtonPlaceholder"] {\n    display: block;\n}\n[data-supertokens~="delayedRender"] {\n    animation-duration: 0.1s;\n    animation-name: animate-fade;\n    animation-delay: 0.2s;\n    animation-fill-mode: backwards;\n}\n@keyframes animate-fade {\n    0% {\n        opacity: 0;\n    }\n    100% {\n        opacity: 1;\n    }\n}\n[data-supertokens~="footerLinkGroupVert"] {\n    display: flex;\n    flex-direction: column;\n    margin-top: 10px;\n    gap: 24px;\n}\n[data-supertokens~="footerLinkGroupVert"] > div {\n    cursor: pointer;\n    margin: 0;\n}\n[data-supertokens~="footerLinkGroupVert"] [data-supertokens~="secondaryText"] {\n    font-weight: 400;\n}\n[data-supertokens~="footerLinkGroupVert"] [data-supertokens~="secondaryLinkWithLeftArrow"] {\n    font-weight: 400;\n    position: relative;\n    left: -6px; /* half the width of the left arrow */\n}\n@media (max-width: 360px) {\n    [data-supertokens~="footerLinkGroupVert"] {\n        flex-direction: column;\n    }\n    [data-supertokens~="footerLinkGroupVert"] > div {\n        margin: 0 auto;\n    }\n}\n[data-supertokens~="footerLinkGroupVert"] div:only-child {\n    margin-left: auto;\n    margin-right: auto;\n    margin-top: 14px;\n}\n[data-supertokens~="withBackButton"] {\n    position: relative;\n    display: flex;\n    justify-content: space-between;
2\n    align-items: center;\n}\n[data-supertokens~="dividerWithOr"] {\n    padding-top: 5px;\n    display: flex;\n    flex-direction: row;\n    justify-content: space-between;\n    align-items: center;\n    color: rgb(var(--palette-textPrimary));\n}\n[data-supertokens~="dividerText"] {\n    flex: 1 1;\n    font-weight: 400;\n    font-size: var(--font-size-1);\n}\n[data-supertokens~="formLabelWithLinkWrapper"] {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n}\n[data-supertokens~="formLabelLinkBtn"] {\n    width: auto;\n    margin-top: 0;\n    line-height: 24px;\n    font-size: var(--font-size-0);\n}\n[data-supertokens~="formLabelLinkBtn"]:hover {\n    text-decoration: underline;\n}\n[data-supertokens~="formLabelLinkBtn"]:disabled {\n    color: rgb(var(--palette-textPrimary));\n    cursor: default;\n    text-decoration: none;\n}\n[data-supertokens~="authComponentList"] {\n    padding-bottom: 20px;\n}\n[data-supertokens~="authPageTitleOAuthClient"] {\n    color: rgb(var(--palette-textGray));\n    font-size: var(--font-size-1);\n    font-weight: 400;\n    margin: 10px 0 25px;\n}\n[data-supertokens~="authPageTitleOAuthClientUrl"] {\n    text-decoration: none;\n}\n[data-supertokens~="authPageTitleOAuthClientLogo"] {\n    width: 44px;\n    height: 44px;\n    margin-bottom: 10px;\n}\n[data-supertokens~="authPageTitleOAuthClient"] [data-supertokens~="authPageTitleOAuthClientName"] {\n    color: rgb(var(--palette-textTitle));\n}\n[data-supertokens~="buttonWithArrow"] {\n    border-radius: 6px;\n    border: 1px solid #d0d5dd;\n    width: 100%;\n    color: rgb(var(--palette-textGray));\n    display: flex;\n    justify-content: center;
2\n    align-items: center;\n    gap: 5px;\n    margin: 24px 0;\n    min-height: 48px;\n    cursor: pointer;\n}\n[data-supertokens~="buttonWithArrow"]:hover {\n    background-color: rgb(var(--palette-inputBackground));\n}\n[data-supertokens~="buttonWithArrow"] [data-supertokens~="secondaryText"] {\n    font-weight: 700;\n    font-size: var(--font-size-2);\n    color: rgb(var(--palette-textGray));\n    margin: 0;\n}\n[data-supertokens~="buttonWithArrow"]:hover [data-supertokens~="secondaryLinkWithRightArrow"] ~ svg {\n    position: relative;\n    left: 2px;\n}\n[data-supertokens~="buttonWithArrow"]:hover [data-supertokens~="secondaryLinkWithLeftArrow"] svg {\n    position: relative;\n    left: -2px;\n}\n[data-supertokens~="buttonWithArrow"] [data-supertokens~="secondaryLinkWithLeftArrow"] {\n    display: flex;\n    align-items: center;\n}\n',n.join("\n")]})]})},V=_("AuthPageComponentList",function(e){for(var t=o.useTranslation(),n=[e.authComponents[0]],s=function(s){n.push(function(){return a.jsxs("div",r.__assign({"data-supertokens":"dividerWithOr"},{children:[a.jsx("div",{"data-supertokens":"divider"}),a.jsx("div",r.__assign({"data-supertokens":"dividerText"},{children:t("DIVIDER_OR")})),a.jsx("div",{"data-supertokens":"divider"})]}),"divider-".concat(s))}),n.push(e.authComponents[s])},i=1;i<e.authComponents.length;++i)s(i);return a.jsx("div",r.__assign({"data-supertokens":"authComponentList"},{children:n.map(function(t){return t(r.__assign({},e))})}))}),$=_("AuthPageFooter",function(e){var t=e.hasSeparateSignUpView,n=e.isSignUp,s=e.termsOfServiceLink,i=e.privacyPolicyLink,l=o.useTranslation();return void 0===s&&void 0===i||t&&!n?null:a.jsxs("div",r.__assign({"data-supertokens":"secondaryText privacyPolicyAndTermsAndConditions"},{children:[l("AUTH_PAGE_FOOTER_START"),void 0!==s&&a.jsx("a",r.__assign({"data-supertokens":"link",href:s,target:"_blank",rel:"noopener noreferer"},{children:l("AUTH_PAGE_FOOTER_TOS")})),void 0!==s&&void 0!==i&&l("AUTH_PAGE_FOOTER_AND"),void 0!==i&&a.jsx("a",r.__assign({"data-supertokens":"link",href:i,target:"_blank",rel:"noopener noreferer"},{children:l("AUTH_PAGE_FOOTER_PP")})),l("AUTH_PAGE_FOOTER_END")]}))});function G(e){var t=e.color;return a.jsx("svg",r.__assign({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"13",viewBox:"0 0 16 13","data-supertokens":"heavyArrowLeftIcon"},{children:a.jsx("path",{fill:t,d:"M13 6.8h.022H3.8l2.9 2.9a.761.761 0 0 1 0 1.07l-.451.451a.754.754 0 0 1-1.064 0L.22 6.254a.759.759 0 0 1 0-1.068L5.186.22a.755.755 0 0 1 1.064 0l.45.451a.746.746 0 0 1 .22.532.724.724 0 0 1-.22.522l-2.93 2.92h9.24a.781.781 0 0 1 .764.773v.638A.766.766 0 0 1 13 6.8z",transform:"translate(1.182 .708)"})}))}function Y(e){var t=e.onClick;return a.jsx("button",r.__assign({onClick:t,"data-supertokens":"backButton backButtonCommon"},{children:a.jsx(G,{color:"rgb(var(--palette-textTitle))"})}))}var K=_("AuthPageHeader",function(e){var t=e.onSignInUpSwitcherClick,n=e.hasSeparateSignUpView,i=e.isSignUp,l=e.showBackButton,c=e.resetFactorList,u=e.oauth2ClientInfo,d=e.headerLabel,f=e.hideSignInSwitcher,h=void 0!==f&&f,p=o.useTranslation();return a.jsxs(s.Fragment,{children:[(null===u||void 0===u?void 0:u.logoUri)&&a.jsx("img",{src:u.logoUri,alt:u.clientName,"data-supertokens":"authPageTitleOAuthClientLogo"}),a.jsxs("div",r.__assign({"data-supertokens":"headerTitle withBackButton"},{children:[l?a.jsx(Y,{onClick:c}):a.jsx("span",{"data-supertokens":"backButtonPlaceholder backButtonCommon"}),p(void 0!==d?d:n?i?"AUTH_PAGE_HEADER_TITLE_SIGN_UP":"AUTH_PAGE_HEADER_TITLE_SIGN_IN":"AUTH_PAGE_HEADER_TITLE_SIGN_IN_AND_UP"),a.jsx("span",{"data-supertokens":"backButtonPlaceholder backButtonCommon"})]})),u&&void 0!==u.clientName&&u.clientName.length>0&&a.jsxs("div",r.__assign({"data-supertokens":"authPageTitleOAuthClient"},{children:[p("AUTH_PAGE_HEADER_TITLE_SIGN_IN_UP_TO_APP"),void 0!==u.clientUri?a.jsx("a",r.__assign({"data-supertokens":"authPageTitleOAuthClientUrl link",href:u.clientUri},{children:u.clientName})):a.jsx("span",r.__assign({"data-supertokens":"authPageTitleOAuthClientName"},{children:u.clientName}))]})),!h&&n&&(i?a.jsxs("div",r.__assign({"data-supertokens":"headerSubtitle secondaryText"},{children:[p("AUTH_PAGE_HEADER_SUBTITLE_SIGN_UP_START"),a.jsx("span",r.__assign({"data-supertokens":"link",onClick:t},{children:p("AUTH_PAGE_HEADER_SUBTITLE_SIGN_UP_SIGN_IN_LINK")})),p("AUTH_PAGE_HEADER_SUBTITLE_SIGN_UP_END")]})):a.jsxs("div",r.__assign({"data-supertokens":"headerSubtitle secondaryText"},{children:[p("AUTH_PAGE_HEADER_SUBTITLE_SIGN_IN_START"),a.jsx("span",r.__assign({"data-supertokens":"link",onClick:t},{children:p("AUTH_PAGE_HEADER_SUBTITLE_SIGN_IN_SIGN_UP_LINK")})),p("AUTH_PAGE_HEADER_SUBTITLE_SIGN_IN_END")]}))),a.jsx("div",{"data-supertokens":"divider"})]})});function Z(e){return e.fullPageCompWithPreloadedInfo?a.jsx(a.Fragment,{children:e.fullPageCompWithPreloadedInfo.component(r.__assign(r.__assign({},e),{preloadInfo:e.fullPageCompWithPreloadedInfo.preloadInfo,showBackButton:e.showBackButton}))}):a.jsxs("div",r.__assign({"data-supertokens":"container authPage ".concat(e.factorIds.length>1?"multiFactor":"singleFactor")},{children:[a.jsxs("div",r.__assign({"data-supertokens":"row"},{children:[a.jsx(K,{factorIds:e.factorIds,isSignUp:e.isSignUp,onSignInUpSwitcherClick:e.onSignInUpSwitcherClick,hasSeparateSignUpView:e.hasSeparateSignUpView,resetFactorList:e.resetFactorList,showBackButton:e.showBackButton,oauth2ClientInfo:e.oauth2ClientInfo}),void 0!==e.error&&a.jsx(W,{error:e.error}),a.jsx(V,r.__assign({},e)),a.jsx($,{factorIds:e.factorIds,isSignUp:e.isSignUp,hasSeparateSignUpView:e.hasSeparateSignUpView,privacyPolicyLink:e.privacyPolicyLink,termsOfServiceLink:e.termsOfServiceLink})]})),a.jsx(z,{})]}))}function J(e){var t=r.SuperTokens.getInstanceOrThrow().rootStyle;return a.jsx(B,r.__assign({userContext:e.userContext},{children:a.jsx(q,r.__assign({userStyles:[t]},{children:a.jsx(Z,r.__assign({},e))}))}))}var X={signin:"SOMETHING_WENT_WRONG_ERROR",no_email_present:"THIRD_PARTY_ERROR_NO_EMAIL",restart_link:"ERROR_SIGN_IN_UP_LINK"},Q=function(e){var t=U();return a.jsx(P,r.__assign({userContext:e.userContext},{children:a.jsx(he,r.__assign({requireAuth:!1,doRedirection:!1},{children:a.jsx(b.Provider,r.__assign({value:t},{children:a.jsx(ee,r.__assign({},e))}))}))}))},ee=function(e){var t,n,i,c,u;if(void 0!==e.factors&&0===e.factors.length)throw new Error("The factors array cannot be empty");var m=l.WindowHandlerReference.getReferenceOrThrow().windowHandler,g=new URLSearchParams(m.location.getSearch()),x=g.get("show"),y=!0!==e.useSignUpStateFromQueryString||null===x?void 0:"signup"===x,b=null!==g.get("error")&&null!==(n=null!==(t=g.get("message"))&&void 0!==t?t:g.get("error"))&&void 0!==n?n:void 0;b=void 0!==b?null!==(i=X[b])&&void 0!==i?i:b:void 0;var w=s.useRef(x),_=s.useRef(b),k=g.get("loginChallenge"),j="true"===g.get("forceFreshAuth"),N=F(),C=I(),T=r.useRethrowInRender(),P=s.useState(void 0),R=P[0],A=P[1],M=s.useState(void 0),L=M[0],U=M[1],H=s.useState(b),z=H[0],B=H[1],W=s.useState(!1),q=W[0],V=W[1],$=r.SuperTokens.getInstanceOrThrow(),G=s.useState(e.factors),Y=G[0],K=G[1],Z=s.useState(null!==(u=null!==(c=e.isSignUp)&&void 0!==c?c:y)&&void 0!==u?u:$.defaultToSignUp),Q=Z[0],ee=Z[1],te=s.useState(0),ne=te[0],re=te[1],ae=s.useRef({buildReq:void 0});s.useEffect(function(){if(e.useSignUpStateFromQueryString&&w.current!==x){var t=!0!==e.useSignUpStateFromQueryString||null===x?void 0:"signup"===x;w.current=x;var n=null!==t&&void 0!==t?t:$.defaultToSignUp;Q!==n&&(ee(n),re(function(e){return e+1}))}}),s.useEffect(function(){_.current!==b&&(_.current=b,B(b))});var se=s.useCallback(function(){!0===e.useSignUpStateFromQueryString&&r.updateQueryParam("show",Q?"signin":"signup"),B(void 0),ee(!Q),re(function(e){return e+1})},[Q,ee,re,B,e.useSignUpStateFromQueryString]);s.useEffect(function(){R||r.Multitenancy.getInstanceOrThrow().getCurrentDynamicLoginMethods({userContext:C}).then(function(e){return A(e)},function(e){return T(e)})},[R,A]),r.useOnMountAPICall(function(){return r.__awaiter(void 0,void 0,void 0,function(){var e;return r.__generator(this,function(t){return L?[2]:void 0!==(e=h.OAuth2Provider.getInstance())&&null!==k?[2,e.webJSRecipe.getLoginChallengeInfo({loginChallenge:k,userContext:C})]:[2,void 0]})})},function(e){return r.__awaiter(void 0,void 0,void 0,function(){return r.__generator(this,function(t){return void 0!==e&&("OK"===e.status?U(e.info):B("SOMETHING_WENT_WRONG_ERROR")),[2]})})},function(){r.clearQueryParams(["loginChallenge"]),B("SOMETHING_WENT_WRONG_ERROR")}),s.useEffect(function(){if(!q&&!1===N.loading)if(N.doesSessionExist)if(void 0!==e.onSessionAlreadyExists)e.onSessionAlreadyExists();else if(!1===e.redirectOnSessionExists||j)V(!0);else{f.Session.getInstanceOrThrow().config.onHandleEvent({action:"SESSION_ALREADY_EXISTS"});var t=h.OAuth2Provider.getInstance();null!==k&&void 0!==t?function(){return r.__awaiter(this,void 0,void 0,function(){var n;return r.__generator(this,function(a){switch(a.label){case 0:return[4,t.webJSRecipe.getRedirectURLToContinueOAuthFlow({loginChallenge:k,userContext:C})];case 1:return n=a.sent().frontendRedirectTo,[2,f.Session.getInstanceOrThrow().validateGlobalClaimsAndHandleSuccessRedirection({action:"SUCCESS_OAUTH2",frontendRedirectTo:n,createdNewUser:!1,isNewRecipeUser:!1,newSessionCreated:!1,tenantIdFromQueryParams:r.getTenantIdFromQueryParams(),recipeId:f.Session.RECIPE_ID},f.Session.RECIPE_ID,r.getRedirectToPathFromURL(),C,e.navigate)]}})})}().catch(T):f.Session.getInstanceOrThrow().validateGlobalClaimsAndHandleSuccessRedirection(void 0,f.Session.RECIPE_ID,r.getRedirectToPathFromURL(),C,e.navigate).catch(T)}else V(!0)},[N.loading]);var ie=s.useState(),oe=ie[0],le=ie[1],ce=void 0!==Y&&(void 0===e.factors||e.factors.some(function(e){return!Y.includes(e)})),ue=r.SuperTokens.getInstanceOrThrow(),de=ue.privacyPolicyLink,fe=ue.termsOfServiceLink;s.useEffect(function(){var t=new AbortController;if(ae.current.buildReq!==ne)return!q||void 0===R&&r.SuperTokens.usesDynamicLoginMethods||function(e,t,n,a,s,i,o){var l,c,u,h,m;return r.__awaiter(this,void 0,void 0,function(){var g,v,x,y,b,w,_,k,j,N,S,C,E,T,I,P,R,O,A,D,M,F,L,U;return r.__generator(this,function(H){switch(H.label){case 0:if(g=r.SuperTokens.getInstanceOrThrow().recipeList.filter(function(e){return"firstFactorIds"in e}),v=null!==(u=null!==(l=null!==a&&void 0!==a?a:null===t||void 0===t?void 0:t.firstFactors)&&void 0!==l?l:null===(c=d.MultiFactorAuth.getInstance())||void 0===c?void 0:c.config.firstFactors)&&void 0!==u?u:g.reduce(function(e,t){return r.__spreadArray(r.__spreadArray([],e,!0),t.getFirstFactorsForAuthPage(),!0)},[]),void 0===a&&void 0===(null===t||void 0===t?void 0:t.firstFactors)&&void 0===(null===(h=d.MultiFactorAuth.getInstance())||void 0===h?void 0:h.config.firstFactors)&&(x=g.filter(function(t){return!e.s
2ome(function(e){return e.recipeInstance.recipeID===t.recipeID})}),x.length>0))throw new Error("Factor list not set but PreBuiltUI not added for ".concat(x.map(function(e){return e.recipeID})));if(0===v.length)throw new Error("There are no enabled factors to show");if(v.includes(f.FactorIds.THIRDPARTY)&&void 0!==(y=e.find(function(e){return e.recipeInstance.recipeID===f.FactorIds.THIRDPARTY}))&&0===y.recipeInstance.config.signInAndUpFeature.providers.length&&(!r.SuperTokens.usesDynamicLoginMethods||0===t.thirdparty.providers.length)&&0===(v=v.filter(function(e){return e!==f.FactorIds.THIRDPARTY})).length)throw new Error("The only enabled first factor is thirdparty, but no providers were defined. Please define at least one provider.");for(b=e.some(function(e){return e.requiresSignUpPage&&e.recipeInstance.firstFactorIds.some(function(e){return v.includes(e)})}),w=b&&s,_=[],k=0,j=e;k<j.length;k++)N=j[k],_.push.apply(_,N.getAuthComponents());S=0,C=_,H.label=1;case 1:return S<C.length?"FULL_PAGE"!==(E=C[S]).type?[3,3]:[4,E.preloadInfoAndRunChecks(v,n,w)]:[3,4];case 2:if(T=H.sent(),o.aborted)return[2];if(T.shouldDisplay)return i({authComponents:[],fullPageCompWithPreloadedInfo:{component:E.component,preloadInfo:T.preloadInfo},isSignUp:w,hasSeparateSignUpView:b,factorIds:v}),[2];H.label=3;case 3:return S++,[3,1];case 4:if(o.aborted)return[2];if(I=_.filter(function(e){return"FULL_PAGE"!==e.type&&e.factorIds.every(function(e){return v.includes(e)})}),(I=I.filter(function(e){return"SIGN_IN_UP"===e.type||(w?"SIGN_UP"===e.type:"SIGN_IN"===e.type)})).sort(function(e,t){return t.factorIds.length-e.factorIds.length}),void 0===(P=p.selectComponentsToCoverAllFirstFactors(I,v))){for(R=new Set,O=0,A=I;O<A.length;O++)for(D=A[O],M=0,F=D.factorIds;M<F.length;M++)L=F[M],R.add(L);throw U=void 0!==a?"local state or props":void 0!==(null===t||void 0===t?void 0:t.firstFactors)?"dynamic tenant configuration":void 0!==(null===(m=d.MultiFactorAuth.getInstance())||void 0===m?void 0:m.config.firstFactors)?"the config passed to the MFA recipe":"all recipes initialized",new Error("Couldn't cover all first factors: ".concat(v.join(", ")," (from ").concat(U,"), available components: ").concat(Array.from(R).join(", "),".\n")+"You may have missed adding a recipe into the list of prebuiltUIs passed to list of prebuiltUIs passed to getSuperTokensRoutesForReactRouterDom, canHandleRoute, handleRoute functions or the AuthPage component.\nAnother common error is adding a non-existent factor id into the list, e.g.: passwordless instead of otp-email/phone")}return i({authComponents:P.sort(function(e,t){return e.displayOrder-t.displayOrder}).map(function(e){return e.component}),factorIds:v,hasSeparateSignUpView:b,isSignUp:w}),[2]}})})}(e.preBuiltUIList,R,C,Y,Q,le,t.signal).then(function(){ae.current.buildReq=ne},T),function(){t.abort()}},[q,ne,re,e.preBuiltUIList,R,C,Y,Q,le,T]);var he=s.useCallback(function(t){return r.__awaiter(void 0,void 0,void 0,function(){var n,a;return r.__generator(this,function(s){switch(s.label){case 0:return n=h.OAuth2Provider.getInstance(),null===k||void 0===n?[2,f.Session.getInstanceOrThrow().validateGlobalClaimsAndHandleSuccessRedirection(r.__assign(r.__assign({},t),{action:"SUCCESS",tenantIdFromQueryParams:r.getTenantIdFromQueryParams(),redirectToPath:r.getRedirectToPathFromURL()}),t.recipeId,r.getRedirectToPathFromURL(),C,e.navigate)]:[4,n.webJSRecipe.getRedirectURLToContinueOAuthFlow({loginChallenge:k,userContext:C})];case 1:return a=s.sent().frontendRedirectTo,[2,f.Session.getInstanceOrThrow().validateGlobalClaimsAndHandleSuccessRedirection(r.__assign(r.__assign({},t),{action:"SUCCESS_OAUTH2",tenantIdFromQueryParams:r.getTenantIdFromQueryParams(),frontendRedirectTo:a}),t.recipeId,r.getRedirectToPathFromURL(),C,e.navigate)]}})})},[k]),pe=void 0===oe||null!==k&&void 0===L&&void 0!==h.OAuth2Provider.getInstance()?void 0:r.__assign(r.__assign({},oe),{oauth2ClientInfo:L,onAuthSuccess:he,error:z,onError:function(e){B(e)},clearError:function(){return B(void 0)},navigate:e.navigate,onSignInUpSwitcherClick:se,privacyPolicyLink:de,rebuildAuthPage:function(){return re(function(e){return e+1})},setFactorList:function(e){K(e),re(function(e){return e+1})},resetFactorList:function(){K(e.factors),re(function(e){return e+1})},showBackButton:ce,termsOfServiceLink:fe,userContext:C}),me=s.useMemo(function(){var t=D;if(void 0!==oe)for(var n=0,a=e.preBuiltUIList;n<a.length;n++){var s=a[n];t=r.mergeObjects(t,s.languageTranslations)}return t=r.mergeObjects(t,$.languageTranslations.userTranslationStore)},[$.languageTranslations.userTranslationStore,oe]);return void 0===pe?a.jsx(S,{}):a.jsx(E,r.__assign({value:R},{children:a.jsx(o.TranslationContextProvider,r.__assign({defaultLanguage:$.languageTranslations.defaultLanguage,defaultStore:me,translationControlEventSource:$.languageTranslations.translationEventSource,userTranslationFunc:$.languageTranslations.userTranslationFunc},{children:a.jsx(O,r.__assign({useShadowDom:$.useShadowDom},{children:a.jsxs(s.Fragment,{children:[void 0===e.children&&a.jsx(J,r.__assign({},pe)),e.children&&v.default.Children.map(e.children,function(e){return v.default.isValidElement(e)?v.default.cloneElement(e,pe):e})]})}))}))}))};var te=[{rid:"thirdpartyemailpassword",includes:["thirdparty","emailpassword"],factorsProvided:[f.FactorIds.THIRDPARTY,f.FactorIds.EMAILPASSWORD]},{rid:"thirdpartypasswordless",includes:["thirdparty","passwordless"],factorsProvided:[f.FactorIds.THIRDPARTY,f.FactorIds.OTP_PHONE,f.FactorIds.OTP_EMAIL,f.FactorIds.LINK_PHONE,f.FactorIds.LINK_EMAIL]},{rid:"emailpassword",includes:["emailpassword"],factorsProvided:[f.FactorIds.EMAILPASSWORD]},{rid:"passwordless",includes:["passwordless"],factorsProvided:[f.FactorIds.OTP_PHONE,f.FactorIds.OTP_EMAIL,f.FactorIds.LINK_PHONE,f.FactorIds.LINK_EMAIL]},{rid:"thirdparty",includes:["thirdparty"],factorsProvided:[f.FactorIds.THIRDPARTY]}];
2function ne(e,t){for(var n,a,s=function(s,i){if(e.every(function(e){return i.includes(e)})){var o=t.find(function(e){return e.recipeID===s});if(o&&(n=s,a=o,e.length===i.length))return r.logDebugMessage("Rendering ".concat(s," because it matches factors: ").concat(e," exactly")),{value:o}}},i=0,o=te;i<o.length;i++){var l=o[i],c=s(l.rid,l.factorsProvided);if("object"===typeof c)return c.value}if(void 0!==a)return r.logDebugMessage("Rendering ".concat(n," to cover ").concat(e," as a fallback")),a;var u=[];e.includes(f.FactorIds.EMAILPASSWORD)&&u.push("emailpassword"),e.includes(f.FactorIds.THIRDPARTY)&&u.push("thirdparty"),[f.FactorIds.OTP_PHONE,f.FactorIds.OTP_EMAIL,f.FactorIds.LINK_PHONE,f.FactorIds.LINK_EMAIL].some(function(t){return e.includes(t)})&&u.push("passwordless"),r.logDebugMessage("Choosing component using fallback logic w/ ".concat(u.join(", ")," enabled"));for(var d=u.length,h=function(e,n){if(d===n.length&&n.every(function(e){return u.includes(e)})){var r=t.find(function(t){return t.recipeID===e});if(r)return{value:r}}},p=0,m=te;p<m.length;p++){var g=m[p],v=h(g.rid,g.includes);if("object"===typeof v)return v.value}for(var x=function(e,n){if(n.some(function(e){return u.includes(e)})){var r=t.find(function(t){return t.recipeID===e});if(r)return{value:r}}},y=0,b=te;y<b.length;y++){var w=b[y],_=x(w.rid,w.includes);if("object"===typeof _)return _.value}throw new Error("No enabled recipes overlap with the requested firstFactors: "+e)}var re=function(){function e(){var e=this;this.getPathsToFeatureComponentWithRecipeIdMap=function(){if(void 0!==e.pathsToFeatureComponentWithRecipeIdMap)return e.pathsToFeatureComponentWithRecipeIdMap;for(var t={},n=e.getFeatures(),r=Object.keys(n),a=0;a<r.length;a++){var s=r[a];void 0===t[s]&&(t[s]=[]),t[s].push(n[s])}return e.pathsToFeatureComponentWithRecipeIdMap=t,e.pathsToFeatureComponentWithRecipeIdMap},this.requiresSignUpPage=!1}return e.getMatchingComponentForRouteAndRecipeIdFromPreBuiltUIList=function(e,t,n,a){var s,i=e.getAsStringDangerous(),o=i===r.SuperTokens.getInstanceOrThrow().appInfo.websiteBasePath.getAsStringDangerous(),l=t.reduce(function(e,t){for(var n=t.getPathsToFeatureComponentWithRecipeIdMap(),r=function(t,n){(t===i||new RegExp("^"+t.replace(/:\w+/g,"[^/]+").replace(/\/\*/g,"/[^/]+")+"$").test(i))&&(e=e.concat(n.map(function(e){return{comp:e,route:t}})))},a=0,s=Object.entries(n);a<s.length;a++){var o=s[a];r(o[0],o[1])}return e},[]),c=l.find(function(e){return e.comp.matches()});s=0===l.length?void 0:void 0!==c?c.comp:l[0].comp;var u=l.find(function(e){return!te.map(function(e){return e.rid}).includes(e.comp.recipeID)||e.route!==r.SuperTokens.getInstanceOrThrow().appInfo.websiteBasePath.getAsStringDangerous()});if(u)return u.comp;if(n)return s;var f=d.MultiFactorAuth.getInstance();if(!1===r.SuperTokens.usesDynamicLoginMethods)return c?c.comp:o&&f&&void 0!==f.config.firstFactors?ne(f.config.firstFactors,l.map(function(e){return e.comp})):s;if(void 0===a)throw new Error("Should never come here: dynamic login methods info has not been loaded but recipeRouter rendered");return!c||te.map(function(e){return e.rid}).includes(c.comp.recipeID)&&!te.some(function(e){return e.rid===c.comp.recipeID&&e.factorsProvided.some(function(e){return a.firstFactors.includes(e)})})?o?ne(a.firstFactors,l.map(function(e){return e.comp})):void 0:c.comp},e}();function ae(e){var t,n,i=I(),o=r.useRethrowInRender(),l=s.useState(void 0),c=l[0],u=l[1],d=null===(t=e.getReactRouterDomWithCustomHistory())||void 0===t?void 0:t.useHistoryCustom(),f=e.path,h=f===r.SuperTokens.getInstanceOrThrow().appInfo.websiteBasePath.getAsStringDangerous(),p=null===(n=e.getReactRouterDomWithCustomHistory())||void 0===n?void 0:n.useLocation(),m=v.default.useMemo(function(){if(!h){var t=new x.default(f);if(void 0!==c||!1===r.SuperTokens.usesDynamicLoginMethods){var n=re.getMatchingComponentForRouteAndRecipeIdFromPreBuiltUIList(t,e.preBuiltUIList,!1,c);return void 0===n&&!0===r.SuperTokens.usesDynamicLoginMethods&&ye({navigate:d,redirectBack:!1}),n}}},[f,p,c,e.preBuiltUIList]);return s.useEffect(function(){c||r.Multitenancy.getInstanceOrThrow().getCurrentDynamicLoginMethods({userContext:i}).then(function(e){return u(e)},function(e){return o(e)})},[c,u]),h?a.jsx(Q,{preBuiltUIList:e.preBuiltUIList,navigate:d,useSignUpStateFromQueryString:!0}):r.SuperTokens.usesDynamicLoginMethods&&void 0===c?a.jsx(S,{}):void 0===m||void 0===c&&r.SuperTokens.usesDynamicLoginMethods?null:a.jsx(m.component,{navigate:d})}function se(e,t){var n=t;if(void 0!==e){if(!n.startsWith(e))throw new Error("basePath has to be a prefix of websiteBasePath passed to SuperTokens.init");(n=n.slice(e.length)).startsWith("/")||(n="/"+n)}return n}function ie(e,t){if(void 0!==e){if(!t.startsWith(e))throw new Error("basePath has to be a prefix of websiteBasePath passed to SuperTokens.init");(t=t.slice(e.length)).startsWith("/")||(t="/"+t)}return t}var oe=function(){function e(){}return e.getSuperTokensRoutesForReactRouterDom=function(t,n,s){if(void 0===n&&(n=[]),void 0===t||0===n.length)throw new Error('Please use getSuperTokensRoutesForReactRouterDom like getSuperTokensRoutesForReactRouterDom(require("react-router-dom"), [EmailPasswordPreBuiltUI]) in your render function');var i=n.map(function(e){return e.getInstanceOrInitAndGetInstance()});if(void 0===e.reactRouterDomIsV6&&(e.reactRouterDomIsV6=void 0===t.withRouter),e.reactRouterDomIsV6){if(void 0===e.reactRouterDom){e.reactRouterDom={router:t,useHistoryCustom:function(){var e=t.useNavigate(),n=v.default.useState(void 0),r=n[0],a=n[1];return v.default.useEffect(function(){void 0!==r&&(a(void 0),e(r))},[r,e,a]),a},useLocation:t.useLocation}}return function(e){var t=e.getReactRouterDomWithCustomHistory,n=e.recipeList,s=e.basePath,i=t();if(void 0===i)return[];var o=i.router.Route,l=Object.values(n.reduce(function(e,r){var i=r.getPathsToFeatureComponentWithRecipeIdMap();
2return Object.keys(i).forEach(function(r){var i=ie(s,r=""===r?"/":r);r in e||(e[r]=a.jsx(o,{path:i,element:a.jsx(ae,{getReactRouterDomWithCustomHistory:t,preBuiltUIList:n,path:r})},"st-".concat(r)))}),e},{}));if(!r.SuperTokens.getInstanceOrThrow().disableAuthRoute&&n.some(function(e){return 0!==e.getAuthComponents().length})){var c=r.SuperTokens.getInstanceOrThrow().appInfo.websiteBasePath.appendPath(new y.default("/")).getAsStringDangerous();l.push(a.jsx(o,{path:ie(s,c),element:a.jsx(ae,{getReactRouterDomWithCustomHistory:t,preBuiltUIList:n,path:c})},"st-/auth"))}return l}({getReactRouterDomWithCustomHistory:e.getReactRouterDomWithCustomHistory,recipeList:i,basePath:s})}return void 0===e.reactRouterDom&&(e.reactRouterDom={router:t,useHistoryCustom:t.useHistory,useLocation:t.useLocation}),function(e){var t=e.getReactRouterDomWithCustomHistory,n=e.recipeList,s=e.basePath,i=t();if(void 0===i)return[];var o=i.router.Route,l=Object.values(n.reduce(function(e,i){var l=i.getPathsToFeatureComponentWithRecipeIdMap();return Object.keys(l).forEach(function(i){var l=se(s,i=""===i?"/":i);i in e||(e[i]=a.jsx(o,r.__assign({exact:!0,path:l},{children:a.jsx(ae,{getReactRouterDomWithCustomHistory:t,preBuiltUIList:n,path:i})}),"st-".concat(i)))}),e},{}));if(!r.SuperTokens.getInstanceOrThrow().disableAuthRoute&&n.some(function(e){return 0!==e.getAuthComponents().length})){var c=r.SuperTokens.getInstanceOrThrow().appInfo.websiteBasePath.appendPath(new y.default("/")).getAsStringDangerous();l.push(a.jsx(o,r.__assign({exact:!0,path:se(s,c)},{children:a.jsx(ae,{getReactRouterDomWithCustomHistory:t,preBuiltUIList:n,path:c})}),"st-/auth"))}return l}({getReactRouterDomWithCustomHistory:e.getReactRouterDomWithCustomHistory,recipeList:i,basePath:s})},e.canHandleRoute=function(e){var t=e.map(function(e){return e.getInstanceOrInitAndGetInstance()});return r.getCurrentNormalisedUrlPath().getAsStringDangerous()===r.SuperTokens.getInstanceOrThrow().appInfo.websiteBasePath.getAsStringDangerous()?!r.SuperTokens.getInstanceOrThrow().disableAuthRoute:void 0!==re.getMatchingComponentForRouteAndRecipeIdFromPreBuiltUIList(r.getCurrentNormalisedUrlPath(),t,!0)},e.getRoutingComponent=function(t){var n=t.map(function(e){return e.getInstanceOrInitAndGetInstance()});return a.jsx(ae,{getReactRouterDomWithCustomHistory:e.getReactRouterDomWithCustomHistory,path:r.getCurrentNormalisedUrlPath().getAsStringDangerous(),preBuiltUIList:n})},e.getReactRouterDomWithCustomHistory=function(){return e.reactRouterDom},e.AuthPage=function(e){return a.jsx(Q,r.__assign({},e,{preBuiltUIList:e.preBuiltUIList.map(function(e){return e.getInstanceOrInitAndGetInstance()})}))},e.AuthPageTheme=Z,e.AuthPageFooter=$,e.AuthPageHeader=K,e.AuthPageComponentList=V,e.AuthRecipeComponentsOverrideContextProvider=H,e}(),le=oe.getSuperTokensRoutesForReactRouterDom,ce=oe.canHandleRoute,ue=oe.getRoutingComponent,de=oe.AuthPage,fe=function(e){var t,n=e.children,i=r.__rest(e,["children"]),o=s.useRef(i.requireAuth);if(i.requireAuth!==o.current)throw new Error('requireAuth prop should not change. If you are seeing this, it probably means that you are using SessionAuth in multiple routes with different values for requireAuth. To solve this, try adding the "key" prop to all uses of SessionAuth like <SessionAuth key="someUniqueKeyPerRoute" requireAuth={...}>');var l,c=s.useState({loading:!0}),u=c[0],d=c[1],h=s.useCallback(function(e){d(function(t){return JSON.stringify(t)!==JSON.stringify(e)?e:t})},[d]),p=s.useRef(),m=s.useRef(null===(t=oe.getReactRouterDomWithCustomHistory())||void 0===t?void 0:t.useHistoryCustom);try{m.current&&(l=m.current())}catch(w){}var g=I(),v=r.useRethrowInRender(),x=s.useCallback(function(){r.SuperTokens.getInstanceOrThrow().redirectToAuth({navigate:l,userContext:g,redirectBack:!0})},[]),y=s.useCallback(function(){return r.__awaiter(void 0,void 0,void 0,function(){var e,t,n,a;return r.__generator(this,function(r){switch(r.label){case 0:return void 0===p.current&&(p.current=f.Session.getInstanceOrThrow()),[4,p.current.doesSessionExist({userContext:g})];case 1:if(!1===r.sent())return[2,{loading:!1,doesSessionExist:!1,accessTokenPayload:{},invalidClaims:[],userId:""}];r.label=2;case 2:return r.trys.push([2,4,,6]),[4,p.current.validateClaims({overrideGlobalClaimValidators:i.overrideGlobalClaimValidators,userContext:g})];case 3:return e=r.sent(),[3,6];case 4:return t=r.sent(),[4,p.current.doesSessionExist({userContext:g})];case 5:if(r.sent())throw t;return[2,{loading:!1,doesSessionExist:!1,accessTokenPayload:{},invalidClaims:[],userId:""}];case 6:return r.trys.push([6,9,,11]),a={loading:!1,doesSessionExist:!0,invalidClaims:e},[4,p.current.getAccessTokenPayloadSecurely({userContext:g})];case 7:return a.accessTokenPayload=r.sent(),[4,p.current.getUserId({userContext:g})];case 8:return[2,(a.userId=r.sent(),a)];case 9:return n=r.sent(),[4,p.current.doesSessionExist({userContext:g})];case 10:if(r.sent())throw n;return[2,{loading:!1,doesSessionExist:!1,accessTokenPayload:{},invalidClaims:[],userId:""}];case 11:return[2]}})})},[]),b=s.useCallback(function(e){return r.__awaiter(void 0,void 0,void 0,function(){var t,n;return r.__generator(this,function(a){switch(a.label){case 0:if(!1===u.loading)return[2];if(!1===i.doRedirection)return[3,8];if(!e.doesSessionExist&&!1!==i.requireAuth)return x(),[2];if(0===e.invalidClaims.length)return[3,8];t=void 0,a.label=1;case 1:return a.trys.push([1,6,,7]),[4,f.getFailureRedirectionInfo({invalidClaims:e.invalidClaims,overrideGlobalClaimValidators:i.overrideGlobalClaimValidators,userContext:g})];case 2:return void 0===(t=a.sent()).redirectPath?[3,5]:f.validateAndCompareOnFailureRedirectionURLToCurrent(t.redirectPath)?(h(e),[2]):[3,3];case 3:return[4,r.SuperTokens.getInstanceOrThrow().redirectToUrl(t.redirectPath,l)];case 4:return[2,a.sent()];case 5:return[3,7];case 6:throw n=a.sent(),v(n),n;case 7:if(void 0!==i.accessDeniedScreen&&void 0!==t.failedClaim)return console.warn({message:"Showing access denied 
2screen because a claim validator failed",claimValidationError:t.failedClaim}),[2,h(r.__assign(r.__assign({},e),{accessDeniedValidatorError:t.failedClaim}))];a.label=8;case 8:return h(e),[2]}})})},[u.loading,i.doRedirection,i.requireAuth,i.overrideGlobalClaimValidators,i.accessDeniedScreen,x,g,l]);return r.useOnMountAPICall(y,b),s.useEffect(function(){if(void 0===p.current&&(p.current=f.Session.getInstanceOrThrow()),!1===u.loading)return p.current.addEventListener(function(e){return r.__awaiter(this,void 0,void 0,function(){var t,n,a;return r.__generator(this,function(s){switch(s.label){case 0:switch(e.action){case"SESSION_CREATED":case"REFRESH_SESSION":case"ACCESS_TOKEN_PAYLOAD_UPDATED":case"API_INVALID_CLAIM":return[3,1];case"SIGN_OUT":return[3,11];case"UNAUTHORISED":return[3,12]}return[3,13];case 1:return[4,p.current.validateClaims({overrideGlobalClaimValidators:i.overrideGlobalClaimValidators,userContext:g})];case 2:if(t=s.sent(),!1===i.doRedirection)return[3,10];n=void 0,s.label=3;case 3:return s.trys.push([3,8,,9]),[4,f.getFailureRedirectionInfo({invalidClaims:t,overrideGlobalClaimValidators:i.overrideGlobalClaimValidators,userContext:g})];case 4:return(n=s.sent()).redirectPath?f.validateAndCompareOnFailureRedirectionURLToCurrent(n.redirectPath)?(h(r.__assign(r.__assign({},e.sessionContext),{loading:!1,invalidClaims:t})),[3,7]):[3,5]:[3,7];case 5:return[4,r.SuperTokens.getInstanceOrThrow().redirectToUrl(n.redirectPath,l)];case 6:return[2,s.sent()];case 7:return[3,9];case 8:throw a=s.sent(),v(a),a;case 9:if(void 0!==i.accessDeniedScreen&&void 0!==n.failedClaim)return console.warn({message:"Showing access denied screen because a claim validator failed",claimValidationError:n.failedClaim}),[2,h(r.__assign(r.__assign({},e.sessionContext),{loading:!1,invalidClaims:t,accessDeniedValidatorError:n.failedClaim}))];s.label=10;case 10:return h(r.__assign(r.__assign({},e.sessionContext),{loading:!1,invalidClaims:t})),[2];case 11:return h(r.__assign(r.__assign({},e.sessionContext),{loading:!1,invalidClaims:[]})),[2];case 12:return h(r.__assign(r.__assign({},e.sessionContext),{loading:!1,invalidClaims:[]})),void 0!==i.onSessionExpired?i.onSessionExpired():!1!==i.requireAuth&&!1!==i.doRedirection&&x(),[2];case 13:return[2]}})})})},[i,h,u.loading,g,l,x]),!1===i.requireAuth||!u.loading&&u.doesSessionExist?!u.loading&&u.accessDeniedValidatorError&&i.accessDeniedScreen?a.jsx(i.accessDeniedScreen,{userContext:g,navigate:l,validationError:u.accessDeniedValidatorError}):a.jsx(M.Provider,r.__assign({value:u},{children:n})):null},he=function(e){return a.jsx(B,r.__assign({userContext:e.userContext},{children:a.jsx(fe,r.__assign({},e))}))},pe=function(e){return a.jsx(he,r.__assign({},e,{requireAuth:!1,doRedirection:!1}))},me=function(){function e(){}var t;return e.init=function(e){r.SuperTokens.init(e)},e.changeLanguage=function(e){return r.SuperTokens.getInstanceOrThrow().changeLanguage(e)},e.loadTranslation=function(e){return r.SuperTokens.getInstanceOrThrow().loadTranslation(e)},t=e,e.SuperTokensWrapper=pe,e.redirectToAuth=function(e){return r.__awaiter(void 0,void 0,void 0,function(){var n;return r.__generator(t,function(t){return[2,r.SuperTokens.getInstanceOrThrow().redirectToAuth(r.__assign(r.__assign({},e),{redirectBack:null===(n=null===e||void 0===e?void 0:e.redirectBack)||void 0===n||n,userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)}))]})})},e.useTranslation=o.useTranslation,e.useUserContext=I,e}(),ge=me.init,ve=me.changeLanguage,xe=me.loadTranslation,ye=me.redirectToAuth;t.AuthPage=de,t.AuthPageComponentList=V,t.AuthPageFooter=$,t.AuthPageHeader=K,t.AuthPageTheme=Z,t.BackButton=Y,t.ComponentOverrideContext=b,t.DynamicLoginMethodsSpinner=S,t.FeatureWrapper=function(e){var t=e.children,n=e.useShadowDom,i=e.defaultStore,l=I(),c=r.useRethrowInRender(),u=s.useState(void 0),d=u[0],f=u[1],h=r.SuperTokens.getInstanceOrThrow();return s.useEffect(function(){d||r.Multitenancy.getInstanceOrThrow().getCurrentDynamicLoginMethods({userContext:l}).then(function(e){return f(e)},function(e){return c(e)})},[d,f]),r.SuperTokens.usesDynamicLoginMethods&&!d?a.jsx(S,{}):a.jsx(E,r.__assign({value:d},{children:a.jsx(o.TranslationContextProvider,r.__assign({defaultLanguage:h.languageTranslations.defaultLanguage,defaultStore:r.mergeObjects(i,h.languageTranslations.userTranslationStore),translationControlEventSource:h.languageTranslations.translationEventSource,userTranslationFunc:h.languageTranslations.userTranslationFunc},{children:a.jsx(O,r.__assign({useShadowDom:n},{children:t}))}))}))},t.GeneralError=W,t.Provider=H,t.RecipeRouter=re,t.SessionAuthWrapper=he,t.SessionContext=M,t.SpinnerIcon=w,t.SuperTokensAPIWrapper=me,t.SuperTokensBranding=z,t.SuperTokensWrapper=pe,t.UI=oe,t.UserContextContext=T,t.UserContextWrapper=B,t.canHandleRoute=ce,t.changeLanguage=ve,t.defaultTranslationsCommon=D,t.getRoutingComponent=ue,t.getSuperTokensRoutesForReactRouterDom=le,t.init=ge,t.loadTranslation=xe,t.redirectToAuth=ye,t.useDynamicLoginMethods=function(){var e=v.default.useContext(C);if(void 0===e)throw new Error("useDynamicLoginMethods used outside of a valid provider (FeatureWrapper)");return e},t.useSessionContext=F,t.useUserContext=I,t.withOverride=_},3633(e,t,n){"use strict";var r=n(660),a=n(5946),s=n(763),i=n(9135),o=n(6032),l=n(9927);
2function c(e){return e&&e.__esModule?e:{default:e}}var u=c(a);var d=function(e){var t=e.invalidClaims,n=e.overrideGlobalClaimValidators,a=e.userContext;return r.__awaiter(void 0,void 0,void 0,function(){var e,s,i,l,c,u,d;return r.__generator(this,function(f){switch(f.label){case 0:e=o.getGlobalClaimValidators({overrideGlobalClaimValidators:n,userContext:a}),s=void 0,i=function(e){var n,i,o;return r.__generator(this,function(r){switch(r.label){case 0:return void 0===(n=t.find(function(t){return t.id===e.id}))?[3,2]:(i=e.onFailureRedirection)?[4,i({reason:n.reason,userContext:a})]:[3,2];case 1:if(void 0!==(o=r.sent()))return[2,{value:{redirectPath:o,failedClaim:n}}];r.label=2;case 2:return!1!==e.showAccessDeniedOnFailure&&void 0===s&&(s=n),[2]}})},l=0,c=e,f.label=1;case 1:return l<c.length?(u=c[l],[5,i(u)]):[3,4];case 2:if("object"===typeof(d=f.sent()))return[2,d.value];f.label=3;case 3:return l++,[3,1];case 4:return[2,{redirectPath:void 0,failedClaim:s}]}})})};function f(e){var t,n=l.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHref();try{new URL(e),t=e}catch(s){if(!e.startsWith("/"))throw new Error("onFailureRedirectionURL returned a relative url: ".concat(e));var a=r.SuperTokens.getInstanceOrThrow().appInfo;t="".concat(a.websiteDomain.getAsStringDangerous()).concat(e)}return n===t}var h=function(e){function t(n,a){void 0===a&&(a=u.default);var i=e.call(this,n)||this;return i.webJSRecipe=a,i.recipeID=t.RECIPE_ID,i.eventListeners=new Set,i.getUserId=function(e){return i.webJSRecipe.getUserId(e)},i.getAccessToken=function(e){return i.webJSRecipe.getAccessToken(e)},i.getClaimValue=function(e){return i.webJSRecipe.getClaimValue(e)},i.getAccessTokenPayloadSecurely=function(e){return r.__awaiter(i,void 0,void 0,function(){return r.__generator(this,function(t){return[2,this.webJSRecipe.getAccessTokenPayloadSecurely(e)]})})},i.doesSessionExist=function(e){return i.webJSRecipe.doesSessionExist(e)},i.signOut=function(e){return i.webJSRecipe.signOut(e)},i.attemptRefreshingSession=function(){return r.__awaiter(i,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.webJSRecipe.attemptRefreshingSession()]})})},i.validateClaims=function(e){return i.webJSRecipe.validateClaims(e)},i.getInvalidClaimsFromResponse=function(e){return i.webJSRecipe.getInvalidClaimsFromResponse(e)},i.addEventListener=function(e){return i.eventListeners.add(e),function(){return i.eventListeners.delete(e)}},i.validateGlobalClaimsAndHandleSuccessRedirection=function(e,t,n,a,o){return r.__awaiter(i,void 0,void 0,function(){var i,l,c,u,h;return r.__generator(this,function(p){switch(p.label){case 0:return a=r.getNormalisedUserContext(a),[4,this.doesSessionExist({userContext:a})];case 1:return p.sent()?[4,this.validateClaims({userContext:a})]:[2,r.SuperTokens.getInstanceOrThrow().redirectToAuth({navigate:o,redirectBack:!1,userContext:a})];case 2:return(i=p.sent()).length>0?void 0===e?[3,4]:(l=JSON.stringify({successRedirectContext:e,redirectToPath:n}),[4,r.setLocalStorage("supertokens-success-redirection-context",l)]):[3,6];case 3:p.sent(),p.label=4;case 4:return[4,d({invalidClaims:i,userContext:a})];case 5:if(void 0!==(c=p.sent()).redirectPath){if(f(c.redirectPath))throw new Error("onFailureRedirectionURL returned the current URL (".concat(c.redirectPath,") during success redirection. This indicates that the user is in a stuck state."));return[2,r.SuperTokens.getInstanceOrThrow().redirectToUrl(c.redirectPath,o)]}p.label=6;case 6:return void 0!==e?[3,13]:[4,r.getLocalStorage("supertokens-success-redirection-context")];case 7:if(null===(u=p.sent()))return[3,12];p.label=8;case 8:return p.trys.push([8,,9,11]),h=JSON.parse(u),e=h.successRedirectContext,void 0===n&&(n=h.redirectToPath),[3,11];case 9:return[4,r.removeFromLocalStorage("supertokens-success-redirection-context")];case 10:return p.sent(),[7];case 11:return[3,13];case 12:e={recipeId:t,action:"SUCCESS",createdNewUser:!1,isNewRecipeUser:!1,newSessionCreated:!1,tenantIdFromQueryParams:r.getTenantIdFromQueryParams()},p.label=13;case 13:if(void 0===e)throw new Error("This should never happen: successRedirectContext undefined ");return"SUCCESS_OAUTH2"===e.action?[2,s.OAuth2Provider.getInstanceOrThrow().redirect(e,o,{},a)]:("SUCCESS"===e.action&&void 0!==n&&(e.redirectToPath=n),[2,r.SuperTokens.getInstanceOrThrow().redirect(e,o,{},a)])}})})},i.getDefaultRedirectionURL=function(){return r.__awaiter(i,void 0,void 0,function(){return r.__generator(this,function(e){return[2,"/"]})})},i.notifyListeners=function(e){return r.__awaiter(i,void 0,void 0,function(){var t;return r.__generator(this,function(n){switch(n.label){case 0:return[4,this.get
2SessionContext(e)];case 1:return t=n.sent(),Array.from(this.eventListeners).forEach(function(n){return n(r.__assign({sessionContext:t},e))}),[2]}})})},i}return r.__extends(t,e),t.prototype.getSessionContext=function(e){var t=e.action,n=e.userContext;return r.__awaiter(this,void 0,void 0,function(){var e,a;return r.__generator(this,function(r){switch(r.label){case 0:return"SESSION_CREATED"!==t&&"REFRESH_SESSION"!==t&&"API_INVALID_CLAIM"!==t&&"ACCESS_TOKEN_PAYLOAD_UPDATED"!==t?[3,2]:[4,Promise.all([this.getUserId({userContext:n}),this.getAccessTokenPayloadSecurely({userContext:n})])];case 1:return e=r.sent(),a=e[0],[2,{doesSessionExist:!0,accessTokenPayload:e[1],userId:a}];case 2:if("SIGN_OUT"===t||"UNAUTHORISED"===t)return[2,{doesSessionExist:!1,accessTokenPayload:{},userId:""}];throw new Error("Unhandled recipe event: ".concat(t))}})})},t.addAxiosInterceptors=function(e,t){return u.default.addAxiosInterceptors(e,t)},t.init=function(e){var n=this,a=function(e){var t,n,a;void 0===e&&(e={});var s={style:null!==(n=null===(t=e.accessDeniedScreen)||void 0===t?void 0:t.style)&&void 0!==n?n:""},i=r.__assign({functions:function(e){return e}},e.override);return r.__assign(r.__assign({},r.normaliseRecipeModuleConfig(e)),{invalidClaimStatusCode:null!==(a=e.invalidClaimStatusCode)&&void 0!==a?a:403,accessDeniedScreen:s,override:i})}(e);return{recipeID:t.RECIPE_ID,authReact:function(e){return t.instance=new t(r.__assign(r.__assign({},a),{appInfo:e,recipeId:t.RECIPE_ID})),t.instance},webJS:u.default.init(r.__assign(r.__assign({},a),{onHandleEvent:function(e){void 0!==a.onHandleEvent&&a.onHandleEvent(e),t.getInstanceOrThrow().notifyListeners(e)},preAPIHook:function(e){return r.__awaiter(n,void 0,void 0,function(){var n;return r.__generator(this,function(s){return n=r.__assign(r.__assign({},e),{requestInit:r.__assign(r.__assign({},e.requestInit),{headers:r.__assign(r.__assign({},e.requestInit.headers),{rid:t.RECIPE_ID})})}),void 0===a.preAPIHook?[2,n]:[2,a.preAPIHook(e)]})})}}))}},t.getInstanceOrThrow=function(){if(void 0===t.instance)throw Error("No instance of Session found. Make sure to call the Session.init method. See https://supertokens.io/docs/emailpassword/quick-setup/frontend");return t.instance},t.getInstance=function(){return t.instance},t.reset=function(){r.isTest()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(i.RecipeModule);t.FactorIds={EMAILPASSWORD:"emailpassword",OTP_EMAIL:"otp-email",OTP_PHONE:"otp-phone",LINK_EMAIL:"link-email",LINK_PHONE:"link-phone",THIRDPARTY:"thirdparty",TOTP:"totp",WEBAUTHN:"webauthn"},t.Session=h,t.getFailureRedirectionInfo=d,t.validateAndCompareOnFailureRedirectionURLToCurrent=f},9675(e,t,n){"use strict";var r=n(660),a=n(54),s=n(6032),i=n(9801),o=n(4257),l=n(9927),c=n(9135),u=n(3633);function d(e){return e&&e.__esModule?e:{default:e}}var f=d(a),h="/mfa",p="st-mfa-info-cache",m=void 0,g=function(e,t,n){var s=this;this.webJSClaim=new a.MultiFactorAuthClaimClass(function(){return e().webJSRecipe}),this.refresh=this.webJSClaim.refresh,this.getLastFetchedTime=this.webJSClaim.getLastFetchedTime,this.getValueFromPayload=this.webJSClaim.getValueFromPayload,this.id=this.webJSClaim.id;var i=function(n){var a=n.reason,i=n.userContext;return r.__awaiter(s,void 0,void 0,function(){var n,s,o,l;return r.__generator(this,function(c){switch(c.label){case 0:return n=e(),void 0===(s=a.oneOf||a.allOfInAnyOrder||(void 0!==a.factorId?[a.factorId]:void 0))?[3,1]:(r.logDebugMessage("Redirecting to MFA on next array from validation failure: "+s.join(", ")),1===(l=n.getSecondaryFactors(i).filter(function(e){return s.factors.next.includes(e.id)}).map(function(e){return e.id})).length?[2,t({action:"GO_TO_FACTOR",factorId:l[0]},i)]:[2,t({action:"FACTOR_CHOOSER",nextFactorOptions:s},i)]);case 1:return[4,n.webJSRecipe.resyncSessionAndFetchMFAInfo({userContext:i})];case 2:return o=c.sent(),l=n.getSecondaryFactors(i).filter(function(e){return o.factors.next.includes(e.id)}).map(function(e){return e.id}),r.logDebugMessage("Redirecting to MFA on next array from backend: "+l.join(", ")),1===l.length?[2,t({action:"GO_TO_FACTOR",factorId:l[0]},i)]:[2,t({action:"FACTOR_CHOOSER"},i)];case 3:return[2,void 0]}})})};this.validators=r.__assign(r.__assign({},this.webJSClaim.validators),{hasCompletedMFARequirementsForAuth:function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);var a=s.webJSClaim.validators.hasCompletedMFARequirementsForAuth();return r.__assign(r.__assign({},a),{showAccessDeniedOnFailure:t,onFailureRedirection:null!==n&&void 0!==n?n:function(t){var n=t.reason,r=t.userContext;return e?i({reason:n,userContext:r}):void 0}})},hasCompletedFactors:function(e,t,a){void 0===t&&(t=!0),void 0===a&&(a=!0);var o=s.webJSClaim.validators.hasCompletedFactors(e);return r.__assign(r.__assign({},o),{showAccessDeniedOnFailure:a,onFailureRedirection:null!==n&&void 0!==n?n:function(e){var n=e.reason,r=e.userContext;return t?i({reason:n,userContext:r}):void 0}})}})};var v=function(e){function t(n,a){void 0===a&&(a=f.default);var s=e.call(this,n)||this;return s.webJSRecipe=a,s.recipeID=t.RECIPE_ID,s.secondaryFactors=[],s.getDefaultRedirectionURL=function(e,t){return r.__awaiter(s,void 0,void 0,function(){var n,a;return r.__generator(this,function(s){if("FACTOR_CHOOSER"===e.action)return n=e.nextFactorOptions&&e.nextFactorOptions.length>0?e.nextFactorOptions.join(","):void 0,[2,r.getDefaultRedirectionURLForPath(this.config,h,e,{n:n,stepUp:e.stepUp?"true":void 0})];if("GO_TO_FACTOR"===e.action){if(void 0!==(a=this.getSecondaryFactors(t).find(function(t){return t.id===e.factorId})))return[2,r.getDefaultRedirectionURLForPath(this.config,a.path,e,{setup:e.forceSetup?"true":void 0,stepUp:e.stepUp?"true":void 0})];throw new Error("Requested redirect to unknown factor id: "+e.factorId)}return[2,"/"]})})}
2,i.PostSuperTokensInitCallbacks.addPostInitCallback(function(){var e=t.MultiFactorAuthClaim.validators.hasCompletedMFARequirementsForAuth();o.SessionClaimValidatorStore.addClaimValidatorFromOtherRecipe(e),u.Session.getInstanceOrThrow().addEventListener(function(){l.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.removeItemSync(p)})}),s}var n;return r.__extends(t,e),t.init=function(e){var n=function(e){var t;void 0===e&&(e={});var n=!0===e.disableDefaultUI,a=r.__assign({functions:function(e){return e}},e.override);return r.__assign(r.__assign({},r.normaliseRecipeModuleConfig(e)),{disableDefaultUI:n,firstFactors:null===e||void 0===e?void 0:e.firstFactors,getSecondaryFactorInfo:function(e){return e},factorChooserScreen:null!==(t=e.factorChooserScreen)&&void 0!==t?t:{},override:a})}(e);return{recipeID:t.RECIPE_ID,authReact:function(e){return t.instance=new t(r.__assign(r.__assign({},n),{appInfo:e,recipeId:t.RECIPE_ID})),t.instance},webJS:f.default.init(r.__assign(r.__assign({},n),{override:{functions:function(e,t){var a=(n.onHandleEvent,function(e){return r.__assign(r.__assign({},e),{resyncSessionAndFetchMFAInfo:function(t){return r.__awaiter(this,void 0,void 0,function(){var n,a,s,i,o,c;return r.__generator(this,function(u){switch(u.label){case 0:return n=l.WindowHandlerReference.getReferenceOrThrow(),[4,m];case 1:return u.sent(),[4,n.windowHandler.sessionStorage.getItem(p)];case 2:if(null!==(a=u.sent())&&(o=JSON.parse(a)).t>Date.now()-1e3)return[2,r.__assign(r.__assign({},o.v),{fetchResponse:new Response(null,{status:304})})];u.label=3;case 3:return void 0===m?[3,5]:[4,m];case 4:return u.sent(),[3,3];case 5:m=new Promise(function(e){return s=e}),u.label=6;case 6:return u.trys.push([6,,11,12]),[4,n.windowHandler.sessionStorage.getItem(p)];case 7:return null!==(i=u.sent())&&(o=JSON.parse(i)).t>Date.now()-1e3?[2,r.__assign(r.__assign({},o.v),{fetchResponse:new Response(null,{status:304})})]:[4,e.resyncSessionAndFetchMFAInfo(t)];case 8:return"OK"!==(c=u.sent()).status?[3,10]:[4,n.windowHandler.sessionStorage.setItem(p,JSON.stringify({t:Date.now(),v:{emails:c.emails,phoneNumbers:c.phoneNumbers,factors:c.factors,status:c.status}}))];case 9:u.sent(),u.label=10;case 10:return[2,c];case 11:return m=void 0,s(),[7];case 12:return[2]}})})}})});return t.override(a),t.override(n.override.functions),e}}}))}},t.getInstance=function(){return t.instance},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of MultiFactorAuth found. Make sure to call the MultiFactorAuth.init method.";throw"undefined"===typeof window&&(e+=r.SSR_ERROR),Error(e)}return t.instance},t.prototype.addMFAFactors=function(e){this.secondaryFactors=r.__spreadArray(r.__spreadArray([],this.secondaryFactors.filter(function(t){return e.every(function(e){return t.id!==e.id})}),!0),e,!0)},t.prototype.isFirstFactorEnabledOnClient=function(e){return void 0===this.config.firstFactors||this.config.firstFactors.includes(e)},t.prototype.getSecondaryFactors=function(e){return this.config.getSecondaryFactorInfo(this.secondaryFactors,e)},t.prototype.redirectToFactor=function(e){var t=e.factorId,n=e.forceSetup,a=e.stepUp,i=e.redirectBack,o=e.navigate,l=e.userContext;return r.__awaiter(this,void 0,void 0,function(){var e,c;return r.__generator(this,function(u){switch(u.label){case 0:return[4,this.getRedirectUrl({action:"GO_TO_FACTOR",forceSetup:n,stepUp:a,factorId:t,tenantIdFromQueryParams:r.getTenantIdFromQueryParams()},s.getNormalisedUserContext(l))];case 1:return null===(e=u.sent())?[2]:(i?(c=r.getCurrentNormalisedUrlPathWithQueryParamsAndFragments(),e=r.appendQueryParamsToURL(e,{redirectToPath:c})):(c=r.getRedirectToPathFromURL())&&(e=r.appendQueryParamsToURL(e,{redirectToPath:c})),[2,r.SuperTokens.getInstanceOrThrow().redirectToUrl(e,o)])}})})},t.prototype.redirectToFactorChooser=function(e){var t=e.redirectBack,n=void 0!==t&&t,a=e.nextFactorOptions,i=void 0===a?[]:a,o=e.stepUp,l=e.navigate,c=e.userContext;return r.__awaiter(this,void 0,void 0,function(){var e,t;return r.__generator(this,function(a){switch(a.label){case 0:return[4,this.getRedirectUrl({action:"FACTOR_CHOOSER",nextFactorOptions:i,stepUp:o,tenantIdFromQueryParams:r.getTenantIdFromQueryParams()},s.getNormalisedUserContext(c))];case 1:return null===(e=a.sent())?[2]:(n?(t=r.getCurrentNormalisedUrlPathWithQueryParamsAndFragments(),e=r.appendQueryParamsToURL(e,{redirectToPath:t})):(t=r.getRedirectToPathFromURL())&&(e=r.appendQueryParamsToURL(e,{redirectToPath:t})),[2,r.SuperTokens.getInstanceOrThrow().redirectToUrl(e,l)])}})})},t.reset=function(){r.isTest()&&(t.instance=void 0)},n=t,t.RECIPE_ID="multifactorauth",t.MultiFactorAuthClaim=new g(function(){return t.getInstanceOrThrow()},function(e,t){return r.__awaiter(void 0,void 0,void 0,function(){return r.__generator(n,function(n){switch(n.label){case 0:return[4,this.getInstanceOrThrow().getRedirectUrl(r.__assign(r.__assign({},e),{tenantIdFromQueryParams:r.getTenantIdFromQueryParams()}),t)];case 1:return[2,n.sent()||void 0]}})})}),t}(c.RecipeModule);t.DEFAULT_FACTOR_CHOOSER_PATH=h,t.MultiFactorAuth=v,t.getAvailableFactors=function(e,t,n,a){r.logDebugMessage("getAvailableFactors: allowed to setup: ".concat(e.allowedToSetup)),r.logDebugMessage("getAvailableFactors: already setup: ".concat(e.alreadySetup)),r.logDebugMessage("getAvailableFactors: next from factorInfo: ".concat(e.next)),r.logDebugMessage("getAvailableFactors: nextArrayQueryParam: ".concat(t)),r.logDebugMessage("getAvailableFactors: secondary factors: ".concat(n.getSecondaryFactors(a).map(function(e){return e.id})));var s=void 0!==t?t.split(","):e.next;return n.getSecondaryFactors(a).filter(function(t){var n=t.id;return 0===s.length?e.allowedToSetup.includes(n)||e.alreadySetup.includes(n):s.includes(n)})}},1464(e,t,n){"use strict";var r=n(660).createGenericComponentsOverrideContext(),a=r[0],s=r[1];t.Provider=s,t.useContext=a},4900(e,t,n){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0});var r=n(8033),a=n(1464),s=n(660);n(2086),n(3921),n(9801),n(9927),n(6032),n(5043),n(7691),n(5547),n(3892),n(579);var i=function(){function e(){}return e.init=function(e){return s.Multitenancy.init(e)},e.AllowedDomainsClaim=r.AllowedDomainsClaim,e.ComponentsOverrideProvider=a.Provider,e}(),o=i.init,l=i.ComponentsOverrideProvider;Object.defineProperty(t,"AllowedDomainsClaim",{enumerable:!0,get:function(){return r.AllowedDomainsClaim}}),t.MultitenancyComponentsOverrideProvider=l,t.default=i,t.init=o},763(e,t,n){"use strict";var r=n(660),a=n(9040),s=n(9135);function i(e){return e&&e.__esModule?e:{default:e}}var o=i(a);var l=function(e){function t(n,r){void 0===r&&(r=o.default);var a=e.call(this,n)||this;return a.webJSRecipe=r,a.recipeID=t.RECIPE_ID,a}return r.__extends(t,e),t.init=function(e){var n=function(e){var t;return r.__assign(r.__assign({},r.normaliseRecipeModuleConfig(e)),{disableDefaultUI:null!==(t=null===e||void 0===e?void 0:e.disableDefaultUI)&&void 0!==t&&t,tryRefreshPage:r.__assign({disableDefaultUI:!1},null===e||void 0===e?void 0:e.tryRefreshPage),oauth2LogoutScreen:r.__assign({disableDefaultUI:!1,style:""},null===e||void 0===e?void 0:e.oauth2LogoutScreen),override:r.__assign({functions:function(e){return e}},null===e||void 0===e?void 0:e.override)})}(e);return{recipeID:t.RECIPE_ID,authReact:function(e){return t.instance=new t(r.__assign(r.__assign({},n),{appInfo:e,recipeId:t.RECIPE_ID})),t.instance},webJS:o.default.init(r.__assign(r.__assign({},n),{override:{functions:function(e,t){var a,s=(a=n.onHandleEvent,function(e){return r.__assign(r.__assign({},e),{getLoginChallengeInfo:function(t){return r.__awaiter(this,void 0,void 0,function(){var n;return r.__generator(this,function(r){switch(r.label){case 0:return[4,e.getLoginChallengeInfo(t)];case 1:return n=r.sent(),a({action:"LOADED_LOGIN_CHALLENGE",loginChallenge:t.loginChallenge,loginInfo:n.info,userContext:t.userContext}),[2,n]}})})},logOut:function(t){return r.__awaiter(this,void 0,void 0,function(){var n;return r.__generator(this,function(r){switch(r.label){case 0:return[4,e.logOut(t)];case 1:return n=r.sent(),a({action:"OAUTH2_LOGOUT_SUCCESS",frontendRedirectTo:n.frontendRedirectTo,userContext:t.userContext}),[2,n]}})})}})});return t.override(s),t.override(n.override.functions),e}}}))}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of OAuth2Provider found. Make sure to call the OAuth2Provider.init method.See https://supertokens.io/docs/oauth2/quick-setup/frontend";throw"undefined"===typeof window&&(e+=r.SSR_ERROR),Error(e)}return t.instance},t.getInstance=function(){return t.instance},t.prototype.getDefaultRedirectionURL=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){if("SUCCESS_OAUTH2"===e.action||"CONTINUE_OAUTH2_AFTER_REFRESH"===e.action||"POST_OAUTH2_LOGOUT_REDIRECT"===e.action)return[2,e.frontendRedirectTo];throw new Error("Should never come here: unknown action in OAuth2Provider.getDefaultRedirectionURL")})})},t.reset=function(){r.isTest()&&(t.instance=void 0)},t.RECIPE_ID="oauth2provider",t}(s.RecipeModule);t.OAuth2Provider=l},9135(e,t,n){"use strict";var r=n(660),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.redirect=function(e,n,a,s){return r.__awaiter(t,void 0,void 0,function(){var t;return r.__generator(this,function(i){switch(i.label){case 0:return[4,this.getRedirectUrl(e,r.getNormalisedUserContext(s))];case 1:return null===(t=i.sent())?(r.logDebugMessage("Skipping redirection because the user override returned null for context ".concat(JSON.stringify(e,null,2))),[2]):(t=r.appendQueryParamsToURL(t,a),[2,r.SuperTokens.getInstanceOrThrow().redirectToUrl(t,n)])}})})},t.getRedirectUrl=function(e,n){return r.__awaiter(t,void 0,void 0,function(){var t;return r.__generator(this,function(r){switch(r.label){case 0:return[4,this.config.getRedirectionURL(e,n)];case 1:return void 0!==(t=r.sent())?[2,t]:[4,this.getDefaultRedirectionURL(e,n)];case 2:return[2,r.sent()]}})})},t}return r.__extends(t,e),t.prototype.getDefaultRedirectionURL=function(e,t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){throw new Error("getDefaultRedirectionURL is not implemented.")})})},t}(r.BaseRecipeModule);t.RecipeModule=a},3377(e,t,n){"use strict";var r=n(660).createGenericComponentsOverrideContext(),a=r[0],s=r[1];t.Provider=s,t.useContext=a},9015(e,t,n){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0});var r=n(660),a=n(5946),s=n(3377),i=n(3633),o=n(7873);n(2086),n(3921),n(9801),n(9927),n(8033),n(6032),n(5043),n(7691),n(5547),n(3892),n(579),n(763),n(9040),n(9135),n(2929),n(7950),n(1464),n(9675),n(54),n(4257),n(2129),n(2221);var l=function(e){function t(t){var n=e.call(this,t)||this,a=r.__assign({},n.validators),s=function(e){var n=a[e];a[e]=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r.__assign(r.__assign({},n.apply(void 0,e)),{onFailureRedirection:t.onFailureRedirection,showAccessDeniedOnFailure:t.showAccessDeniedOnFailure})}};for(var i in a)s(i);return n.validators=a,n}return r.__extends(t,e),t}(a.BooleanClaim),c=function(e){function t(t){var n=e.call(this,t)||this,a=r.__assign({},n.validators),s=function(e){var n=a[e];a[e]=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r.__assign(r.__assign({},n.apply(void 0,e)),{onFailureRedirection:t.onFailureRedirection,showAccessDeniedOnFailure:t.showAccessDeniedOnFailure})}};for(var i in a)s(i);return n.validators=a,n}return r.__extends(t,e),t}(a.PrimitiveArrayClaim),u=function(e){function t(t){var n=e.call(this,t)||this,a=r.__assign({},n.validators),s=function(e){var n=a[e];a[e]=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r.__assign(r.__assign({},n.apply(void 0,e)),{onFailureRedirection:t.onFailureRedirection,showAccessDeniedOnFailure:t.showAccessDeniedOnFailure})}};for(var i in a)s(i);return n.validators=a,n}return r.__extends(t,e),t}(a.PrimitiveClaim),d=function(e){var t=o.useSessionContext();return t.loading?{loading:!0}:!1===t.doesSessionExist?{loading:!1,doesSessionExist:!1,value:void 0}:{loading:!1,doesSessionExist:!0,value:e.getValueFromPayload(t.accessTokenPayload)}},f=function(){function e(){}return e.init=function(e){return i.Session.init(e)},e.getUserId=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,i.Session.getInstanceOrThrow().getUserId({userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)})]})})},e.getAccessToken=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,i.Session.getInstanceOrThrow().getAccessToken({userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)})]})})},e.getAccessTokenPayloadSecurely=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,i.Session.getInstanceOrThrow().getAccessTokenPayloadSecurely({userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)})]})})},e.attemptRefreshingSession=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,i.Session.getInstanceOrThrow().attemptRefreshingSession()]})})},e.doesSessionExist=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,i.Session.getInstanceOrThrow().doesSessionExist({userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)})]})})},e.addAxiosInterceptors=function(e,t){return i.Session.addAxiosInterceptors(e,r.getNormalisedUserContext(t))},e.signOut=function(e){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(t){return[2,i.Session.getInstanceOrThrow().signOut({userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)})]})})},e.validateClaims=function(e){return i.Session.getInstanceOrThrow().validateClaims({overrideGlobalClaimValidators:null===e||void 0===e?void 0:e.overrideGlobalClaimValidators,userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)})},e.getInvalidClaimsFromResponse=function(e){return i.Session.getInstanceOrThrow().getInvalidClaimsFromResponse(e)},e.getClaimValue=function(e){return i.Session.getInstanceOrThrow().getClaimValue({claim:e.claim,userContext:r.getNormalisedUserContext(null===e||void 0===e?void 0:e.userContext)})},e.useSessionContext=o.useSessionContext,e.useClaimValue=d,e.SessionAuth=o.SessionAuthWrapper,e.ComponentsOverrideProvider=s.Provider,e}(),h=f.useSessionContext,p=f.useClaimValue,m=f.SessionAuth,g=f.init,v=f.getUserId,x=f.getAccessToken,y=f.getAccessTokenPayloadSecurely,b=f.attemptRefreshingSession,w=f.doesSessionExist,_=f.addAxiosInterceptors,k=f.signOut,j=f.validateClaims,N=f.getInvalidClaimsFromResponse,S=f.getClaimValue,C=f.ComponentsOverrideProvider;t.SessionContext=o.SessionContext,t.BooleanClaim=l,t.PrimitiveArrayClaim=c,t.PrimitiveClaim=u,t.
2SessionAuth=m,t.SessionComponentsOverrideProvider=C,t.addAxiosInterceptors=_,t.attemptRefreshingSession=b,t.default=f,t.doesSessionExist=w,t.getAccessToken=x,t.getAccessTokenPayloadSecurely=y,t.getClaimValue=S,t.getInvalidClaimsFromResponse=N,t.getUserId=v,t.init=g,t.signOut=k,t.useClaimValue=p,t.useSessionContext=h,t.validateClaims=j},2929(e,t,n){"use strict";var r=n(660),a=n(579),s=n(5043);function i(e){return e&&e.__esModule?e:{default:e}}var o=i(s).default.createContext({translate:function(){throw new Error("Cannot use translation func outside TranslationContext provider.")}});t.TranslationContextProvider=function(e){var t=e.children,n=e.defaultLanguage,i=e.userTranslationFunc,l=e.defaultStore,c=e.translationControlEventSource,u=s.useState(l),d=u[0],f=u[1],h=s.useState(void 0),p=h[0],m=h[1];s.useEffect(function(){!function(){r.__awaiter(this,void 0,void 0,function(){var e,t;return r.__generator(this,function(a){switch(a.label){case 0:return[4,r.getCurrentLanguageFromCookie()];case 1:return e=a.sent(),t=null===e?n:e,m(function(e){return void 0!==e?e:t}),[2]}})})}()},[n,m]),s.useEffect(function(){var e=function(e,t){m(t)},t=function(e,t){f(function(e){return r.mergeObjects(e,t)})};return c.on("LanguageChange",e),c.on("TranslationLoaded",t),function(){c.off("LanguageChange",e),c.off("TranslationLoaded",t)}});var g=s.useCallback(function(e){if(void 0!==i)return i(e);if(void 0!==p){var t=d[p]&&d[p][e],r=d[n]&&d[n][e];return void 0===t?void 0!==r?r:e:t}throw new Error("Should never come here")},[d,p,n,i]);return void 0===p?null:a.jsx(o.Provider,r.__assign({value:{translate:g}},{children:t}))},t.useTranslation=function(){return s.useContext(o).translate}},9205(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(1358))},8483(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4900))},6744(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(9015))},3730(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getProxyObject=void 0,t.getProxyObject=function(e){for(var t=n(n({},e),{_call:function(e,t){throw new Error("This function should only be called through the recipe object")}}),r=function(e){"_call"!==e&&(t[e]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._call(e,t)})},a=0,s=Object.keys(t);a<s.length;a++){r(s[a])}return t}},529(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OverrideableBuilder=void 0;var r=n(3730),a=function(){function e(e){this.layers=[e],this.proxies=[]}return e.prototype.override=function(e){for(var t=(0,r.getProxyObject)(this.layers[0]),n=e(t,this),a=0,s=Object.keys(this.layers[0]);a<s.length;a++){var i=s[a];n[i]===t[i]||"_call"===i?delete n[i]:void 0===n[i]&&(n[i]=null)}return this.layers.push(n),this.proxies.push(t),this},e.prototype.build=function(){var e=this;if(this.result)return this.result;this.result={};for(var t=0,n=this.layers;t<n.length;t++)for(var r=n[t],a=0,s=Object.keys(r);a<s.length;a++){var i=s[a],o=r[i];void 0!==o&&(this.result[i]=null===o?void 0:"function"===typeof o?o.bind(this.result):o)}for(var l=function(t){c.proxies[t]._call=function(n,r){for(var a=t;a>=0;--a){var s=e.layers[a][n];if(void 0!==s&&null!==s)return s.bind(e.result).apply(void 0,r)}}},c=this,u=0;u<this.proxies.length;++u)l(u);return this.result},e}();t.OverrideableBuilder=a,t.default=a}
2,2086(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(5481))},4096(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},7620(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CookieHandlerReference=void 0;var r=n(7994);Object.defineProperty(t,"CookieHandlerReference",{enumerable:!0,get:function(){return r.CookieHandlerReference}})},1759(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DateProviderReference=void 0;var r=n(5105);Object.defineProperty(t,"DateProviderReference",{enumerable:!0,get:function(){return r.DateProviderReference}})},7691(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7810);t.default=r.STGeneralError},5481(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;var r=n(188),a=function(){function e(){}return e.init=function(e){r.default.init(e)},e}();t.default=a,t.init=a.init},7974(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)};function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(e);return e=t?n.hostname.startsWith("localhost")||(a=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(a))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(s){}var a;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(s){}}throw new Error("Please provide a valid domain name")}t.default=n},2221(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)};function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(t){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(t){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(t){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(t){throw new Error("Please provide a valid URL path")}}t.default=n},9006(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PostSuperTokensInitCallbacks=void 0;var n=function(){function e(){}return e.addPostInitCallback=function(t){e.postInitCallbacks.push(t)},e.runPostInitCallbacks=function(){for(var t=0,n=e.postInitCallbacks;t<n.length;t++){(0,n[t])()}},e.postInitCallbacks=[],e}();t.PostSuperTokensInitCallbacks=n},3434(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}
2([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2221),o=n(5001),l=n(7691),c=function(){function e(e,t){var n=this;this.recipeId=e,this.appInfo=t,this.get=function(e,t,i,o,l,c){return a(n,void 0,void 0,function(){var n;return s(this,function(a){switch(a.label){case 0:return[4,this.fetch(this.getFullUrl(e,t,o),r({method:"GET"},i),l,c)];case 1:return n=a.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:a.sent(),fetchResponse:n}]}})})},this.post=function(e,t,i,o,l){return a(n,void 0,void 0,function(){var n;return s(this,function(a){switch(a.label){case 0:if(void 0===i.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},i),o,l)];case 1:return n=a.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:a.sent(),fetchResponse:n}]}})})},this.delete=function(e,t,i,o,l){return a(n,void 0,void 0,function(){var n;return s(this,function(a){switch(a.label){case 0:return[4,this.fetch(this.getFullUrl(e,t),r({method:"DELETE"},i),o,l)];case 1:return n=a.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:a.sent(),fetchResponse:n}]}})})},this.put=function(e,t,i,o,l){return a(n,void 0,void 0,function(){var n;return s(this,function(a){switch(a.label){case 0:return[4,this.fetch(this.getFullUrl(e,t),r({method:"PUT"},i),o,l)];case 1:return n=a.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:a.sent(),fetchResponse:n}]}})})},this.fetch=function(e,t,i,l){return a(n,void 0,void 0,function(){var n,a,c,u,d,f;return s(this,function(s){switch(s.label){case 0:return n=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:i,url:e,requestInit:r(r({},t),{headers:r(r({},n),{"fdi-version":o.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return a=s.sent(),c=a.requestInit,u=a.url,[4,fetch(u,c)];case 2:if((d=s.sent()).status>=300)throw d;return void 0===l?[3,4]:(f=d.clone(),[4,l({requestInit:c,url:e,fetchResponse:f})]);case 3:s.sent(),s.label=4;case 4:return[2,d]}})})},this.callPreAPIHook=function(e){return a(n,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}})})},this.getFullUrl=function(e,t,r){var a=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(a="".concat(a,"/").concat(e));var s=new i.default(t),o="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(a).concat(s.getAsStringDangerous());return void 0===r?o:o+"?"+new URLSearchParams(r)},this.getResponseJsonOrThrowGeneralError=function(e){return a(n,void 0,void 0,function(){var t,n;return s(this,function(r){switch(r.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=r.sent()).status)throw n=void 0===t.message?"No Error Message Provided":t.message,new l.default(n);return[2,t]}})})}}var t;return t=e,e.preparePreAPIHook=function(e){var n=e.recipePreAPIHook,i=e.action,o=e.options,l=e.userContext;return function(e){return a(void 0,void 0,void 0,function(){var a;return s(t,function(t){switch(t.label){case 0:return[4,n(r(r({},e),{action:i,userContext:l}))];case 1:return a=t.sent(),void 0===o||void 0===o.preAPIHook?[2,a]:[2,o.preAPIHook({url:a.url,requestInit:a.requestInit,userContext:l})]}})})}},e.preparePostAPIHook=function(e){var n=e.recipePostAPIHook,i=e.action,o=e.userContext;return function(e){return a(void 0,void 0,void 0,function(){return s(t,function(t){switch(t.label){case 0:return[4,n(r(r({},e),{userContext:o,action:i}))];case 1:return t.sent(),[2]}})})}},e}();t.default=c},273(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
2ise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(8823),o=n(4193),l=function(e){function t(t){var n=e.call(this,t)||this;return n.signOut=function(e){return a(n,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,o.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}})})},n}return r(t,e),t}(i.default);t.default=l},1852(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var r=n(8802);t.normaliseAuthRecipe=function(e){return(0,r.normaliseRecipeModuleConfig)(e)}},8346(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.signOut=t.getTenantIdFromURL=t.getResetPasswordTokenFromURL=t.doesEmailExist=t.signIn=t.signUp=t.sendPasswordResetEmail=t.submitNewPassword=t.init=void 0;var a=n(7750),s=n(2500),i=function(){function e(){}return e.init=function(e){return a.default.init(e)},e.signOut=function(e){return a.default.getInstanceOrThrow().signOut({userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)})},e.submitNewPassword=function(e){return a.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.sendPasswordResetEmail=function(e){return a.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.signUp=function(e){return a.default.getInstanceOrThrow().recipeImplementation.signUp(r(r({},e),{shouldTryLinkingWithSessionUser:null===e||void 0===e?void 0:e.shouldTryLinkingWithSessionUser,userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.signIn=function(e){return a.default.getInstanceOrThrow().recipeImplementation.signIn(r(r({},e),{shouldTryLinkingWithSessionUser:null===e||void 0===e?void 0:e.shouldTryLinkingWithSessionUser,userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.doesEmailExist=function(e){return a.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.getResetPasswordTokenFromURL=function(e){return a.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)}))},e.getTenantIdFromURL=function(e){return a.default.getInstanceOrThrow().recipeImplementation.getTenantIdFromURL(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)}))},e}();t.default=i;var o=i.init;t.init=o;var l=i.submitNewPassword;t.submitNewPassword=l;var c=i.sendPasswordResetEmail;t.sendPasswordResetEmail=c;var u=i.signUp;t.signUp=u;var d=i.signIn;t.signIn=d;var f=i.doesEmailExist;t.doesEmailExist=f;var h=i.signOut;t.signOut=h;var p=i.getResetPasswordTokenFromURL;t.getResetPasswordTokenFromURL=p;var m=i.getTenantIdFromURL;t.getTenantIdFromURL=m},7750(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},a.apply(this,arguments)};
2Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(4939),i=n(7604),o=n(529),l=n(2500),c=function(e){function t(t){var n=e.call(this,(0,s.normaliseUserInput)(t))||this,r=new o.default((0,i.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=r.override(n.config.override.functions).build(),n}return r(t,e),t.init=function(e){return function(n,r){return t.instance=new t(a(a({},e),{recipeId:t.RECIPE_ID,clientType:r,appInfo:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Ensure that the 'EmailPassword.init' method is called within the 'SuperTokens.init' recipeList.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="emailpassword",t}(n(273).default);t.Recipe=c,t.default=c},7604(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=n(3434),o=n(3158),l=n(2500);function c(e){var t=new i.default(e.recipeId,e.appInfo);return{submitNewPassword:function(n){var o=n.formFields,l=n.options,c=n.userContext;return a(this,void 0,void 0,function(){var n,a,u,d,f;return s(this,function(s){switch(s.label){case 0:return n=this.getTenantIdFromURL({userContext:c}),a=this.getResetPasswordTokenFromURL({userContext:c}),[4,t.post(n,"/user/password/reset",{body:JSON.stringify({formFields:o,token:a,method:"token"})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:l,userContext:c}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:c}))];case 1:return u=s.sent(),d=u.jsonBody,f=u.fetchResponse,"FIELD_ERROR"===d.status?[2,{status:"FIELD_ERROR",formFields:d.formFields,fetchResponse:f}]:"RESET_PASSWORD_INVALID_TOKEN_ERROR"===d.status?[2,{status:d.status,fetchResponse:f}]:[2,r(r({},d),{fetchResponse:f})]}})})},sendPasswordResetEmail:function(n){var r=n.formFields,l=n.options,c=n.userContext;return a(this,void 0,void 0,function(){var n,a,u,d,f;return s(this,function(s){switch(s.label){case 0:return f=(d=t).post,[4,o.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,f.apply(d,[s.sent(),"/user/password/reset/token",{body:JSON.stringify({formFields:r})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:l,userContext:c}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:c})])];case 2:return n=s.sent(),a=n.jsonBody,u=n.fetchResponse,"FIELD_ERROR"===a.status?[2,{status:"FIELD_ERROR",formFields:a.formFields,fetchResponse:u}]:"PASSWORD_RESET_NOT_ALLOWED"===a.status?[2,{status:a.status,reason:a.reason,fetchResponse:u}]:[2,{status:a.status,fetchResponse:u}]}})})},signUp:function(n){var r=n.formFields,c=n.shouldTryLinkingWithSessionUser,u=n.options,d=n.userContext;return a(this,void 0,void 0,function(){var n,a,f,h,p;return s(this,function(s){switch(s.label){case 0:return p=(h=t).post,[4,o.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:d})];case 1:return[4,p.apply(h,[s.sent(),"/signup",{body:JSON.stringify({formFields:r,shouldTryLinkingWithSessionUser:c})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:u,userContext:d}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:d})])];case 2:return n=s.sent(),a=n.jsonBody,f=n.fetchResponse,"FIELD_ERROR"===a.status?[2,{status:"FIELD_ERROR",formFields:a.formFields,fetchResponse:f}]:"SIGN_UP_NOT_ALLOWED"===a.status?[2,{status:"SIGN_UP_NOT_ALLOWED",reason:a.reason,fetchResponse:f}]:[2,{status:a.status,user:(0,l.normaliseUser)("emailpassword",a.user),fetchResponse:f}]}})})}
2,signIn:function(n){var r=n.formFields,c=n.shouldTryLinkingWithSessionUser,u=n.options,d=n.userContext;return a(this,void 0,void 0,function(){var n,a,f,h,p;return s(this,function(s){switch(s.label){case 0:return p=(h=t).post,[4,o.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:d})];case 1:return[4,p.apply(h,[s.sent(),"/signin",{body:JSON.stringify({formFields:r,shouldTryLinkingWithSessionUser:c})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:u,userContext:d}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:d})])];case 2:return n=s.sent(),a=n.jsonBody,f=n.fetchResponse,"FIELD_ERROR"===a.status?[2,{status:"FIELD_ERROR",formFields:a.formFields,fetchResponse:f}]:"WRONG_CREDENTIALS_ERROR"===a.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:f}]:"SIGN_IN_NOT_ALLOWED"===a.status?[2,{status:"SIGN_IN_NOT_ALLOWED",reason:a.reason,fetchResponse:f}]:[2,{status:"OK",user:(0,l.normaliseUser)("emailpassword",a.user),fetchResponse:f}]}})})},doesEmailExist:function(n){var r=n.email,l=n.options,c=n.userContext;return a(this,void 0,void 0,function(){var n,a,u,d,f;return s(this,function(s){switch(s.label){case 0:return f=(d=t).get,[4,o.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,f.apply(d,[s.sent(),"/emailpassword/email/exists",{},{email:r},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:l,userContext:c}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:c})])];case 2:return n=s.sent(),a=n.jsonBody,u=n.fetchResponse,[2,{status:a.status,doesExist:a.exists,fetchResponse:u}]}})})},getResetPasswordTokenFromURL:function(){var e=(0,l.getQueryParams)("token");return void 0===e?"":e},getTenantIdFromURL:function(){return(0,l.getQueryParams)("tenantId")}}}t.default=c,t.getRecipeImplementation=c},4939(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var a=n(1852);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,a.normaliseAuthRecipe)(e)),{override:t})}},7037(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},9139(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiFactorAuthClaimClass=t.MultiFactorAuthClaim=t.resyncSessionAndFetchMFAInfo=t.init=void 0;var r=n(1143);Object.defineProperty(t,"MultiFactorAuthClaimClass",{enumerable:!0,get:function(){return r.MultiFactorAuthClaimClass}});var a=n(601),s=n(2500),i=function(){function e(){}return e.init=function(e){return a.default.init(e)},e.resyncSessionAndFetchMFAInfo=function(e){var t;return a.default.getInstanceOrThrow().recipeImplementation.resyncSessionAndFetchMFAInfo({options:null!==(t=null===e||void 0===e?void 0:e.options)&&void 0!==t?t:{},userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)})},e.MultiFactorAuthClaim=a.default.MultiFactorAuthClaim,e}();t.default=i;var o=i.init;t.init=o;var l=i.resyncSessionAndFetchMFAInfo;t.resyncSessionAndFetchMFAInfo=l;var c=i.MultiFactorAuthClaim;t.MultiFactorAuthClaim=c},1143(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}
2([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.MultiFactorAuthClaimClass=void 0;var s=n(7006),i=function(){function e(e){var t=this;this.getRecipeImpl=e,this.id="st-mfa",this.validators={hasCompletedMFARequirementsForAuth:function(){return{id:t.id,refresh:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.refresh.apply(t,e)},shouldRefresh:function(e,n){return void 0===t.getValueFromPayload(e,n)},validate:function(e,n){return r(t,void 0,void 0,function(){var t;return a(this,function(r){return void 0===(t=this.getValueFromPayload(e,n))?[2,{isValid:!1,reason:{message:"MFA info not available in payload"}}]:t.v?[2,{isValid:!0}]:[2,{isValid:!1,reason:{message:"not all required factors have been completed"}}]})})}}},hasCompletedFactors:function(e){return{id:t.id,shouldRefresh:function(e,n){return void 0===t.getValueFromPayload(e,n)},refresh:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.refresh.apply(t,e)},validate:function(n,r){var a=t.getValueFromPayload(n,r);if(void 0===a)return{isValid:!1,reason:{message:"MFA info not available in payload"}};for(var i=a.c,o=0,l=e;o<l.length;o++){var c=l[o];if("object"===typeof c&&"oneOf"in c){if((u=c.oneOf.map(function(e){return(0,s.checkFactorRequirement)(e,i)}).filter(function(e){return!1===e.isValid})).length===c.oneOf.length)return{isValid:!1,reason:{message:"All factor checkers failed in the list",oneOf:c.oneOf,failures:u}}}else if("object"===typeof c&&"allOfInAnyOrder"in c){if(0!==(u=c.allOfInAnyOrder.map(function(e){return(0,s.checkFactorRequirement)(e,i)}).filter(function(e){return!1===e.isValid})).length)return{isValid:!1,reason:{message:"Some factor checkers failed in the list",allOfInAnyOrder:c.allOfInAnyOrder,failures:u}}}else{var u;if(!0!==(u=(0,s.checkFactorRequirement)(c,i)).isValid)return{isValid:!1,reason:{message:"Factor validation failed: "+u.message,factorId:u.id}}}}return{isValid:!0}}}}}}return e.prototype.refresh=function(e){return r(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,this.getRecipeImpl().resyncSessionAndFetchMFAInfo(e)];case 1:return t.sent(),[2]}})})},e.prototype.getValueFromPayload=function(e,t){if(void 0!==e[this.id])return{c:e[this.id].c,v:e[this.id].v}},e.prototype.getLastFetchedTime=function(e,t){var n;return null===(n=e[this.id])||void 0===n?void 0:n.t},e}();t.MultiFactorAuthClaimClass=i},601(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(7006),i=n(529),o=n(4571),l=n(2500),c=n(273),u=n(9006),d=n(8843),f=n(1143),h=function(e){function t(n){var r=e.call(this,(0,s.normaliseUserInput)(n))||this,a=new i.default((0,o.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=a.override(r.config.override.functions).build(),u.PostSuperTokensInitCallbacks.addPostInitCallback(function(){d.SessionClaimValidatorStore.addClaimValidatorFromOtherRecipe(t.MultiFactorAuthClaim.validators.hasCompletedMFARequirementsForAuth())}),r}return r(t,e),t.init=function(e){return function(n,r){return t.instance=new t(a(a({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of MultiFactorAuth found. Make sure to call the MultiFactorAuth.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multifactorauth",t.MultiFactorAuthClaim=new f.MultiFactorAuthClaimClass(function(){return t.getInstanceOrThrow().recipeImplementation}),t}(c.default);t.Recipe=h,t.default=h},4571(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
2ise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=n(3434);function o(e){var t=new i.default(e.recipeId,e.appInfo);return{resyncSessionAndFetchMFAInfo:function(n){var o=n.options,l=n.userContext;return a(this,void 0,void 0,function(){var n,a,c;return s(this,function(s){switch(s.label){case 0:return[4,t.put(void 0,"/mfa/info",{},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_MFA_INFO",options:o,userContext:l}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_MFA_INFO",userContext:l}))];case 1:return n=s.sent(),a=n.jsonBody,c=n.fetchResponse,[2,r(r({},a),{fetchResponse:c})]}})})}}}t.default=o,t.getRecipeImplementation=o},7006(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.checkFactorRequirement=t.normaliseUserInput=void 0;var a=n(1852);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,a.normaliseAuthRecipe)(e)),{override:t})},t.checkFactorRequirement=function(e,t){return{id:e,isValid:void 0!==t[e],message:"Not completed"}}},9149(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},a.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}
2([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AllowedDomainsClaim=t.AllowedDomainsClaimClass=void 0;var o=n(3384),l=function(e){function t(){var t=e.call(this,{id:"st-t-dmns",refresh:function(){return s(t,void 0,void 0,function(){return i(this,function(e){return[2]})})},defaultMaxAgeInSeconds:Number.MAX_SAFE_INTEGER})||this;return t.validators=a(a({},t.validators),{hasAccessToCurrentDomain:function(){return{id:t.id,refresh:t.refresh,shouldRefresh:function(){return!1},validate:function(e,n){return s(t,void 0,void 0,function(){var t;return i(this,function(r){return t=o.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHostName(),[2,this.validators.includes(t,Number.MAX_SAFE_INTEGER,this.id).validate(e,n)]})})}}}}),t}return r(t,e),t}(n(2731).PrimitiveArrayClaim);t.AllowedDomainsClaimClass=l,t.AllowedDomainsClaim=new l},506(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.AllowedDomainsClaim=t.getTenantId=t.getLoginMethods=t.init=void 0;var a=n(2500),s=n(9149);Object.defineProperty(t,"AllowedDomainsClaim",{enumerable:!0,get:function(){return s.AllowedDomainsClaim}});var i=n(3158),o=function(){function e(){}return e.init=function(e){return i.default.init(e)},e.getLoginMethods=function(e){return i.default.getInstanceOrThrow().recipeImplementation.getLoginMethods(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)}))},e.getTenantId=function(e){return i.default.getInstanceOrThrow().recipeImplementation.getTenantId(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)}))},e.AllowedDomainsClaim=s.AllowedDomainsClaim,e}();t.default=o;var l=o.init;t.init=l;var c=o.getLoginMethods;t.getLoginMethods=c;var u=o.getTenantId;t.getTenantId=u},3158(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(4267),i=n(529),o=n(852),l=n(2500),c=function(e){function t(t){var n=e.call(this,(0,s.normaliseUserInput)(t))||this,r=new i.default((0,o.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=r.override(n.config.override.functions).build(),n}return r(t,e),t.init=function(e){return function(n,r){return t.instance=new t(a(a({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(n(273).default);t.Recipe=c,t.default=c},852(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}
2([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=n(3434),i=n(2500);function o(e){var t=new s.default(e.recipeId,e.appInfo);return{getTenantId:function(){var e=(0,i.getQueryParams)("tenantId");if(""!==(null===e||void 0===e?void 0:e.trim()))return e},getLoginMethods:function(n){var i=n.tenantId,o=n.options,l=n.userContext;return r(this,void 0,void 0,function(){var n,r,c,u,d;return a(this,function(a){switch(a.label){case 0:return n={},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(i,"/loginmethods",{},n,s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:o,userContext:l}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:l}))];case 1:return r=a.sent(),c=r.jsonBody,u=r.fetchResponse,void 0===c.firstFactors?(d=[],c.emailPassword.enabled&&d.push("emailpassword"),c.thirdParty.enabled&&d.push("thirdparty"),c.passwordless.enabled&&(d.push("otp-email"),d.push("otp-phone"),d.push("link-email"),d.push("link-phone"))):d=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:d,fetchResponse:u}]}})})}}}t.default=o,t.getRecipeImplementation=o},4267(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var a=n(1852);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,a.normaliseAuthRecipe)(e)),{override:t})}},3147(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.logOut=t.getRedirectURLToContinueOAuthFlow=t.getLoginChallengeInfo=t.init=void 0;var a=n(2500),s=n(7697),i=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.getLoginChallengeInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getLoginChallengeInfo(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getRedirectURLToContinueOAuthFlow=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getRedirectURLToContinueOAuthFlow(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.logOut=function(e){return s.default.getInstanceOrThrow().recipeImplementation.logOut(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e}();t.default=i;var o=i.init;t.init=o;var l=i.getLoginChallengeInfo;t.getLoginChallengeInfo=l;var c=i.getRedirectURLToContinueOAuthFlow;t.getRedirectURLToContinueOAuthFlow=c;var u=i.logOut;t.logOut=u},7697(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(598),i=n(529),o=n(8979),l=n(2500),c=function(e){function t(t){var n=e.call(this,(0,s.normaliseUserInput)(t))||this,r=new i.default((0,o.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=r.override(n.config.override.functions).build(),n}return r(t,e),t.init=function(e){return function(n,r){return t.instance=new t(a(a({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of OAuth2Provider found. Ensure that the 'OAuth2Provider.init' method is called within the 'SuperTokens.init' recipeList.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="oauth2provider",t}(n(273).default);t.Recipe=c,t.default=c},8979(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
2ise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=n(3434),i=n(3158);function o(e){var t=new s.default(e.recipeId,e.appInfo);return{getLoginChallengeInfo:function(n){var o=n.loginChallenge,l=n.options,c=n.userContext;return r(this,void 0,void 0,function(){var n,r,u,d,f,h;return a(this,function(a){switch(a.label){case 0:return n={loginChallenge:o},h=(f=t).get,[4,i.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,h.apply(f,[a.sent(),"/oauth/login/info",{},n,s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_CHALLENGE_INFO",options:l,userContext:c}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_CHALLENGE_INFO",userContext:c})])];case 2:return r=a.sent(),u=r.jsonBody,d=r.fetchResponse,[2,{status:"OK",info:u.info,fetchResponse:d}]}})})},getRedirectURLToContinueOAuthFlow:function(n){var o=n.loginChallenge,l=n.options,c=n.userContext;return r(this,void 0,void 0,function(){var n,r,u,d,f;return a(this,function(a){switch(a.label){case 0:return f=(d=t).get,[4,i.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,f.apply(d,[a.sent(),"/oauth/login",{},{loginChallenge:o},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_REDIRECT_URL_TO_CONTINUE_OAUTH_FLOW",options:l,userContext:c}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_REDIRECT_URL_TO_CONTINUE_OAUTH_FLOW",userContext:c})])];case 2:return n=a.sent(),r=n.jsonBody,u=n.fetchResponse,[2,{status:"OK",frontendRedirectTo:r.frontendRedirectTo,fetchResponse:u}]}})})},logOut:function(n){var o=n.logoutChallenge,l=n.options,c=n.userContext;return r(this,void 0,void 0,function(){var n,r,u,d,f;return a(this,function(a){switch(a.label){case 0:return f=(d=t).post,[4,i.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,f.apply(d,[a.sent(),"/oauth/logout",{body:JSON.stringify({logoutChallenge:o})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"LOG_OUT",options:l,userContext:c}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"LOG_OUT",userContext:c})])];case 2:return n=a.sent(),r=n.jsonBody,u=n.fetchResponse,[2,{status:"OK",frontendRedirectTo:r.frontendRedirectTo,fetchResponse:u}]}})})}}}t.default=o,t.getRecipeImplementation=o},598(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var a=n(1852);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,a.normaliseAuthRecipe)(e)),{override:t})}},8823(e,t){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){this.config=e};t.default=n},8802(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,a=e.preAPIHook;void 0===a&&(a=function(e){return n(t,void 0,void 0,function(){return r(this,function(t){return[2,e]})})});var s=e.postAPIHook;return void 0===s&&(s=function(){return n(t,void 0,void 0,function(){return r(this,function(e){return[2]})})}),{recipeId:e.recipeId,appInfo:e.appInfo,clientType:e.clientType,preAPIHook:a,postAPIHook:s}}},2731(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getInvalidClaimsFromResponse=t.getClaimValue=t.validateClaims=t.signOut=t.addAxiosInterceptors=t.doesSessionExist=t.attemptRefreshingSession=t.getAccessToken=t.getAccessTokenPayloadSecurely=t.getUserId=t.init=t.BooleanClaim=t.PrimitiveArrayClaim=t.PrimitiveClaim=void 0;var s=n(2500),i=n(4193),o=function(){function e(){}return e.init=function(e){return i.default.init(e)},e.getUserId=function(e){return i.default.getInstanceOrThrow().getUserId({userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)})},e.getAccessToken=function(e){return i.default.getInstanceOrThrow().getAccessToken({userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)})},e.getAccessTokenPayloadSecurely=function(e){return r(this,void 0,void 0,function(){return a(this,function(t){return[2,i.default.getInstanceOrThrow().getAccessTokenPayloadSecurely({userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)})]})})},e.attemptRefreshingSession=function(){return r(this,void 0,void 0,function(){return a(this,function(e){return[2,i.default.getInstanceOrThrow().attemptRefreshingSession()]})})},e.doesSessionExist=function(e){return i.default.getInstanceOrThrow().doesSessionExist({userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)})},e.addAxiosInterceptors=function(e,t){return i.default.addAxiosInterceptors(e,(0,s.getNormalisedUserContext)(t))},e.signOut=function(e){return i.default.getInstanceOrThrow().signOut({userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)})},e.getClaimValue=function(e){return i.default.getInstanceOrThrow().getClaimValue({claim:e.claim,userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)})},e.validateClaims=function(e){return i.default.getInstanceOrThrow().validateClaims({overrideGlobalClaimValidators:null===e||void 0===e?void 0:e.overrideGlobalClaimValidators,userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)})},e.getInvalidClaimsFromResponse=function(e){return i.default.getInstanceOrThrow().getInvalidClaimsFromResponse({response:e.response,userContext:(0,s.getNormalisedUserContext)(null===e||void 0===e?void 0:e.userContext)})},e}();t.default=o;var l=o.init;t.init=l;var c=o.getUserId;t.getUserId=c;var u=o.getAccessTokenPayloadSecurely;t.getAccessTokenPayloadSecurely=u;var d=o.getAccessToken;t.getAccessToken=d;var f=o.attemptRefreshingSession;t.attemptRefreshingSession=f;var h=o.doesSessionExist;t.doesSessionExist=h;var p=o.addAxiosInterceptors;t.addAxiosInterceptors=p;var m=o.signOut;t.signOut=m;var g=o.validateClaims;t.validateClaims=g;var v=o.getClaimValue;t.getClaimValue=v;var x=o.getInvalidClaimsFromResponse;t.getInvalidClaimsFromResponse=x;var y=n(8481);Object.defineProperty(t,"PrimitiveClaim",{enumerable:!0,get:function(){return y.PrimitiveClaim}}),Object.defineProperty(t,"PrimitiveArrayClaim",{enumerable:!0,get:function(){return y.PrimitiveArrayClaim}}),Object.defineProperty(t,"BooleanClaim",{enumerable:!0,get:function(){return y.BooleanClaim}})},4193(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},a.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
2ise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},o=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,a=0,s=t.length;a<s;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var l=n(8823),c=n(8481),u=n(2500),d=[n(7037).EMAILVERIFICATION_CLAIM_ID],f=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},n.getAccessToken=function(e){return s(n,void 0,void 0,function(){return i(this,function(t){return[2,c.default.getAccessToken({userContext:e.userContext})]})})},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,function(){return i(this,function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]})})},n.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return c.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return s(n,void 0,void 0,function(){return i(this,function(e){return[2,c.default.attemptRefreshingSession()]})})},n.validateClaims=function(e){return c.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},c.default.init(a(a({},t),{override:{functions:function(e,n){var r;return n.override(function(e){return a(a({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return o(o([],n.filter(function(e){return d.includes(e.id)}),!0),n.filter(function(e){return!d.includes(e.id)}),!0)}})}),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return s(n,void 0,void 0,function(){var n,r;return i(this,function(s){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=a(a({},e),{requestInit:a(a({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[2,t.preAPIHook(e)]})})},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),n}return r(t,e),t.init=function(e){return function(n,r,s){return t.instance=new t(a(a({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:s})),t.instance}},t.prototype.getClaimValue=function(e){return c.default.getClaimValue(e)},t.prototype.getInvalidClaimsFromResponse=function(e){return c.default.getInvalidClaimsFromResponse(e)},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";throw e=(0,u.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,u.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(l.default);t.Recipe=f,t.default=f},2554(e,t,n){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.SessionClaimValidatorStore=void 0;var r=n(8843);Object.defineProperty(t,"SessionClaimValidatorStore",{enumerable:!0,get:function(){return r.SessionClaimValidatorStore}})},188(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2500),a=n(7620),s=n(4138),i=n(9006),o=n(3158),l=n(1759),c=function(){function e(e){var t=this;if(this.recipeList=[],this.appInfo=(0,r.normaliseInputAppInfoOrThrowError)(e.appInfo),void 0===e.recipeList||0===e.recipeList.length)throw new Error("Please provide at least one recipe to the supertokens.init function call. See https://supertokens.io/docs/emailpassword/quick-setup/frontend");var n=!1;void 0!==e.enableDebugLogs&&(n=e.enableDebugLogs);var a=!1;this.recipeList=e.recipeList.map(function(r){var s=r(t.appInfo,e.clientType,n);return s.config.recipeId===o.Recipe.RECIPE_ID&&(a=!0),s}),a||this.recipeList.push(o.Recipe.init()(this.appInfo,e.clientType,n))}return e.init=function(t){a.CookieHandlerReference.init(t.cookieHandler),s.WindowHandlerReference.init(t.windowHandler),l.DateProviderReference.init(t.dateProvider),void 0===e.instance?(e.instance=new e(t),i.PostSuperTokensInitCallbacks.runPostInitCallbacks()):console.warn("SuperTokens was already initialized")},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="SuperTokens must be initialized before calling this method.";throw t=(0,r.checkForSSRErrorAndAppendIfNeeded)(t),new Error(t)}return e.instance}
2,e.reset=function(){(0,r.isTest)()?(o.Recipe.reset(),e.instance=void 0):console.warn("Calling reset() is only supported during testing")},e}();t.default=c},2500(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(4138),a=n(4096),s=n(7974),i=n(2221),o=n(4910);function l(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],a=void 0!==t.thirdParty?[t.thirdParty]:[],s=void 0!==t.webauthn?t.webauthn:{credentialIds:[]};return{id:t.id,emails:n,phoneNumbers:r,thirdParty:a,webauthn:s,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach(function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)}),n.href}catch(s){var r=e.startsWith("/")?"http:localhost":"http://localhost/",a=new URL("".concat(r).concat(e));return Object.entries(t).forEach(function(e){var t=e[0],n=e[1];a.searchParams.set(t,n)}),"".concat(a.pathname).concat(a.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,n,r=new i.default("");return void 0!==e.apiGatewayPath&&(r=new i.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new s.default(e.apiDomain),apiBasePath:r.appendPath((t=a.DEFAULT_API_BASE_PATH,n=e.apiBasePath,void 0!==n?new i.default(n):new i.default(t)))}},t.isTest=function(){try{return!1}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"===typeof window&&(e+=a.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,o.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:l(e,t.user)}},t.normaliseUser=l},5001(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.15.0",t.supported_fdi=["3.1","4.0","4.1"]},4138(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(3384);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},7143(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(8346))},54(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(9139))},8033(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(506))},9040(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(3147))},5946(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(2731))}
2,3921(e,t,n){"use strict";var r=n(2897).default;function a(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let s=n(7620);void 0!==s.default?a(s):a(r({default:s},s))},6032(e,t,n){"use strict";var r=n(2897).default;function a(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let s=n(2500);void 0!==s.default?a(s):a(r({default:s},s))},5547(e,t,n){"use strict";var r=n(2897).default;function a(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let s=n(7974);void 0!==s.default?a(s):a(r({default:s},s))},3892(e,t,n){"use strict";var r=n(2897).default;function a(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let s=n(2221);void 0!==s.default?a(s):a(r({default:s},s))},9801(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(9006))},4257(e,t,n){"use strict";var r=n(2897).default;function a(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let s=n(2554);void 0!==s.default?a(s):a(r({default:s},s))},9927(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4138))},8481(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(6206))},4692(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.responseErrorInterceptor=t.responseInterceptor=t.interceptorFunctionRequestFulfilled=void 0;var i=n(668),o=n(4554),l=n(2234),c=n(1407),u=n(6924);function d(e){var t=void 0===e.url?"":e.url,n=e.baseURL;return void 0!==n&&(t="/"===t.charAt(0)&&"/"===n.charAt(n.length-1)?n+t.substr(1):"/"!==t.charAt(0)&&"/"!==n.charAt(n.length-1)?n+"/"+t:n+t),t}t.interceptorFunctionRequestFulfilled=function(e){return a(this,void 0,void 0,function(){var t,n,a,i,f,p;return s(this,function(s){switch(s.label){case 0:(0,u.logDebugMessage)("interceptorFunctionRequestFulfilled: started axios interception"),t=d(e),n=!1;try{n="string"===typeof t&&!o.default.recipeImpl.shouldDoInterceptionBasedOnUrl(t,o.default.config.apiDomain,o.default.config.sessionTokenBackendDomain)}catch(g){if("Please provide a valid domain name"!==g.message)throw g;(0,u.logDebugMessage)("interceptorFunctionRequestFulfilled: Trying shouldDoInterceptionBasedOnUrl with location.origin"),n=!o.default.recipeImpl.shouldDoInterceptionBasedOnUrl(c.default.getReferenceOrThrow().windowHandler.location.getOrigin(),o.default.config.apiDomain,o.default.config.sessionTokenBackendDomain)}return(0,u.logDebugMessage)("interceptorFunctionRequestFulfilled: Value of doNotDoInterception: "+n),n?((0,u.logDebugMessage)("interceptorFunctionRequestFulfilled: Returning config unchanged"),[2,e]):((0,u.logDebugMessage)("interceptorFunctionRequestFulfilled: Modifying config"),l.ProcessState.getInstance().addState(l.PROCESS_STATE.CALLING_INTERCEPTION_REQUEST),[4,(0,o.getL
2ocalSessionState)(!0)]);case 1:return a=s.sent(),i=e,"EXISTS"!==a.status?[3,3]:[4,o.AntiCsrfToken.getToken(a.lastAccessTokenUpdate)];case 2:void 0!==(f=s.sent())&&((0,u.logDebugMessage)("interceptorFunctionRequestFulfilled: Adding anti-csrf token to request"),i=r(r({},i),{headers:void 0===i?{"anti-csrf":f}:r(r({},i.headers),{"anti-csrf":f})})),s.label=3;case 3:return o.default.config.autoAddCredentials&&void 0===i.withCredentials&&((0,u.logDebugMessage)("interceptorFunctionRequestFulfilled: Adding credentials include"),i=r(r({},i),{withCredentials:!0})),(0,u.logDebugMessage)("interceptorFunctionRequestFulfilled: Adding rid header: anti-csrf (it may be overriden by the user's provided rid)"),i=r(r({},i),{headers:void 0===i?{rid:"anti-csrf"}:r({rid:"anti-csrf"},i.headers)}),p=o.default.config.tokenTransferMethod,(0,u.logDebugMessage)("interceptorFunctionRequestFulfilled: Adding st-auth-mode header: "+p),i.headers["st-auth-mode"]=p,[4,m(i)];case 4:return[4,h(i=s.sent())];case 5:return s.sent(),(0,u.logDebugMessage)("interceptorFunctionRequestFulfilled: returning modified config"),[2,i]}})})},t.responseInterceptor=function(e){var t=this;return function(n){return a(t,void 0,void 0,function(){var t,r,a,i;return s(this,function(s){switch(s.label){case 0:if(t=!1,!o.default.initCalled)throw new Error("init function not called");(0,u.logDebugMessage)("responseInterceptor: started"),(0,u.logDebugMessage)("responseInterceptor: already intercepted: "+n.headers["x-supertokens-xhr-intercepted"]),r=d(n.config);try{t="string"===typeof r&&!o.default.recipeImpl.shouldDoInterceptionBasedOnUrl(r,o.default.config.apiDomain,o.default.config.sessionTokenBackendDomain)||!!n.headers["x-supertokens-xhr-intercepted"]}catch(h){if("Please provide a valid domain name"!==h.message)throw h;(0,u.logDebugMessage)("responseInterceptor: Trying shouldDoInterceptionBasedOnUrl with location.origin"),t=!o.default.recipeImpl.shouldDoInterceptionBasedOnUrl(c.default.getReferenceOrThrow().windowHandler.location.getOrigin(),o.default.config.apiDomain,o.default.config.sessionTokenBackendDomain)||!!n.headers["x-supertokens-xhr-intercepted"]}return(0,u.logDebugMessage)("responseInterceptor: Value of doNotDoInterception: "+t),t?((0,u.logDebugMessage)("responseInterceptor: Returning without interception"),[2,n]):((0,u.logDebugMessage)("responseInterceptor: Interception started"),l.ProcessState.getInstance().addState(l.PROCESS_STATE.CALLING_INTERCEPTION_RESPONSE),[4,(0,o.getLocalSessionState)(!1)]);case 1:return a=s.sent(),[4,p(n)];case 2:return s.sent(),(0,o.fireSessionUpdateEventsIfNecessary)("EXISTS"===a.status,n.status,n.headers["front-token"]),n.status!==o.default.config.sessionExpiredStatusCode?[3,3]:((0,u.logDebugMessage)("responseInterceptor: Status code is: "+n.status),i=n.config,[2,f.doRequest(function(t){return e(t)},i,r,n,void 0,!0)]);case 3:return n.status!==o.default.config.invalidClaimStatusCode?[3,5]:[4,(0,o.onInvalidClaimResponse)(n)];case 4:s.sent(),s.label=5;case 5:return[2,n]}})})}},t.responseErrorInterceptor=function(e){var t=this;return function(n){return a(t,void 0,void 0,function(){var t;return s(this,function(r){switch(r.label){case 0:if((0,u.logDebugMessage)("responseErrorInterceptor: called"),(0,u.logDebugMessage)("responseErrorInterceptor: already intercepted: "+(n.response&&n.response.headers["x-supertokens-xhr-intercepted"])),void 0===n.response||n.response.headers["x-supertokens-xhr-intercepted"])throw n;return void 0===n.response||n.response.status!==o.default.config.sessionExpiredStatusCode?[3,1]:((0,u.logDebugMessage)("responseErrorInterceptor: Status code is: "+n.response.status),t=n.config,[2,f.doRequest(function(t){return e(t)},t,d(t),void 0,n,!0)]);case 1:return void 0===n.response||n.response.status!==o.default.config.invalidClaimStatusCode?[3,3]:[4,(0,o.onInvalidClaimResponse)(n.response)];case 2:r.sent(),r.label=3;case 3:throw n}})})}};var f=function(){function e(){}var t;return t=e,e.doRequest=function(e,n,l,d,f,g){return void 0===g&&(g=!1),a(void 0,void 0,void 0,function(){var a,v,x,y,b,w,_,k,j,N,S,C,E,T;return s(t,function(t){switch(t.label){case 0:if(!o.default.initCalled)throw Error("init function not called");(0,u.logDebugMessage)("doRequest: called"),a=!1;try{a="string"===typeof l&&!o.default.recipeImpl.shouldDoInterceptionBasedOnUrl(l,o.default.config.apiDomain,o.default.config.sessionTokenBackendDomain)&&g}catch(s){if("Please provide a valid domain name"!==s.message)throw s;(0,u.logDebugMessage)("doRequest: Trying shouldDoInterceptionBasedOnUrl with location.origin"),a=!o.default.recipeImpl.shouldDoInterceptionBasedOnUrl(c.default.getReferenceOrThrow().windowHandler.location.getOrigin(),o.default.config.apiDomain,o.default.config.sessionTokenBackendDomain)&&g}if((0,u.logDebugMessage)("doRequest: Value of doNotDoInterception: "+a),!a)return[3,2];if((0,u.logDebugMessage)("doRequest: Returning without interception"),void 0!==f)throw f;return void 0!==d?[2,d]:[4,e(n)];case 1:return[2,t.sent()];case 2:return(0,u.logDebugMessage)("doRequest: Interception started"),[4,m(n)];case 3:n=t.sent(),v=void 0,t.label=4;
2case 4:return[4,(0,o.getLocalSessionState)(!0)];case 5:return x=t.sent(),y=n,"EXISTS"!==x.status?[3,7]:[4,o.AntiCsrfToken.getToken(x.lastAccessTokenUpdate)];case 6:void 0!==(b=t.sent())&&((0,u.logDebugMessage)("doRequest: Adding anti-csrf token to request"),y=r(r({},y),{headers:void 0===y?{"anti-csrf":b}:r(r({},y.headers),{"anti-csrf":b})})),t.label=7;case 7:return o.default.config.autoAddCredentials&&void 0===y.withCredentials&&((0,u.logDebugMessage)("doRequest: Adding credentials include"),y=r(r({},y),{withCredentials:!0})),(0,u.logDebugMessage)("doRequest: Adding rid header: anti-csrf (May get overriden by user's rid)"),y=r(r({},y),{headers:void 0===y?{rid:"anti-csrf"}:r({rid:"anti-csrf"},y.headers)}),w=o.default.config.tokenTransferMethod,(0,u.logDebugMessage)("doRequest: Adding st-auth-mode header: "+w),y.headers["st-auth-mode"]=w,[4,h(y)];case 8:t.sent(),t.label=9;case 9:if(t.trys.push([9,14,,27]),_=f,k=d,f=void 0,d=void 0,void 0!==_)throw(0,u.logDebugMessage)("doRequest: Not making call because localPrevError is not undefined"),_;return void 0!==k?(0,u.logDebugMessage)("doRequest: Not making call because localPrevResponse is not undefined"):(0,u.logDebugMessage)("doRequest: Making user's http call"),void 0!==k?[3,11]:[4,e(y)];case 10:return j=t.sent(),[3,12];case 11:j=k,t.label=12;case 12:return S=j,(0,u.logDebugMessage)("doRequest: User's http call ended"),[4,p(S)];case 13:return t.sent(),(0,o.fireSessionUpdateEventsIfNecessary)("EXISTS"===x.status,S.status,S.headers["front-token"]),[2,S];case 14:return N=t.sent(),void 0===(S=N.response)?[3,25]:[4,p(S)];case 15:if(t.sent(),(0,o.fireSessionUpdateEventsIfNecessary)("EXISTS"===x.status,S.status,S.headers["front-token"]),S.status!==o.default.config.sessionExpiredStatusCode)return[3,21];if((0,u.logDebugMessage)("doRequest: Status code is: "+S.status),function(e){return void 0===e.__supertokensSessionRefreshAttempts&&(e.__supertokensSessionRefreshAttempts=0),e.__supertokensSessionRefreshAttempts>=o.default.config.maxRetryAttemptsForSessionRefresh}(n))throw(0,u.logDebugMessage)("doRequest: Maximum session refresh attempts reached. sessionRefreshAttempts: ".concat(n.__supertokensSessionRefreshAttempts,", maxRetryAttemptsForSessionRefresh: ").concat(o.default.config.maxRetryAttemptsForSessionRefresh)),C="Received a 401 response from ".concat(l,". Attempted to refresh the session and retry the request with the updated session tokens ").concat(o.default.config.maxRetryAttemptsForSessionRefresh," times, but each attempt resulted in a 401 error. The maximum session refresh limit has been reached. Please investigate your API. To increase the session refresh attempts, update maxRetryAttemptsForSessionRefresh in the config."),console.error(C),new Error(C);return[4,(0,o.onUnauthorisedResponse)(x)];case 16:return E=t.sent(),function(e){void 0===e.__supertokensSessionRefreshAttempts&&(e.__supertokensSessionRefreshAttempts=0),e.__supertokensSessionRefreshAttempts++}(n),(0,u.logDebugMessage)("doRequest: sessionRefreshAttempts: "+n.__supertokensSessionRefreshAttempts),"RETRY"===E.result?[3,20]:((0,u.logDebugMessage)("doRequest: Not retrying original request"),void 0===E.error?[3,18]:[4,(0,i.createAxiosErrorFromFetchResp)(E.error)]);case 17:return T=t.sent(),[3,19];case 18:T=N,t.label=19;case 19:return v=T,[3,28];case 20:return(0,u.logDebugMessage)("doRequest: Retrying original request"),[3,24];case 21:return S.status!==o.default.config.invalidClaimStatusCode?[3,23]:[4,(0,o.onInvalidClaimResponse)(S)];case 22:t.sent(),t.label=23;case 23:throw N;case 24:return[3,26];case 25:throw N;case 26:return[3,27];case 27:return[3,4];case 28:throw v}})})},e}();function h(e){return a(this,void 0,void 0,function(){var t,n;return s(this,function(a){switch(a.label){case 0:return void 0===e.headers&&(e.headers={}),(0,u.logDebugMessage)("setAuthorizationHeaderIfRequired: adding existing tokens as header"),[4,(0,o.getTokenForHeaderAuth)("access")];case 1:return t=a.sent(),[4,(0,o.getTokenForHeaderAuth)("refresh")];case 2:return n=a.sent(),void 0!==t&&void 0!==n?void 0!==e.headers.Authorization||void 0!==e.headers.authorization?(0,u.logDebugMessage)("setAuthorizationHeaderIfRequired: Authorization header defined by the user, not adding"):((0,u.logDebugMessage)("setAuthorizationHeaderIfRequired: added authorization header"),e.headers=r(r({},e.headers),{Authorization:"Bearer ".concat(t)}),e.__supertokensAddedAuthHeader=!0):(0,u.logDebugMessage)("setAuthorizationHeaderIfRequired: token for header based auth not found"),[2]}})})}function p(e){return a(this,void 0,void 0,function(){var t,n,r,a,i,l;return s(this,function(s){switch(s.label){case 0:return(0,u.logDebugMessage)("saveTokensFromHeaders: Saving updated tokens from the response"),void 0===(t=e.headers["st-refresh-token"])?[3,2]:((0,u.logDebugMessage)("saveTokensFromHeaders: saving new refresh token"),[4,(0,o.setToken)("refresh",t)]);case 1:s.sent(),s.label=2;case 2:return void 0===(n=e.headers["st-access-token"])?[3,4]:((0,u.logDebugMessage)("saveTokensFromHeaders: saving new access token"),[4,(0,o.setToken)("access",n)]);case 3:s.sent(),s.label=4;case 4:return void 0===(r=e.headers["front-token"])?[3,6]:((0,u.logDebugMessage)("doRequest: Setting sFrontToken: "+r),[4,o.FrontToken.setItem(r)]);
2case 5:s.sent(),a=new Headers,Object.entries(e.headers).forEach(function(e){var t=e[0],n=e[1];Array.isArray(n)?n.forEach(function(e){return a.append(t,e)}):a.append(t,n)}),(0,o.updateClockSkewUsingFrontToken)({frontToken:r,responseHeaders:a}),s.label=6;case 6:return void 0===(i=e.headers["anti-csrf"])?[3,9]:[4,(0,o.getLocalSessionState)(!1)];case 7:return"EXISTS"!==(l=s.sent()).status?[3,9]:((0,u.logDebugMessage)("doRequest: Setting anti-csrf token"),[4,o.AntiCsrfToken.setItem(l.lastAccessTokenUpdate,i)]);case 8:s.sent(),s.label=9;case 9:return[2]}})})}function m(e){return a(this,void 0,void 0,function(){var t,n,a,i;return s(this,function(s){switch(s.label){case 0:return[4,(0,o.getTokenForHeaderAuth)("access")];case 1:return t=s.sent(),[4,(0,o.getTokenForHeaderAuth)("refresh")];case 2:return n=s.sent(),a=e.headers.Authorization||e.headers.authorization,void 0===t||void 0===n||a!=="Bearer ".concat(t)&&!("__supertokensAddedAuthHeader"in e)?[2,e]:((0,u.logDebugMessage)("removeAuthHeaderIfMatchesLocalToken: Removing Authorization from user provided headers because it contains our access token"),delete(i=r(r({},e),{headers:r({},e.headers)})).headers.authorization,delete i.headers.Authorization,[2,i])}})})}t.default=f},668(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};function a(e,t,n,r,a){return e.config=t,n&&(e.code=n),e.request=r,e.response=a,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}Object.defineProperty(t,"__esModule",{value:!0}),t.createAxiosErrorFromFetchResp=void 0,t.createAxiosErrorFromFetchResp=function(e){return n(this,void 0,void 0,function(){var t,n,s,i,o;return r(this,function(r){switch(r.label){case 0:if(t={url:e.url,headers:e.headers},!(n="status"in e))return[3,12];if(i=e.headers.get("content-type"),o=void 0,null!==i)return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.text()];case 2:return o=r.sent(),[3,4];case 3:return r.sent(),o="",[3,4];case 4:return[3,11];case 5:return i.includes("application/json")?[4,e.json()]:[3,7];case 6:return o=r.sent(),[3,11];case 7:return i.includes("text/")?[4,e.text()]:[3,9];case 8:return o=r.sent(),[3,11];case 9:return[4,e.blob()];case 10:o=r.sent(),r.label=11;case 11:s={data:o,status:e.status,statusText:e.statusText,headers:e.headers,config:t,request:void 0},r.label=12;case 12:return[2,a(n?new Error("Request failed with status code "+e.status):e,t,e.code,void 0,s)]}})})}},6720(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},a.apply(this,arguments)};
2Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanClaim=void 0;var s=function(e){function t(t){var n=e.call(this,t)||this;return n.validators=a(a({},n.validators),{isTrue:function(e){return n.validators.hasValue(!0,e)},isFalse:function(e){return n.validators.hasValue(!1,e)}}),n}return r(t,e),t}(n(4755).PrimitiveClaim);t.BooleanClaim=s},7068(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.PrimitiveArrayClaim=void 0;var s=n(856),i=function(){function e(e){var t=this;this.validators={includes:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var o=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n<o.getThresholdInSeconds())throw new Error("maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ".concat(o.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].t<o.now()-1e3*n},validate:function(s,i){return r(t,void 0,void 0,function(){var t,r;return a(this,function(a){return void 0===(t=this.getValueFromPayload(s,i))?[2,{isValid:!1,reason:{message:"value does not exist",expectedToInclude:e,actualValue:t}}]:(r=(o.now()-this.getLastFetchedTime(s,i))/1e3,void 0!==n&&r>n?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:t.includes(e)?[2,{isValid:!0}]:[2,{isValid:!1,reason:{message:"wrong value",expectedToInclude:e,actualValue:t}}])})})}}},excludes:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var o=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n<o.getThresholdInSeconds())throw new Error("maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ".concat(o.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].t<o.now()-1e3*n},validate:function(s,i){return r(t,void 0,void 0,function(){var t,r;return a(this,function(a){return void 0===(t=this.getValueFromPayload(s,i))?[2,{isValid:!1,reason:{message:"value does not exist",expectedToNotInclude:e,actualValue:t}}]:(r=(o.now()-this.getLastFetchedTime(s,i))/1e3,void 0!==n&&r>n?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:t.includes(e)?[2,{isValid:!1,reason:{message:"wrong value",expectedToNotInclude:e,actualValue:t}}]:[2,{isValid:!0}])})})}}},includesAll:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var o=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n<o.getThresholdInSeconds())throw new Error("maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ".concat(o.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].t<o.now()-1e3*n},validate:function(s,i){return r(t,void 0,void 0,function(){var t,r,l,c;return a(this,function(a){return void 0===(t=this.getValueFromPayload(s,i))?[2,{isValid:!1,reason:{message:"value does not exist",expectedToInclude:e,actualValue:t}}]:(r=(o.now()-this.getLastFetchedTime(s,i))/1e3,void 0!==n&&r>n?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:(l=new Set(t),[2,(c=e.every(function(e){return l.has(e)}))?{isValid:c}:{isValid:c,reason:{message:"wrong value",expectedToInclude:e,actualValue:t}}]))})})}}},includesAny:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var o=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n<o.getThresholdInSeconds())throw new Error("maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ".concat(o.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].t<o.now()-1e3*n},validate:function(s,i){return r(t,void 0,void 0,function(){var t,r,l,c;return a(this,function(a){return void 0===(t=this.getValueFromPayload(s,i))?[2,{isValid:!1,reason:{message:"value does not exist",expectedToInclude:e,actualValue:t}}]:(r=(o.now()-this.getLastFetchedTime(s,i))/1e3,void 0!==n&&r>n?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:(l=new Set(t),[2,(c=e.some(function(e){return l.has(e)}))?{isValid:c}:{isValid:c,reason:{message:"wrong value",expectedToIncludeAtLeastOneOf:e,actualValue:t}}]))})})}}},excludesAll:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var o=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n<o.getThresholdInSeconds())throw new Error("maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ".concat(o.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].t<o.now()-1e3*n},validate:function(s,i){return r(t,void 0,void 0,function(){var t,r,l,c;return a(this,function(a){return void 0===(t=this.getValueFromPayload(s,i))?[2,{isValid:!1,reason:{message:"value does not exist",expectedToNotInclude:e,actualValue:t}}]:(r=(o.now()-this.getLastFetchedTime(s,i))/1e3,void 0!==n&&r>n?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:(l=new Set(t),[2,(c=e.every(function(e){return!l.has(e)}))?{isValid:c}:{isValid:c,reason:{message:"wrong value",expectedToNotInclude:e,actualValue:t}}]))})})}}}},this.id=e.id,this.refresh=e.refresh,this.defaultMaxAgeInSeconds=e.defaultMaxAgeInSeconds}return e.prototype.getValueFromPayload=function(e,t){return void 0!==e[this.id]?e[this.id].v:void 0},e.prototype.getLastFetchedTime=function(e,t){return void 0!==e[this.id]?e[this.id].t:void 0},e}();t.PrimitiveArrayClaim=i}
2,4755(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrimitiveClaim=void 0;var r=n(856),a=function(){function e(e){var t=this;this.validators={hasValue:function(e,n,a){void 0===n&&(n=t.defaultMaxAgeInSeconds);var s=r.default.getReferenceOrThrow().dateProvider;return{id:void 0!==a?a:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n<s.getThresholdInSeconds())throw new Error("maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ".concat(s.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].t<s.now()-1e3*n},validate:function(r,a){var i=t.getValueFromPayload(r,a);if(void 0===i)return{isValid:!1,reason:{message:"value does not exist",expectedValue:e,actualValue:i}};var o=(s.now()-t.getLastFetchedTime(r,a))/1e3;return void 0!==n&&o>n?{isValid:!1,reason:{message:"expired",ageInSeconds:o,maxAgeInSeconds:n}}:i!==e?{isValid:!1,reason:{message:"wrong value",expectedValue:e,actualValue:i}}:{isValid:!0}}}}},this.id=e.id,this.refresh=e.refresh,this.defaultMaxAgeInSeconds=e.defaultMaxAgeInSeconds}return e.prototype.getValueFromPayload=function(e,t){return void 0!==e[this.id]?e[this.id].v:void 0},e.prototype.getLastFetchedTime=function(e,t){return void 0!==e[this.id]?e[this.id].t:void 0},e}();t.PrimitiveClaim=a},9580(e,t){"use strict";var n=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.STGeneralError=void 0;var r=function(e){function t(t){var n=e.call(this,t)||this;return n.isSuperTokensGeneralError=!0,n}return n(t,e),t.isThisError=function(e){return!0===e.isSuperTokensGeneralError},t}(Error);t.STGeneralError=r},4554(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.updateClockSkewUsingFrontToken=t.fireSessionUpdateEventsIfNecessary=t.setFrontToken=t.getFrontToken=t.setAntiCSRF=t.saveLastAccessTokenUpdate=t.getTokenForHeaderAuth=t.setToken=t.getStorageNameForToken=t.getLocalSessionState=t.onInvalidClaimResponse=t.onTokenUpdate=t.onUnauthorisedResponse=t.FrontToken=t.AntiCsrfToken=void 0;var i=n(2234),o=n(874),l=n(8249),c=n(1407),u=n(4796),d=n(6924),f=n(856),h=function(){function e(){}return e.getToken=function(t){return a(this,void 0,void 0,function(){var n;return s(this,function(r){switch(r.label){case 0:return(0,d.logDebugMessage)("AntiCsrfToken.getToken: called"),void 0===t?(e.tokenInfo=void 0,(0,d.logDebugMessage)("AntiCsrfToken.getToken: returning undefined"),[2,void 0]):void 0!==e.tokenInfo?[3,2]:[4,R()];case 1:return null===(n=r.sent())?((0,d.logDebugMessage)("AntiCsrfToken.getToken: returning undefined"),[2,void 0]):(e.tokenInfo={antiCsrf:n,associatedAccessTokenUpdate:t},[3,4]);case 2:return e.tokenInfo.associatedAccessTokenUpdate===t?[3,4]:(e.tokenInfo=void 0,[4,e.getToken(t)]);case 3:return[2,r.sent()];case 4:return(0,d.logDebugMessage)("AntiCsrfToken.getToken: returning: "+e.tokenInfo.antiCsrf),[2,e.tokenInfo.antiCsrf]}})})},e.removeToken=function(){return a(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("AntiCsrfToken.removeToken: called"),e.tokenInfo=void 0,[4,O(void 0)];case 1:return t.sent(),[2]}})})},e.setItem=function(t,n){return a(this,void 0,void 0,function(){return s(this,function(r){switch(r.label){case 0:return void 0===t?(e.tokenInfo=void 0,[2]):((0,d.logDebugMessage)("AntiCsrfToken.setItem: called"),[4,O(n)]);case 1:return r.sent(),e.tokenInfo={antiCsrf:n,associatedAccessTokenUpdate:t},[2]}})})},e}();t.AntiCsrfToken=h;var p=function(){function e(){}return e.getTokenInfo=function(){return a(this,void 0,void 0,function(){var t,n;return s(this,function(r){switch(r.label){case 0:return(0,d.logDebugMessage)("FrontToken.getTokenInfo: called"),[4,M()];case 1:return null!==(t=r.sent())?[3,5]:[4,_(!1)];case 2:return"EXISTS"!==r.sent().status?[3,4]:[4,new Promise(function(t){e.waiters.push(t)})];case 3:return r.sent(),[2,e.getTokenInfo()];case 4:return[2,void 0];case 5:return n=D(t),(0,d.logDebugMessage)("FrontToken.getTokenInfo: returning ate: "+n.ate),(0,d.logDebugMessage)("FrontToken.getTokenInfo: returning uid: "+n.uid),(0,d.logDebugMessage)("FrontToken.getTokenInfo: returning up: "+n.up),[2,n]}})})},e.removeToken=function(){return a(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("FrontToken.removeToken: called"),[4,F(void 0)];case 1:return t.sent(),[4,j("access","")];case 2:return t.sent(),[4,j("refresh","")];case 3:return t.sent(),[4,h.removeToken()];
2case 4:return t.sent(),e.waiters.forEach(function(e){return e(void 0)}),e.waiters=[],[2]}})})},e.setItem=function(t){return a(this,void 0,void 0,function(){return s(this,function(n){switch(n.label){case 0:return[4,P()];case 1:return n.sent(),"remove"===t?[2,e.removeToken()]:((0,d.logDebugMessage)("FrontToken.setItem: called"),[4,F(t)]);case 2:return n.sent(),e.waiters.forEach(function(e){return e(void 0)}),e.waiters=[],[2]}})})},e.doesTokenExists=function(){return a(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return[4,A()];case 1:return[2,null!==e.sent()]}})})},e.waiters=[],e}();t.FrontToken=p;var m=function(){function e(){}var t;return e.init=function(t,r){(0,d.logDebugMessage)("init: called"),(0,d.logDebugMessage)("init: Input apiBasePath: "+t.apiBasePath),(0,d.logDebugMessage)("init: Input apiDomain: "+t.apiDomain),(0,d.logDebugMessage)("init: Input autoAddCredentials: "+t.autoAddCredentials),(0,d.logDebugMessage)("init: Input sessionTokenBackendDomain: "+t.sessionTokenBackendDomain),(0,d.logDebugMessage)("init: Input isInIframe: "+t.isInIframe),(0,d.logDebugMessage)("init: Input sessionExpiredStatusCode: "+t.sessionExpiredStatusCode),(0,d.logDebugMessage)("init: Input sessionTokenFrontendDomain: "+t.sessionTokenFrontendDomain),(0,d.logDebugMessage)("init: Input tokenTransferMethod: "+t.tokenTransferMethod);var a=c.default.getReferenceOrThrow().windowHandler.getWindowUnsafe();e.env=void 0===a||void 0===a.fetch?n.g:a,e.refreshTokenUrl=t.apiDomain+t.apiBasePath+"/session/refresh",e.signOutUrl=t.apiDomain+t.apiBasePath+"/signout",e.rid="session",e.config=t,void 0===e.env.__supertokensOriginalFetch&&((0,d.logDebugMessage)("init: __supertokensOriginalFetch is undefined"),e.env.__supertokensOriginalFetch=e.env.fetch.bind(e.env),e.env.__supertokensSessionRecipe=r,e.env.fetch=e.env.__supertokensSessionRecipe.addFetchInterceptorsAndReturnModifiedFetch({originalFetch:e.env.__supertokensOriginalFetch,userContext:{}}),e.env.__supertokensSessionRecipe.addXMLHttpRequestInterceptor({userContext:{}})),e.recipeImpl=e.env.__supertokensSessionRecipe,e.initCalled=!0},t=e,e.initCalled=!1,e.doRequest=function(n,o,l){return a(void 0,void 0,void 0,function(){var a,u,f,p,m,g,v,x,b,k,j,N,C,I,P;return s(t,function(t){switch(t.label){case 0:if(!e.initCalled)throw Error("init function not called");(0,d.logDebugMessage)("doRequest: start of fetch interception"),a=!1;try{u=void 0,"string"===typeof l?u=l:"object"===typeof l&&("string"===typeof l.url?u=l.url:"string"===typeof l.href&&(u=l.href)),a=!e.recipeImpl.shouldDoInterceptionBasedOnUrl(u,e.config.apiDomain,e.config.sessionTokenBackendDomain)}catch(s){if("Please provide a valid domain name"!==s.message)throw s;(0,d.logDebugMessage)("doRequest: Trying shouldDoInterceptionBasedOnUrl with location.origin"),a=!e.recipeImpl.shouldDoInterceptionBasedOnUrl(c.default.getReferenceOrThrow().windowHandler.location.getOrigin(),e.config.apiDomain,e.config.sessionTokenBackendDomain)}return(0,d.logDebugMessage)("doRequest: Value of doNotDoInterception: "+a),a?((0,d.logDebugMessage)("doRequest: Returning without interception"),[4,n(o)]):[3,2];case 1:return[2,t.sent()];case 2:return(f=new Headers(void 0!==o&&void 0!==o.headers?o.headers:l.headers)).has("Authorization")?[4,S("access")]:[3,5];case 3:return p=t.sent(),[4,S("refresh")];case 4:m=t.sent(),void 0!==p&&void 0!==m&&f.get("Authorization")==="Bearer ".concat(p)&&((0,d.logDebugMessage)("doRequest: Removing Authorization from user provided headers because it contains our access token"),f.delete("Authorization")),t.label=5;case 5:(0,d.logDebugMessage)("doRequest: Interception started"),i.ProcessState.getInstance().addState(i.PROCESS_STATE.CALLING_INTERCEPTION_REQUEST),g=0,v=void 0,t.label=6;case 6:return[4,_(!0)];case 7:return x=t.sent(),b=new Headers(f),k=r(r({},o),{headers:b}),"EXISTS"!==x.status?[3,9]:[4,h.getToken(x.lastAccessTokenUpdate)];case 8:void 0!==(j=t.sent())&&((0,d.logDebugMessage)("doRequest: Adding anti-csrf token to request"),b.set("anti-csrf",j)),t.label=9;case 9:return e.config.autoAddCredentials&&((0,d.logDebugMessage)("doRequest: Adding credentials include"),void 0===k?k={credentials:"include"}:void 0===k.credentials&&(k=r(r({},k),{credentials:"include"}))),b.has("rid")?(0,d.logDebugMessage)("doRequest: rid header was already there in request"):((0,d.logDebugMessage)("doRequest: Adding rid header: anti-csrf"),b.set("rid","anti-csrf")),N=e.config.tokenTransferMethod,(0,d.logDebugMessage)("doRequest: Adding st-auth-mode header: "+N),b.set("st-auth-mode",N),[4,E(b)];case 10:return t.sent(),(0,d.logDebugMessage)("doRequest: Making user's http call"),[4,n(k)];case 11:return C=t.sent(),(0,d.logDebugMessage)("doRequest: User's http call ended"),[4,T(C)];case 12:if(t.sent(),L("EXISTS"===x.status,C.status,C.headers.get("front-token")),C.status!==e.config.sessionExpiredStatusCode)return[3,14];if((0,d.logDebugMessage)("doRequest: Status code is: "+C.status),g>=e.config.maxRetryAttemptsForSessionRefresh)throw(0,d.logDebugMessage)("doRequest: Maximum session refresh attempts reached. sessionRefreshAttempts: ".concat(g,", maxRetryAttemptsForSessionRefresh: ").concat(e.config.maxRetryAttemptsForSessionRefresh)),I="Received a 401 response from ".concat(l,". Attempted to refresh the session and retry the request with the updated session tokens ").concat(e.config.maxRetryAttemptsForSessionRefresh," times, but each attempt resulted in a 401 error. The maximum session refresh limit has been reached. Please investigate your API. To increase the session refresh attempts, update maxRetryAttemptsForSessionRefresh in the config."),console.error(I),new Error(I);return[4,y(x)];
2case 13:if(P=t.sent(),g++,(0,d.logDebugMessage)("doRequest: sessionRefreshAttempts: "+g),"RETRY"!==P.result){if((0,d.logDebugMessage)("doRequest: Not retrying original request"),void 0!==P.error){if(!(P.error instanceof Response))throw P.error;v=P.error}else v=C;return[3,18]}return(0,d.logDebugMessage)("doRequest: Retrying original request"),[3,17];case 14:return C.status!==e.config.invalidClaimStatusCode?[3,16]:[4,w(C)];case 15:t.sent(),t.label=16;case 16:return[2,C];case 17:return[3,6];case 18:return[2,v]}})})},e.attemptRefreshingSession=function(){return a(void 0,void 0,void 0,function(){var n;return s(t,function(t){switch(t.label){case 0:if(!e.initCalled)throw Error("init function not called");return[4,_(!1)];case 1:return[4,y(t.sent())];case 2:if("API_ERROR"===(n=t.sent()).result)throw n.error;return[2,"RETRY"===n.result]}})})},e}();t.default=m;var g="st-last-access-token-update",v="sAntiCsrf",x="sFrontToken";function y(e){return a(this,void 0,void 0,function(){var t,n,r,a,i,l,c,f,g,v,x,y,b,w,k;return s(this,function(s){switch(s.label){case 0:return[4,u.default.getReferenceOrThrow().lockFactory()];case 1:t=s.sent(),s.label=2;case 2:return(0,d.logDebugMessage)("onUnauthorisedResponse: trying to acquire lock"),[4,t.acquireLock("REFRESH_TOKEN_USE",1e3)];case 3:if(!s.sent())return[3,21];(0,d.logDebugMessage)("onUnauthorisedResponse: lock acquired"),s.label=4;case 4:return s.trys.push([4,17,19,21]),[4,_(!1)];case 5:return"NOT_EXISTS"===(n=s.sent()).status?((0,d.logDebugMessage)("onUnauthorisedResponse: Not refreshing because local session state is NOT_EXISTS"),m.config.onHandleEvent({action:"UNAUTHORISED",sessionExpiredOrRevoked:!1,userContext:{}}),[2,{result:"SESSION_EXPIRED"}]):(r="EXISTS"===n.status,a="EXISTS"===e.status,i=n.status!==e.status,l="lastAccessTokenUpdate"in n&&"lastAccessTokenUpdate"in e&&n.lastAccessTokenUpdate!==e.lastAccessTokenUpdate,i&&r?((0,d.logDebugMessage)("onUnauthorisedResponse: Retrying early because session status has changed and postLockLSS.status is EXISTS"),[2,{result:"RETRY"}]):r&&a&&l?((0,d.logDebugMessage)("onUnauthorisedResponse: Retrying early because pre and post lastAccessTokenUpdate don't match"),[2,{result:"RETRY"}]):(c=new Headers,"EXISTS"!==e.status?[3,7]:[4,h.getToken(e.lastAccessTokenUpdate)]));case 6:void 0!==(f=s.sent())&&((0,d.logDebugMessage)("onUnauthorisedResponse: Adding anti-csrf token to refresh API call"),c.set("anti-csrf",f)),s.label=7;case 7:return(0,d.logDebugMessage)("onUnauthorisedResponse: Adding rid and fdi-versions to refresh call header"),c.set("rid",m.rid),c.set("fdi-version",o.supported_fdi.join(",")),g=m.config.tokenTransferMethod,(0,d.logDebugMessage)("onUnauthorisedResponse: Adding st-auth-mode header: "+g),c.set("st-auth-mode",g),[4,E(c,!0)];case 8:return s.sent(),(0,d.logDebugMessage)("onUnauthorisedResponse: Calling refresh pre API hook"),[4,m.config.preAPIHook({action:"REFRESH_SESSION",requestInit:{method:"post",credentials:"include",headers:c},url:m.refreshTokenUrl,userContext:{}})];case 9:return v=s.sent(),(0,d.logDebugMessage)("onUnauthorisedResponse: Making refresh call"),[4,m.env.__supertokensOriginalFetch(v.url,v.requestInit)];case 10:return x=s.sent(),(0,d.logDebugMessage)("onUnauthorisedResponse: Refresh call ended"),[4,T(x)];case 11:return s.sent(),(0,d.logDebugMessage)("onUnauthorisedResponse: Refresh status code is: "+x.status),y=x.status===m.config.sessionExpiredStatusCode,null!==x.headers.get("front-token")?[3,14]:y?[4,p.setItem("remove")]:[3,13];case 12:return s.sent(),[3,14];case 13:if(200===x.status)throw b="The 'front-token' header is missing from a successful refresh-session response. The most likely causes are proxy settings (e.g.: 'front-token' missing from 'access-control-expose-headers' or a proxy stripping this header). Please investigate your API.",console.error(b),new Error(b);s.label=14;case 14:if(L("EXISTS"===e.status,x.status,y&&null===x.headers.get("front-token")?"remove":x.headers.get("front-token")),x.status>=300)throw x;return[4,m.config.postAPIHook({action:"REFRESH_SESSION",fetchResponse:x.clone(),requestInit:v.requestInit,url:v.url,userContext:{}})];case 15:return s.sent(),[4,_(!1)];case 16:return"NOT_EXISTS"===s.sent().status?((0,d.logDebugMessage)("onUnauthorisedResponse: local session doesn't exist, so returning session expired"),[2,{result:"SESSION_EXPIRED"}]):(m.config.onHandleEvent({action:"REFRESH_SESSION",userContext:{}}),(0,d.logDebugMessage)("onUnauthorisedResponse: Sending RETRY signal"),[2,{result:"RETRY"}]);case 17:return w=s.sent(),[4,_(!1)];case 18:return"NOT_EXISTS"===s.sent().status?((0,d.logDebugMessage)("onUnauthorisedResponse: local session doesn't exist, so returning session expired"),[2,{result:"SESSION_EXPIRED",error:w}]):((0,d.logDebugMessage)("onUnauthorisedResponse: sending API_ERROR"),[2,{result:"API_ERROR",error:w}]);case 19:return[4,t.releaseLock("REFRESH_TOKEN_USE")];case 20:return s.sent(),(0,d.logDebugMessage)("onUnauthorisedResponse: Released lock"),[7];case 21:return[4,_(!1)];case 22:return"NOT_EXISTS"===(k=s.sent()).status?((0,d.logDebugMessage)("onUnauthorisedResponse: lock acquired failed and local session doesn't exist, so sending SESSION_EXPIRED"),[2,{result:"SESSION_EXPIRED"}]):k.status!==e.status||"EXISTS"===k.status&&"EXISTS"===e.status&&k.lastAccessTokenUpdate!==e.lastAccessTokenUpdate?((0,d.logDebugMessage)("onUnauthorisedResponse: lock acquired failed and retrying early because pre and post lastAccessTokenUpdate don't match"),[2,{result:"RETRY"}]):[3,2];case 23:return[2]}})})}function b(){(0,d.logDebugMessage)("onTokenUpdate: firing ACCESS_TOKEN_PAYLOAD_UPDATED event"),m.config.onHandleEvent({action:"ACCESS_TOKEN_PAYLOAD_UPDATED",userContext:{}})}function w(e){return a(this,void 0,void 0,function(){var t;return s(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,m.recipeImpl.getInvalidClaimsFromResponse({response:e,userContext:{}})];case 1:return(t=n.sent())&&m.config.onHandleEvent({action:"API_INVALID_CLAIM",claimValidationErrors:t,userContext:{}}),[3,3];case 2:return n.sent(),[3,3];case 3:return[2]}})})}function _(e){return a(this,void 0,void 0,function(){var t,n,r,a,i;return s(this,function(s){switch(s.label){case 0:return(0,d.logDebugMessage)("getLocalSessionState: called"),[4,C(g)];case 1:return t=s.sent(),[4,p.doesTokenExists()];case 2:return s.sent()&&void 0!==t?((0,d.logDebugMessage)("getLocalSessionState: returning EXISTS since both frontToken and lastAccessTokenUpdate exists"),[2,{status:"EXISTS",lastAccessTokenUpdate:t}]):[3,3];case 3:return t?((0,d.logDebugMessage)("getLocalSessionState: returning NOT_EXISTS since frontToken was cleared but lastAccessTokenUpdate exists"),[2,{status:"NOT_EXISTS"}]):[3,4];case 4:return n={status:"MAY_EXIST"},e?((0,d.logDebugMessage)("getLocalSessionState: trying to refresh"),[4,y(n)]):[3,8];case 5:return"RETRY"!==(r=s.sent()).result?((0,d.logDebugMessage)("getLocalSessionState: return NOT_EXISTS in case error from backend"+r.result),[2,{status:"NOT_EXISTS"}]):[4,C(g)];case 6:return a=s.sent(),[4,p.doesTokenExists()];case 7:if(!s.sent()||void 0===a)throw i="Failed to retrieve local session state from cookies after a successful session refresh. This indicates a configuration error or that the browser is preventing cookie writes.",console.error(i),new Error(i);return(0,d.logDebugMessage)("getLocalSessionState: returning EXISTS since both frontToken and lastAccessTokenUpdate exists post refresh"),[2,{status:"EXISTS",lastAccessTokenUpdate:a}];case 8:return(0,d.logDebugMessage)("getLocalSessionState: returning: "+n.status),[2,n]}})})}function k(e){switch(e){case"access":return"st-access-token";case"refresh":return"st-refresh-token"}}function j(e,t){var n=k(e);return""!==t?((0,d.logDebugMessage)("setToken: saved ".concat(e," token into cookies")),N(n,t,Date.now()+31536e5)):((0,d.logDebugMessage)("setToken: cleared ".concat(e," token from cookies")),N(n,t,0))}function N(e,t,n){var r="Fri, 31 Dec 9999 23:59:59 GMT";n!==Number.MAX_SAFE_INTEGER&&(r=new Date(n).toUTCString());var a=m.config.sessionTokenFrontendDomain;return"localhost"===a||a===c.default.getReferenceOrThrow().windowHandler.location.getHostName()?l.default.getReferenceOrThrow().cookieHandler.setCookie("".concat(e,"=").concat(t,";expires=").concat(r,";path=/;samesite=").concat(m.config.isInIframe?"none;secure":"lax")):l.default.getReferenceOrThrow().cookieHandler.setCookie("".concat(e,"=").concat(t,";expires=").concat(r,";domain=").concat(a,";path=/;samesite=").concat(m.config.isInIframe?"none;secure":"lax"))}function S(e){return a(this,void 0,void 0,function(){return s(this,function(t){return[2,C(k(e))]})})}function C(e){return a(this,void 0,void 0,function(){var t,n,r,a;return s(this,function(s){switch(s.label){case 0:return n="; ",[4,l.default.getReferenceOrThrow().cookieHandler.getCookie()];case 1:return t=n+s.sent(),(r=t.split("; "+e+"=")).length>=2&&void 0!==(a=r.pop())?[2,a.split(";").shift()]:[2,void 0]}})})}function E(e,t){return void 0===t&&(t=!1),a(this,void 0,void 0,function(){var n,r;return s(this,function(a){switch(a.label){case 0:return(0,d.logDebugMessage)("setTokenHeaders: adding existing tokens as header"),[4,S("access")];case 1:return n=a.sent(),[4,S("refresh")];case 2:return r=a.sent(),!t&&void 0===n||void 0===r?(0,d.logDebugMessage)("setAuthorizationHeaderIfRequired: token for header based auth not found"):e.has("Authorization")?(0,d.logDebugMessage)("setAuthorizationHeaderIfRequired: Authorization header defined by the user, not adding"):((0,d.logDebugMessage)("setAuthorizationHeaderIfRequired: added authorization header"),e.set("Authorization","Bearer ".concat(t?r:n))),[2]}})})}function T(e){return a(this,void 0,void 0,function(){var n,r,a,i,o;return s(this,function(s){switch(s.label){case 0:return(0,d.logDebugMessage)("saveTokensFromHeaders: Saving updated tokens from the response headers"),null===(n=e.headers.get("st-refresh-token"))?[3,2]:((0,d.logDebugMessage)("saveTokensFromHeaders: saving new refresh token"),[4,j("refresh",n)]);case 1:s.sent(),s.label=2;case 2:return null===(r=e.headers.get("st-access-token"))?[3,4]:((0,d.logDebugMessage)("saveTokensFromHeaders: saving new access token"),[4,j("access",r)]);case 3:s.sent(),s.label=4;case 4:return null===(a=e.headers.get("front-token"))?[3,6]:((0,d.logDebugMessage)("saveTokensFromHeaders: Setting sFrontToken: "+a),[4,p.setItem(a)]);case 5:s.sent(),(0,t.updateClockSkewUsingFrontToken)({frontToken:a,responseHeaders:e.headers}),s.label=6;case 6:return null===(i=e.headers.get("anti-csrf"))?[3,9]:[4,_(!1)];case 7:return"EXISTS"!==(o=s.sent()).status?[3,9]:((0,d.logDebugMessage)("saveTokensFromHeaders: Setting anti-csrf token"),[4,h.setItem(o.lastAccessTokenUpdate,i)]);case 8:s.sent(),s.label=9;case 9:return[2]}})})}t.onUnauthorisedResponse=y,t.onTokenUpdate=b,t.onInvalidClaimResponse=w,t.getLocalSessionState=_,t.getStorageNameForToken=k,t.setToken=j,t.getTokenForHeaderAuth=S;var I=void 0;function P(){return a(this,void 0,void 0,function(){var e;return s(this,function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("saveLastAccessTokenUpdate: called"),e=Date.now().toString(),(0,d.logDebugMessage)("saveLastAccessTokenUpdate: setting "+e),[4,N(g,e,Number.MAX_SAFE_INTEGER)];case 1:return t.sent(),void 0!==I?[3,3]:[4,C(g)];case 2:I=t.sent()===e,t.label=3;case 3:return!1===I&&console.warn("Saving to cookies was not successful, this indicates a configuration error or the browser preventing us from writing the cookies."),[4,N("sIRTFrontend","",0)];case 4:return t.sent(),[2]}})})}function R(){return a(this,void 0,void 0,function(){function e(){return a(this,void 0,void 0,function(){var e,t,n,r,a;return s(this,function(s){switch(s.label){case 0:return t="; ",[4,l.default.getReferenceOrThrow().cookieHandler.getCookie()];case 1:return e=t+s.sent(),(n=e.split("; "+v+"=")).length>=2&&void 0!==(r=n.pop())?void 0===(a=r.split(";").shift())?[2,null]:[2,a]:[2,null]}})})}var t;return s(this,function(n){switch(n.label){case 0:return(0,d.logDebugMessage)("getAntiCSRFToken: called"),[4,_(!0)];case 1:return"EXISTS"!==n.sent().status?((0,d.logDebugMessage)("getAntiCSRFToken: Returning because local session state != EXISTS"),[2,null]):[4,e()];case 2:return t=n.sent(),(0,d.logDebugMessage)("getAntiCSRFToken: returning: "+t),[2,t]}})})}function O(e){return a(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("setAntiCSRF: called: "+e),void 0===e?[3,2]:[4,N(v,e,Number.MAX_SAFE_INTEGER)];case 1:return t.sent(),[3,4];case 2:return[4,N(v,"",0)];case 3:t.sent(),t.label=4;case 4:return[2]}})})}function A(){return a(this,void 0,void 0,function(){var e;return s(this,function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("getFrontTokenFromCookie: called"),[4,C(x)];case 1:return[2,void 0===(e=t.sent())?null:e]}})})}function D(e){return JSON.parse(decodeURIComponent(escape(atob(e)))
2)}function M(){return a(this,void 0,void 0,function(){var e;return s(this,function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("getFrontToken: called"),[4,_(!0)];case 1:return"EXISTS"!==t.sent().status?((0,d.logDebugMessage)("getFrontToken: Returning because sIRTFrontend != EXISTS"),[2,null]):[4,A()];case 2:return e=t.sent(),(0,d.logDebugMessage)("getFrontToken: returning: "+e),[2,e]}})})}function F(e){return a(this,void 0,void 0,function(){var t,n,r;return s(this,function(a){switch(a.label){case 0:return(0,d.logDebugMessage)("setFrontToken: called"),[4,A()];case 1:return null!==(t=a.sent())&&void 0!==e&&(n=D(t).up,r=D(e).up,JSON.stringify(n)!==JSON.stringify(r)&&b()),void 0!==e?[3,3]:[4,N(x,"",0)];case 2:return a.sent(),[3,5];case 3:return[4,N(x,e,Number.MAX_SAFE_INTEGER)];case 4:a.sent(),a.label=5;case 5:return[2]}})})}function L(e,t,n){if(void 0!==n&&null!==n){var r="remove"!==n;(0,d.logDebugMessage)("fireSessionUpdateEventsIfNecessary wasLoggedIn: ".concat(e," frontTokenExistsAfter: ").concat(r," status: ").concat(t)),e?r||(t===m.config.sessionExpiredStatusCode?((0,d.logDebugMessage)("onUnauthorisedResponse: firing UNAUTHORISED event"),m.config.onHandleEvent({action:"UNAUTHORISED",sessionExpiredOrRevoked:!0,userContext:{}})):((0,d.logDebugMessage)("onUnauthorisedResponse: firing SIGN_OUT event"),m.config.onHandleEvent({action:"SIGN_OUT",userContext:{}}))):r&&((0,d.logDebugMessage)("onUnauthorisedResponse: firing SESSION_CREATED event"),m.config.onHandleEvent({action:"SESSION_CREATED",userContext:{}}))}else(0,d.logDebugMessage)("fireSessionUpdateEventsIfNecessary returning early because the front token was not updated")}t.saveLastAccessTokenUpdate=P,t.setAntiCSRF=O,t.getFrontToken=M,t.setFrontToken=F,t.fireSessionUpdateEventsIfNecessary=L;t.updateClockSkewUsingFrontToken=function(e){var t=e.frontToken,n=e.responseHeaders;if((0,d.logDebugMessage)("updateClockSkewUsingFrontToken: frontToken: "+t),null!==t&&void 0!==t&&"remove"!==t){var r=D(t),a=m.recipeImpl.calculateClockSkewInMillis({accessTokenPayload:r.up,responseHeaders:n});f.default.getReferenceOrThrow().dateProvider.setClientClockSkewInMillis(a),(0,d.logDebugMessage)("updateClockSkewUsingFrontToken: Client clock synchronized successfully")}else(0,d.logDebugMessage)("updateClockSkewUsingFrontToken: the access token payload wasn't updated or is being removed, skipping clock skew update")}},6206(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanClaim=t.PrimitiveArrayClaim=t.PrimitiveClaim=t.getInvalidClaimsFromResponse=t.getClaimValue=t.validateClaims=t.signOut=t.addAxiosInterceptors=t.doesSessionExist=t.attemptRefreshingSession=t.getAccessToken=t.getAccessTokenPayloadSecurely=t.getUserId=t.init=void 0;var s=n(4554),i=n(376),o=n(529),l=n(8088),c=n(8249),u=n(1407),d=n(4796),f=n(8105),h=n(6924),p=n(856),m=function(){function e(){}var t;return e.init=function(t){c.default.init(t.cookieHandler),u.default.init(t.windowHandler),p.default.init(t.dateProvider),d.default.init(t.lockFactory,u.default.getReferenceOrThrow().windowHandler.localStorage);var n=(0,l.validateAndNormaliseInputOrThrowError)(t);void 0!==t.enableDebugLogs&&t.enableDebugLogs&&(0,h.enableLogging)();var r=new o.default((0,i.default)({onHandleEvent:n.onHandleEvent,preAPIHook:n.preAPIHook,postAPIHook:n.postAPIHook,sessionExpiredStatusCode:n.sessionExpiredStatusCode})).override(n.override.functions).build();s.default.init(n,r),e.axiosInterceptorQueue.forEach(function(e){e()}),e.axiosInterceptorQueue=[]},e.getUserId=function(e){return s.default.recipeImpl.getUserId({userContext:(0,l.getNormalisedUserContext)(void 0===e?void 0:e.userContext)})},e.getAccessTokenPayloadSecurely=function(e){return r(this,void 0,void 0,function(){return a(this,function(t){return[2,s.default.recipeImpl.getAccessTokenPayloadSecurely({userContext:(0,l.getNormalisedUserContext)(void 0===e?void 0:e.userContext)})]})})},t=e,e.axiosInterceptorQueue=[],e.attemptRefreshingSession=function(){return r(void 0,void 0,void 0,function(){return a(t,function(e){return[2,s.default.attemptRefreshingSession()]})})},e.doesSessionExist=function(e){return s.default.recipeImpl.doesSessionExist({userContext:(0,l.getNormalisedUserContext)(void 0===e?void 0:e.userContext)})},e.addAxiosInterceptors=function(t,n){s.default.initCalled?s.default.recipeImpl.addAxiosInterceptors({axiosInstance:t,userContext:(0,l.getNormalisedUserContext)(n)}):e.axiosInterceptorQueue.push(function(){s.default.recipeImpl.addAxiosInterceptors({axiosInstance:t,userContext:(0,l.getNormalisedUserContext)(n)})})},e.signOut=function(e){return s.default.recipeImpl.signOut({userContext:(0,l.getNormalisedUserContext)(void 0===e?void 0:e.userContext)})},e.getInvalidClaimsFromResponse=function(e){return r(this,void 0,void 0,function(){return a(this,function(t){return[2,s.default.recipeImpl.getInvalidClaimsFromResponse({response:e.response,userContext:(0,l.getNormalisedUserContext)(e.userContext)})]})})},e.getClaimValue=function(t){return r(this,void 0,void 0,function(){var n,r;return a(this,function(a){switch(a.label){case 0:return n=(0,l.getNormalisedUserContext)(void 0===t?void 0:t.userContext),[4,e.getAccessTokenPayloadSecurely({userContext:n})];case 1:return r=a.sent(),[2,t.claim.getValueFromPayload(r,n)]}})})},e.validateClaims=function(e,t){var n=(0,l.getNormalisedUserContext)(t),r=f.SessionClaimValidatorStore.getClaimValidatorsAddedByOtherRecipes(),a=s.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:r,userContext:n}),i=void 0!==e?e(a,n):a;return 0===i.length?[]:s.default.recipeImpl.validateClaims({claimValidators:i,userContext:(0,l.getNormalisedUserContext)(t)})},e.getAccessToken=function(e){return r(void 0,void 0,void 0,function(){return a(t,function(t){switch(t.label){case 0:return[4,s.default.recipeImpl.doesSessionExist({userContext:(0,l.getNormalisedUserContext)(void 0===e?void 0:e.userContext)})];case 1:return t.sent()?[2,(0,s.getTokenForHeaderAuth)("access")]:[2,void 0]}})})},e}();t.default=m,t.init=m.init,t.getUserId=m.getUserId,t.getAccessTokenPayloadSecurely=m.getAccessTokenPayloadSecurely,t.getAccessToken=m.getAccessToken,t.attemptRefreshingSession=m.attemptRefreshingSession,t.doesSessionExist=m.doesSessionExist,t.addAxiosInterceptors=m.addAxiosInterceptors,t.signOut=m.signOut,t.validateClaims=m.validateClaims,t.getClaimValue=m.getClaimValue,t.getInvalidClaimsFromResponse=m.getInvalidClaimsFromResponse;var g=n(4755);Object.defineProperty(t,"PrimitiveClaim",{enumerable:!0,get:function(){return g.PrimitiveClaim}});var v=n(7068);Object.defineProperty(t,"PrimitiveArrayClaim",{enumerable:!0,get:function(){return v.PrimitiveArrayClaim}});var x=n(6720);Object.defineProperty(t,"BooleanClaim",{enumerable:!0,get:function(){return x.BooleanClaim}})},6924(e,t,n){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.logDebugMessage=t.disableLogging=t.enableLogging=void 0;var r=n(874),a=!1;t.enableLogging=function(){a=!0},t.disableLogging=function(){a=!1},t.logDebugMessage=function(e){a&&console.log("".concat("com.supertokens",' {t: "').concat((new Date).toISOString(),'", message: "').concat(e,'", supertokens-website-ver: "').concat(r.package_version,'"}'))}},3793(e,t){"use strict";function n(e){return/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isAnIpAddress=void 0,t.isAnIpAddress=n;var r=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=a(e)};function a(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("converting to proper URL");var r=new URL(e);return e=t?r.hostname.startsWith("localhost")||n(r.hostname)?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(s){}if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),a(e,!0)}catch(s){}}throw new Error("Please provide a valid domain name")}t.default=r},7138(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)};function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(t){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(t){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(t){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(t){throw new Error("Please provide a valid URL path")}}t.default=n},2234(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProcessState=t.PROCESS_STATE=void 0,function(e){e[e.CALLING_INTERCEPTION_REQUEST=0]="CALLING_INTERCEPTION_REQUEST",e[e.CALLING_INTERCEPTION_RESPONSE=1]="CALLING_INTERCEPTION_RESPONSE"}(t.PROCESS_STATE||(t.PROCESS_STATE={}));var a=function(){function e(){var e=this;this.history=[],this.addState=function(e){try{process,0}catch(t){}},this.getEventByLastEventByName=function(t){for(var n=e.history.length-1;n>=0;n--)if(e.history[n]==t)return e.history[n]},this.reset=function(){e.history=[]},this.waitForEvent=function(t,a){return void 0===a&&(a=7e3),n(e,void 0,void 0,function(){var e,n=this;return r(this,function(r){return e=Date.now(),[2,new Promise(function(r){var s=n;!function n(){var i=s.getEventByLastEventByName(t);void 0===i?Date.now()-e>a?r(void 0):setTimeout(n,1e3):r(i)}()})]})})}}return e.getInstance=function(){return void 0==e.instance&&(e.instance=new e),e.instance},e}();t.ProcessState=a},376(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
2ise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(4554),o=n(4692),l=n(874),c=n(6924),u=n(9580),d=n(8798),f=n(8088),h=n(856),p=n(4796),m="CLAIM_REFRESH_LOCK";t.default=function(e){return{addXMLHttpRequestInterceptor:function(e){(0,c.logDebugMessage)("addXMLHttpRequestInterceptorAndReturnModified: called"),(0,d.addInterceptorsToXMLHttpRequest)()},addFetchInterceptorsAndReturnModifiedFetch:function(e){return(0,c.logDebugMessage)("addFetchInterceptorsAndReturnModifiedFetch: called"),function(t,n){return a(this,void 0,void 0,function(){return s(this,function(a){switch(a.label){case 0:return[4,i.default.doRequest(function(n){return e.originalFetch("object"===typeof t&&"clone"in t?t.clone():t,r({},n))},n,t)];case 1:return[2,a.sent()]}})})}},addAxiosInterceptors:function(e){if((0,c.logDebugMessage)("addAxiosInterceptors: called"),XMLHttpRequest.__interceptedBySuperTokens)return console.warn("Not adding axios interceptor since XMLHttpRequest is already added. This is just a warning."),console.warn("Our axios and XMLHttpRequest interceptors cannot be used at the same time."),console.warn("Since XMLHttpRequest is added automatically and supports axios by default, you can just remove addAxiosInterceptors from your code."),console.warn("If you want to continue using our axios interceptor, you can override addXMLHttpRequestInterceptor with an empty function."),void(0,c.logDebugMessage)("addAxiosInterceptors: not adding, because XHR interceptors are already in place");for(var t=e.axiosInstance.interceptors.request,n=0;n<t.handlers.length;n++)if(t.handlers[n].fulfilled===o.interceptorFunctionRequestFulfilled)return void(0,c.logDebugMessage)("addAxiosInterceptors: not adding because already added on this instance");e.axiosInstance.interceptors.request.use(o.interceptorFunctionRequestFulfilled,function(e){return a(this,void 0,void 0,function(){return s(this,function(t){throw e})})}),e.axiosInstance.interceptors.response.use((0,o.responseInterceptor)(e.axiosInstance),(0,o.responseErrorInterceptor)(e.axiosInstance))},getUserId:function(e){return a(this,void 0,void 0,function(){var e;return s(this,function(t){switch(t.label){case 0:return(0,c.logDebugMessage)("getUserId: called"),[4,i.FrontToken.getTokenInfo()];case 1:if(void 0===(e=t.sent()))throw new Error("No session exists");return(0,c.logDebugMessage)("getUserId: returning: "+e.uid),[2,e.uid]}})})},getAccessTokenPayloadSecurely:function(e){return a(this,void 0,void 0,function(){var t;return s(this,function(n){switch(n.label){case 0:return(0,c.logDebugMessage)("getAccessTokenPayloadSecurely: called"),[4,i.FrontToken.getTokenInfo()];case 1:if(void 0===(t=n.sent()))throw new Error("No session exists");return t.ate<h.default.getReferenceOrThrow().dateProvider.now()?((0,c.logDebugMessage)("getAccessTokenPayloadSecurely: access token expired. Refreshing session"),[4,i.default.attemptRefreshingSession()]):[3,5];case 2:return n.sent()?[4,this.getAccessTokenPayloadSecurely({userContext:e.userContext})]:[3,4];case 3:return[2,n.sent()];case 4:throw new Error("Could not refresh session");case 5:return(0,c.logDebugMessage)("getAccessTokenPayloadSecurely: returning: "+JSON.stringify(t.up)),[2,t.up]}})})},doesSessionExist:function(e){return a(this,void 0,void 0,function(){var e,t;return s(this,function(n){switch(n.label){case 0:return(0,c.logDebugMessage)("doesSessionExist: called"),[4,i.FrontToken.getTokenInfo()];case 1:return void 0===(e=n.sent())?((0,c.logDebugMessage)("doesSessionExist: access token does not exist locally"),[2,!1]):e.ate<h.default.getReferenceOrThrow().dateProvider.now()?((0,
2c.logDebugMessage)("doesSessionExist: access token expired. Refreshing session"),[4,(0,i.getLocalSessionState)(!1)]):[3,4];case 2:return t=n.sent(),[4,(0,i.onUnauthorisedResponse)(t)];case 3:return[2,"RETRY"===n.sent().result];case 4:return[2,!0]}})})},signOut:function(t){return a(this,void 0,void 0,function(){var n,r,a,o;return s(this,function(s){switch(s.label){case 0:return(0,c.logDebugMessage)("signOut: called"),[4,this.doesSessionExist(t)];case 1:return s.sent()?((0,c.logDebugMessage)("signOut: Calling refresh pre API hook"),[4,e.preAPIHook({action:"SIGN_OUT",requestInit:{method:"post",headers:{"fdi-version":l.supported_fdi.join(","),rid:i.default.rid}},url:i.default.signOutUrl,userContext:t.userContext})]):((0,c.logDebugMessage)("signOut: exiting early because session does not exist"),(0,c.logDebugMessage)("signOut: firing SIGN_OUT event"),e.onHandleEvent({action:"SIGN_OUT",userContext:t.userContext}),[2]);case 2:return n=s.sent(),(0,c.logDebugMessage)("signOut: Calling API"),[4,fetch(n.url,n.requestInit)];case 3:if(r=s.sent(),(0,c.logDebugMessage)("signOut: API ended"),(0,c.logDebugMessage)("signOut: API responded with status code: "+r.status),r.status===e.sessionExpiredStatusCode)return[2];if(r.status>=300)throw r;return[4,e.postAPIHook({action:"SIGN_OUT",requestInit:n.requestInit,url:n.url,fetchResponse:r.clone(),userContext:t.userContext})];case 4:return s.sent(),[4,r.clone().json()];case 5:if("GENERAL_ERROR"===(a=s.sent()).status)throw(0,c.logDebugMessage)("doRequest: Throwing general error"),o=void 0===a.message?"No Error Message Provided":a.message,new u.STGeneralError(o);return[2]}})})},getInvalidClaimsFromResponse:function(e){return a(this,void 0,void 0,function(){var t;return s(this,function(n){switch(n.label){case 0:return"body"in e.response?[4,e.response.clone().json()]:[3,2];case 1:return t=n.sent(),[3,3];case 2:t="string"===typeof e.response.data?JSON.parse(e.response.data):e.response.data,n.label=3;case 3:return[2,t.claimValidationErrors]}})})},getGlobalClaimValidators:function(e){return e.claimValidatorsAddedByOtherRecipes},validateClaims:function(e){return a(this,void 0,void 0,function(){var t,n,r,a,i,o,l,u,d,f,h;return s(this,function(s){switch(s.label){case 0:n=0,s.label=1;case 1:return++n<100?[4,p.default.getReferenceOrThrow().lockFactory()]:[3,20];case 2:return r=s.sent(),(0,c.logDebugMessage)("validateClaims: trying to acquire claim refresh lock"),[4,r.acquireLock(m)];case 3:if(!s.sent())return[3,18];s.label=4;case 4:return s.trys.push([4,,15,17]),[4,this.getAccessTokenPayloadSecurely({userContext:e.userContext})];case 5:t=s.sent(),(0,c.logDebugMessage)("validateClaims: claim refresh lock acquired"),a=0,i=e.claimValidators,s.label=6;case 6:return a<i.length?[4,(f=i[a]).shouldRefresh(t,e.userContext)]:[3,14];case 7:if(!s.sent())return[3,13];s.label=8;case 8:return s.trys.push([8,10,,11]),[4,f.refresh(e.userContext)];case 9:return s.sent(),[3,11];case 10:return o=s.sent(),console.error("Encountered an error while refreshing validator ".concat(f.id),o),[3,11];case 11:return[4,this.getAccessTokenPayloadSecurely({userContext:e.userContext})];case 12:t=s.sent(),s.label=13;case 13:return a++,[3,6];case 14:return[3,17];case 15:return(0,c.logDebugMessage)("validateClaims: releasing claim refresh lock"),[4,r.releaseLock(m)];case 16:return s.sent(),[7];case 17:return[3,20];case 18:(0,c.logDebugMessage)("validateClaims: Retrying refresh lock ".concat(n,"/").concat(100)),s.label=19;case 19:return[3,1];case 20:return 100!==n?[3,22]:((0,c.logDebugMessage)("validateClaims: ran out of retries while trying to acquire claim refresh lock"),[4,this.getAccessTokenPayloadSecurely({userContext:e.userContext})]);case 21:t=s.sent(),s.label=22;case 22:l=[],u=0,d=e.claimValidators,s.label=23;case 23:return u<d.length?[4,(f=d[u]).validate(t,e.userContext)]:[3,26];case 24:(h=s.sent()).isValid||l.push({id:f.id,reason:h.reason}),s.label=25;case 25:return u++,[3,23];case 26:return[2,l]}})})},shouldDoInterceptionBasedOnUrl:function(e,t,n){if((0,c.logDebugMessage)("shouldDoInterceptionBasedOnUrl: toCheckUrl: "+e+" apiDomain: "+t+" sessionTokenBackendDomain: "+n),e.includes("superTokensDoNotDoInterception"))return!1;e=(0,f.normaliseURLDomainOrThrowError)(e);
2var r=new URL(e).hostname,a=!1;""!==t&&(t=(0,f.normaliseURLDomainOrThrowError)(t),a=r===new URL(t).hostname);if(void 0===n||a)return a;var s=(0,f.normaliseSessionScopeOrThrowError)(n);return(0,f.matchesDomainOrSubdomain)(r,s)},calculateClockSkewInMillis:function(e){var t=e.accessTokenPayload;(0,c.logDebugMessage)("calculateClockSkewInMillis: called");var n=null===t||void 0===t?void 0:t.iat;if(void 0===n||"number"!==typeof n)return(0,c.logDebugMessage)("calculateClockSkewInMillis: payload iat is undefined or not a number. This may happen due to an unsupported backend sdk. Returning 0"),0;var r=1e3*n-Date.now();return(0,c.logDebugMessage)("calculateClockSkewInMillis: returning "+r),r}}}},6350(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultCookieHandlerImplementation=void 0;var s=n(1407);t.defaultCookieHandlerImplementation={getCookie:function(){return r(this,void 0,void 0,function(){return a(this,function(e){return[2,s.default.getReferenceOrThrow().windowHandler.getWindowUnsafe().document.cookie]})})},setCookie:function(e){return r(this,void 0,void 0,function(){return a(this,function(t){return s.default.getReferenceOrThrow().windowHandler.getWindowUnsafe().document.cookie=e,[2]})})}}},8249(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CookieHandlerReference=void 0;var r=n(6350),a=function(){function e(e){var t=function(e){return e};void 0!==e&&(t=e),this.cookieHandler=t(r.defaultCookieHandlerImplementation)}return e.init=function(t){void 0===e.instance&&(e.instance=new e(t))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensCookieHandler must be initialized before calling this method.");return e.instance},e}();t.CookieHandlerReference=a,t.default=a},4683(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DateProvider=void 0;var r=n(1407),a=function(){function e(){this.clockSkewInMillis=0,this.thresholdInSeconds=7}return e.init=function(){if(void 0===e.instance){e.instance=new e;var t=r.default.getReferenceOrThrow().windowHandler.localStorage.getItemSync(e.CLOCK_SKEW_KEY),n=null!==t?parseInt(t,10):0;e.instance.setClientClockSkewInMillis(n)}},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("DateProvider must be initialized before calling this method.");return e.instance},e.prototype.getThresholdInSeconds=function(){return this.thresholdInSeconds},e.prototype.setThresholdInSeconds=function(e){this.thresholdInSeconds=e},e.prototype.setClientClockSkewInMillis=function(t){this.clockSkewInMillis=Math.abs(t)>=1e3*this.thresholdInSeconds?t:0,r.default.getReferenceOrThrow().windowHandler.localStorage.setItemSync(e.CLOCK_SKEW_KEY,String(t))},e.prototype.getClientClockSkewInMillis=function(){return this.clockSkewInMillis},e.prototype.now=function(){return Date.now()+this.getClientClockSkewInMillis()},e.CLOCK_SKEW_KEY="__st_clockSkewInMillis",e}();t.DateProvider=a},856(e,t,n){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.DateProviderReference=void 0;var r=n(4683),a=function(){function e(e){void 0!==e?this.dateProvider=e():(r.DateProvider.init(),this.dateProvider=r.DateProvider.getReferenceOrThrow())}return e.init=function(t){void 0===e.instance&&(e.instance=new e(t))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensDateProvider must be initialized before calling this method.");return e.instance},e}();t.DateProviderReference=a,t.default=a},8050(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(8088),a=n(4554),s=n(8105);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),i=s.default.getClaimValidatorsAddedByOtherRecipes(),o=a.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:i,userContext:n});return void 0!==e?e(o,n):o}},8088(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},r.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.matchesDomainOrSubdomain=t.getNormalisedUserContext=t.validateAndNormaliseInputOrThrowError=t.normaliseSessionScopeOrThrowError=t.normaliseURLPathOrThrowError=t.normaliseURLDomainOrThrowError=void 0;var i=n(3793),o=n(7138),l=n(1407);function c(e){return new i.default(e).getAsStringDangerous()}function u(e){return new o.default(e).getAsStringDangerous()}function d(e){var t=function(e){(e=e.trim().toLowerCase()).startsWith(".")&&(e=e.substr(1)),e.startsWith("http://")||e.startsWith("https://")||(e="http://"+e);try{return e=new URL(e).hostname}catch(t){throw new Error("Please provide a valid sessionScope")}}(e);return"localhost"===t||(0,i.isAnIpAddress)(t)?t:e.startsWith(".")?"."+t:t}t.normaliseURLDomainOrThrowError=c,t.normaliseURLPathOrThrowError=u,t.normaliseSessionScopeOrThrowError=d,t.validateAndNormaliseInputOrThrowError=function(e){var t=this,n=c(e.apiDomain),i=u("/auth");void 0!==e.apiBasePath&&(i=u(e.apiBasePath));var o=l.default.getReferenceOrThrow().windowHandler.location.getHostName(),f=d(void 0!==e&&void 0!==e.sessionTokenFrontendDomain?e.sessionTokenFrontendDomain:o),h=401;void 0!==e.sessionExpiredStatusCode&&(h=e.sessionExpiredStatusCode);var p=403;if(void 0!==e.invalidClaimStatusCode&&(p=e.invalidClaimStatusCode),h===p)throw new Error("sessionExpiredStatusCode and invalidClaimStatusCode cannot be the same.");var m=!0;void 0!==e.autoAddCredentials&&(m=e.autoAddCredentials);var g=!1;void 0!==e.isInIframe&&(g=e.isInIframe);var v=void 0;void 0!==e.sessionTokenBackendDomain&&(v=d(e.sessionTokenBackendDomain));var x=10;if(void 0!==e.maxRetryAttemptsForSessionRefresh){if(e.maxRetryAttemptsForSessionRefresh<0)throw new Error("maxRetryAttemptsForSessionRefresh must be greater than or equal to 0.");x=e.maxRetryAttemptsForSessionRefresh}var y=function(e){return a(t,void 0,void 0,function(){return s(this,function(t){return[2,{url:e.url,requestInit:e.requestInit}]})})};void 0!==e.preAPIHook&&(y=e.preAPIHook);var b=function(){return a(t,void 0,void 0,function(){return s(this,function(e){return[2]})})};void 0!==e.postAPIHook&&(b=e.postAPIHook);var w=function(){};void 0!==e.onHandleEvent&&(w=e.onHandleEvent);var _=r({functions:function(e){return e}},e.override);return{apiDomain:n,apiBasePath:i,sessionTokenFrontendDomain:f,sessionExpiredStatusCode:h,invalidClaimStatusCode:p,autoAddCredentials:m,isInIframe:g,tokenTransferMethod:void 0!==e.tokenTransferMethod?e.tokenTransferMethod:"cookie",sessionTokenBackendDomain:v,maxRetryAttemptsForSessionRefresh:x,preAPIHook:y,postAPIHook:b,onHandleEvent:w,override:_}},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.matchesDomainOrSubdomain=function(e,t){for(var n=e.split("."),r=0;r<n.length;r++){var a=n.slice(r).join(".");if(a===t||".".concat(a)===t)return!0}return!1}}
2,4796(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LockFactoryReference=void 0;var r=n(3337),a=function(){function e(e){this.lockFactory=e}return e.init=function(t,n){void 0===this.instance&&(this.instance=new e(null!==t&&void 0!==t?t:function(e){return function(){return Promise.resolve(new r.default(e))}}(n)))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensLockReference must be initialized before calling this method.");return e.instance},e}();t.LockFactoryReference=a,t.default=a},8105(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionClaimValidatorStore=void 0;var n=function(){function e(){}return e.claimValidatorsAddedByOtherRecipes=[],e.addClaimValidatorFromOtherRecipe=function(t){e.claimValidatorsAddedByOtherRecipes.push(t)},e.getClaimValidatorsAddedByOtherRecipes=function(){return e.claimValidatorsAddedByOtherRecipes},e}();t.SessionClaimValidatorStore=n,t.default=n},1192(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};function a(){if("undefined"===typeof window)throw Error("If you are using this package with server-side rendering, please make sure that you are checking if the window object is defined.");return window}Object.defineProperty(t,"__esModule",{value:!0}),t.defaultWindowHandlerImplementation=void 0;var s={key:function(e){return n(this,void 0,void 0,function(){return r(this,function(t){return[2,a().localStorage.key(e)]})})},clear:function(){return n(this,void 0,void 0,function(){return r(this,function(e){return[2,a().localStorage.clear()]})})},getItem:function(e){return n(this,void 0,void 0,function(){return r(this,function(t){return[2,a().localStorage.getItem(e)]})})},removeItem:function(e){return n(this,void 0,void 0,function(){return r(this,function(t){return[2,a().localStorage.removeItem(e)]})})},setItem:function(e,t){return n(this,void 0,void 0,function(){return r(this,function(n){return[2,a().localStorage.setItem(e,t)]})})},keySync:function(e){return a().localStorage.key(e)},clearSync:function(){return a().localStorage.clear()},getItemSync:function(e){return a().localStorage.getItem(e)},removeItemSync:function(e){return a().localStorage.removeItem(e)},setItemSync:function(e,t){return a().localStorage.setItem(e,t)}},i={key:function(e){return n(this,void 0,void 0,function(){return r(this,function(t){return[2,a().sessionStorage.key(e)]})})},clear:function(){return n(this,void 0,void 0,function(){return r(this,function(e){return[2,a().sessionStorage.clear()]})})},getItem:function(e){return n(this,void 0,void 0,function(){return r(this,function(t){return[2,a().sessionStorage.getItem(e)]})})},removeItem:function(e){return n(this,void 0,void 0,function(){return r(this,function(t){return[2,a().sessionStorage.removeItem(e)]})})},setItem:function(e,t){return n(this,void 0,void 0,function(){return r(this,function(n){return[2,a().sessionStorage.setItem(e,t)]})})},keySync:function(e){return a().sessionStorage.key(e)},clearSync:function(){return a().sessionStorage.clear()},getItemSync:function(e){return a().sessionStorage.getItem(e)},removeItemSync:function(e){return a().sessionStorage.removeItem(e)},setItemSync:function(e,t){return a().sessionStorage.setItem(e,t)}};t.defaultWindowHandlerImplementation={history:{replaceState:function(e,t,n){return a().history.replaceState(e,t,n)},getState:function(){return a().history.state}},location:{getHref:function(){return a().location.href},setHref:function(e){a().location.href=e}
2,getSearch:function(){return a().location.search},getHash:function(){return a().location.hash},getPathName:function(){return a().location.pathname},assign:function(e){a().location.assign(e)},getHostName:function(){return a().location.hostname},getHost:function(){return a().location.host},getOrigin:function(){return a().location.origin}},getDocument:function(){return a().document},getWindowUnsafe:function(){return a().window},localStorage:s,sessionStorage:i}},1407(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(1192),a=function(){function e(e){var t=function(e){return e};void 0!==e&&(t=e),this.windowHandler=t(r.defaultWindowHandlerImplementation)}return e.init=function(t){void 0===e.instance&&(e.instance=new e(t))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensWindowHandler must be initialized before calling this method.");return e.instance},e}();t.WindowHandlerReference=a,t.default=a},874(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="20.1.6",t.supported_fdi=["1.16","1.17","1.18","1.19","2.0","3.0","3.1","4.0","4.1"]},8798(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,s){function i(e){try{l(r.next(e))}catch(t){s(t)}}function o(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,o)}l((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&s[0]?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o],r=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.addInterceptorsToXMLHttpRequest=void 0;var s=n(4554),i=n(6924),o=n(1407),l=n(2234),c=["readystatechange","abort","error","load","loadend","loadstart","progress","timeout"];function u(e){return r(this,void 0,void 0,function(){var t,n,r,s,i;return a(this,function(a){switch(a.label){case 0:if(t=e.headers.get("content-type"),n="",r="text",null!==t)return[3,5];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.text()];case 2:return n=a.sent(),[3,4];case 3:return a.sent(),n="",[3,4];case 4:return[3,9];case 5:return t.includes("application/json")?(r="json",i=(s=JSON).stringify,[4,e.json()]):[3,7];case 6:return n=i.apply(s,[a.sent()]),[3,9];case 7:return t.includes("text/")?[4,e.text()]:[3,9];case 8:n=a.sent(),a.label=9;case 9:return[2,{status:e.status,responseText:n,statusText:e.statusText,responseType:r,headers:e.headers}]}})})}function d(e,t){return r(this,void 0,void 0,function(){var n,r;return a(this,function(a){switch(a.label){case 0:return(0,i.logDebugMessage)("setAuthorizationHeaderIfRequired: adding existing tokens as header"),[4,(0,s.getTokenForHeaderAuth)("access")];case 1:return n=a.sent(),[4,(0,s.getTokenForHeaderAuth)("refresh")];case 2:return r=a.sent(),void 0!==n&&void 0!==r?t.some(function(e){return"authorization"===e.name.toLowerCase()})?(0,i.logDebugMessage)("setAuthorizationHeaderIfRequired: Authorization header defined by the user, not adding"):void 0!==n&&((0,i.logDebugMessage)("setAuthorizationHeaderIfRequired: added authorization header"),e.setRequestHeader("Authorization","Bearer ".concat(n))):(0,i.logDebugMessage)("setAuthorizationHeaderIfRequired: token for header based auth not found"),[2]}})})}function f(e){return r(this,void 0,void 0,function(){var t,n,r,o,l;return a(this,function(a){switch(a.label){case 0:return(0,i.logDebugMessage)("saveTokensFromHeaders: Saving updated tokens from the response"),null===(t=e.get("st-refresh-token"))?[3,2]:((0,i.logDebugMessage)("saveTokensFromHeaders: saving new refresh token"),[4,(0,s.setToken)("refresh",t)]);case 1:a.sent(),a.label=2;case 2:return null===(n=e.get("st-access-token"))?[3,4]:((0,i.logDebugMessage)("saveTokensFromHeaders: saving new access token"),[4,(0,s.setToken)("access",n)]);case 3:a.sent(),a.label=4;case 4:return null===(r=e.get("front-token"))?[3,6]:((0,i.logDebugMessage)("saveTokensFromHeaders: Setting sFrontToken: "+r),[4,s.FrontToken.setItem(r)]);case 5:a.sent(),(0,s.updateClockSkewUsingFrontToken)({frontToken:r,responseHeaders:e}),a.label=6;case 6:return null===(o=e.get("anti-csrf"))?[3,9]:[4,(0,s.getLocalSessionState)(!1)];case 7:return"EXISTS"!==(l=a.sent()).status?[3,9]:((0,i.logDebugMessage)("saveTokensFromHeaders: Setting anti-csrf token"),[4,s.AntiCsrfToken.setItem(l.lastAccessTokenUpdate,o)]);case 8:a.sent(),a.label=9;case 9:return[2]}})})}t.addInterceptorsToXMLHttpRequest=function(){var e=new Promise(function(e){return setTimeout(e,0)}),t=XMLHttpRequest;(0,i.logDebugMessage)("addInterceptorsToXMLHttpRequest called"),XMLHttpRequest=function(){var n,h=new t,p=this,m=[],g=[],v={},x=new Map,y=e;function b(e){y=y.finally(function(){var t;return null===(t=e())||void 0===t?void 0:t.catch(function(e){var t=new ProgressEvent("error");
2t.error=e,void 0!==p.onerror&&null!==p.onerror&&p.onerror(t),S("error",t)})})}var w,_="",k=!1,j=void 0,N=0;function S(e,t){var n=x.get(e);(0,i.logDebugMessage)("XHRInterceptor dispatching ".concat(t.type," to ").concat(n?n.size:0," listeners")),n&&Array.from(n).forEach(function(e){return e.apply(p,[t])})}function C(){return r(this,void 0,void 0,function(){var e,n,r;return a(this,function(a){switch(a.label){case 0:if(void 0===j)throw new Error("Should never come here..");if((0,i.logDebugMessage)("XHRInterceptor.handleRetryPostRefreshing: preRequestLSS "+j.status),N>=s.default.config.maxRetryAttemptsForSessionRefresh)throw(0,i.logDebugMessage)("XHRInterceptor.handleRetryPostRefreshing: Maximum session refresh attempts reached. sessionRefreshAttempts: ".concat(N,", maxRetryAttemptsForSessionRefresh: ").concat(s.default.config.maxRetryAttemptsForSessionRefresh)),v.status=0,v.statusText="",v.responseType="",e="Received a 401 response from ".concat(_,". Attempted to refresh the session and retry the request with the updated session tokens ").concat(s.default.config.maxRetryAttemptsForSessionRefresh," times, but each attempt resulted in a 401 error. The maximum session refresh limit has been reached. Please investigate your API. To increase the session refresh attempts, update maxRetryAttemptsForSessionRefresh in the config."),console.error(e),new Error(e);return[4,(0,s.onUnauthorisedResponse)(j)];case 1:if(n=a.sent(),N++,(0,i.logDebugMessage)("XHRInterceptor.handleRetryPostRefreshing: sessionRefreshAttempts: "+N),"RETRY"!==n.result){if((0,i.logDebugMessage)("XHRInterceptor.handleRetryPostRefreshing: Not retrying original request "+!!n.error),void 0!==n.error)throw n.error;return[2,!0]}return(0,i.logDebugMessage)("XHRInterceptor.handleRetryPostRefreshing: Retrying original request"),r=new t,I(p,r,!0),m.forEach(function(e){e(r)}),P(r,w),[2,!1]}})})}function E(e){return r(this,void 0,void 0,function(){var t,r,o,c,d;return a(this,function(a){switch(a.label){case 0:if(k)return(0,i.logDebugMessage)("XHRInterceptor.handleResponse: Returning without interception"),[2,!0];a.label=1;case 1:return a.trys.push([1,7,,11]),(0,i.logDebugMessage)("XHRInterceptor.handleResponse: Interception started"),l.ProcessState.getInstance().addState(l.PROCESS_STATE.CALLING_INTERCEPTION_RESPONSE),t=e.status,r=function(e){return new Headers(e.getAllResponseHeaders().split("\r\n").map(function(e){var t=e.indexOf(": ");return-1===t?["",""]:[e.slice(0,t),e.slice(t+2)]}).filter(function(e){return 0!==e[0].length}))}(e),[4,f(r)];case 2:return a.sent(),(0,s.fireSessionUpdateEventsIfNecessary)("EXISTS"===j.status,t,r.get("front-token")),t!==s.default.config.sessionExpiredStatusCode?[3,4]:((0,i.logDebugMessage)("responseInterceptor: Status code is: "+t),[4,C()]);case 3:return[2,a.sent()];case 4:return t!==s.default.config.invalidClaimStatusCode?[3,6]:[4,(0,s.onInvalidClaimResponse)({data:e.responseText})];case 5:a.sent(),a.label=6;case 6:return[2,!0];case 7:return o=a.sent(),(0,i.logDebugMessage)("XHRInterceptor.handleResponse: caught error"),void 0===o.status?[3,9]:[4,u(o)];case 8:if(c=a.sent(),v.status=c.status,v.statusText=c.statusText,v.responseType=c.responseType,n=c.headers,"json"===c.responseType)try{v.response=JSON.parse(c.responseText)}catch(h){v.response=c.responseText}else v.response=c.responseText;return v.responseText=c.responseText,[3,10];case 9:(d=new ProgressEvent("error")).error=o,void 0!==p.onerror&&null!==p.onerror&&p.onerror(d),S("error",d),a.label=10;case 10:return[2,!0];case 11:return[2]}})})}p.onload=null,p.onreadystatechange=null,p.onloadend=null,p.addEventListener=function(e,t,n){var r=x.get(e);void 0===r&&(r=new Set,x.set(e,r)),r.add(t)},p.removeEventListener=function(e,t){var n=x.get(e);void 0===n&&(n=new Set,x.set(e,n)),n.delete(t)},p.open=function(e,t){(0,i.logDebugMessage)("XHRInterceptor.open called");var n=arguments;_=t;try{k="string"===typeof _&&!s.default.recipeImpl.shouldDoInterceptionBasedOnUrl(_,s.default.config.apiDomain,s.default.config.sessionTokenBackendDomain)||"string"!==typeof _&&!s.default.recipeImpl.shouldDoInterceptionBasedOnUrl(_.toString(),s.default.config.apiDomain,s.default.config.sessionTokenBackendDomain)}catch(r){if("Please provide a valid domain name"!==r.message)throw r;(0,i.logDebugMessage)("XHRInterceptor.open: Trying shouldDoInterceptionBasedOnUrl with location.origin"),k=!s.default.recipeImpl.shouldDoInterceptionBasedOnUrl(o.default.getReferenceOrThrow().windowHandler.location.getOrigin(),s.default.config.apiDomain,s.default.config.sessionTokenBackendDomain)}b(function(){m.push(function(e){e.open.apply(e,n)}),h.open.apply(h,n)})},p.send=function(e){P(h,w=e)},p.setRequestHeader=function(e,t){var n=this;(0,i.logDebugMessage)("XHRInterceptor.setRequestHeader: Called with ".concat(e)),k?b(function(){return h.setRequestHeader(e,t)}):"anti-csrf"!==e&&b(function(){return r(n,void 0,void 0,function(){var n,r;return a(this,function(a){switch(a.label){case 0:return"authorization"!==e.toLowerCase()?[3,3]:((0,i.logDebugMessage)("XHRInterceptor.setRequestHeader: checking if user provided auth header matches local token"),[4,(0,s.getTokenForHeaderAuth)("access")]);case 1:return n=a.sent(),[4,(0,s.getTokenForHeaderAuth)("refresh")];case 2:if(r=a.sent(),void 0!==n&&void 0!==r&&t==="Bearer ".concat(n))return(0,i.logDebugMessage)("XHRInterceptor.setRequestHeader: skipping Authorization from user provided headers because it c
2ontains our access token"),[2];a.label=3;case 3:return m.push(function(n){n.setRequestHeader(e,t)}),g.push({name:e,value:t}),h.setRequestHeader(e,t),[2]}})})})};var T=void 0;function I(e,r,a){var s,o=["load","loadend","readystatechange"];(0,i.logDebugMessage)("XHRInterceptor.setUpXHR called");for(var l=function(e){(0,i.logDebugMessage)("XHRInterceptor added listener for event ".concat(e)),r.addEventListener(e,function(t){(0,i.logDebugMessage)("XHRInterceptor got event ".concat(e)),o.includes(e)||S(e,t)})},u=0,d=c;u<d.length;u++){l(d[u])}if(r.onload=function(t){void 0===s&&(s=E(r)),s.then(function(n){n&&(e.onload&&e.onload(t),S("load",t))})},r.onreadystatechange=function(n){r.readyState===t.DONE?(void 0===s&&(s=E(r)),s.then(function(t){t&&(e.onreadystatechange&&e.onreadystatechange(n),S("readystatechange",n))})):(e.onreadystatechange&&e.onreadystatechange(n),S("readystatechange",n))},r.onloadend=function(t){void 0===s&&(s=E(r)),s.then(function(n){n&&(e.onloadend&&e.onloadend(t),S("loadend",t))})},e.getAllResponseHeaders=function(){var e;return n?(e="",n.forEach(function(t,n){return e+="".concat(n,": ").concat(t,"\r\n")})):e=r.getAllResponseHeaders(),e+"x-supertokens-xhr-intercepted: true\r\n"},e.getResponseHeader=function(e){return"x-supertokens-xhr-intercepted"===e?"true":n?n.get(e):r.getResponseHeader(e)},void 0===T)for(var f in T=[],r)f in e||T.push(f);for(var h=function(t){"function"===typeof r[t]?Object.defineProperty(e,t,{configurable:!0,value:function(){var e=arguments;return a||m.push(function(n){n[t].apply(n,e)}),r[t].apply(r,e)}}):Object.defineProperty(e,t,{configurable:!0,get:function(){return void 0!==v[t]?v[t]:r[t]},set:function(e){a||m.push(function(n){n[t]=e}),(0,i.logDebugMessage)("XHRInterceptor.set[".concat(t,"] = ").concat(e)),r[t]=e}})},p=0,g=T;p<g.length;p++){h(f=g[p])}}function P(e,t){var n=this;if((0,i.logDebugMessage)("XHRInterceptor.send: called"),(0,i.logDebugMessage)("XHRInterceptor.send: Value of doNotDoInterception: "+k),k)return(0,i.logDebugMessage)("XHRInterceptor.send: Returning without interception"),void b(function(){return e.send(t)});(0,i.logDebugMessage)("XHRInterceptor.send: Interception started"),l.ProcessState.getInstance().addState(l.PROCESS_STATE.CALLING_INTERCEPTION_REQUEST),b(function(){return r(n,void 0,void 0,function(){var n,r;return a(this,function(a){switch(a.label){case 0:return[4,(0,s.getLocalSessionState)(!0)];case 1:return"EXISTS"!==(j=a.sent()).status?[3,3]:[4,s.AntiCsrfToken.getToken(j.lastAccessTokenUpdate)];case 2:void 0!==(n=a.sent())&&((0,i.logDebugMessage)("XHRInterceptor.send: Adding anti-csrf token to request"),e.setRequestHeader("anti-csrf",n)),a.label=3;case 3:return s.default.config.autoAddCredentials&&((0,i.logDebugMessage)("XHRInterceptor.send: Adding credentials include"),p.withCredentials=!0),g.some(function(e){return"rid"===e.name})?(0,i.logDebugMessage)("XHRInterceptor.send: rid header was already there in request"):((0,i.logDebugMessage)("XHRInterceptor.send: Adding rid header: anti-csrf"),e.setRequestHeader("rid","anti-csrf")),r=s.default.config.tokenTransferMethod,g.some(function(e){return"st-auth-mode"===e.name})?(0,i.logDebugMessage)("XHRInterceptor.send: st-auth-mode header was already there in request"):((0,i.logDebugMessage)("XHRInterceptor.send: Adding st-auth-mode header: "+r),e.setRequestHeader("st-auth-mode",r)),[4,d(e,g)];case 4:return a.sent(),(0,i.logDebugMessage)("XHRInterceptor.send: Making user's http call"),[2,e.send(t)]}})})})}I(p,h,!1)},XMLHttpRequest.__interceptedBySuperTokens=!0,XMLHttpRequest.__original=t}},7994(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(8249))},5105(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(856))},7810(e,t,n){"use strict";var r=n(2897).default;function a(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let s=n(9580);void 0!==s.default?a(s):a(r({default:s},s))},4910(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(8050))},8843(e,t,n){"use strict";var r=n(2897).default;function a(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}
2t.__esModule=!0;let s=n(8105);void 0!==s.default?a(s):a(r({default:s},s))},3384(e,t,n){"use strict";t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(1407))},3693(e,t,n){var r=n(7736);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},2897(e,t,n){var r=n(3693);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e},e.exports.__esModule=!0,e.exports.default=e.exports},9045(e,t,n){var r=n(3738).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7736(e,t,n){var r=n(3738).default,a=n(9045);e.exports=function(e){var t=a(e,"string");return"symbol"==r(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},3738(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}};const t={};function n(r){const a=t[r];if(void 0!==a)return a.exports;const s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.m=e,n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{const e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;let t;n.t=function(r,a){if(1&a&&(r=this(r)),8&a)return r;if("object"===typeof r&&r){if(4&a&&r.__esModule)return r;if(16&a&&"function"===typeof r.then)return r}const s=Object.create(null);n.r(s);const i={};t=t||[null,e({}),e([]),e(e)];for(var o=2&a&&r;("object"==typeof o||"function"==typeof o)&&!~t.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(e=>i[e]=()=>r[e]);return i.default=()=>r,n.d(s,i),s}})(),n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var a=t[r++],s=t[r++];n.o(e,a)?0===s&&r++:0===s?Object.defineProperty(e,a,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,a,{enumerable:!0,get:s})}else for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((t,r)=>(n.f[r](e,t),t),[])),n.u=e=>"static/js/"+e+".0ccaed4e.chunk.js",n.miniCssF=e=>{},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="qevents.ca:";n.l=(r,a,s,i)=>{if(e[r])return void e[r].push(a);let o,l;if(void 0!==s){const e=document.getElementsByTagName("script");for(var c=0;c<e.length;c++){const n=e[c];if(n.getAttribute("src")==r||n.getAttribute("data-webpack")==t+s){o=n;break}}}o||(l=!0,o=document.createElement("script"),o.charset="utf-8",n.nc&&o.setAttribute("nonce",n.nc),o.setAttribute("data-webpack",t+s),o.src=r),e[r]=[a];const u=(t,n)=>{o.onerror=o.onload=null,clearTimeout(d);const a=e[r];if(delete e[r],o.parentNode&&o.parentNode.removeChild(o),a&&a.forEach(e=>e(n)),t)return t(n)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),l&&document.head.appendChild(o)}})(),n.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
2),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/",(()=>{const e={792:0};n.f.j=(t,r)=>{let a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else{const s=new Promise((n,r)=>a=e[t]=[n,r]);r.push(a[2]=s);const i=n.p+n.u(t),o=new Error,l=r=>{if(n.o(e,t)&&(a=e[t],0!==a&&(e[t]=void 0),a)){const e=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+e+": "+n+")",o.name="ChunkLoadError",o.type=e,o.request=n,a[1](o)}};n.l(i,l,"chunk-"+t,t)}};const t=(t,r)=>{let[a,s,i]=r;var o,l,c=0;if(a.some(t=>0!==e[t])){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(i)i(n)}for(t&&t(r);c<a.length;c++)l=a[c],n.o(e,l)&&e[l]&&e[l][0](),e[l]=0},r=self.webpackChunkqevents_ca=self.webpackChunkqevents_ca||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),n.nc=void 0,(()=>{"use strict";var e=n(5043),t=n.t(e,2),r=n(4391);function a(e){if(Array.isArray(e))return e}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e,t){return a(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,i,o=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return o}}(e,t)||i(e,t)||o()}var c="undefined"!=typeof window?window:void 0,u="undefined"!=typeof globalThis?globalThis:c,d=Array.prototype,f=d.forEach,h=d.indexOf,p=null==u?void 0:u.navigator,m=null==u?void 0:u.document,g=null==u?void 0:u.location,v=null==u?void 0:u.fetch,x=null!=u&&u.XMLHttpRequest&&"withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:void 0,y=null==u?void 0:u.AbortController,b=null==p?void 0:p.userAgent,w=null!=c?c:{},_={DEBUG:!1,LIB_VERSION:"1.257.0"},k="$copy_autocapture",j=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],N=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),S=["fatal","error","warning","log","info","debug"];function C(e,t){return-1!==e.indexOf(t)}var E=function(e){return e.trim()},T=function(e){return e.replace(/^\$/,"")},I=Array.isArray,P=Object.prototype,R=P.hasOwnProperty,O=P.toString,A=I||function(e){return"[object Array]"===O.call(e)},D=e=>"function"==typeof e,M=e=>e===Object(e)&&!A(e),F=e=>{if(M(e)){for(var t in e)if(R.call(e,t))return!1;return!0}return!1},L=e=>void 0===e,U=e=>"[object String]"==O.call(e),H=e=>U(e)&&0===e.trim().length,z=e=>null===e,B=e=>L(e)||z(e),W=e=>"[object Number]"==O.call(e),q=e=>"[object Boolean]"===O.call(e),V=e=>C(j,e),$=e=>{var t={t:function(t){if(c&&(_.DEBUG||w.POSTHOG_DEBUG)&&!L(c.console)&&c.console){for(var n=("__rrweb_original__"in c.console[t]?c.console[t].__rrweb_original__:c.console[t]),r=arguments.length,a=new Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];n(e,...a)}},info:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.t("log",...n)},warn:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.t("warn",...n)},error:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.t("error",...n)},critical:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];console.error(e,...n)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling "+e)},createLogger:t=>$(e+" "+t)};return t},G=$("[PostHog.js]"),Y=G.createLogger,K=Y("[ExternalScriptsLoader]"),Z=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return K.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=null==m?void 0:m.querySelectorAll("script");
vendor: 4,576 bytes, line 2
2if(r)for(var a=0;a<r.length;a++)if(r[a].src===t)return n();var s=()=>{if(!m)return n("document not found");var r=m.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>n(void 0,e),r.onerror=e=>n(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return n("prepare_external_dependency_script returned null");var a,s=m.querySelectorAll("body > script");s.length>0?null==(a=s[0].parentNode)||a.insertBefore(r,s[0]):m.body.appendChild(r)};null!=m&&m.body?s():null==m||m.addEventListener("DOMContentLoaded",s)};function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J.apply(null,arguments)}function X(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}w.__PosthogExtensions__=w.__PosthogExtensions__||{},w.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/"+t+".js?v="+e.version;if("remote-config"===t&&(r="/array/"+e.config.token+"/config.js"),"toolbar"===t){var a=3e5;r=r+"&t="+Math.floor(Date.now()/a)*a}var s=e.requestRouter.endpointFor("assets",r);Z(e,s,n)},w.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);Z(e,r,n)};var Q={};function ee(e,t,n){if(A(e))if(f&&e.forEach===f)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,a=e.length;r<a;r++)if(r in e&&t.call(n,e[r],r)===Q)return}function te(e,t,n){if(!B(e)){if(A(e))return ee(e,t,n);if((e=>e instanceof FormData)(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===Q)return}else for(var a in e)if(R.call(e,a)&&t.call(n,e[a],a)===Q)return}}var ne=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ee(n,function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},re=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ee(n,function(t){ee(t,function(t){e.push(t)})}),e};function ae(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var se=function(e){try{return e()}catch(e){return}},ie=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){G.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),G.critical(e)}}},oe=function(e){var t={};return te(e,function(e,n){(U(e)&&e.length>0||W(e))&&(t[n]=e)}),t};var le=["herokuapp.com","vercel.app","netlify.app"];function ce(e){var t=null==e?void 0:e.hostname;if(!U(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of le)if(n===r)return!1;return!0}function ue(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function de(e,t,n,r){var a=null!=r?r:{},s=a.capture,i=void 0!==s&&s,o=a.passive,l=void 0===o||o;null==e||e.addEventListener(t,n,{capture:i,passive:l})}var fe="$people_distinct_id",he="__alias",pe="__timers",me="$autocapture_disabled_server_side",ge="$heatmaps_enabled_server_side",ve="$exception_capture_enabled_server_side",xe="$error_tracking_suppression_rules",ye="$web_vitals_enabled_server_side",be="$dead_clicks_enabled_server_side",we="$web_vitals_allowed_metrics",_e="$session_recording_enabled_server_side",ke="$console_log_recording_enabled_server_side",je="$session_recording_network_payload_capture",Ne="$session_recording_masking",Se="$session_recording_canvas_recording",Ce="$replay_sample_rate",Ee="$replay_minimum_duration",Te="$replay_script_config",Ie="$sesid",Pe="$session_is_sampled",Re="$session_recording_url_trigger_activated_session",Oe="$session_recording_event_trigger_activated_session",Ae="$enabled_feature_flags",De="$early_access_features",Me="$feature_flag_details",Fe="$stored_person_properties",Le="$stored_group_properties",Ue="$surveys",He="$surveys_activated",ze="$flag_call_reported",Be="$user_state",We="$client_session_props",qe="$capture_rate_limit",Ve="$initial_campaign_params",$e="$initial_referrer_info",Ge="$initial_person_info",Ye="$epp",Ke="__POSTHOG_TOOLBAR__",Ze="$posthog_cookieless",Je=[fe,he,"__cmpns",pe,_e,ge,Ie,Ae,xe,Be,De,Me,Le,Fe,Ue,ze,We,qe,Ve,$e,Ye,Ge];function Xe(e){return e instanceof Element&&(e.id===Ke||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Qe(e){return!!e&&1===e.nodeType}function et(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}
2function tt(e){return!!e&&3===e.nodeType}function nt(e){return!!e&&11===e.nodeType}function rt(e){return e?E(e).split(/\s+/):[]}function at(e){var t=null==c?void 0:c.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function st(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return rt(t)}function it(e){return B(e)?null:E(e).split(/(\s+)/).filter(e=>yt(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ot(e){var t="";return dt(e)&&!ft(e)&&e.childNodes&&e.childNodes.length&&te(e.childNodes,function(e){var n;tt(e)&&e.textContent&&(t+=null!==(n=it(e.textContent))&&void 0!==n?n:"")}),E(t)}function lt(e){return L(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var ct=["a","button","form","input","select","textarea","label"];function ut(e){var t=e.parentNode;return!(!t||!Qe(t))&&t}function dt(e){for(var t=e;t.parentNode&&!et(t,"body");t=t.parentNode){var n=st(t);if(C(n,"ph-sensitive")||C(n,"ph-no-capture"))return!1}if(C(st(e),"ph-include"))return!0;var r=e.type||"";if(U(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var a=e.name||e.id||"";return!U(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function ft(e){return!!(et(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||et(e,"select")||et(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var ht="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",pt=new RegExp("^(?:"+ht+")$"),mt=new RegExp(ht),gt="\\d{3}-?\\d{2}-?\\d{4}",vt=new RegExp("^("+gt+")$"),xt=new RegExp("("+gt+")");function yt(e,t){if(void 0===t&&(t=!0),B(e))return!1;if(U(e)){if(e=E(e),(t?pt:mt).test((e||"").replace(/[- ]/g,"")))return!1;if((t?vt:xt).test(e))return!1}return!0}function bt(e){var t=ot(e);return yt(t=(t+" "+wt(e)).trim())?t:""}function wt(e){var t="";return e&&e.childNodes&&e.childNodes.length&&te(e.childNodes,function(e){var n;if(e&&"span"===(null==(n=e.tagName)?void 0:n.toLowerCase()))try{var r=ot(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+wt(e)).trim())}catch(e){G.error("[AutoCapture]",e)}}),t}function _t(e){return function(e){var t=e.map(e=>{var t,n,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var a of(e.attr_class.sort(),e.attr_class))r+="."+a.replace(/"/g,"");var s=J({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),i={};return ae(s).sort((e,t)=>{var n=l(e,1)[0],r=l(t,1)[0];return n.localeCompare(r)}).forEach(e=>{var t=l(e,2),n=t[0],r=t[1];return i[kt(n.toString())]=kt(r.toString())}),(r+=":")+ae(i).map(e=>{var t=l(e,2);return t[0]+'="'+t[1]+'"'}).join("")});return t.join(";")}(function(e){return e.map(e=>{var t,n,r={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(n=e.attr__href)?void 0:n.slice(0,2048),attr_class:jt(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ae(e).filter(e=>0===l(e,1)[0].indexOf("attr__")).forEach(e=>{var t=l(e,2),n=t[0],a=t[1];return r.attributes[n]=a}),r})}(e))}function kt(e){return e.replace(/"|\\"/g,'\\"')}function jt(e){var t=e.attr__class;return t?A(t)?t:rt(t):void 0}class Nt{constructor(){this.clicks=[]}isRageClick(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}var St=["localhost","127.0.0.1"],Ct=e=>{var t=null==m?void 0:m.createElement("a");return L(t)?null:(t.href=e,t)},Et=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),a=0;a<r.length;a++){var s=r[a].split("=");if(s[0]===t){n=s;break}}if(!A(n)||n.length<2)return"";var i=n[1];try{i=decodeURIComponent(i)}catch(e){G.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},Tt=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),a=r[0]||"",s=r[1],i=a.split("?"),o=i[1],l=i[0],c=(o||"").split("&"),u=[],d=0;d<c.length;d++){var f=c[d].split("=");A(f)&&(t.includes(f[0])?u.push(f[0]+"="+n):u.push(c[d]))}var h=l;return null!=o&&(h+="?"+u.join("&")),null!=s&&(h+="#"+s),h},It=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));
vendor: 9,856 bytes, line 2
2return n?n[1]:null},Pt=Y("[AutoCapture]");function Rt(e,t){return t.length>e?t.slice(0,e)+"...":t}function Ot(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Qe(t));return t}function At(e,t){for(var n,r,a=t.e,s=t.maskAllElementAttributes,i=t.maskAllText,o=t.elementAttributeIgnoreList,l=t.elementsChainAsString,u=[e],d=e;d.parentNode&&!et(d,"body");)nt(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var f,h=[],p={},m=!1,g=!1;if(te(u,e=>{var t=dt(e);"a"===e.tagName.toLowerCase()&&(m=e.getAttribute("href"),m=t&&m&&yt(m)&&m),C(st(e),"ph-no-capture")&&(g=!0),h.push(function(e,t,n,r){var a=e.tagName.toLowerCase(),s={tag_name:a};ct.indexOf(a)>-1&&!n&&("a"===a.toLowerCase()||"button"===a.toLowerCase()?s.$el_text=Rt(1024,bt(e)):s.$el_text=Rt(1024,ot(e)));var i=st(e);i.length>0&&(s.classes=i.filter(function(e){return""!==e})),te(e.attributes,function(n){var a;if((!ft(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==r||!r.includes(n.name))&&!t&&yt(n.value)&&(a=n.name,!U(a)||"_ngcontent"!==a.substring(0,10)&&"_nghost"!==a.substring(0,7))){var i=n.value;"class"===n.name&&(i=rt(i).join(" ")),s["attr__"+n.name]=Rt(1024,i)}});for(var o=1,l=1,c=e;c=Ot(c);)o++,c.tagName===e.tagName&&l++;return s.nth_child=o,s.nth_of_type=l,s}(e,s,i,o));var n=function(e){if(!dt(e))return{};var t={};return te(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&yt(r)&&(t[n]=r)}}),t}(e);ne(p,n)}),g)return{props:{},explicitNoCapture:g};if(i||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=bt(e):h[0].$el_text=ot(e)),m){var v,x;h[0].attr__href=m;var y=null==(v=Ct(m))?void 0:v.host,b=null==c||null==(x=c.location)?void 0:x.host;y&&b&&y!==b&&(f=m)}return{props:ne({$event_type:a.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:_t(h)},null!=(n=h[0])&&n.$el_text?{$el_text:null==(r=h[0])?void 0:r.$el_text}:{},f&&"click"===a.type?{$external_click_url:f}:{},p)}}class Dt{constructor(e){this.i=!1,this.o=null,this.rageclicks=new Nt,this.h=!1,this.instance=e,this.m=null}get S(){var e,t,n=M(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null==(e=n.url_allowlist)?void 0:e.map(e=>new RegExp(e)),n.url_ignorelist=null==(t=n.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),n}$(){if(this.isBrowserSupported()){if(c&&m){var e=e=>{e=e||(null==c?void 0:c.event);try{this.k(e)}catch(c){Pt.error("Failed to capture event",c)}};if(de(m,"submit",e,{capture:!0}),de(m,"change",e,{capture:!0}),de(m,"click",e,{capture:!0}),this.S.capture_copied_text){var t=e=>{e=e||(null==c?void 0:c.event),this.k(e,k)};de(m,"copy",t,{capture:!0}),de(m,"cut",t,{capture:!0})}}}else Pt.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.i&&(this.$(),this.i=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.h=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[me]:!!e.autocapture_opt_out}),this.o=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.m=e}getElementSelectors(e){var t,n=[];return null==(t=this.m)||t.forEach(t=>{var r=null==m?void 0:m.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&n.push(t)})}),n}get isEnabled(){var e,t,n=null==(e=this.instance.persistence)?void 0:e.props[me],r=this.o;if(z(r)&&!q(n)&&!this.instance.I())return!1;var a=null!==(t=this.o)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!a}k(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var n,r=lt(e);tt(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.k(e,"$rageclick");var a=t===k;if(r&&function(e,t,n,r,a){var s,i,o;if(void 0===n&&(n=void 0),!c||!e||et(e,"html")||!Qe(e))return!1;if(null!=(s=n)&&s.url_allowlist&&!at(n.url_allowlist))return!1;if(null!=(i=n)&&i.url_ignorelist&&at(n.url_ignorelist))return!1;if(null!=(o=n)&&o.dom_event_allowlist){var l=n.dom_event_allowlist;if(l&&!l.some(e=>t.type===e))return!1}for(var u=!1,d=[e],f=!0,h=e;h.parentNode&&!et(h,"body");)if(nt(h.parentNode))d.push(h.parentNode.host),h=h.parentNode.host;else{if(!(f=ut(h)))break;if(r||ct.indexOf(f.tagName.toLowerCase())>-1)u=!0;else{var p=c.getComputedStyle(f);p&&"pointer"===p.getPropertyValue("cursor")&&(u=!0)}d.push(f),h=f}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(L(n))return!0;var r,a=function(e){if(n.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var s of e)if(r=a(s))return r.v;return!1}(d,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(L(n))return!0;var r,a=function(e){if(n.some(t=>e.matches(t)))return{v:!0}};for(var s of e)if(r=a(s))return r.v;return!1}(d,n))return!1;var m=c.getComputedStyle(e);if(m&&"pointer"===m.getPropertyValue("cursor")&&"click"===t.type)return!0;var g=e.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(a||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(a||["change","click"]).indexOf(t.type)>=0;default:return u?(a||["click"]).indexOf(t.type)>=0:(a||["click"]).indexOf(t.type)>=0&&(ct.indexOf(g)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.S,a,a?["copy","cut"]:void 0)){var s=At(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.S.element_attribute_ignorelist,elementsChainAsString:this.h}),i=s.props;if(s.explicitNoCapture)return!1;var o=this.getElementSelectors(r);if(o&&o.length>0&&(i.$element_selectors=o),t===k){var l,u=it(null==c||null==(l=c.getSelection())?void 0:l.toString()),d=e.type||"clipboard";if(!u)return!1;i.$selected_content=u,i.$copy_type=d}return this.instance.capture(t,i),!0}}}isBrowserSupported(){return D(null==m?void 0:m.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return W(e)&&isFinite(e)&&Math.floor(e)===e});var Mt="0123456789abcdef";class Ft{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||e<0||t<0||n<0||r<0||e>0xffffffffffff||t>4095||n>1073741823||r>4294967295)throw new RangeError("invalid field value");var a=new Uint8Array(16);return a[0]=e/Math.pow(2,40),a[1]=e/Math.pow(2,32),a[2]=e/Math.pow(2,24),a[3]=e/Math.pow(2,16),a[4]=e/Math.pow(2,8),a[5]=e,a[6]=112|t>>>8,a[7]=t,a[8]=128|n>>>24,a[9]=n>>>16,a[10]=n>>>8,a[11]=n,a[12]=r>>>24,a[13]=r>>>16,a[14]=r>>>8,a[15]=r,new Ft(a)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Mt.charAt(this.bytes[t]>>>4)+Mt.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Ft(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}class Lt{constructor(){this.P=0,this.R=0,this.T=new zt}generate(){var e=this.generateOrAbort();if(L(e)){this.P=0;var t=this.generateOrAbort();if(L(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.M();else{if(!(e+1e4>this.P))return;this.R++,this.R>4398046511103&&(this.P++,this.M())}return Ft.fromFieldsV7(this.P,Math.trunc(this.R/Math.pow(2,30)),this.R&Math.pow(2,30)-1,this.T.nextUint32())}M(){this.R=1024*this.T.nextUint32()+(1023&this.T.nextUint32())}}var Ut,Ht=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};c&&!L(c.crypto)&&crypto.getRandomValues&&(Ht=e=>crypto.getRandomValues(e));class zt{constructor(){this.C=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.C.length&&(Ht(this.C),this.F=0),this.C[this.F++]}}var Bt=()=>Wt().toString(),Wt=()=>(Ut||(Ut=new Lt)).generate(),qt="",Vt=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var $t={O:()=>!!m,A:function(e){G.error("cookieStore error: "+e)},D:function(e){if(m){try{for(var t=e+"=",n=m.cookie.split(";").filter(e=>e.length),r=0;r<n.length;r++){for(var a=n[r];" "==a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t))return decodeURIComponent(a.substring(t.length,a.length))}}catch(e){}return null}},L:function(e){var t;try{t=JSON.parse($t.D(e))||{}}catch(e){}return t},j:function(e,t,n,r,a){if(m)try{var s="",i="",o=function(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=m),qt)return qt;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),a="dmn_chk_"+Bt();!qt&&r--;){var s=n.slice(r).join("."),i=a+"=1;domain=."+s+";path=/";t.cookie=i+";max-age=3",t.cookie.includes(a)&&(t.cookie=i+";max-age=0",qt=s)}return qt}(e);if(!n){var r=(e=>{var t=e.match(Vt);return t?t[0]:""})(e);r!==n&&G.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}(m.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}a&&(i="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+o+i;return c.length>3686.4&&G.warn("cookieStore warning: large cookie, len="+c.length),m.cookie=c,c}catch(e){return}},N:function(e,t){try{$t.j(e,"",-1,t)}catch(e){return}}},Gt=null,Yt={O:function(){if(!z(Gt))return Gt;var e=!0;if(L(c))e=!1;
2else try{var t="__mplssupport__";Yt.j(t,"xyz"),'"xyz"'!==Yt.D(t)&&(e=!1),Yt.N(t)}catch(c){e=!1}return e||G.error("localStorage unsupported; falling back to cookie store"),Gt=e,e},A:function(e){G.error("localStorage error: "+e)},D:function(e){try{return null==c?void 0:c.localStorage.getItem(e)}catch(c){Yt.A(c)}return null},L:function(e){try{return JSON.parse(Yt.D(e))||{}}catch(e){}return null},j:function(e,t){try{null==c||c.localStorage.setItem(e,JSON.stringify(t))}catch(c){Yt.A(c)}},N:function(e){try{null==c||c.localStorage.removeItem(e)}catch(c){Yt.A(c)}}},Kt=["distinct_id",Ie,Pe,Ye,Ge],Zt=J({},Yt,{L:function(e){try{var t={};try{t=$t.L(e)||{}}catch(e){}var n=ne(t,JSON.parse(Yt.D(e)||"{}"));return Yt.j(e,n),n}catch(e){}return null},j:function(e,t,n,r,a,s){try{Yt.j(e,t,void 0,void 0,s);var i={};Kt.forEach(e=>{t[e]&&(i[e]=t[e])}),Object.keys(i).length&&$t.j(e,i,n,r,a,s)}catch(e){Yt.A(e)}},N:function(e,t){try{null==c||c.localStorage.removeItem(e),$t.N(e,t)}catch(c){Yt.A(c)}}}),Jt={},Xt={O:function(){return!0},A:function(e){G.error("memoryStorage error: "+e)},D:function(e){return Jt[e]||null},L:function(e){return Jt[e]||null},j:function(e,t){Jt[e]=t},N:function(e){delete Jt[e]}},Qt=null,en={O:function(){if(!z(Qt))return Qt;if(Qt=!0,L(c))Qt=!1;else try{var e="__support__";en.j(e,"xyz"),'"xyz"'!==en.D(e)&&(Qt=!1),en.N(e)}catch(c){Qt=!1}return Qt},A:function(e){G.error("sessionStorage error: ",e)},D:function(e){try{return null==c?void 0:c.sessionStorage.getItem(e)}catch(c){en.A(c)}return null},L:function(e){try{return JSON.parse(en.D(e))||null}catch(e){}return null},j:function(e,t){try{null==c||c.sessionStorage.setItem(e,JSON.stringify(t))}catch(c){en.A(c)}},N:function(e){try{null==c||c.sessionStorage.removeItem(e)}catch(c){en.A(c)}}},tn=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class nn{constructor(e){this._instance=e}get S(){return this._instance.config}get consent(){return this.U()?tn.DENIED:this.q}isOptedOut(){return this.consent===tn.DENIED||this.consent===tn.PENDING&&this.S.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.B.j(this.H,e?1:0,this.S.cookie_expiration,this.S.cross_subdomain_cookie,this.S.secure_cookie)}reset(){this.B.N(this.H,this.S.cross_subdomain_cookie)}get H(){var e=this._instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}get q(){var e=this.B.D(this.H);return"1"===e?tn.GRANTED:"0"===e?tn.DENIED:tn.PENDING}get B(){if(!this.W){var e=this.S.opt_out_capturing_persistence_type;this.W="localStorage"===e?Yt:$t;var t="localStorage"===e?$t:Yt;t.D(this.H)&&(this.W.D(this.H)||this.optInOut("1"===t.D(this.H)),t.N(this.H,this.S.cross_subdomain_cookie))}return this.W}U(){return!!this.S.respect_dnt&&!!ue([null==p?void 0:p.doNotTrack,null==p?void 0:p.msDoNotTrack,w.doNotTrack],e=>C([!0,1,"1","yes"],e))}}var rn=Y("[Dead Clicks]"),an=()=>!0,sn=e=>{var t,n=!(null==(t=e.instance.persistence)||!t.get_property(be)),r=e.instance.config.capture_dead_clicks;return q(r)?r:n};class on{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[be]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.J(()=>{this.V()})}J(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?rn.error("failed to load script",t):e()})}V(){var e;if(m){if(!this.G&&null!=(e=w.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=M(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.G=w.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.G.start(m),rn.info("starting...")}}else rn.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,rn.info("stopping..."))}}function ln(e,t,n,r,a){return t>n&&(G.warn("min cannot be greater than max."),t=n),W(e)?e>n?(r&&G.warn(r+" cannot be  greater than max: "+n+". Using max value instead."),n):e<t?(r&&G.warn(r+" cannot be less than min: "+t+". Using min value instead."),t):e:(r&&G.warn(r+" must be a number. using max or fallback. max: "+n+", fallback: "+a),ln(a||n,t,n,r))}class cn{constructor(e){this.K={},this.Y=()=>
2{Object.keys(this.K).forEach(e=>{var t=this.X(e)+this.Z;t>=this.tt?delete this.K[e]:this.it(e,t)})},this.X=e=>this.K[String(e)],this.it=(e,t)=>{this.K[String(e)]=t},this.consumeRateLimit=e=>{var t,n=null!==(t=this.X(e))&&void 0!==t?t:this.tt;if(0===(n=Math.max(n-1,0)))return!0;this.it(e,n);var r,a=0===n;return a&&(null==(r=this.et)||r.call(this,e)),a},this.rt=e,this.et=this.rt.et,this.tt=ln(this.rt.bucketSize,0,100,"rate limiter bucket size"),this.Z=ln(this.rt.refillRate,0,this.tt,"rate limiter refill rate"),this.st=ln(this.rt.refillInterval,0,864e5,"rate limiter refill interval"),setInterval(()=>{this.Y()},this.st)}}var un=Y("[ExceptionAutocapture]");class dn{constructor(e){var t,n,r;this.nt=()=>{var e;if(c&&this.isEnabled&&null!=(e=w.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=w.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=w.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=w.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ot&&this.S.capture_unhandled_errors&&(this.ot=t(this.captureException.bind(this))),!this.lt&&this.S.capture_unhandled_rejections&&(this.lt=n(this.captureException.bind(this))),!this.ut&&this.S.capture_console_errors&&(this.ut=r(this.captureException.bind(this)))}catch(c){un.error("failed to start",c),this.ht()}}},this._instance=e,this.dt=!(null==(t=this._instance.persistence)||!t.props[ve]),this.S=this.vt(),this.ct=new cn({refillRate:null!==(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==n?n:1,bucketSize:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10,refillInterval:1e4}),this.startIfEnabled()}vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return M(e)?t=J({},t,e):(L(e)?this.dt:e)&&(t=J({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.S.capture_console_errors||this.S.capture_unhandled_errors||this.S.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(un.info("enabled"),this.J(this.nt))}J(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return un.error("failed to load script",t);e()})}ht(){var e,t,n;null==(e=this.ot)||e.call(this),this.ot=void 0,null==(t=this.lt)||t.call(this),this.lt=void 0,null==(n=this.ut)||n.call(this),this.ut=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.dt=!!t||!1,this.S=this.vt(),this._instance.persistence&&this._instance.persistence.register({[ve]:this.dt}),this.startIfEnabled()}captureException(e){var t,n=this._instance.requestRouter.endpointFor("ui");e.$exception_personURL=n+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id();var r=null!==(t=e.$exception_list[0].type)&&void 0!==t?t:"Exception";this.ct.consumeRateLimit(r)?un.info("Skipping exception capture because of client rate limiting.",{exception:e.$exception_list[0].type}):this._instance.exceptions.sendExceptionEvent(e)}}function fn(e){return!L(Event)&&hn(e,Event)}function hn(e,t){try{return e instanceof t}catch(e){return!1}}function pn(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return hn(e,Error)}}function mn(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function gn(e){return mn(e,"DOMError")}var vn=/\(error: (.*)\)/,xn="?";function yn(e,t,n,r){var a={platform:"web:javascript",filename:e,function:"<anonymous>"===t?xn:t,in_app:!0};return L(n)||(a.lineno=n),L(r)||(a.colno=r),a}var bn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,wn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,_n=/\((\S*)(?::(\d+))(?::(\d+))\)/,kn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Nn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.sort((e,t)=>
2e[0]-t[0]).map(e=>e[1]);return function(e,t){void 0===t&&(t=0);for(var n=[],a=e.split("\n"),s=t;s<a.length;s++){var i=a[s];if(!(i.length>1024)){var o=vn.test(i)?i.replace(vn,"$1"):i;if(!o.match(/\S*Error: /)){for(var l of r){var c=l(o);if(c){n.push(c);break}}if(n.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>J({},e,{filename:e.filename||Sn(t).filename,function:e.function||xn}))}(n)}}([30,e=>{var t=bn.exec(e);if(t){var n=l(t,4),r=n[1],a=n[2],s=n[3];return yn(r,xn,+a,+s)}var i=wn.exec(e);if(i){if(i[2]&&0===i[2].indexOf("eval")){var o=_n.exec(i[2]);o&&(i[2]=o[1],i[3]=o[2],i[4]=o[3])}var c=l(In(i[1]||xn,i[2]),2),u=c[0];return yn(c[1],u,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}}],[50,e=>{var t=kn.exec(e);if(t){var n;if(t[3]&&t[3].indexOf(" > eval")>-1){var r=jn.exec(t[3]);r&&(t[1]=t[1]||"eval",t[3]=r[1],t[4]=r[2],t[5]="")}var a=t[3],s=t[1]||xn;return s=(n=l(In(s,a),2))[0],yn(a=n[1],s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]);function Sn(e){return e[e.length-1]||{}}var Cn,En,Tn,In=(e,t)=>{var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:xn,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Pn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Rn(e,t){void 0===t&&(t=0);var n=e.stacktrace||e.stack||"",r=function(e){return e&&On.test(e.message)?1:0}(e);try{var a=Nn,s=function(e,t){var n=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var n=Object.keys(t);return Tn&&n.length===En||(En=n.length,Tn=n.reduce((n,r)=>{Cn||(Cn={});var a=Cn[r];if(a)n[a[0]]=a[1];else for(var s=e(r),i=s.length-1;i>=0;i--){var o=s[i],l=null==o?void 0:o.filename,c=t[r];if(l&&c){n[l]=c,Cn[r]=[l,c];break}}return n},{})),Tn}(t);return e.forEach(e=>{e.filename&&(e.chunk_id=n[e.filename])}),e}(a(n,r),a);return s.slice(0,s.length-t)}catch(e){}return[]}var On=/Minified React error #\d+;/i;function An(e,t){var n=function(e,t){var n,r,a=Rn(e),s=null===(n=null==t?void 0:t.handled)||void 0===n||n,i=null!==(r=null==t?void 0:t.synthetic)&&void 0!==r&&r;return{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(e){var t=e.message;return t.error&&"string"==typeof t.error.message?String(t.error.message):String(t)}(e),stacktrace:{frames:a,type:"raw"},mechanism:{handled:s,synthetic:i}}}(e,t);return e.cause&&pn(e.cause)&&e.cause!==e?[n,...An(e.cause,{handled:null==t?void 0:t.handled,synthetic:null==t?void 0:t.synthetic})]:[n]}function Dn(e,t){return{$exception_list:An(e,t),$exception_level:"error"}}function Mn(e,t){var n,r,a,s=null===(n=null==t?void 0:t.handled)||void 0===n||n,i=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,o={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(a=null==t?void 0:t.defaultExceptionType)&&void 0!==a?a:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:s,synthetic:i}};if(null!=t&&t.syntheticException){var l=Rn(t.syntheticException,1);l.length&&(o.stacktrace={frames:l,type:"raw"})}return{$exception_list:[o],$exception_level:"error"}}function Fn(e){return U(e)&&!H(e)&&S.indexOf(e)>=0}function Ln(e,t){var n=e.error,r=e.event,a={$exception_list:[]},s=n||r;if(gn(s)||function(e){return mn(e,"DOMException")}(s)){var i=s;if(function(e){return"stack"in e}(s))a=Dn(s,t);else{var o=i.name||(gn(i)?"DOMError":"DOMException"),l=i.message?o+": "+i.message:o;a=Mn(l,J({},t,{overrideExceptionType:gn(i)?"DOMError":"DOMException",defaultExceptionMessage:l}))}return"code"in i&&(a.$exception_DOMException_code=""+i.code),a}if(function(e){return mn(e,"ErrorEvent")}(s)&&s.error)return Dn(s.error,t);if(pn(s))return Dn(s,t);if(function(e){return mn(e,"Object")}(s)||fn(s))return function(e,t){var n,r,a=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,i=null!=t&&t.overrideExceptionType?t.overrideExceptionType:fn(e)?e.constructor.name:"Error",o="Non-Error 'exception' captured with keys: "+function(e,t){void 0===t&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var a=n.slice(0,r).join(", ");
2if(!(a.length>t))return r===n.length||a.length<=t?a:a.slice(0,t)+"..."}return""}(e),l={type:i,value:o,mechanism:{handled:a,synthetic:s}};if(null!=t&&t.syntheticException){var c=Rn(null==t?void 0:t.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:Fn(e.level)?e.level:"error"}}(s,t);if(L(n)&&U(r)){var c="Error",u=r,d=r.match(Pn);return d&&(c=d[1],u=d[2]),Mn(u,J({},t,{overrideExceptionType:c,defaultExceptionMessage:u}))}return Mn(s,t)}function Un(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],a=n(r);return D(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=a,()=>{e[t]=r}}catch(e){return()=>{}}}class Hn{constructor(e){var t;this._instance=e,this.ft=(null==c||null==(t=c.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(G.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.gt&&this.gt(),this.gt=void 0,G.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(c&&c.history){var n=this;null!=(e=c.history.pushState)&&e.__posthog_wrapped__||Un(c.history,"pushState",e=>function(t,r,a){e.call(this,t,r,a),n._t("pushState")}),null!=(t=c.history.replaceState)&&t.__posthog_wrapped__||Un(c.history,"replaceState",e=>function(t,r,a){e.call(this,t,r,a),n._t("replaceState")}),this.bt()}}_t(e){try{var t,n=null==c||null==(t=c.location)?void 0:t.pathname;if(!n)return;n!==this.ft&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ft=n}catch(c){G.error("Error capturing "+e+" pageview",c)}}bt(){if(!this.gt){var e=()=>{this._t("popstate")};de(c,"popstate",e),this.gt=()=>{c&&c.removeEventListener("popstate",e)}}}}function zn(e){var t,n;return(null==(t=JSON.stringify(e,(n=[],function(e,t){if(M(t)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(t)?"[Circular]":(n.push(t),t)}return t})))?void 0:t.length)||0}function Bn(e,t){if(void 0===t&&(t=6606028.8),e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),a=e.data.slice(n);return[Bn({size:zn(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),Bn({size:zn(a),data:a,sessionId:e.sessionId,windowId:e.windowId})].flatMap(e=>e)}return[e]}var Wn=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Wn||{}),qn=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(qn||{}),Vn="[SessionRecording]",$n="redacted",Gn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Yn=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Kn=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Zn=["/s/","/e/","/i/"];function Jn(e,t,n,r){if(B(e))return e;var a=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return U(a)&&(a=parseInt(a)),a>n?Vn+" "+r+" body too large to record ("+a+" bytes)":e}function Xn(e,t){if(B(e))return e;var n=e;return yt(n,!1)||(n=Vn+" "+t+" body "+$n),te(Kn,e=>{var r,a;null!=(r=n)&&r.length&&-1!==(null==(a=n)?void 0:a.indexOf(e))&&(n=Vn+" "+t+" body "+$n+" as might contain: "+e)}),n}class Qn{constructor(e,t){var n,r;void 0===t&&(t={}),this.yt={},this.wt=e=>{if(!this.yt[e]){var t,n;this.yt[e]=!0;var r=this.St(e);null==(t=(n=this.rt).onBlockedNode)||t.call(n,e,r)}},this.$t=e=>{var t=this.St(e);
2if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[this._rrweb.mirror.getId(n),n]}return[e,t]},this.St=e=>this._rrweb.mirror.getNode(e),this.kt=e=>{var t,n,r,a,s,i,o,l;return(null!==(t=null==(n=e.removes)?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null==(a=e.attributes)?void 0:a.length)&&void 0!==r?r:0)+(null!==(s=null==(i=e.texts)?void 0:i.length)&&void 0!==s?s:0)+(null!==(o=null==(l=e.adds)?void 0:l.length)&&void 0!==o?o:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=this.kt(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var t=l(this.$t(e.id),1)[0];return!this.ct.consumeRateLimit(t)&&e}));var r=this.kt(t);return 0!==r||n===r?e:void 0},this._rrweb=e,this.rt=t,this.ct=new cn({bucketSize:null!==(n=this.rt.bucketSize)&&void 0!==n?n:100,refillRate:null!==(r=this.rt.refillRate)&&void 0!==r?r:10,refillInterval:1e3,et:this.wt})}}var er=Uint8Array,tr=Uint16Array,nr=Uint32Array,rr=new er([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ar=new er([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),sr=new er([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ir=function(e,t){for(var n=new tr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var a=new nr(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)a[s]=s-n[r]<<5|r;return[n,a]},or=ir(rr,2),lr=or[0],cr=or[1];lr[28]=258,cr[258]=28;for(var ur=ir(ar,0)[1],dr=new tr(32768),fr=0;fr<32768;++fr){var hr=(43690&fr)>>>1|(21845&fr)<<1;hr=(61680&(hr=(52428&hr)>>>2|(13107&hr)<<2))>>>4|(3855&hr)<<4,dr[fr]=((65280&hr)>>>8|(255&hr)<<8)>>>1}var pr=function(e,t,n){for(var r=e.length,a=0,s=new tr(t);a<r;++a)++s[e[a]-1];var i,o=new tr(t);for(a=0;a<t;++a)o[a]=o[a-1]+s[a-1]<<1;if(n){i=new tr(1<<t);var l=15-t;for(a=0;a<r;++a)if(e[a])for(var c=a<<4|e[a],u=t-e[a],d=o[e[a]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)i[dr[d]>>>l]=c}else for(i=new tr(r),a=0;a<r;++a)i[a]=dr[o[e[a]-1]++]>>>15-e[a];return i},mr=new er(288);for(fr=0;fr<144;++fr)mr[fr]=8;for(fr=144;fr<256;++fr)mr[fr]=9;for(fr=256;fr<280;++fr)mr[fr]=7;for(fr=280;fr<288;++fr)mr[fr]=8;var gr=new er(32);for(fr=0;fr<32;++fr)gr[fr]=5;var vr=pr(mr,9,0),xr=pr(gr,5,0),yr=function(e){return(e/8|0)+(7&e&&1)},br=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof tr?tr:e instanceof nr?nr:er)(n-t);return r.set(e.subarray(t,n)),r},wr=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},_r=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},kr=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,s=n.slice();if(!a)return[new er(0),0];if(1==a){var i=new er(n[0].s+1);return i[n[0].s]=1,[i,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var o=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=a-1;)o=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:o.f+l.f,l:o,r:l};var f=s[0].s;for(r=1;r<a;++r)s[r].s>f&&(f=s[r].s);var h=new tr(f+1),p=jr(n[u-1],h,0);if(p>t){r=0;var m=0,g=p-t,v=1<<g;for(s.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});r<a;++r){var x=s[r].s;if(!(h[x]>t))break;m+=v-(1<<p-h[x]),h[x]=t}for(m>>>=g;m>0;){var y=s[r].s;h[y]<t?m-=1<<t-h[y]++-1:++r}for(;r>=0&&m;--r){var b=s[r].s;h[b]==t&&(--h[b],++m)}p=t}return[new er(h),p]},jr=function(e,t,n){return-1==e.s?Math.max(jr(e.l,t,n+1),jr(e.r,t,n+1)):t[e.s]=n},Nr=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new tr(++t),r=0,a=e[0],s=1,i=function(e){n[r++]=e},o=1;o<=t;++o)if(e[o]==a&&o!=t)++s;else{if(!a&&s>2){for(;s>138;s-=138)i(32754);s>2&&(i(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(i(a),--s;s>6;s-=6)i(8304);s>2&&(i(s-3<<5|8208),s=0)}for(;s--;)i(a);s=1,a=e[o]}return[n.subarray(0,r),t]},Sr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Cr=function(e,t,n){var r=n.length,a=yr(t+2);e[a]=255&r,e[a+1]=r>>>8,e[a+2]=255^e[a],e[a+3]=255^e[a+1];for(var s=0;s<r;++s)e[a+s+4]=n[s];return 8*(a+4+r)},Er=function(e,t,n,r,a,s,i,o,l,c,u){wr(t,u++,n),++a[256];for(var d=kr(a,15),f=d[0],h=d[1],p=kr(s,15),m=p[0],g=p[1],v=Nr(f),x=v[0],y=v[1],b=Nr(m),w=b[0],_=b[1],k=new tr(19),j=0;j<x.length;++j)k[31&x[j]]++;for(j=0;j<w.length;++j)k[31&w[j]]++;for(var N=kr(k,7),S=N[0],C=N[1],E=19;E>4&&!S[sr[E-1]];--E);var T,I,P,R,O=c+5<<3,A=Sr(a,mr)+Sr(s,gr)+i,D=Sr(a,f)+Sr(s,m)+i+14+3*E+Sr(k,S)+(2*k[16]+3*k[17]+7*k[18]);if(O<=A&&O<=D)return Cr(t,u,e.subarray(l,l+c));if(wr(t,u,1+(D<A)),u+=2,D<A){T=pr(f,h,0),I=f,P=pr(m,g,0),R=m;var M=pr(S,C,0);for(wr(t,u,y-257),wr(t,u+5,_-1),wr(t,u+10,E-4),u+=14,j=0;j<E;++j)wr(t,u+3*j,S[sr[j]]);u+=3*E;for(var F=[x,w],L=0;L<2;++L){var U=F[L];for(j=0;j<U.length;++j){var H=31&U[j];wr(t,u,M[H]),u+=S[H],H>15&&(wr(t,u,U[j]>>>5&127),u+=U[j]>>>12)}}}else T=vr,I=mr,P=xr,R=gr;for(j=0;j<o;++j)if(r[j]>
2255){H=r[j]>>>18&31,_r(t,u,T[H+257]),u+=I[H+257],H>7&&(wr(t,u,r[j]>>>23&31),u+=rr[H]);var z=31&r[j];_r(t,u,P[z]),u+=R[z],z>3&&(_r(t,u,r[j]>>>5&8191),u+=ar[z])}else _r(t,u,T[r[j]]),u+=I[r[j]];return _r(t,u,T[256]),u+I[256]},Tr=new nr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ir=function(){for(var e=new nr(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Pr=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Rr(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Ir[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var a=function(e,t,n,r,a){return function(e,t,n,r,a,s){var i=e.length,o=new er(r+i+5*(1+Math.floor(i/7e3))+a),l=o.subarray(r,o.length-a),c=0;if(!t||i<8)for(var u=0;u<=i;u+=65535){var d=u+65535;d<i?c=Cr(l,c,e.subarray(u,d)):(l[u]=s,c=Cr(l,c,e.subarray(u,i)))}else{for(var f=Tr[t-1],h=f>>>13,p=8191&f,m=(1<<n)-1,g=new tr(32768),v=new tr(m+1),x=Math.ceil(n/3),y=2*x,b=function(t){return(e[t]^e[t+1]<<x^e[t+2]<<y)&m},w=new nr(25e3),_=new tr(288),k=new tr(32),j=0,N=0,S=(u=0,0),C=0,E=0;u<i;++u){var T=b(u),I=32767&u,P=v[T];if(g[I]=P,v[T]=I,C<=u){var R=i-u;if((j>7e3||S>24576)&&R>423){c=Er(e,l,0,w,_,k,N,S,E,u-E,c),S=j=N=0,E=u;for(var O=0;O<286;++O)_[O]=0;for(O=0;O<30;++O)k[O]=0}var A=2,D=0,M=p,F=I-P&32767;if(R>2&&T==b(u-F))for(var L=Math.min(h,R)-1,U=Math.min(32767,u),H=Math.min(258,R);F<=U&&--M&&I!=P;){if(e[u+A]==e[u+A-F]){for(var z=0;z<H&&e[u+z]==e[u+z-F];++z);if(z>A){if(A=z,D=F,z>L)break;var B=Math.min(F,z-2),W=0;for(O=0;O<B;++O){var q=u-F+O+32768&32767,V=q-g[q]+32768&32767;V>W&&(W=V,P=q)}}}F+=(I=P)-(P=g[I])+32768&32767}if(D){w[S++]=268435456|cr[A]<<18|ur[D];var $=31&cr[A],G=31&ur[D];N+=rr[$]+ar[G],++_[257+$],++k[G],C=u+A,++j}else w[S++]=e[u],++_[e[u]]}}c=Er(e,l,s,w,_,k,N,S,E,u-E,c)}return br(o,0,r+yr(c)+a)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!a)}(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),s=a.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Pr(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(a,t),Pr(a,s-8,n.d()),Pr(a,s-4,r),a}function Or(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new er(e.length+(e.length>>>1)),a=0,s=function(e){r[a++]=e},i=0;i<n;++i){if(a+5>r.length){var o=new er(a+8+(n-i<<1));o.set(r),r=o}var l=e.charCodeAt(i);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++i))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return br(r,0,a)}var Ar="disabled",Dr="sampled",Mr="active",Fr="buffering",Lr="paused",Ur="trigger",Hr=Ur+"_activated",zr=Ur+"_pending",Br=Ur+"_"+Ar;function Wr(e,t){return t.some(t=>"regex"===t.matching&&new RegExp(t.url).test(e))}class qr{constructor(e){this.xt=e}triggerStatus(e){var t=this.xt.map(t=>t.triggerStatus(e));return t.includes(Hr)?Hr:t.includes(zr)?zr:Br}stop(){this.xt.forEach(e=>e.stop())}}class Vr{constructor(e){this.xt=e}triggerStatus(e){var t=new Set;for(var n of this.xt)t.add(n.triggerStatus(e));switch(t.delete(Br),t.size){case 0:return Br;case 1:return Array.from(t)[0];default:return zr}}stop(){this.xt.forEach(e=>e.stop())}}class $r{triggerStatus(){return zr}stop(){}}class Gr{constructor(e){this.Et=[],this.It=[],this.urlBlocked=!1,this._instance=e}onRemoteConfig(e){var t,n;this.Et=(null==(t=e.sessionRecording)?void 0:t.urlTriggers)||[],this.It=(null==(n=e.sessionRecording)?void 0:n.urlBlocklist)||[]}Pt(e){var t;return 0===this.Et.length?Br:(null==(t=this._instance)?void 0:t.get_property(Re))===e?Hr:zr}triggerStatus(e){var t=this.Pt(e),n=t===Hr?Hr:t===zr?zr:Br;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:n}),n}checkUrlTriggerConditions(e,t,n){if(void 0!==c&&c.location.href){var r=c.location.href,a=this.urlBlocked,s=Wr(r,this.It);a&&s||(s&&!a?e():!s&&a&&t(),Wr(r,this.Et)&&n("url"))}}stop(){}}class Yr{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Rt=()=>{},this._instance=e}triggerStatus(){var e=zr;return B(this.linkedFlag)&&(e=Br),this.linkedFlagSeen&&(e=Hr),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}onRemoteConfig(e,t){var n;if(this.linkedFlag=(null==(n=e.sessionRecording)?void 0:n.linkedFlag)||null,!B(this.linkedFlag)&&!this.linkedFlagSeen){var r=U(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,a=U(this.linkedFlag)?null:this.linkedFlag.variant;this.Rt=this._instance.onFeatureFlags((e,n)=>{var s=!1;if(M(n)&&r in n){var i=n[r];s=q(i)?!0===i:a?i===a:!!i}this.linkedFlagSeen=s,s&&t(r,a)})}}stop(){this.Rt()}}class Kr{constructor(e){this.Tt=[],this._instance=e}onRemoteConfig(e){var t;this.Tt=(null==(t=e.sessionRecording)?void 0:t.eventTriggers)||[]}Mt(e){var t;return 0===this.Tt.length?Br:(null==(t=this._instance)?void 0:t.get_property(Oe))===e?Hr:zr}triggerStatus(e){var t=this.Mt(e),n=t===Hr?Hr:t===zr?zr:Br;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:n}),n}stop(){}}function Zr(e){return e.isRecordingEnabled?Fr:Ar}function Jr(e){if(!e.receivedFlags)return Fr;if(!e.isRecordingEnabled)return Ar;if(e.urlTriggerMatching.urlBlocked)return Lr;var t=!0===e.isSampled,n=new qr([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?Dr:n===Hr?Mr:n===zr?Fr:!1===e.isSampled?Ar:Mr}function Xr(e){if(!e.receivedFlags)return Fr;if(!e.isRecordingEnabled)return Ar;if(e.urlTriggerMatching.urlBlocked)return Lr;var t=new Vr([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),n=t!==Br,r=q(e.isSampled);return n&&t===zr?Fr:n&&t===Br||r&&!e.isSampled?Ar:!0===e.isSampled?Dr:Mr}var Qr="[SessionRecording]",ea=Y(Qr);function ta(){var e;return null==w||null==(e=w.__PosthogExtensions__)||null==(e=e.rrweb)?void 0:e.record}var na=[qn.MouseMove,qn.MouseInteraction,qn.Scroll,qn.ViewportResize,qn.Input,qn.TouchMove,qn.MediaInteraction,qn.Drag],ra=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function aa(e){return function(e){for(var t="",n=0;n<e.length;){var r=e[n++];t+=String.fromCharCode(r)}return t}(Rr(Or(JSON.stringify(e))))}function sa(e){return e.type===Wn.Custom&&"sessionIdle"===e.data.tag}class ia{get sessionId(){return this.Ct}get Ft(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Ot}get At(){if(!this._instance.sessionManager)throw new Error(Qr+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Dt(){var e,t;return this.Lt.triggerStatus(this.sessionId)===zr?6e4:null!==(e=null==(t=this._instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:3e5}get jt(){var e=this._instance.get_property(Pe);return q(e)?e:null}get Nt(){var e,t,n=null==(e=this.C)?void 0:e.data[(null==(t=this.C)?void 0:t.data.length)-1],r=this.At.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}get zt(){var e=!!this._instance.get_property(_e),t=!this._instance.config.disable_session_recording;return c&&e&&t}get Ut(){var e=!!this._instance.get_property(ke),t=this._instance.config.enable_recording_console_log;return null!=t?t:e}get qt(){var e,t,n,r,a,s,i=this._instance.config.session_recording.captureCanvas,o=this._instance.get_property(Se),l=null!==(e=null!==(t=null==i?void 0:i.recordCanvas)&&void 0!==t?t:null==o?void 0:o.enabled)&&void 0!==e&&e,c=null!==(n=null!==(r=null==i?void 0:i.canvasFps)&&void 0!==r?r:null==o?void 0:o.fps)&&void 0!==n?n:4,u=null!==(a=null!==(s=null==i?void 0:i.canvasQuality)&&void 0!==s?s:null==o?void 0:o.quality)&&void 0!==a?a:.4;if("string"==typeof u){var d=parseFloat(u);u=isNaN(d)?.4:d}return{enabled:l,fps:ln(c,0,12,"canvas recording fps",4),quality:ln(u,0,1,"canvas recording quality",.4)}}get Bt(){var e,t,n=this._instance.get_property(je),r={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(t=this._instance.config.session_recording)?void 0:t.recordBody},a=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),s=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),i=M(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,o=!!(q(i)?i:null==n?void 0:n.capturePerformance);return a||s||o?{recordHeaders:a,recordBody:s,recordPerformance:o}:void 0}get Ht(){var e,t,n,r,a,s,i=this._instance.get_property(Ne),o={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(t=this._instance.config.session_recording)?void 0:t.maskTextSelector,blockSelector:null==(n=this._instance.config.session_recording)?void 0:n.blockSelector},l=null!==(r=null==o?void 0:o.maskAllInputs)&&void 0!==r?r:null==i?void 0:i.maskAllInputs,c=null!==(a=null==o?void 0:o.maskTextSelector)&&void 0!==a?a:null==i?void 0:i.maskTextSelector,u=null!==(s=null==o?void 0:o.blockSelector)&&void 0!==s?s:null==i?void 0:i.blockSelector;return L(l)&&L(c)&&L(u)?void 0:{maskAllInputs:null==l||l,maskTextSelector:c,blockSelector:u}}get Wt(){var e=this._instance.get_property(Ce);return W(e)?e:null}get Gt(){var e=this._instance.get_property(Ee);return W(e)?e:null}get status(){return this.Jt?this.Vt({receivedFlags:this.Jt,isRecordingEnabled:this.zt,isSampled:this.jt,urlTriggerMatching:this.Kt,eventTriggerMatching:this.Yt,linkedFlagMatching:this.Xt,sessionId:this.sessionId}):Fr}constructor(e){if(this.Vt=Zr,this.Jt=!1,this.Qt=[],this.Zt="unknown",this.ti=Date.now(),this.Lt=ne
2w $r,this.ii=void 0,this.ei=void 0,this.ri=void 0,this.si=void 0,this.ni=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.oi=()=>{this.ai()},this.li=()=>{this.ui("browser offline",{})},this.hi=()=>{this.ui("browser online",{})},this.di=()=>{if(null!=m&&m.visibilityState){var e="window "+m.visibilityState;this.ui(e,{})}},this._instance=e,this.Ot=!1,this.vi="/s/",this.ci=void 0,this.Jt=!1,!this._instance.sessionManager)throw ea.error("started without valid sessionManager"),new Error(Qr+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw new Error(Qr+" cannot be used with __preview_experimental_cookieless_mode.");this.Xt=new Yr(this._instance),this.Kt=new Gr(this._instance),this.Yt=new Kr(this._instance);var t=this.At.checkAndGetSessionAndWindowId(),n=t.sessionId,r=t.windowId;this.Ct=n,this.fi=r,this.C=this.pi(),this.Ft>=this.At.sessionTimeoutMs&&ea.warn("session_idle_threshold_ms ("+this.Ft+") is greater than the session timeout ("+this.At.sessionTimeoutMs+"). Session will never be detected as idle")}startIfEnabledOrStop(e){this.zt?(this.gi(e),de(c,"beforeunload",this.oi),de(c,"offline",this.li),de(c,"online",this.hi),de(c,"visibilitychange",this.di),this.mi(),this.bi(),B(this.ii)&&(this.ii=this._instance.on("eventCaptured",e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this.yi(null==e?void 0:e.properties.$current_url):"";if(!t)return;this.ui("$pageview",{href:t})}}catch(e){ea.error("Could not add $pageview to rrweb session",e)}})),this.ei||(this.ei=this.At.onSessionId((e,t,n)=>{var r,a;n&&(this.ui("$session_id_change",{sessionId:e,windowId:t,changeReason:n}),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(Oe),null==(a=this._instance)||null==(a=a.persistence)||a.unregister(Re))}))):this.stopRecording()}stopRecording(){var e,t,n,r;this.Ot&&this.ci&&(this.ci(),this.ci=void 0,this.Ot=!1,null==c||c.removeEventListener("beforeunload",this.oi),null==c||c.removeEventListener("offline",this.li),null==c||c.removeEventListener("online",this.hi),null==c||c.removeEventListener("visibilitychange",this.di),this.pi(),clearInterval(this.wi),null==(e=this.ii)||e.call(this),this.ii=void 0,null==(t=this.ni)||t.call(this),this.ni=void 0,null==(n=this.ei)||n.call(this),this.ei=void 0,null==(r=this.si)||r.call(this),this.si=void 0,this.Yt.stop(),this.Kt.stop(),this.Xt.stop(),ea.info("stopped"))}Si(){var e;null==(e=this._instance.persistence)||e.unregister(Pe)}$i(e){var t,n=this.Ct!==e,r=this.Wt;if(W(r)){var a=this.jt,s=n||!q(a),i=s?function(e,t){return function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(e)%100<ln(100*t,0,100)}(e,r):a;s&&(i?this.ki(Dr):ea.warn("Sample rate ("+r+") has determined that this sessionId ("+e+") will not be sent to the server."),this.ui("samplingDecisionMade",{sampleRate:r,isSampled:i})),null==(t=this._instance.persistence)||t.register({[Pe]:i})}else this.Si()}onRemoteConfig(e){var t,n,r,a;this.ui("$remote_config_received",e),this.xi(e),null!=(t=e.sessionRecording)&&t.endpoint&&(this.vi=null==(a=e.sessionRecording)?void 0:a.endpoint),this.mi(),"any"===(null==(n=e.sessionRecording)?void 0:n.triggerMatchType)?(this.Vt=Jr,this.Lt=new qr([this.Yt,this.Kt])):(this.Vt=Xr,this.Lt=new Vr([this.Yt,this.Kt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==(r=e.sessionRecording)?void 0:r.triggerMatchType}),this.Kt.onRemoteConfig(e),this.Yt.onRemoteConfig(e),this.Xt.onRemoteConfig(e,(e,t)=>{this.ki("linked_flag_matched",{flag:e,variant:t})}),this.Jt=!0,this.startIfEnabledOrStop()}mi(){W(this.Wt)&&B(this.si)&&(this.si=this.At.onSessionId(e=>{this.$i(e)}))}xi(e){if(this._instance.persistence){var t,n=this._instance.persistence,r=()=>{var t,r,a,s,i,o,l,c,u,d=null==(t=e.sessionRecording)?void 0:t.sampleRate,f=B(d)?null:parseFloat(d);B(f)&&this.Si();var h=null==(r=e.sessionRecording)?void 0:r.minimumDurationMilliseconds;n.register({[_e]:!!e.sessionRecording,[ke]:null==(a=e.sessionRecording)?void 0:a.consoleLogRecordingEnabled,[je]:J({capturePerformance:e.capturePerformance},null==(s=e.sessionRecording)?void 0:s.networkPayloadCapture),[Ne]:null==(i=e.sessionRecording)?void 0:i.masking,[Se]:{enabled:null==(o=e.sessionRecording)?void 0:o.recordCanvas,fps:null==(l=e.sessionRecording)?void 0:l.canvasFps,quality:null==(c=e.sessionRecording)?void 0:c.canvasQuality},[Ce]:f,[Ee]:L(h)?null:h,[Te]:null==(u=e.sessionRecording)?void 0:u.scriptConfig})};r(),null==(t=this.ri)||t.call(this),this.ri=this.At.onSessionId(r)}}log(e,t){var n;void 0===t&&(t="log"),null==(n=this._instance.sessionRecording)||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}gi(e){var t;L(Object.assign)||L(Array.from)||(this.Ot||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())||(this.Ot=!0,this.At.checkAndGetSessionAndWindowId(),ta()?this.Ei():null==(t=w.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,this.Ii,e=>{if(e)return ea.error("could not load recorder",e);this.Ei()}),ea.info("starting"),this.status===Mr&&this.ki(e||"recording_initialized"))}get Ii(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property(Te))?void 0:e.script)||"recorder"}Pi(e){var t;return 3===e.type&&-1!==na.indexOf(null==(t=e.data)?void 0:t.source)}Ri(e){var t=this.Pi(e);t||this.Zt||e.timestamp-this.ti>this.Ft&&(this.Zt=!0,clearInterval(this.wi),this.ui("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.ti,threshold:this.Ft,bufferLength:this.C.data.length,bufferSize:this.C.size}),this.ai());var n=!1;if(t&&(this.ti=e.timestamp,this.Zt)){var r="unknown"===this.Zt;this.Zt=!1,r||(this.ui("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)}if(!this.Zt){var a=this.At.checkAndGetSessionAndWindowId(!t,e.timestamp),s=a.windowId,i=a.sessionId,o=this.Ct!==i,l=this.fi!==s;this.fi=s,this.Ct=i,o||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this.Ti()}}Mi(e){try{return e.rrwebMethod(),!0}catch(u){return this.Qt.length<10?this.Qt.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):ea.warn("could not emit queued rrweb event.",u,e),!1}}ui(e,t){return this.Mi(ra(()=>ta().addCustomEvent(e,t)))}Ci(){return this.Mi(ra(()=>ta().takeFullSnapshot()))}Ei(){var e,t,n,r,a={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{}
2,collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},s=this._instance.config.session_recording;for(var i of Object.entries(s||{})){var o=l(i,2),c=o[0],u=o[1];c in a&&("maskInputOptions"===c?a.maskInputOptions=J({password:!0},u):a[c]=u)}this.qt&&this.qt.enabled&&(a.recordCanvas=!0,a.sampling={canvas:this.qt.fps},a.dataURLOptions={type:"image/webp",quality:this.qt.quality}),this.Ht&&(a.maskAllInputs=null===(t=this.Ht.maskAllInputs)||void 0===t||t,a.maskTextSelector=null!==(n=this.Ht.maskTextSelector)&&void 0!==n?n:void 0,a.blockSelector=null!==(r=this.Ht.blockSelector)&&void 0!==r?r:void 0);var d=ta();if(d){this.Fi=null!==(e=this.Fi)&&void 0!==e?e:new Qn(d,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(e,t)=>{var n="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";ea.info(n,{node:t}),this.log(Qr+" "+n,"warn")}});var f=this.Oi();this.ci=d(J({emit:e=>{this.onRRwebEmit(e)},plugins:f},a)),this.ti=Date.now(),this.Zt=q(this.Zt)?this.Zt:"unknown",this.ui("$session_options",{sessionRecordingOptions:a,activePlugins:f.map(e=>null==e?void 0:e.name)}),this.ui("$posthog_config",{config:this._instance.config})}else ea.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Ti(){if(this.wi&&clearInterval(this.wi),!0!==this.Zt){var e=this.Dt;e&&(this.wi=setInterval(()=>{this.Ci()},e))}}Oi(){var e,t,n=[],r=null==(e=w.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;
2r&&this.Ut&&n.push(r());var a=null==(t=w.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;return this.Bt&&D(a)&&(!St.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?n.push(a(((e,t)=>{var n,r,a,s={payloadSizeLimitBytes:Gn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Gn.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Gn.payloadHostDenyList]},i=!1!==e.session_recording.recordHeaders&&t.recordHeaders,o=!1!==e.session_recording.recordBody&&t.recordBody,l=!1!==e.capture_performance&&t.recordPerformance,c=(n=s,a=Math.min(1e6,null!==(r=n.payloadSizeLimitBytes)&&void 0!==r?r:1e6),e=>(null!=e&&e.requestBody&&(e.requestBody=Jn(e.requestBody,e.requestHeaders,a,"Request")),null!=e&&e.responseBody&&(e.responseBody=Jn(e.responseBody,e.responseHeaders,a,"Response")),e)),u=t=>{return c(((e,t)=>{var n,r=Ct(e.name),a=0===t.indexOf("http")?null==(n=Ct(t))?void 0:n.pathname:t;"/"===a&&(a="");var s=null==r?void 0:r.pathname.replace(a||"","");if(!(r&&s&&Zn.some(e=>0===s.indexOf(e))))return e})((r=(n=t).requestHeaders,B(r)||te(Object.keys(null!=r?r:{}),e=>{Yn.includes(e.toLowerCase())&&(r[e]=$n)}),n),e.api_host));var n,r},d=D(e.session_recording.maskNetworkRequestFn);return d&&D(e.session_recording.maskCapturedNetworkRequestFn)&&G.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var n=e.session_recording.maskNetworkRequestFn({url:t.name});return J({},t,{name:null==n?void 0:n.url})}),s.maskRequestFn=D(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,r=u(t);return r&&null!==(n=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(r))&&void 0!==n?n:void 0}:e=>function(e){if(!L(e))return e.requestBody=Xn(e.requestBody,"Request"),e.responseBody=Xn(e.responseBody,"Response"),e}(u(e)),J({},Gn,s,{recordHeaders:i,recordBody:o,recordPerformance:l,recordInitialRequests:l})})(this._instance.config,this.Bt))):ea.info("NetworkCapture not started because we are on localhost.")),n}onRRwebEmit(e){var t;if(this.Ai(),e&&M(e)){if(e.type===Wn.Meta){var n=this.yi(e.data.href);if(this.Di=n,!n)return;e.data.href=n}else this.Li();if(this.Kt.checkUrlTriggerConditions(()=>this.ji(),()=>this.Ni(),e=>this.zi(e)),!this.Kt.urlBlocked||(r=e).type===Wn.Custom&&"recording paused"===r.data.tag){var r;e.type===Wn.FullSnapshot&&this.Ti(),e.type===Wn.FullSnapshot&&this.Jt&&this.Lt.triggerStatus(this.sessionId)===zr&&this.pi();var a=this.Fi?this.Fi.throttleMutations(e):e;if(a){var s=function(e){var t=e;if(t&&M(t)&&6===t.type&&M(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(a);if(this.Ri(s),!0!==this.Zt||sa(s)){if(sa(s)){var i=s.data.payload;if(i){var o=i.lastActivityTimestamp,l=i.threshold;s.timestamp=o+l}}var c=null===(t=this._instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(zn(e)<1024)return e;try{if(e.type===Wn.FullSnapshot)return J({},e,{data:aa(e.data),cv:"2024-10"});if(e.type===Wn.IncrementalSnapshot&&e.data.source===qn.Mutation)return J({},e,{cv:"2024-10",data:J({},e.data,{texts:aa(e.data.texts),attributes:aa(e.data.attributes),removes:aa(e.data.removes),adds:aa(e.data.adds)})});if(e.type===Wn.IncrementalSnapshot&&e.data.source===qn.StyleSheetRule)return J({},e,{cv:"2024-10",data:J({},e.data,{adds:e.data.adds?aa(e.data.adds):void 0,removes:e.data.removes?aa(e.data.removes):void 0})})}catch(e){ea.error("could not compress event - will use uncompressed event",e)}return e}(s):s,u={$snapshot_bytes:zn(c),$snapshot_data:c,$session_id:this.Ct,$window_id:this.fi};this.status!==Ar?this.Ui(u):this.pi()}}}}}Li(){if(!this._instance.config.capture_pageview&&c){var e=this.yi(c.location.href);this.Di!==e&&(this.ui("$url_changed",{href:e}),this.Di=e)}}Ai(){if(this.Qt.length){var e=[...this.Qt];
2this.Qt=[],e.forEach(e=>{Date.now()-e.enqueuedAt<=2e3&&this.Mi(e)})}}yi(e){var t=this._instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null==(n=r=t.maskNetworkRequestFn(r))?void 0:n.url}return e}pi(){return this.C={size:0,data:[],sessionId:this.Ct,windowId:this.fi},this.C}ai(){this.qi&&(clearTimeout(this.qi),this.qi=void 0);var e=this.Gt,t=this.Nt,n=W(t)&&t>=0,r=W(e)&&n&&t<e;return this.status===Fr||this.status===Lr||this.status===Ar||r?(this.qi=setTimeout(()=>{this.ai()},2e3),this.C):(this.C.data.length>0&&Bn(this.C).forEach(e=>{this.Bi({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:_.LIB_VERSION})}),this.pi())}Ui(e){var t,n=2+((null==(t=this.C)?void 0:t.data.length)||0);!this.Zt&&(this.C.size+e.$snapshot_bytes+n>943718.4||this.C.sessionId!==this.Ct)&&(this.C=this.ai()),this.C.size+=e.$snapshot_bytes,this.C.data.push(e.$snapshot_data),this.qi||this.Zt||(this.qi=setTimeout(()=>{this.ai()},2e3))}Bi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.vi),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}zi(e){var t;this.Lt.triggerStatus(this.sessionId)===zr&&(null==(t=this._instance)||null==(t=t.persistence)||t.register({["url"===e?Re:Oe]:this.Ct}),this.ai(),this.ki(e+"_trigger_matched"))}ji(){this.Kt.urlBlocked||(this.Kt.urlBlocked=!0,clearInterval(this.wi),ea.info("recording paused due to URL blocker"),this.ui("recording paused",{reason:"url blocker"}))}Ni(){this.Kt.urlBlocked&&(this.Kt.urlBlocked=!1,this.Ci(),this.Ti(),this.ui("recording resumed",{reason:"left blocked url"}),ea.info("recording resumed"))}bi(){0!==this.Yt.Tt.length&&B(this.ni)&&(this.ni=this._instance.on("eventCaptured",e=>{try{this.Yt.Tt.includes(e.event)&&this.zi("event")}catch(e){ea.error("Could not activate event trigger",e)}}))}overrideLinkedFlag(){this.Xt.linkedFlagSeen=!0,this.Ci(),this.ki("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[Pe]:!0}),this.Ci(),this.ki("sampling_overridden")}overrideTrigger(e){this.zi(e)}ki(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),ea.info(e.replace("_"," "),t),C(["recording_initialized","session_id_changed"],e)||this.ui(e,t)}get sdkDebugProperties(){var e=this.At.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.C.data.length,$sdk_debug_replay_internal_buffer_size:this.C.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:e}}}var oa=Y("[SegmentIntegration]");var la="posthog-js";function ca(e,t){var n=void 0===t?{}:t,r=n.organization,a=n.projectId,s=n.prefix,i=n.severityAllowList,o=void 0===i?["error"]:i;return t=>{var n,i,l,c,u;if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f=(null==(n=t.exception)?void 0:n.values)||[],h=f.map(e=>J({},e,{stacktrace:e.stacktrace?J({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>J({},e,{platform:"web:javascript"}))}):void 0})),p={$exception_message:(null==(i=f[0])?void 0:i.value)||t.message,$exception_type:null==(l=f[0])?void 0:l.type,$exception_personURL:d,$exception_level:t.level,$exception_list:h,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(u=f[0])?void 0:u.type,$sentry_tags:t.tags};return r&&a&&(p.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+a+"&query="+t.event_id),e.exceptions.sendExceptionEvent(p),t}}class ua{constructor(e,t,n,r,a){this.name=la,this.setupOnce=function(s){s(ca(e,{organization:t,projectId:n,prefix:r,severityAllowList:a}))}}}var da=null!=c&&c.location?It(c.location.hash,"__posthog")||It(location.hash,"state"):null,fa="_postHogToolbarParam
2s",ha=Y("[Toolbar]"),pa=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(pa||{});class ma{constructor(e){this.instance=e}Hi(e){w.ph_toolbar_state=e}Wi(){var e;return null!==(e=w.ph_toolbar_state)&&void 0!==e?e:pa.UNINITIALIZED}maybeLoadToolbar(e,t,n){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),!c||!m)return!1;e=null!=e?e:c.location,n=null!=n?n:c.history;try{if(!t){try{c.localStorage.setItem("test","test"),c.localStorage.removeItem("test")}catch(c){return!1}t=null==c?void 0:c.localStorage}var r,a=da||It(e.hash,"__posthog")||It(e.hash,"state"),s=a?se(()=>JSON.parse(atob(decodeURIComponent(a))))||se(()=>JSON.parse(decodeURIComponent(a))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(fa)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch(c){return!1}}Gi(e){var t=w.ph_load_toolbar||w.ph_load_editor;!B(t)&&D(t)?t(e,this.instance):ha.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==m||!m.getElementById(Ke));if(!c||t)return!1;var n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=J({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(c.localStorage.setItem(fa,JSON.stringify(J({},r,{source:void 0}))),this.Wi()===pa.LOADED)this.Gi(r);else if(this.Wi()===pa.UNINITIALIZED){var a;this.Hi(pa.LOADING),null==(a=w.__PosthogExtensions__)||null==a.loadExternalDependency||a.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return ha.error("[Toolbar] Failed to load",e),void this.Hi(pa.UNINITIALIZED);this.Hi(pa.LOADED),this.Gi(r)}),de(c,"turbolinks:load",()=>{this.Hi(pa.UNINITIALIZED),this.loadToolbar(r)})}return!0}Ji(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}var ga=Y("[TracingHeaders]");class va{constructor(e){this.Vi=void 0,this.Ki=void 0,this.nt=()=>{var e,t;L(this.Vi)&&(null==(e=w.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.get_distinct_id(),this._instance.sessionManager)),L(this.Ki)&&(null==(t=w.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}J(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return ga.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.J(this.nt):(null==(e=this.Vi)||e.call(this),null==(t=this.Ki)||t.call(this),this.Vi=void 0,this.Ki=void 0)}}var xa=Y("[Web Vitals]"),ya=9e5;class ba{constructor(e){var t;this.Yi=!1,this.i=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Xi=()=>{clearTimeout(this.Qi),0!==this.C.metrics.length&&(this._instance.capture("$web_vitals",this.C.metrics.reduce((e,t)=>J({},e,{["$web_vitals_"+t.name+"_event"]:J({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Zi=e=>{var t,n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(L(n))xa.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.te();L(r)||(B(null==e?void 0:e.name)||B(null==e?void 0:e.value)?xa.error("Invalid metric received",e):this.ie&&e.value>=this.ie?xa.error("Ignoring metric with value >= "+this.ie,e):(this.C.url!==r&&(this.Xi(),this.Qi=setTimeout(this.Xi,this.flushToCaptureTimeoutMs)),L(this.C.url)&&(this.C.url=r),this.C.firstMetricTimestamp=L(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.C.metrics.push(J({},e,{$current_url:r,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Xi()))}},this.nt=()=>{var e,t,n,r,a,s=w.__PosthogExtensions__;L(s)||L(s.postHogWebVitalsCallbacks)||(t=(e=s.postHogWebVitalsCallbacks).onLCP,n=e.onCLS,r=e.onFCP,a=e.onINP),t&&n&&r&&a?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.Zi.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this.Zi.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.Zi.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Zi.bind(this)),this.i=!0):xa.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Yi=!(null==(t=this._instance.persistence)||!t.props[ye]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=M(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return L(n)?(null==(t=this._instance.persistence)?void 0:t.props[we])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(M(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get ie(){var e=M(this._instance.config.capture_performance)&&W(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:ya;return 0<e&&e<=6e4?ya:e}get isEnabled(){var e=null==g?void 0:g.protocol;if("http:"!==e&&"https:"!==e)return xa.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=M(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:q(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return q(t)?t:this.Yi}startIfEnabled(){this.isEnabled&&!this.i&&(xa.info("enabled, starting..."),this.J(this.nt))}onRemoteConfig(e){var t=M(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=M(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ye]:t}),this._instance.persistence.register({[we]:n})),this.Yi=t,this.startIfEnabled()}J(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"web-vitals",t=>{t?xa.error("failed to load script",t):e()})}te(){var e=c?c.location.href:void 0;return e||xa.error("Could not determine current URL"),e}}var wa=Y("[Heatmaps]");function _a(e){return M(e)&&"clientX"in e&&"clientY"in e&&W(e.clientX)&&W(e.clientY)}class ka{constructor(e){var t;this.rageclicks=new Nt,this.Yi=!1,this.i=!1,this.ee=null,this.instance=e,this.Yi=!(null==(t=this.instance.persistence)||!t.props[ge])}get flushIntervalMilliseconds(){var e=5e3;return M(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return L(this.instance.config.capture_heatmaps)?L(this.instance.config.enable_heatmaps)?this.Yi:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.i)return;wa.info("starting..."),this.re(),this.ee=setInterval(this.se.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this.ee)&&void 0!==e?e:void 0),null==(t=this.ne)||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ge]:t}),this.Yi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.C;return this.C=void 0,e}oe(e){this.ae(e.originalEvent,"deadclick")}re(){c&&m&&(de(c,"beforeunload",this.se.bind(this)),de(m,"click",e=>this.ae(e||(null==c?void 0:c.event)),{capture:!0}),de(m,"mousemove",e=>this.le(e||(null==c?void 0:c.event)),{capture:!0}),this.ne=new on(this.instance,an,this.oe.bind(this)),this.ne.startIfEnabled(),this.i=!0)}ue(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),s=function(e,t,n){for(var r=e;r&&Qe(r)&&!et(r,"body");){if(r===n)return!1;if(C(t,null==c?void 0:c.getComputedStyle(r).position))return!0;r=ut(r)}return!1}(lt(e),["fixed","sticky"],a);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}ae(e,t){var n;if(void 0===t&&(t="click"),!Xe(e.target)&&_a(e)){var r=this.ue(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.he(J({},r,{type:"rageclick"})),this.he(r)}}le(e){!Xe(e.target)&&_a(e)&&(clearTimeout(this.de),this.de=setTimeout(()=>{this.he(this.ue(e,"mousemove"))},500))}he(e){if(c){var t=c.location.href;this.C=this.C||{},this.C[t]||(this.C[t]=[]),this.C[t].push(e)}}se(){this.C&&!F(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class ja{constructor(e){this._instance=e}doPageView(e,t){var n,r=this.ve(e,t);return this.ce={pathname:null!==(n=null==c?void 0:c.location.pathname)&&void 0!==n?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.ve(e,null==(t=this.ce)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ce)?void 0:e.pageViewId}}ve(e,t){var n=this.ce;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},a=this._instance.scrollManager.getContext();if(a&&!this._instance.config.disable_scroll_properties){var s=a.maxScrollHeight,i=a.lastScrollY,o=a.maxScrollY,l=a.maxContentHeight,c=a.lastContentY,u=a.maxContentY;if(!(L(s)||L(i)||L(o)||L(l)||L(c)||L(u))){s=Math.ceil(s),i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var d=s<=1?1:ln(i/s,0,1),f=s<=1?1:ln(o/s,0,1),h=l<=1?1:ln(c/l,0,1),p=l<=1?1:ln(u/l,0,1);r=ne(r,{$prev_pageview_last_scroll:i,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:h,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:p})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}}var Na=!!x||!!v,Sa="text/plain",Ca=(e,t)=>{var n=l(e.split("?"),2),r=n[0],a=n[1],s=J({},t);
2null==a||a.split("&").forEach(e=>{var t=l(e.split("="),1)[0];delete s[t]});var i=function(e,t){var n,r;void 0===t&&(t="&");var a=[];return te(e,function(e,t){L(e)||L(t)||"undefined"===t||(n=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),a[a.length]=r+"="+n)}),a.join(t)}(s);return r+"?"+(i?(a?a+"&":"")+i:a)},Ea=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),Ta=e=>{var t=e.data,n=e.compression;if(t){if(n===N.GZipJS){var r=Rr(Or(Ea(t)),{mtime:0}),a=new Blob([r],{type:Sa});return{contentType:Sa,body:a,estimatedSize:a.size}}if(n===N.Base64){var s=function(e){var t,n,r,a,s,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=0,l=0,c="",u=[];if(!e)return e;e=function(e){var t,n,r,a,s="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,a=0;a<r;a++){var i=e.charCodeAt(a),o=null;i<128?n++:o=i>127&&i<2048?String.fromCharCode(i>>6|192,63&i|128):String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128),z(o)||(n>t&&(s+=e.substring(t,n)),s+=o,t=n=a+1)}return n>t&&(s+=e.substring(t,e.length)),s}(e);do{t=(s=e.charCodeAt(o++)<<16|e.charCodeAt(o++)<<8|e.charCodeAt(o++))>>18&63,n=s>>12&63,r=s>>6&63,a=63&s,u[l++]=i.charAt(t)+i.charAt(n)+i.charAt(r)+i.charAt(a)}while(o<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(Ea(t)),i=(e=>"data="+encodeURIComponent("string"==typeof e?e:Ea(e)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var o=Ea(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Ia=[];v&&Ia.push({transport:"fetch",method:e=>{var t,n,r=null!==(t=Ta(e))&&void 0!==t?t:{},a=r.contentType,s=r.body,i=r.estimatedSize,o=new Headers;te(e.headers,function(e,t){o.append(t,e)}),a&&o.append("Content-Type",a);var l=e.url,c=null;if(y){var u=new y;c={signal:u.signal,timeout:setTimeout(()=>u.abort(),e.timeout)}}v(l,J({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&(i||0)<52428.8,body:s,signal:null==(n=c)?void 0:n.signal},e.fetchOptions)).then(t=>t.text().then(n=>{var r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){G.error(e)}null==e.callback||e.callback(r)})).catch(t=>{G.error(t),null==e.callback||e.callback({statusCode:0,text:t})}).finally(()=>c?clearTimeout(c.timeout):null)}}),x&&Ia.push({transport:"XHR",method:e=>{var t,n=new x;n.open(e.method||"GET",e.url,!0);var r=null!==(t=Ta(e))&&void 0!==t?t:{},a=r.contentType,s=r.body;te(e.headers,function(e,t){n.setRequestHeader(t,e)}),a&&n.setRequestHeader("Content-Type",a),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(4===n.readyState){var t={statusCode:n.status,text:n.responseText};if(200===n.status)try{t.json=JSON.parse(n.responseText)}catch(e){}null==e.callback||e.callback(t)}},n.send(s)}}),null!=p&&p.sendBeacon&&Ia.push({transport:"sendBeacon",method:e=>{var t=Ca(e.url,{beacon:"1"});try{var n,r=null!==(n=Ta(e))&&void 0!==n?n:{},a=r.contentType,s=r.body,i="string"==typeof s?new Blob([s],{type:a}):s;p.sendBeacon(t,i)}catch(e){}}});var Pa=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function Ra(e,t,n){return Ea({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var Oa={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>Pa(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!Pa(t,e))),icontains:(e,t)=>t.map(Aa).some(t=>e.map(Aa).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(Aa).every(t=>e.map(Aa).every(e=>!t.includes(e)))},Aa=e=>e.toLowerCase(),Da=Y("[Error tracking]");class Ma{constructor(e){var t,n;this.fe=[],this._instance=e,this.fe=null!==(t=null==(n=this._instance.persistence)?void 0:n.get_property(xe))&&void 0!==t?t:[]}onRemoteConfig(e){var t,n,r=null!==(t=null==(n=e.errorTracking)?void 0:n.suppressionRules)&&void 0!==t?t:[];this.fe=r,this._instance.persistence&&this._instance.persistence.register({[xe]:this.fe})}sendExceptionEvent(e){this.pe(e)?Da.info("Skipping exception capture because a suppression rule matched"):this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}pe(e){var t=e.$exception_list;if(!t||!A(t)||0===t.length)return!1;var n=t.reduce((e,t)=>
vendor: 20,914 bytes, line 2
2{var n=t.type,r=t.value;return U(n)&&n.length>0&&e.$exception_types.push(n),U(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.fe.some(e=>{var t=e.values.map(e=>{var t,r=Oa[e.operator],a=A(e.value)?e.value:[e.value],s=null!==(t=n[e.key])&&void 0!==t?t:[];return a.length>0&&r(a,s)});return"OR"===e.type?t.some(Boolean):t.every(Boolean)})}}var Fa="Mobile",La="iOS",Ua="Android",Ha="Tablet",za=Ua+" "+Ha,Ba="iPad",Wa="Apple",qa=Wa+" Watch",Va="Safari",$a="BlackBerry",Ga="Samsung",Ya=Ga+"Browser",Ka=Ga+" Internet",Za="Chrome",Ja=Za+" OS",Xa=Za+" "+La,Qa="Internet Explorer",es=Qa+" "+Fa,ts="Opera",ns=ts+" Mini",rs="Edge",as="Microsoft "+rs,ss="Firefox",is=ss+" "+La,os="Nintendo",ls="PlayStation",cs="Xbox",us=Ua+" "+Fa,ds=Fa+" "+Va,fs="Windows",hs=fs+" Phone",ps="Nokia",ms="Ouya",gs="Generic",vs=gs+" "+Fa.toLowerCase(),xs=gs+" "+Ha.toLowerCase(),ys="Konqueror",bs="(\\d+(\\.\\d+)?)",ws=new RegExp("Version/"+bs),_s=new RegExp(cs,"i"),ks=new RegExp(ls+" \\w+","i"),js=new RegExp(os+" \\w+","i"),Ns=new RegExp($a+"|PlayBook|BB10","i"),Ss={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Cs=function(e,t){return t=t||"",C(e," OPR/")&&C(e,"Mini")?ns:C(e," OPR/")?ts:Ns.test(e)?$a:C(e,"IE"+Fa)||C(e,"WPDesktop")?es:C(e,Ya)?Ka:C(e,rs)||C(e,"Edg/")?as:C(e,"FBIOS")?"Facebook "+Fa:C(e,"UCWEB")||C(e,"UCBrowser")?"UC Browser":C(e,"CriOS")?Xa:C(e,"CrMo")||C(e,Za)?Za:C(e,Ua)&&C(e,Va)?us:C(e,"FxiOS")?is:C(e.toLowerCase(),ys.toLowerCase())?ys:((e,t)=>t&&C(t,Wa)||function(e){return C(e,Va)&&!C(e,Za)&&!C(e,Ua)}(e))(e,t)?C(e,Fa)?ds:Va:C(e,ss)?ss:C(e,"MSIE")||C(e,"Trident/")?Qa:C(e,"Gecko")?ss:""},Es={[es]:[new RegExp("rv:"+bs)],[as]:[new RegExp(rs+"?\\/"+bs)],[Za]:[new RegExp("("+Za+"|CrMo)\\/"+bs)],[Xa]:[new RegExp("CriOS\\/"+bs)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+bs)],[Va]:[ws],[ds]:[ws],[ts]:[new RegExp("(Opera|OPR)\\/"+bs)],[ss]:[new RegExp(ss+"\\/"+bs)],[is]:[new RegExp("FxiOS\\/"+bs)],[ys]:[new RegExp("Konqueror[:/]?"+bs,"i")],[$a]:[new RegExp($a+" "+bs),ws],[us]:[new RegExp("android\\s"+bs,"i")],[Ka]:[new RegExp(Ya+"\\/"+bs)],[Qa]:[new RegExp("(rv:|MSIE )"+bs)],Mozilla:[new RegExp("rv:"+bs)]},Ts=function(e,t){var n=Cs(e,t),r=Es[n];if(L(r))return null;for(var a=0;a<r.length;a++){var s=r[a],i=e.match(s);if(i)return parseFloat(i[i.length-2])}return null},Is=[[new RegExp(cs+"; "+cs+" (.*?)[);]","i"),e=>[cs,e&&e[1]||""]],[new RegExp(os,"i"),[os,""]],[new RegExp(ls,"i"),[ls,""]],[Ns,[$a,""]],[new RegExp(fs,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[hs,""];if(new RegExp(Fa).test(t)&&!/IEMobile\b/.test(t))return[fs+" "+Fa,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],a=Ss[r]||"";return/arm/i.test(t)&&(a="RT"),[fs,a]}return[fs,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[La,t.join(".")]}return[La,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=L(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Ua+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ua+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Ua,t.join(".")]}return[Ua,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ja,""]],[/Linux|debian/i,["Linux",""]]],Ps=function(e){return js.test(e)?os:ks.test(e)?ls:_s.test(e)?cs:new RegExp(ms,"i").test(e)?ms:new RegExp("("+hs+"|WPDesktop)","i").test(e)?hs:/iPad/.test(e)?Ba:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?qa:Ns.test(e)?$a:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ps,"i").test(e)?ps:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Fa).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Ua:za:Ua:new RegExp("(pda|"+Fa+")","i").test(e)?vs:new RegExp(Ha,"i").test(e)&&!new RegExp(Ha+" pc","i").test(e)?xs:""},Rs="https?://(.*)",Os=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],As=re(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Os),Ds="<masked>",Ms=["li_fat_id"];function Fs(e,t,n){if(!m)return{};var r,a=t?re([],Os,n||[]):[],s=Ls(Tt(m.URL,a,Ds),e),i=(r={},te(Ms,function(e){var t=$t.D(e);r[e]=t||null}),r);return ne(i,s)}function Ls(e,t){var n=As.concat(t||[]),r={};return te(n,function(t){var n=Et(e,t);r[t]=n||null}),r}function Us(e){var t=function(e){return e?0===e.search(Rs+"google.([^/?]*)")?"google":0===e.search(Rs+"bing.com")?"bing":0===e.search(Rs+"yahoo.com")?"yahoo":0===e.search(Rs+"duckduckgo.com")?"duckduckgo":null:null}(e),n="yahoo"!=t?"q":"p",r={};if(!z(t)){r.$search_engine=t;var a=m?Et(m.referrer,n):"";a.length&&(r.ph_keyword=a)}return r}function Hs(){return navigator.language||navigator.userLanguage}function zs(){return(null==m?void 0:m.referrer)||"$direct"}function Bs(e,t){var n=e?re([],Os,t||[]):[],r=null==g?void 0:g.href.substring(0,1e3);return{r:zs().substring(0,1e3),u:r?Tt(r,n,Ds):void 0}}function Ws(e){var t,n=e.r,r=e.u,a={$referrer:n,$referring_domain:null==n?void 0:"$direct"==n?"$direct":null==(t=Ct(n))?void 0:t.host};if(r){a.$current_url=r;var s=Ct(r);a.$host=null==s?void 0:s.host,a.$pathname=null==s?void 0:s.pathname;var i=Ls(r);ne(a,i)}if(n){var o=Us(n);ne(a,o)}return a}function qs(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(c){return}}function Vs(){try{return(new Date).getTimezoneOffset()}catch(c){return}}function $s(e,t){if(!b)return{};var n,r,a,s=e?re([],Os,t||[]):[],i=function(e){for(var t=0;t<Is.length;t++){var n=l(Is[t],2),r=n[0],a=n[1],s=r.exec(e),i=s&&(D(a)?a(s,e):a);if(i)return i}return["",""]}(b),o=l(i,2),u=o[0],d=o[1];return ne(oe({$os:u,$os_version:d,$browser:Cs(b,navigator.vendor),$device:Ps(b),$device_type:(r=b,a=Ps(r),a===Ba||a===za||"Kobo"===a||"Kindle Fire"===a||a===xs?Ha:a===os||a===cs||a===ls||a===ms?"Console":a===qa?"Wearable":a?Fa:"Desktop"),$timezone:qs(),$timezone_offset:Vs()}),{$current_url:Tt(null==g?void 0:g.href,s,Ds),$host:null==g?void 0:g.host,$pathname:null==g?void 0:g.pathname,$raw_user_agent:b.length>1e3?b.substring(0,997)+"...":b,$browser_version:Ts(b,navigator.vendor),$browser_language:Hs(),$browser_language_prefix:(n=Hs(),"string"==typeof n?n.split("-")[0]:void 0),$screen_height:null==c?void 0:c.screen.height,$screen_width:null==c?void 0:c.screen.width,$viewport_height:null==c?void 0:c.innerHeight,$viewport_width:null==c?void 0:c.innerWidth,$lib:"web",$lib_version:_.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Gs=Y("[FeatureFlags]"),Ys="$active_feature_flags",Ks="$override_feature_flags",Zs="$feature_flag_payloads",Js="$override_feature_flag_payloads",Xs="$feature_flag_request_id",Qs=e=>{var t={};for(var n of ae(e||{})){var r=l(n,2),a=r[0],s=r[1];s&&(t[a]=s)}return t},ei=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class ti{constructor(e){this.ge=!1,this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.we=!0;else{var e=!this.$e&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.ke({disableFlags:e})}}get hasLoadedFlags(){return this._e}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Me),t=this._instance.get_property(Ks),n=this._instance.get_property(Js);if(!n&&!t)return e||{};var r=ne({},e||{}),a=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of a){var i,o,l=r[s],c=null==t?void 0:t[s],u=L(c)?null!==(i=null==l?void 0:l.enabled)&&void 0!==i&&i:!!c,d=L(c)?l.variant:"string"==typeof c?c:void 0,f=null==n?void 0:n[s],h=J({},l,{enabled:u,variant:u?null!=d?d:null==l?void 0:l.variant:void 0});u!==(null==l?void 0:l.enabled)&&(h.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(h.original_variant=null==l?void 0:l.variant),f&&(h.metadata=J({},null==l?void 0:l.metadata,{payload:f,original_payload:null==l||null==(o=l.metadata)?void 0:o.payload})),r[s]=h}return this.ge||(Gs.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.ge=!0),r}getFlagVariants(){var e=this._instance.get_property(Ae),t=this._instance.get_property(Ks);if(!t)return e||{};for(var n=ne({},e),r=Object.keys(t),a=0;a<r.length;a++)n[r[a]]=t[r[a]];return this.ge||(Gs.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.ge=!0),n}getFlagPayloads(){var e=this._instance.get_property(Zs),t=this._instance.get_property(Js);if(!t)return e||{};for(var n=ne({},e||{}),r=Object.keys(t),a=0;a<r.length;a++)n[r[a]]=t[r[a]];return this.ge||(Gs.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.ge=!0),n}reloadFeatureFlags(){this.be||this._instance.config.advanced_disable_feature_flags||this.$e||(this.$e=setTimeout(()=>{this.ke()},5))}xe(){clearTimeout(this.$e),this.$e=void 0}ensureFlagsLoaded(){this._e||this.me||this.$e||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.be=e}ke(e){var t;if(this.xe(),!this._instance.I())if(this.me)this.ye=!0;else{var n={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:J({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(Fe)||{}),group_properties:this._instance.get_property(Le)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0);var r=this._instance.config.__preview_remote_config,a=r?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",i=this._instance.requestRouter.endpointFor("api",a+s);r&&(n.timezone=qs()),this.me=!0,this._instance.Ee({method:"POST",url:i,data:n,compression:this._instance.config.disable_compression?void 0:N.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,r,a=!0;if(200===e.statusCode&&(this.ye||(this.$anon_distinct_id=void 0),a=!1),this.me=!1,this.we||(this.we=!0,this._instance.Ie(null!==(r=e.json)&&void 0!==r?r:{})),!n.disable_flags||this.ye)if(this.Se=!a,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(ei.FeatureFlags))Gs.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var s;n.disable_flags||this.receivedFeatureFlags(null!==(s=e.json)&&void 0!==s?s:{},a),this.ye&&(this.ye=!1,this.ke())}}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],r=""+n,a=this._instance.get_property(Xs)||void 0,s=this._instance.get_property(ze)||{};if((t.send_event||!("send_event"in t))&&(!(e in s)||!s[e].includes(r))){var i,o,l,c,u,d,f,h,p;A(s[e])?s[e].push(r):s[e]=[r],null==(i=this._instance.persistence)||i.register({[ze]:s});var m=this.getFeatureFlagDetails(e),g={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:a,$feature_flag_bootstrapped_response:(null==(o=this._instance.config.bootstrap)||null==(o=o.featureFlags)?void 0:o[e])||null,$feature_flag_bootstrapped_payload:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[e])||null,$used_bootstrap_value:!this.Se};L(null==m||null==(c=m.metadata)?void 0:c.version)||(g.$feature_flag_version=m.metadata.version);var v,x=null!==(u=null==m||null==(d=m.reason)?void 0:d.description)&&void 0!==u?u:null==m||null==(f=m.reason)?void 0:f.code;x&&(g.$feature_flag_reason=x),null!=m&&null!=(h=m.metadata)&&h.id&&(g.$feature_flag_id=m.metadata.id),L(null==m?void 0:m.original_variant)&&L(null==m?void 0:m.original_enabled)||(g.$feature_flag_original_response=L(m.original_variant)?m.original_enabled:m.original_variant),null!=m&&null!=(p=m.metadata)&&p.original_payload&&(g.$feature_flag_original_payload=null==m||null==(v=m.metadata)?void 0:v.original_payload),this._instance.capture("$feature_flag_called",g)}return n}Gs.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var n=this._instance.config.token;this._instance.Ee({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:n},compression:this._instance.config.disable_compression?void 0:N.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:n=>{var r,a=null==(r=n.json)?void 0:r.featureFlagPayloads;t((null==a?void 0:a[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Gs.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this._e=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),a=this.getFlagsWithDetails();!function(e,t,n,r,a){void 0===n&&(n={}),void 0===r&&(r={}),void 0===a&&(a={});var s=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(e=>{var n;return[e,null!==(n=t[e].variant)&&void 0!==n?n:t[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(e=>t[e].enabled).filter(e=>{var n;return null==(n=t[e].metadata)?void 0:n.payload}).map(e=>{var n;return[e,null==(n=t[e].metadata)?void 0:n.payload]}))):Gs.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),i=s.flags,o=s.featureFlags,l=s.featureFlagPayloads;if(o){var c=e.requestId;if(A(o)){Gs.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var u={};if(o)for(var d=0;d<o.length;d++)u[o[d]]=!0;t&&t.register({[Ys]:o,[Ae]:u})}else{var f=o,h=l,p=i;e.errorsWhileComputingFlags&&(f=J({},n,f),h=J({},r,h),p=J({},a,p)),t&&t.register(J({[Ys]:Object.keys(Qs(f)),[Ae]:f||{},[Zs]:h||{},[Me]:p||{}},c?{[Xs]:c}:{}))}}}(e,this._instance.persistence,n,r,a),this.Pe(t)}}override(e,t){void 0===t&&(t=!1),Gs.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Gs.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(Ks),this._instance.persistence.unregister(Js),void this.Pe();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,n=e;if(this.ge=Boolean(null!==(t=n.suppressWarning)&&void 0!==t&&t),"flags"in n)if(!1===n.flags)this._instance.persistence.unregister(Ks);else if(n.flags)if(A(n.flags)){for(var r={},a=0;a<n.flags.length;a++)r[n.flags[a]]=!0;this._instance.persistence.register({[Ks]:r})}else this._instance.persistence.register({[Ks]:n.flags});return"payloads"in n&&(!1===n.payloads?this._instance.persistence.unregister(Js):n.payloads&&this._instance.persistence.register({[Js]:n.payloads})),void this.Pe()}this.Pe()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._e){var t=this.Re(),n=t.flags,r=t.flagVariants;e(n,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n,r=(this._instance.get_property(De)||[]).find(t=>t.flagKey===e),a={["$feature_enrollment/"+e]:t},s={$feature_flag:e,$feature_enrollment:t,$set:a};r&&(s.$early_access_feature_name=r.name),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(a,!1);var i=J({},this.getFlagVariants(),{[e]:t});null==(n=this._instance.persistence)||n.register({[Ys]:Object.keys(Qs(i)),[Ae]:i}),this.Pe()}getEarlyAccessFeatures(e,t,n){void 0===t&&(t=!1);var r=this._instance.get_property(De),a=n?"&"+n.map(e=>"stage="+e).join("&"):"";if(r&&!t)return e(r);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+a),method:"GET",callback:t=>{var n;if(t.json){var r=t.json.earlyAccessFeatures;return null==(n=this._instance.persistence)||n.register({[De]:r}),e(r)}}})}Re(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,n)=>(e[n]=t[n],e),{})}}Pe(e){var t=this.Re(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(t=>t(n,r,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var n=this._instance.get_property(Fe)||{};this._instance.register({[Fe]:J({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Fe)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var n=this._instance.get_property(Le)||{};0!==Object.keys(n).length&&Object.keys(n).forEach(t=>{n[t]=J({},n[t],e[t]),delete e[t]}),this._instance.register({[Le]:J({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Le)||{};this._instance.register({[Le]:J({},t,{[e]:{}})})}else this._instance.unregister(Le)}reset(){this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$anon_distinct_id=void 0,this.xe(),this.ge=!1}}var ni=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class ri{constructor(e){this.S=e,this.props={},this.Te=!1,this.Me=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.B=this.Ce(e),this.load(),e.debug&&G.info("Persistence loaded",e.persistence,J({},this.props)),this.update_config(e,e),this.save()}Ce(e){-1===ni.indexOf(e.persistence.toLowerCase())&&(G.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Yt.O()?Yt:"localstorage+cookie"===t&&Zt.O()?Zt:"sessionstorage"===t&&en.O()?en:"memory"===t?Xt:"cookie"===t?$t:Zt.O()?Zt:$t}properties(){var e={};return te(this.props,function(t,n){if(n===Ae&&M(t))for(var r=Object.keys(t),a=0;a<r.length;a++)e["$feature/"+r[a]]=t[r[a]];else i=n,o=!1,(z(s=Je)?o:h&&s.indexOf===h?-1!=s.indexOf(i):(te(s,function(e){if(o||(o=e===i))return Q}),o))||(e[n]=t);var s,i,o}),e}load(){if(!this.Fe){var e=this.B.L(this.Me);e&&(this.props=ne({},e))}}save(){this.Fe||this.B.j(this.Me,this.props,this.Oe,this.Ae,this.De,this.S.debug)}remove(){this.B.N(this.Me,!1),this.B.N(this.Me,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(M(e)){L(t)&&(t="None"),this.Oe=L(n)?this.Le:n;var r=!1;if(te(e,(e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(M(e)){this.Oe=L(t)?this.Le:t;var n=!1;if(te(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,n=!0)}),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Te){var e=Fs(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);F(oe(e))||this.register(e),this.Te=!0}}update_search_keyword(){var e;this.register((e=null==m?void 0:m.referrer)?Us(e):{})}update_referrer_info(){var e;this.register_once({$referrer:zs(),$referring_domain:null!=m&&m.referrer&&(null==(e=Ct(m.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Ve]||this.props[$e]||this.register_once({[Ge]:Bs(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};te([$e,Ve],t=>{var n=this.props[t];n&&te(n,function(t,n){e["$initial_"+T(n)]=t})});var t,n,r=this.props[Ge];if(r){var a=(t=Ws(r),n={},te(t,function(e,t){n["$initial_"+T(t)]=e}),n);ne(e,a)}return e}
2safe_merge(e){return te(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t){if(this.Le=this.Oe=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.Ce(e),r=this.props;this.clear(),this.B=n,this.props=r,this.save()}}set_disabled(e){this.Fe=e,this.Fe?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ae&&(this.Ae=e,this.remove(),this.save())}set_secure(e){e!==this.De&&(this.De=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[pe]||{};n[e]=t,this.props[pe]=n,this.save()}remove_event_timer(e){var t=(this.props[pe]||{})[e];return L(t)||(delete this.props[pe][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class ai{constructor(){this.je={},this.je={}}on(e,t){return this.je[e]||(this.je[e]=[]),this.je[e].push(t),()=>{this.je[e]=this.je[e].filter(e=>e!==t)}}emit(e,t){for(var n of this.je[e]||[])n(t);for(var r of this.je["*"]||[])r(e,t)}}class si{constructor(e){this.Ne=new ai,this.ze=(e,t)=>this.Ue(e,t)&&this.qe(e,t)&&this.Be(e,t),this.Ue=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.He=new Set,this.We=new Set}init(){var e,t;L(null==(e=this._instance)?void 0:e.Ge)||(null==(t=this._instance)||t.Ge((e,t)=>{this.on(e,t)}))}register(e){var t,n;if(!L(null==(t=this._instance)?void 0:t.Ge)&&(e.forEach(e=>{var t,n;null==(t=this.We)||t.add(e),null==(n=e.steps)||n.forEach(e=>{var t;null==(t=this.He)||t.add((null==e?void 0:e.event)||"")})}),null!=(n=this._instance)&&n.autocapture)){var r,a=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&a.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(a)}}on(e,t){var n;null!=t&&0!=e.length&&(this.He.has(e)||this.He.has(null==t?void 0:t.event))&&this.We&&(null==(n=this.We)?void 0:n.size)>0&&this.We.forEach(e=>{this.Je(t,e)&&this.Ne.emit("actionCaptured",e.name)})}Ve(e){this.onAction("actionCaptured",t=>e(t))}Je(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var n of t.steps)if(this.ze(e,n))return!0;return!1}onAction(e,t){return this.Ne.on(e,t)}qe(e,t){if(null!=t&&t.url){var n,r=null==e||null==(n=e.properties)?void 0:n.$current_url;if(!r||"string"!=typeof r)return!1;if(!si.Ke(r,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static Ke(e,t,n){switch(n){case"regex":return!!c&&Pa(e,t);case"exact":return t===e;case"contains":var r=si.Ye(t).replace(/_/g,".").replace(/%/g,".*");return Pa(e,r);default:return!1}}static Ye(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Be(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.Xe(e).some(e=>!(null!=t&&t.href&&!si.Ke(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&(null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!si.Ke(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!si.Ke(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))return!1;if(null!=t&&t.selector){var n,r=null==e||null==(n=e.properties)?void 0:n.$element_selectors;if(!r)return!1;if(!r.includes(null==t?void 0:t.selector))return!1}return!0}Xe(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}var ii=Y("[Surveys]"),oi="seenSurvey_",li=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n};class ci{constructor(e){this._instance=e,this.Qe=new Map,this.Ze=new Map}register(e){var t;L(null==(t=this._instance)?void 0:t.Ge)||(this.tr(e),this.ir(e))}ir(e){var t=e.filter(e=>{var t,n;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)?void 0:n.length)>0});0!==t.length&&(null==this.er&&(this.er=new si(this._instance),this.er.init(),this.er.Ve(e=>{this.onAction(e)}
2)),t.forEach(e=>{var t,n,r,a,s;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(n=e.conditions)&&null!=(n=n.actions)&&n.values&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(a=this.er)||a.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach(t=>{if(t&&t.name){var n=this.Ze.get(t.name);n&&n.push(e.id),this.Ze.set(t.name,n||[e.id])}}))}))}tr(e){var t;0!==e.filter(e=>{var t,n;return(null==(t=e.conditions)?void 0:t.events)&&(null==(n=e.conditions)||null==(n=n.events)||null==(n=n.values)?void 0:n.length)>0}).length&&(null==(t=this._instance)||t.Ge((e,t)=>{this.onEvent(e,t)}),e.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||t.forEach(t=>{if(t&&t.name){var n=this.Qe.get(t.name);n&&n.push(e.id),this.Qe.set(t.name,n||[e.id])}})}))}onEvent(e,t){var n,r=(null==(n=this._instance)||null==(n=n.persistence)?void 0:n.props[He])||[];if("survey shown"===e&&t&&r.length>0){var a;ii.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var s=null==t||null==(a=t.properties)?void 0:a.$survey_id;if(s){var i=r.indexOf(s);i>=0&&(r.splice(i,1),this.rr(r))}}else this.Qe.has(e)&&(ii.info("survey event matched, updating activated surveys",{event:e,surveys:this.Qe.get(e)}),this.rr(r.concat(this.Qe.get(e)||[])))}onAction(e){var t,n=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[He])||[];this.Ze.has(e)&&this.rr(n.concat(this.Ze.get(e)||[]))}rr(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[He]:[...new Set(e)]})}getSurveys(){var e;return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[He])||[]}getEventToSurveys(){return this.Qe}sr(){return this.er}}class ui{constructor(e){this.nr=void 0,this.ar=null,this.lr=!1,this.ur=!1,this.hr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(B(t))return ii.warn("Flags not loaded yet. Not loading surveys.");var n=A(t);this.nr=n?t.length>0:t,ii.info("flags response received, isSurveysEnabled: "+this.nr),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(null!=n&&n.startsWith(oi)||null!=n&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this.ar)if(this.ur)ii.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ii.info("Disabled. Not loading surveys.");else{var e=null==w?void 0:w.__PosthogExtensions__;if(e){var t=this.nr;if(!L(t)){this.ur=!0;try{var n=e.generateSurveys;if(n)return void this.dr(n,t);var r=e.loadExternalDependency;if(!r)return void this.vr("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",n=>{n||!e.generateSurveys?this.vr("Could not load surveys script",n):this.dr(e.generateSurveys,t)})}catch(e){throw this.vr("Error initializing surveys",e),e}finally{this.ur=!1}}}else ii.error("PostHog Extensions not found.")}}dr(e,t){this.ar=e(this._instance,t),this._surveyEventReceiver=new ci(this._instance),ii.info("Surveys loaded successfully"),this.cr({isLoaded:!0})}vr(e,t){ii.error(e,t),this.cr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.hr.push(e),this.ar&&this.cr({isLoaded:!0}),()=>{this.hr=this.hr.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return ii.info("Disabled. Not loading surveys."),e([]);var n=this._instance.get_property(Ue);if(n&&!t)return e(n,{isLoaded:!0});if(this.lr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.lr=!0,this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{var n;this.lr=!1;var r=t.statusCode;if(200!==r||!t.json){var a="Surveys API could not be loaded, status: "+r;return ii.error(a),e([],{isLoaded:!1,error:a})}var s,i=t.json.surveys||[],o=i.filter(e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}(e)||function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e)));return o.length>0&&(null==(s=this._surveyEventReceiver)||s.register(o)),null==(n=this._instance.persistence)||n.register({[Ue]:i}),e(i,{isLoaded:!0})}})}catch(e){throw this.lr=!1,e}}
vendor: 8,598 bytes, line 2
2cr(e){for(var t of this.hr)try{e.isLoaded?this.getSurveys(t):t([],e)}catch(e){ii.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!B(this.ar))return this.ar.getActiveMatchingSurveys(e,t);ii.warn("init was not called")}pr(e){var t=null;return this.getSurveys(n=>{var r;t=null!==(r=n.find(t=>t.id===e))&&void 0!==r?r:null}),t}gr(e){if(B(this.ar))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.pr(e):e;return t?this.ar.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(B(this.ar))return ii.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return B(this.ar)?(ii.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(n=>{this.getSurveys(t=>{var r,a=null!==(r=t.find(t=>t.id===e))&&void 0!==r?r:null;if(a){var s=this.gr(a);n({visible:s.eligible,disabledReason:s.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(B(this.ar))ii.warn("init was not called");else{var n=this.pr(e),r=null==m?void 0:m.querySelector(t);n?r?this.ar.renderSurvey(n,r):ii.warn("Survey element not found"):ii.warn("Survey not found")}}}(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"})({}),function(e){e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger"}({}),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}({}),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}({}),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}({}),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}({});var di=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({}),fi=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e}({}),hi=Y("[RateLimiter]");class pi{constructor(e){var t,n;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{hi.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void hi.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(n=e.config.rate_limiting)?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,n,r;void 0===e&&(e=!1);var a=(new Date).getTime(),s=null!==(t=null==(n=this.instance.persistence)?void 0:n.get_property(qe))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:a};s.tokens+=(a-s.last)/1e3*this.captureEventsPerSecond,s.last=a,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var i=s.tokens<1;return i||e||(s.tokens=Math.max(0,s.tokens-1)),!i||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=i,null==(r=this.instance.persistence)||r.set_property(qe,s),{isRateLimited:i,remainingTokens:s.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var mi=Y("[RemoteConfig]");class gi{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=w._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_r(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.loadExternalDependency?null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(mi.error("PostHog Extensions not found. Cannot load remote config."),e())}mr(e){this._instance.Ee({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return mi.info("Using preloaded remote config",this.remoteConfig),void this.Ie(this.remoteConfig);if(this._instance.I())return void mi.warn("Remote config is disabled. Falling back to local config.");this._r(e=>{if(!e)return mi.info("No config found after loading remote JS config. Falling back to JSON."),void this.mr(e=>{this.Ie(e)});this.Ie(e)})}catch(c){mi.error("Error loading remote config",c)}}Ie(e){e?this._instance.config.__preview_remote_config?(this._instance.Ie(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):mi.info("__preview_remote_config is disabled. Logging config instead",e):mi.error("Failed to fetch remote config from PostHog.")}}var vi=3e3;class xi{constructor(e,t){this.br=!0,this.yr=[],this.wr=ln((null==t?void 0:t.flush_interval_ms)||vi,250,5e3,"flush interval",vi),this.Sr=e}enqueue(e){this.yr.push(e),this.$r||this.kr()}unload(){this.Er();var e=this.yr.length>0?this.Ir():{},t=Object.values(e);[...t.filter(e=>0===e.url.indexOf("/e")),...t.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Sr(J({},e,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.kr()}kr(){var e=this;this.br||(this.$r=setTimeout(()=>{if(this.Er(),this.yr.length>0){var t=this.Ir(),n=function(){var n=t[r],a=(new Date).getTime();n.data&&A(n.data)&&te(n.data,e=>{e.offset=Math.abs(e.timestamp-a),delete e.timestamp}),e.Sr(n)};for(var r in t)n()}},this.wr))}Er(){clearTimeout(this.$r),this.$r=void 0}Ir(){var e={};return te(this.yr,t=>{var n,r=t,a=(r?r.batchKey:null)||r.url;L(e[a])&&(e[a]=J({},r,{data:[]})),null==(n=e[a].data)||n.push(r.data)}),this.yr=[],e}}var yi=["retriesPerformedSoFar"];class bi{constructor(e){this.Pr=!1,this.Rr=3e3,this.yr=[],this._instance=e,this.yr=[],this.Tr=!0,!L(c)&&"onLine"in c.navigator&&(this.Tr=c.navigator.onLine,de(c,"online",()=>{this.Tr=!0,this.se()}),de(c,"offline",()=>{this.Tr=!1}))}get length(){return this.yr.length}retriableRequest(e){var t=e.retriesPerformedSoFar,n=X(e,yi);W(t)&&t>0&&(n.url=Ca(n.url,{retry_count:t})),this._instance.Ee(J({},n,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.Mr(J({retriesPerformedSoFar:t},n)):null==n.callback||n.callback(e)}}))}Mr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),a=(Math.random()-.5)*(r-n);return Math.ceil(r+a)}(t),r=Date.now()+n;this.yr.push({retryAt:r,requestOptions:e});var a="Enqueued failed request for retry in "+n;navigator.onLine||(a+=" (Browser is offline)"),G.warn(a),this.Pr||(this.Pr=!0,this.Cr())}Cr(){this.Fr&&clearTimeout(this.Fr),this.Fr=setTimeout(()=>{this.Tr&&this.yr.length>0&&this.se(),this.Cr()},this.Rr)}se(){var e=Date.now(),t=[],n=this.yr.filter(n=>n.retryAt<e||(t.push(n),!1));if(this.yr=t,n.length>0)for(var r of n){var a=r.requestOptions;this.retriableRequest(a)}}unload(){for(var e of(this.Fr&&(clearTimeout(this.Fr),this.Fr=void 0),this.yr)){var t=e.requestOptions;try{this._instance.Ee(J({},t,{transport:"sendBeacon"}))}catch(t){G.error(t)}}this.yr=[]}}class wi{constructor(e){this.Or=()=>{var e,t,n,r;this.Ar||(this.Ar={});var a=this.scrollElement(),s=this.scrollY(),i=a?Math.max(0,a.scrollHeight-a.clientHeight):0,o=s+((null==a?void 0:a.clientHeight)||0),l=(null==a?void 0:a.scrollHeight)||0;this.Ar.lastScrollY=Math.ceil(s),this.Ar.maxScrollY=Math.max(s,null!==(e=this.Ar.maxScrollY)&&void 0!==e?e:0),this.Ar.maxScrollHeight=Math.max(i,null!==(t=this.Ar.maxScrollHeight)&&void 0!==t?t:0),this.Ar.last
2ContentY=o,this.Ar.maxContentY=Math.max(o,null!==(n=this.Ar.maxContentY)&&void 0!==n?n:0),this.Ar.maxContentHeight=Math.max(l,null!==(r=this.Ar.maxContentHeight)&&void 0!==r?r:0)},this._instance=e}getContext(){return this.Ar}resetContext(){var e=this.Ar;return setTimeout(this.Or,0),e}startMeasuringScrollPosition(){de(c,"scroll",this.Or,{capture:!0}),de(c,"scrollend",this.Or,{capture:!0}),de(c,"resize",this.Or)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==c?void 0:c.document.documentElement;var e=A(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var n=null==c?void 0:c.document.querySelector(t);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return c&&(c.scrollY||c.pageYOffset||c.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return c&&(c.scrollX||c.pageXOffset||c.document.documentElement.scrollLeft)||0}}var _i=e=>Bs(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class ki{constructor(e,t,n,r){this.Dr=e=>{var t=this.Lr();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.jr(this._instance)};this.Nr.register({[We]:n})}},this._instance=e,this.zr=t,this.Nr=n,this.jr=r||_i,this.zr.onSessionId(this.Dr)}Lr(){return this.Nr.props[We]}getSetOnceProps(){var e,t=null==(e=this.Lr())?void 0:e.props;return t?"r"in t?Ws(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return te(oe(this.getSetOnceProps()),(t,n)=>{"$current_url"===n&&(n="url"),e["$session_entry_"+T(n)]=t}),e}}var ji=Y("[SessionId]");class Ni{constructor(e,t,n){var r;if(this.Ur=[],!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=e.config,this.Nr=e.persistence,this.fi=void 0,this.Ct=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.qr=t||Bt,this.Br=n||Bt;var a=this.S.persistence_name||this.S.token,s=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*ln(s,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hr(),this.Wr="ph_"+a+"_window_id",this.Gr="ph_"+a+"_primary_window_exists",this.Jr()){var i=en.L(this.Wr),o=en.L(this.Gr);i&&!o?this.fi=i:en.N(this.Wr),en.j(this.Gr,!0)}if(null!=(r=this.S.bootstrap)&&r.sessionID)try{var l=(()=>{var e=this.S.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.Vr(this.S.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){ji.error("Invalid sessionID in bootstrap",e)}this.Kr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return L(this.Ur)&&(this.Ur=[]),this.Ur.push(e),this.Ct&&e(this.Ct,this.fi),()=>{this.Ur=this.Ur.filter(t=>t!==e)}}Jr(){return"memory"!==this.S.persistence&&!this.Nr.Fe&&en.O()}Yr(e){e!==this.fi&&(this.fi=e,this.Jr()&&en.j(this.Wr,e))}Xr(){return this.fi?this.fi:this.Jr()?en.L(this.Wr):null}Vr(e,t,n){e===this.Ct&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Ct=e,this.Nr.register({[Ie]:[t,e,n]}))}Qr(){if(this.Ct&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ct,this._sessionStartTimestamp];var e=this.Nr.props[Ie];return A(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Vr(null,null,null)}Kr(){de(c,"beforeunload",()=>{this.Jr()&&en.N(this.Gr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.S.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||(new Date).getTime(),r=l(this.Qr(),3),a=r[0],s=r[1],i=r[2],o=this.Xr(),c=W(i)&&i>0&&Math.abs(n-i)>864e5,u=!1,d=!s,f=!e&&Math.abs(n-a)>this.sessionTimeoutMs;d||f||c?(s=this.qr(),o=this.Br(),ji.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}}),i=n,u=!0):o||(o=this.Br(),u=!0);var h=0===a||!e||c?n:a,p=0===i?(new Date).getTime():i;return this.Yr(o),this.Vr(s,h,p),e||this.Hr(),u&&this.Ur.forEach(e
vendor: 8,852 bytes, line 2
2=>e(s,o,u?{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}:void 0)),{sessionId:s,windowId:o,sessionStartTimestamp:p,changeReason:u?{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:a}}Hr(){clearTimeout(this.Zr),this.Zr=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var Si=["$set_once","$set"],Ci=Y("[SiteApps]");class Ei{constructor(e){this._instance=e,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(e,t){if(t){var n=this.globalsForEvent(t);this.ts.push(n),this.ts.length>1e3&&(this.ts=this.ts.slice(10))}}get siteAppLoaders(){var e;return null==(e=w._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ge(this.es.bind(this));this.rs=()=>{e(),this.ts=[],this.rs=void 0}}}globalsForEvent(e){var t,n,r,a,s,i,o;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var f of Object.entries(d)){var h=l(f,2),p=h[0],m=h[1];c[p]={id:u[p],type:p,properties:m}}var g=e.$set_once,v=e.$set;return{event:J({},X(e,Si),{properties:J({},e.properties,v?{$set:J({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},v)}:{},g?{$set_once:J({},null!==(r=null==(a=e.properties)?void 0:a.$set_once)&&void 0!==r?r:{},g)}:{}),elements_chain:null!==(s=null==(i=e.properties)?void 0:i.$elements_chain)&&void 0!==s?s:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.ts.length&&(Ci.info("Processing "+this.ts.length+" events for site app with id "+e.id),this.ts.forEach(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(n=this.rs)||n.call(this))},r=!1,a=a=>{t.errored=!a,t.loaded=!0,Ci.info("Site app with id "+e.id+" "+(a?"loaded":"errored")),r&&n()};try{var s=e.init({posthog:this._instance,callback:e=>{a(e)}}).processEvent;s&&(t.processEvent=s),r=!0}catch(t){Ci.error("Error while initializing PostHog app with config id "+e.id,t),a(!1)}if(r&&t.loaded)try{n()}catch(n){Ci.error("Error while processing buffered events PostHog app with config id "+e.id,n),t.errored=!0}}ss(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ns(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{null==n.processEvent||n.processEvent(t)}catch(t){Ci.error("Error while processing event "+e.event+" for site app "+n.id,t)}}}onRemoteConfig(e){var t,n,r,a=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",e=>this.ns(e))):void Ci.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(n=this.rs)||n.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled){var s=function(e){var t;w["__$$ph_site_app_"+e]=a._instance,null==(t=w.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(a._instance,l,t=>{if(t)return Ci.error("Error while initializing PostHog app with config id "+e,t)})};for(var i of e.siteApps){var o=i.id,l=i.url;s(o)}}else Ci.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Ti=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Ii=function(e,t){if(!e)return!1;var n=e.toLowerCase();return Ti.concat(t||[]).some(e=>{var t=e.toLowerCase();return-1!==n.indexOf(t)})},Pi=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Ii(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>Ii(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},Ri=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),Oi="i.posthog.com";class Ai{constructor(e){this.os={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Oi,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.os[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=Ri.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=Ri.EU:this.os[this.apiHost]=Ri.CUSTOM),this.os[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if(this.region===Ri.CUSTOM)return this.apiHost+t;var n=Oi+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}}var Di={icontains:(e,t)=>!!c&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!c&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!c&&Pa(t.href,e),not_regex:(e,t)=>!!c&&!Pa(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Mi{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{Mi.ls("retrieved web experiments from the server"),t.us=new Map,e.forEach(e=>{if(e.feature_flag_key){var n;t.us&&(Mi.ls("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(n=t.us)||n.set(e.feature_flag_key,e));var r=t._instance.getFeatureFlag(e.feature_flag_key);U(r)&&e.variants[r]&&t.hs(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var a in e.variants){var s=e.variants[a];Mi.ds(s)&&t.hs(e.name,a,s.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())Mi.ls("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(B(this.us))return this.us=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Mi.ls("applying feature flags",e),e.forEach(e=>{var t;if(this.us&&null!=(t=this.us)&&t.has(e)){var n,r=this._instance.getFeatureFlag(e),a=null==(n=this.us)?void 0:n.get(e);r&&null!=a&&a.variants[r]&&this.hs(a.name,r,a.variants[r].transforms)}})}}previewWebExperiment(){var e=Mi.getWindowLocation();if(null!=e&&e.search){var t=Et(null==e?void 0:e.search,"__experiment_id"),n=Et(null==e?void 0:e.search,"__experiment_variant");t&&n&&(Mi.ls("previewing web experiments "+t+" && "+n),this.getWebExperiments(e=>{this.vs(parseInt(t),n,e)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this._instance.config.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var n=t.json.experiments||[];return e(n)}})}vs(e,t,n){var r=n.filter(t=>t.id===e);r&&r.length>0&&(Mi.ls("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.hs(r[0].name,t,r[0].variants[t].transforms))}static ds(e){return!B(e.conditions)&&Mi.cs(e)&&Mi.fs(e)}static cs(e){var t;if(B(e.conditions)||B(null==(t=e.conditions)?void 0:t.url))return!0;var n,r,a,s=Mi.getWindowLocation();return!!s&&(null==(n=e.conditions)||!n.url||Di[null!==(r=null==(a=e.conditions)?void 0:a.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,s))}
2static getWindowLocation(){return null==c?void 0:c.location}static fs(e){var t;if(B(e.conditions)||B(null==(t=e.conditions)?void 0:t.utm))return!0;var n=Fs();if(n.utm_source){var r,a,s,i,o,l,c,u,d=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_campaign)==n.utm_campaign,f=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(i=e.conditions)||null==(i=i.utm)?void 0:i.utm_source)==n.utm_source,h=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==n.utm_medium,p=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==n.utm_term;return d&&h&&p&&f}return!1}static ls(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];G.info("[WebExperiments] "+e,n)}hs(e,t,n){this._is_bot()?Mi.ls("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?n.forEach(n=>{if(n.selector){var r;Mi.ls("applying transform of variant "+t+" for experiment "+e+" ",n);var a=null==(r=document)?void 0:r.querySelectorAll(n.selector);null==a||a.forEach(e=>{var t=e;n.html&&(t.innerHTML=n.html),n.css&&t.setAttribute("style",n.css)})}}):Mi.ls("Control variants leave the page unmodified.")}_is_bot(){return p&&this._instance?Pi(p,this._instance.config.custom_blocked_useragents):void 0}}var Fi=Y("[PostHog ExternalIntegrations]"),Li={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Ui{constructor(e){this._instance=e}J(e,t){var n;null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,e,e=>{if(e)return Fi.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e=this,t=function(t){var n,r,a;!i||null!=(n=w.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t]||e.J(Li[t],()=>{var n;null==(n=w.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[t])||n.start(e._instance)}),!i&&null!=(r=w.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]&&(null==(a=w.__PosthogExtensions__)||null==(a=a.integrations)||null==(a=a[t])||a.stop())};for(var n of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r,a=l(n,2),s=a[0],i=a[1];t(s)}}}var Hi={},zi=()=>{},Bi="posthog",Wi=!Na&&-1===(null==b?void 0:b.indexOf("MSIE"))&&-1===(null==b?void 0:b.indexOf("Mozilla")),qi=e=>{var t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:ce(null==m?void 0:m.location),persistence:"localStorage+cookie",persistence_name:"",loaded:zi,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:"2025-05-24"!==e||"history_change",capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",debug:g&&U(null==g?void 0:g.search)&&-1!==g.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==c||null==(t=c.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;G.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:vi},error_tracking:{},_onCapture:zi}},Vi=e=>{var t={};L(e.process_person)||(t.person_profiles=e.process_person),L(e.xhr_headers)||(t.request_headers=e.x
2hr_headers),L(e.cookie_name)||(t.persistence_name=e.cookie_name),L(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),L(e.store_google)||(t.save_campaign_params=e.store_google),L(e.verbose)||(t.debug=e.verbose);var n=ne({},t,e);return A(e.property_blacklist)&&(L(e.property_denylist)?n.property_denylist=e.property_blacklist:A(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:G.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class $i{constructor(){this.__forceAllowLocalhost=!1}get ps(){return this.__forceAllowLocalhost}set ps(e){G.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Gi{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new $i,this.gs=!1,this.version=_.LIB_VERSION,this._s=new ai,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=qi(),this.SentryIntegration=ua,this.sentryIntegration=e=>function(e,t){var n=ca(e,t);return{name:la,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bs=!1,this.ys=null,this.ws=null,this.Ss=null,this.featureFlags=new ti(this),this.toolbar=new ma(this),this.scrollManager=new wi(this),this.pageViewManager=new ja(this),this.surveys=new ui(this),this.experiments=new Mi(this),this.exceptions=new Ma(this),this.rateLimiter=new pi(this),this.requestRouter=new Ai(this),this.consent=new nn(this),this.externalIntegrations=new Ui(this),this.people={set:(e,t,n)=>{var r=U(e)?{[e]:t}:e;this.setPersonProperties(r),null==n||n({})},set_once:(e,t,n)=>{var r=U(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==n||n({})}},this.on("eventCaptured",e=>G.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,n){if(n&&n!==Bi){var r,a=null!==(r=Hi[n])&&void 0!==r?r:new Gi;return a._init(e,t,n),Hi[n]=a,Hi[Bi][n]=a,a}return this._init(e,t,n)}_init(e,t,n){var r,a;if(void 0===t&&(t={}),L(e)||H(e))return G.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return G.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.$s=t,this.ks=[],t.person_profiles&&(this.ws=t.person_profiles),this.set_config(ne({},qi(t.defaults),Vi(t),{name:n,token:e})),this.config.on_xhr_error&&G.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:N.GZipJS,this.persistence=new ri(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ri(J({},this.config,{persistence:"sessionStorage"}));var s=J({},this.persistence.props),i=J({},this.sessionPersistence.props);if(this.register({$initialization_time:(new Date).toISOString()}),this.xs=new xi(e=>this.Es(e),this.config.request_queue_config),this.Is=new bi(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new Ni(this),this.sessionPropsManager=new ki(this,this.sessionManager,this.persistence)),new va(this).startIfEnabledOrStop(),this.siteApps=new Ei(this),null==(r=this.siteApps)||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new ia(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Dt(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new ka(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new ba(this),this.exceptionObserver=new dn(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new on(this,sn),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new Hn(this),this.historyAutocapture.startIfEnabled(),_.DEBUG=_.DEBUG||this.config.debug,_.DEBUG&&G.info("Starting in debug mode",{this:this,config:t,thisC:J({},this.config),p:s,s:i}),this.Ps(),void 0!==(null==(a=t.bootstrap)?void 0:a.distinctID)
vendor: 16,830 bytes, line 2
2){var o,l,u=this.config.get_device_id(Bt()),d=null!=(o=t.bootstrap)&&o.isIdentifiedID?u:t.bootstrap.distinctID;this.persistence.set_property(Be,null!=(l=t.bootstrap)&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.Rs()){var f,h,p=Object.keys((null==(f=t.bootstrap)?void 0:f.featureFlags)||{}).filter(e=>{var n;return!(null==(n=t.bootstrap)||null==(n=n.featureFlags)||!n[e])}).reduce((e,n)=>{var r;return e[n]=(null==(r=t.bootstrap)||null==(r=r.featureFlags)?void 0:r[n])||!1,e},{}),m=Object.keys((null==(h=t.bootstrap)?void 0:h.featureFlagPayloads)||{}).filter(e=>p[e]).reduce((e,n)=>{var r,a;return null!=(r=t.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[n]&&(e[n]=null==(a=t.bootstrap)||null==(a=a.featureFlagPayloads)?void 0:a[n]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:m})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Ze,$device_id:null},"");else if(!this.get_distinct_id()){var g=this.config.get_device_id(Bt());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(Be,"anonymous")}return de(c,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?function(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||Bt();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(Be,"identified")),t()},a=n.user();"then"in a&&D(a.then)?a.then(e=>r(e)):r(a)}(e,()=>{n.register((e=>{Promise&&Promise.resolve||oa.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,n)=>{if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(oa.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(oa.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then(()=>{t()})})}(this,()=>this.Ts()):this.Ts(),D(this.config._onCapture)&&this.config._onCapture!==zi&&(G.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&G.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Ie(e){var t,n,r,a,s,i,o,l;if(!m||!m.body)return G.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ie(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=C(e.supportedCompression,N.GZipJS)?N.GZipJS:C(e.supportedCompression,N.Base64)?N.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.ws?this.ws:"identified_only"}),null==(n=this.siteApps)||n.onRemoteConfig(e),null==(r=this.sessionRecording)||r.onRemoteConfig(e),null==(a=this.autocapture)||a.onRemoteConfig(e),null==(s=this.heatmaps)||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(i=this.webVitalsAutocapture)||i.onRemoteConfig(e),null==(o=this.exceptionObserver)||o.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(e)}Ts(){try{this.config.loaded(this)}catch(c){G.critical("`loaded` function failed",c)}this.Ms(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Cs()},1),new gi(this).load(),this.featureFlags.flags()}Ms(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null==(e=this.xs)||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||ee(this.__request_queue,e=>this.Es(e)),this.__request_queue=[],this.Ms()}_handle_unload(){var e,t;this.config.request_batching?(this.Fs()&&this.capture("$pageleave"),null==(e=this.xs)||e.unload(),null==(t=this.Is)||t.unload()):this.Fs()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Ee(e){this.__loaded&&(Wi?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Ca(e.url,{ip:this.config.ip?1:0}),e.headers=J({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,n,r,a=J({},e);a.timeout=a.timeout||6e4,a.url=Ca(a.url,{_:(new Date).getTime().toString(),ver:_.LIB_VERSION,compression:a.compression});var s=null!==(t=a.transport)&&void 0!==t?t:"fetch",i=null!==(n=null==(r=ue(Ia,e=>e.transport===s))?void 0:r.method)&&void 0!==n?n:Ia[0].method;if(!i)throw new Error("No available transport method");i(a)})(J({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(n=(r=this.config).on_request_error)||n.call(r,t)),null==e.callback||e.callback(t)}}))))}Es(e){this.Is?this.Is.retriableRequest(e):this.Ee(e)}_execute_array(e){var t,n=[],r=[],a=[];ee(e,e=>{e&&(t=e[0],A(t)?a.push(e):D(e)?e.call(this):A(e)&&"alias"===t?n.push(e):A(e)&&-1!==t.indexOf("capture")&&D(this[t])?a.push(e):r.push(e))});var s=function(e,t){ee(e,function(e){if(A(e[0])){var n=t;te(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};s(n,this),s(r,this),s(a,this)}Rs(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.xs){if(!this.consent.isOptedOut())if(!L(e)&&U(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var a=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==a||!a.isRateLimited){null!=t&&t.$current_url&&!U(null==t?void 0:t.$current_url)&&(G.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,i=(null==n?void 0:n.timestamp)||s,o=Bt(),l={uuid:o,event:e,properties:this.calculateEventProperties(e,t||{},i,o)};a&&(l.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),(null==n?void 0:n.$set)&&(l.$set=null==n?void 0:n.$set);var c,u,d=this.Os(null==n?void 0:n.$set_once);if(d&&(l.$set_once=d),(l=function(e,t){return n=e,r=e=>U(e)&&!z(t)?e.slice(0,t):e,a=new Set,function e(t,n){return t!==Object(t)?r?r(t):t:a.has(t)?void 0:(a.add(t),A(t)?(s=[],ee(t,t=>{s.push(e(t))})):(s={},te(t,(t,n)=>{a.has(t)||(s[n]=e(t,n))})),s);var s}(n);var n,r,a}(l,null!=n&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=i,L(null==n?void 0:n.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=s),e===di.DISMISSED||e===di.SENT){var f=null==t?void 0:t[fi.SURVEY_ID],h=null==t?void 0:t[fi.SURVEY_ITERATION];localStorage.setItem((u=""+oi+(c={id:f,current_iteration:h}).id,c.current_iteration&&c.current_iteration>0&&(u=""+oi+c.id+"_"+c.current_iteration),u),"true"),l.$set=J({},l.$set,{[li({id:f,current_iteration:h},e===di.SENT?"responded":"dismissed")]:!0})}var p=J({},l.properties.$set,l.$set);if(F(p)||this.setPersonPropertiesForFlags(p),!B(this.config.before_send)){var m=this.As(l);if(!m)return;l=m}this._s.emit("eventCaptured",l);var g={method:"POST",url:null!==(r=null==n?void 0:n._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this.Es(g):this.xs.enqueue(g),l}G.critical("This capture call is ignored due to client rate limiting.")}}else G.error("No event name provided to posthog.capture")}else G.uninitializedWarning("posthog.capture")}Ge(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,n,r,a){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var s=a?void 0:this.persistence.remove_event_timer(e),i=J({},t);if(i.token=this.config.token,i.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(i.$cookieless_mode=!0),"$snapshot"===e){var o=J({},this.persistence.properties(),this.sessionPersistence.properties());return i.distinct_id=o.distinct_id,(!U(i.distinct_id)&&!W(i.distinct_id)||H(i.distinct_id))&&G.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),i}var l,c=$s(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(a,n.getTime()),d=u.sessionId,f=u.windowId;i.$session_id=d,i.$window_id=f}this.sessionPropsManager&&ne(i,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&ne(i,this.sessionRecording.sdkDebugProperties),i.$sdk_debug_retry_queue_size=null==(h=this.Is)?void 0:h.length}catch(e){i.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Ri.CUSTOM&&(i.$lib_custom_api_host=this.config.api_host),l="$pageview"!==e||a?"$pageleave"!==e||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),i=ne(i,l),"$pageview"===e&&m&&(i.title=m.title),!L(s)){var p=n.getTime()-s;i.$duration=parseFloat((p/1e3).toFixed(3))}b&&this.config.opt_out_useragent_filter&&(i.$browser_type=this._is_bot()?"bot":"browser"),(i=ne({},c,this.persistence.properties(),this.sessionPersistence.properties(),i)).$is_identified=this._isIdentified(),A(this.config.property_denylist)?te(this.config.property_denylist,function(e){delete i[e]}):G.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(G.error("sanitize_properties is deprecated. Use before_send instead"),i=g(i,e));var v=this.Ds();return i.$process_person_profile=v,v&&!a&&this.Ls("_calculate_event_properties"),i}Os(e){var t;if(!this.persistence||!this.Ds())return e;if(this.gs)return e;var n=this.persistence.get_initial_props(),r=null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps(),a=ne({},n,r||{},e||{}),s=this.config.sanitize_properties;return s&&(G.error("sanitize_properties is deprecated. Use before_send instead"),a=s(a,"$set_once")),this.gs=!0,F(a)?void 0:a}register(e,t){var n;null==(n=this.persistence)||n.register(e,t)}register_once(e,t,n){var r;null==(r=this.persistence)||r.register_once(e,t,n)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}js(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e,t,n){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,n)}on(e,t){return this._s.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,n;return null!==(t=null==(n=this.sessionManager)?void 0:n.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,n){if(!this.__loaded||!this.persistence)return G.uninitializedWarning("posthog.identify");if(W(e)&&(e=e.toString(),G.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))G.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==Ze){if(this.Ls("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var a=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:a},"")}e!==r&&e!==this.get_property(he)&&(this.unregister(he),this.register({distinct_id:e}));var s="anonymous"===(this.persistence.get_property(Be)||"anonymous");e!==r&&s?(this.persistence.set_property(Be,"identified"),this.setPersonPropertiesForFlags(J({},n||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Ss=Ra(e,t,n),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(ze))}}else G.critical('The string "'+Ze+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else G.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Ls("posthog.setPersonProperties")){var n=Ra(this.get_distinct_id(),e,t);this.Ss!==n?(this.setPersonPropertiesForFlags(J({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ss=n):G.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,n){if(e&&t){if(this.Ls("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:J({},r,{[e]:t})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),r[e]===t||n||this.reloadFeatureFlags()}}else G.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Ls("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,a;if(G.info("reset"),!this.__loaded)return G.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(n=this.sessionPersistence)||n.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(r=this.persistence)||r.set_property(Be,"anonymous"),null==(a=this.sessionManager)||a.resetSessionId(),this.Ss=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Ze,$device_id:null},"");else{var i=this.config.get_device_id(Bt());this.register_once({distinct_id:i,$device_id:e?i:s},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,r=t.sessionStartTimestamp,a=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(null!=e&&e.withTimestamp&&r){var s,i=null!==(s=e.timestampLookBack)&&void 0!==s?s:10;if(!r)return a;a+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-i,0)}return a}
2alias(e,t){return e===this.get_property(fe)?(G.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ls("posthog.alias")?(L(t)&&(t=this.get_distinct_id()),e!==t?(this.js(he,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(G.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,n,r,a,s,i=J({},this.config);M(e)&&(ne(this.config,Vi(e)),null==(t=this.persistence)||t.update_config(this.config,i),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ri(J({},this.config,{persistence:"sessionStorage"})),Yt.O()&&"true"===Yt.D("ph_debug")&&(this.config.debug=!0),this.config.debug&&(_.DEBUG=!0,G.info("set_config",{config:e,oldConfig:i,newConfig:J({},this.config)})),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(r=this.autocapture)||r.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Ps(),null==(s=this.externalIntegrations)||s.startIfEnabledOrStop())}startSessionRecording(e){var t,n,r,a,s,i=!0===e,o={sampling:i||!(null==e||!e.sampling),linked_flag:i||!(null==e||!e.linked_flag),url_trigger:i||!(null==e||!e.url_trigger),event_trigger:i||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(n=this.sessionRecording)||n.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(a=this.sessionRecording)||a.overrideTrigger("url")),o.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var n=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(J({},Ln((e=>e instanceof Error)(e)?{error:e,event:e.message}:{event:e},{syntheticException:n}),t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Bi;return t!==Bi&&(t=Bi+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(Be))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(Be))}Ds(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&F(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[he])&&(null==(t=this.persistence)||null==(t=t.props)||!t[Ye]))}Fs(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Ds()||this.Ls("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ls(e){return"never"===this.config.person_profiles?(G.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.js(Ye,!0),!0)}Ps(){var e,t,n,r,a=this.consent.isOptedOut(),s=this.config.opt_out_persistence_by_default,i=this.config.disable_persistence||a&&!!s;(null==(e=this.persistence)?void 0:e.Fe)!==i&&(null==(n=this.persistence)||n.set_disabled(i)),(null==(t=this.sessionPersistence)?void 0:t.Fe)!==i&&(null==(r=this.sessionPersistence)||r.set_disabled(i))}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.Ps(),(L(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Cs()}opt_out_capturing(){this.consent.optInOut(!1),this.Ps()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.Ps()}_is_bot(){return p?Pi(p,this.config.custom_blocked_useragents):void 0}Cs(){m&&("visible"===m.visibilityState?this.bs||(this.bs=!0,this.capture("$pageview",{title:m.title},{send_instantly:!0}),this.ys&&(m.removeEventListener("visibilitychange",this.ys),this.ys=null)):this.ys||(this.ys=this.Cs.bind(this),de(m,"visibilitychange",this.ys)))}
2debug(e){!1===e?(null==c||c.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==c||c.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}I(){var e,t,n,r,a,s,i=this.$s||{};return"advanced_disable_flags"in i?!!i.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(G.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(n="advanced_disable_decide",r=G,a=(t="advanced_disable_flags")in(e=i)&&!L(e[t]),s=n in e&&!L(e[n]),a?e[t]:!!s&&(r&&r.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n]))}As(e){if(B(this.config.before_send))return e;var t=A(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),B(n)){var a="Event '"+e.event+"' was rejected in beforeSend function";return V(e.event)?G.warn(a+". This can cause unexpected behavior."):G.info(a),null}n.properties&&!F(n.properties)||G.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var e;return null==(e=this.pageViewManager.ce)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}}!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=ie(e.prototype[t[n]])}(Gi,["identify"]);var Yi,Ki=(Yi=Hi[Bi]=new Gi,function(){function e(){e.done||(e.done=!0,Wi=!1,te(Hi,function(e){e._dom_loaded()}))}null!=m&&m.addEventListener?"complete"===m.readyState?e():de(m,"DOMContentLoaded",e,{capture:!1}):c&&G.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Yi),Zi=(0,e.createContext)({client:Ki});function Ji(e,t,n){if(void 0===n&&(n=new WeakMap),e===t)return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var s=0,i=r;s<i.length;s++){var o=i[s];if(!a.includes(o))return!1;if(!Ji(e[o],t[o],n))return!1}return!0}function Xi(t){var n=t.children,r=t.client,a=t.apiKey,s=t.options,i=(0,e.useRef)(null),o=(0,e.useMemo)(function(){return r?(a&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),s&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),r):(a||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),Ki)},[r,a,JSON.stringify(s)]);return(0,e.useEffect)(function(){if(!r){var e=i.current;e?(a!==e.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),s&&!Ji(s,e.options)&&Ki.set_config(s),i.current={apiKey:a,options:null!==s&&void 0!==s?s:{}}):(Ki.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),Ki.init(a,s),i.current={apiKey:a,options:null!==s&&void 0!==s?s:{}})}},[r,a,JSON.stringify(s)]),e.createElement(Zi.Provider,{value:{client:o}},n)}var Qi=function(){return(0,e.useContext)(Zi).client};
2var eo=function(e,t){return eo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},eo(e,t)};"function"===typeof SuppressedError&&SuppressedError;var to=function(e){return"function"===typeof e};var no={componentStack:null,error:null},ro="[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element.";!function(t){function n(e){var n=t.call(this,e)||this;return n.state=no,n}(function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}eo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(n,t),n.prototype.componentDidCatch=function(e,t){var n,r=t.componentStack,a=this.props.additionalProperties;this.setState({error:e,componentStack:r}),to(a)?n=a(e):"object"===typeof a&&(n=a),this.context.client.captureException(e,n)},n.prototype.render=function(){var t=this.props,n=t.children,r=t.fallback,a=this.state;if(null==a.componentStack)return to(n)?n():n;var s=to(r)?e.createElement(r,{error:a.error,componentStack:a.componentStack}):r;return e.isValidElement(s)?s:(console.warn(ro),e.createElement(e.Fragment,null))},n.contextType=Zi}(e.Component);var ao,so=n(7950),io=n.t(so,2);function oo(e){return a(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(e)||o()}function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lo.apply(null,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(ao||(ao={}));const co="popstate";function uo(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function fo(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(d){}}}function ho(e,t){return{usr:e.state,key:e.key,idx:t}}function po(e,t,n,r){return void 0===n&&(n=null),lo({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?go(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function mo(e){let t=e.pathname,n=void 0===t?"/":t,r=e.search,a=void 0===r?"":r,s=e.hash,i=void 0===s?"":s;return a&&"?"!==a&&(n+="?"===a.charAt(0)?a:"?"+a),i&&"#"!==i&&(n+="#"===i.charAt(0)?i:"#"+i),n}function go(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function vo(e,t,n,r){void 0===r&&(r={});let a=r,s=a.window,i=void 0===s?document.defaultView:s,o=a.v5Compat,l=void 0!==o&&o,c=i.history,u=ao.Pop,d=null,f=h();function h(){return(c.state||{idx:null}).idx}function p(){u=ao.Pop;let e=h(),t=null==e?null:e-f;f=e,d&&d({action:u,location:g.location,delta:t})}function m(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"===typeof e?e:mo(e);return n=n.replace(/ $/,"%20"),uo(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==f&&(f=0,c.replaceState(lo({},c.state,{idx:f}),""));let g={get action(){return u},get location(){return e(i,c)},listen(e){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(co,p),d=e,()=>{i.removeEventListener(co,p),d=null}},createHref:e=>
vendor: 3,314 bytes, line 2
2t(i,e),createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){u=ao.Push;let r=po(g.location,e,t);n&&n(r,e),f=h()+1;let a=ho(r,f),s=g.createHref(r);try{c.pushState(a,"",s)}catch(o){if(o instanceof DOMException&&"DataCloneError"===o.name)throw o;i.location.assign(s)}l&&d&&d({action:u,location:g.location,delta:1})},replace:function(e,t){u=ao.Replace;let r=po(g.location,e,t);n&&n(r,e),f=h();let a=ho(r,f),s=g.createHref(r);c.replaceState(a,"",s),l&&d&&d({action:u,location:g.location,delta:0})},go:e=>c.go(e)};return g}var xo;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(xo||(xo={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function yo(e,t,n){return void 0===n&&(n="/"),bo(e,t,n,!1)}function bo(e,t,n,r){let a=Oo(("string"===typeof t?go(t):t).pathname||"/",n);if(null==a)return null;let s=wo(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n]);return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(s);let i=null,o=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return fo(!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}}(a);for(let l=0;null==i&&l<s.length;++l)i=Po(s[l],o,r);return i}function wo(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let a=(e,a,s)=>{let i={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(uo(i.relativePath.startsWith(r),'Absolute route path "'+i.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(r.length));let o=Bo([r,i.relativePath]),l=n.concat(i);e.children&&e.children.length>0&&(uo(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),wo(e.children,t,l,o)),(null!=e.path||e.index)&&t.push({path:o,score:Io(o,e.index),routesMeta:l})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let r of _o(e.path))a(e,t,r);else a(e,t)}),t}function _o(e){let t=e.split("/");if(0===t.length)return[];let n=oo(t),r=n[0],a=n.slice(1),s=r.endsWith("?"),i=r.replace(/\?$/,"");if(0===a.length)return s?[i,""]:[i];let o=_o(a.join("/")),l=[];return l.push(...o.map(e=>""===e?i:[i,e].join("/"))),s&&l.push(...o),l.map(t=>e.startsWith("/")&&""===t?"/":t)}const ko=/^:[\w-]+$/,jo=3,No=2,So=1,Co=10,Eo=-2,To=e=>"*"===e;function Io(e,t){let n=e.split("/"),r=n.length;return n.some(To)&&(r+=Eo),t&&(r+=No),n.filter(e=>!To(e)).reduce((e,t)=>e+(ko.test(t)?jo:""===t?So:Co),r)}function Po(e,t,n){void 0===n&&(n=!1);let r=e.routesMeta,a={},s="/",i=[];for(let o=0;o<r.length;++o){let e=r[o],l=o===r.length-1,c="/"===s?t:t.slice(s.length)||"/",u=Ro({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=Ro({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;
2Object.assign(a,u.params),i.push({params:a,pathname:Bo([s,u.pathname]),pathnameBase:Wo(Bo([s,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(s=Bo([s,u.pathnameBase]))}return i}function Ro(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let n=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);fo("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"));e.endsWith("*")?(r.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))");let s=new RegExp(a,t?void 0:"i");return[s,r]}(e.path,e.caseSensitive,e.end),r=l(n,2),a=r[0],s=r[1],i=t.match(a);if(!i)return null;let o=i[0],c=o.replace(/(.)\/+$/,"$1"),u=i.slice(1),d=s.reduce((e,t,n)=>{let r=t.paramName,a=t.isOptional;if("*"===r){let e=u[n]||"";c=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const s=u[n];return e[r]=a&&!s?void 0:(s||"").replace(/%2F/g,"/"),e},{});return{params:d,pathname:o,pathnameBase:c,pattern:e}}function Oo(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}const Ao=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Do(e,t){void 0===t&&(t="/");let n,r="string"===typeof e?go(e):e,a=r.pathname,s=r.search,i=void 0===s?"":s,o=r.hash,l=void 0===o?"":o;if(a)if(c=a,Ao.test(c))n=a;else{if(a.includes("//")){let e=a;a=zo(a),fo(!1,"Pathnames cannot have embedded double slashes - normalizing "+e+" -> "+a)}n=a.startsWith("/")?Mo(a.substring(1),"/"):Mo(a,t)}else n=t;var c;return{pathname:n,search:qo(i),hash:Vo(l)}}function Mo(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function Fo(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function Lo(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function Uo(e,t){let n=Lo(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function Ho(e,t,n,r){let a;void 0===r&&(r=!1),"string"===typeof e?a=go(e):(a=lo({},e),uo(!a.pathname||!a.pathname.includes("?"),Fo("?","pathname","search",a)),uo(!a.pathname||!a.pathname.includes("#"),Fo("#","pathname","hash",a)),uo(!a.search||!a.search.includes("#"),Fo("#","search","hash",a)));let s,i=""===e||""===a.pathname,o=i?"/":a.pathname;if(null==o)s=n;else{let e=t.length-1;if(!r&&o.startsWith("..")){let t=o.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}s=e>=0?t[e]:"/"}let l=Do(a,s),c=o&&"/"!==o&&o.endsWith("/"),u=(i||"."===o)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}const zo=e=>e.replace(/\/\/+/g,"/"),Bo=e=>zo(e.join("/")),Wo=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qo=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Vo=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;function $o(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const Go=["post","put","patch","delete"],Yo=(new Set(Go),["get",...Go]);new Set(Yo),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function Ko(){return Ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ko.apply(null,arguments)}const Zo=e.createContext(null);const Jo=e.createContext(null);const Xo=e.createContext(null);const Qo=e.createContext(null);const el=e.createContext({outlet:null,matches:[],isDataRoute:!1});const tl=e.createContext(null);function nl(){return null!=e.useContext(Qo)}function rl(){return nl()||uo(!1),e.useContext(Qo).location}function al(t){e.useContext(Xo).static||e.useLayoutEffect(t)}function sl(){return e.useContext(el).isDataRoute?function(){let t=gl(pl.UseNavigateStable).router,n=xl(ml.UseNavigateStable),r=e.useRef(!1);al(()=>{r.current=!0});let a=e.useCallback(function(e,a){void 0===a&&(a={}),r.current&&("number"===typeof e?t.navigate(e):t.navigate(e,Ko({fromRouteId:n},a)))},[t,n]);return a}():function(){nl()||uo(!1);let t=e.useContext(Zo),n=e.useContext(Xo),r=n.basename,a=n.future,s=n.navigator,i=e.useContext(el).matches,o=rl().pathname,l=JSON.stringify(Uo(i,a.v7_relativeSplatPath)),c=e.useRef(!1);al(()=>{c.current=!0});let u=e.useCallback(function(e,n){if(void 0===n&&(n={}),!c.current)return;if("number"===typeof e)return void s.go(e);let a=Ho(e,JSON.parse(l),o,"path"===n.relative);null==t&&"/"!==r&&(a.pathname="/"===a.pathname?r:Bo([r,a.pathname])),(n.replace?s.replace:s.push)(a,n.state,n)},[r,s,l,o,t]);return u}()}function il(){let t=e.useContext(el).matches,n=t[t.length-1];return n?n.params:{}}function ol(t,n){let r=(void 0===n?{}:n).relative,a=e.useContext(Xo).future,s=e.useContext(el).matches,i=rl().pathname,o=JSON.stringify(Uo(s,a.v7_relativeSplatPath));return e.useMemo(()=>Ho(t,JSON.parse(o),i,"path"===r),[t,o,i,r])}function ll(t,n,r,a){nl()||uo(!1);let s=e.useContext(Xo).navigator,i=e.useContext(el).matches,o=i[i.length-1],l=o?o.params:{},c=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let u,d=rl();if(n){var f;let e="string"===typeof n?go(n):n;"/"===c||(null==(f=e.pathname)?void 0:f.startsWith(c))||uo(!1),u=e}else u=d;let h=u.pathname||"/",p=h;if("/"!==c){let e=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=yo(t,{pathname:p});let g=hl(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:Bo([c,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:Bo([c,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),i,r,a);return n&&g?e.createElement(Qo.Provider,{value:{location:Ko({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:ao.Pop}},g):g}function cl(){let t=function(){var t;let n=e.useContext(tl),r=vl(ml.UseRouteError),a=xl(ml.UseRouteError);if(void 0!==n)return n;return null==(t=r.errors)?void 0:t[a]}(),n=$o(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application 
2Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},n),r?e.createElement("pre",{style:s},r):null,null)}const ul=e.createElement(cl,null);class dl extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?e.createElement(el.Provider,{value:this.props.routeContext},e.createElement(tl.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function fl(t){let n=t.routeContext,r=t.match,a=t.children,s=e.useContext(Zo);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(el.Provider,{value:n},a)}function hl(t,n,r,a){var s;if(void 0===n&&(n=[]),void 0===r&&(r=null),void 0===a&&(a=null),null==t){var i;if(!r)return null;if(r.errors)t=r.matches;else{if(!(null!=(i=a)&&i.v7_partialHydration&&0===n.length&&!r.initialized&&r.matches.length>0))return null;t=r.matches}}let o=t,l=null==(s=r)?void 0:s.errors;if(null!=l){let e=o.findIndex(e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id]));e>=0||uo(!1),o=o.slice(0,Math.min(o.length,e+1))}let c=!1,u=-1;if(r&&a&&a.v7_partialHydration)for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let e=r,n=e.loaderData,a=e.errors,s=t.route.loader&&void 0===n[t.route.id]&&(!a||void 0===a[t.route.id]);if(t.route.lazy||s){c=!0,o=u>=0?o.slice(0,u+1):[o[0]];break}}}return o.reduceRight((t,a,s)=>{let i,d=!1,f=null,h=null;var p;r&&(i=l&&a.route.id?l[a.route.id]:void 0,f=a.route.errorElement||ul,c&&(u<0&&0===s?(p="route-fallback",!1||yl[p]||(yl[p]=!0),d=!0,h=null):u===s&&(d=!0,h=a.route.hydrateFallbackElement||null)));let m=n.concat(o.slice(0,s+1)),g=()=>{let n;return n=i?f:d?h:a.route.Component?e.createElement(a.route.Component,null):a.route.element?a.route.element:t,e.createElement(fl,{match:a,routeContext:{outlet:t,matches:m,isDataRoute:null!=r},children:n})};return r&&(a.route.ErrorBoundary||a.route.errorElement||0===s)?e.createElement(dl,{location:r.location,revalidation:r.revalidation,component:f,error:i,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()},null)}var pl=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(pl||{}),ml=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}(ml||{});function gl(t){let n=e.useContext(Zo);return n||uo(!1),n}function vl(t){let n=e.useContext(Jo);return n||uo(!1),n}function xl(t){let n=function(){let t=e.useContext(el);return t||uo(!1),t}(),r=n.matches[n.matches.length-1];return r.route.id||uo(!1),r.route.id}const yl={};function bl(e,t){null==e||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}t.startTransition;function wl(t){let n=t.to,r=t.replace,a=t.state,s=t.relative;nl()||uo(!1);let i=e.useContext(Xo),o=i.future,l=(i.static,e.useContext(el).matches),c=rl().pathname,u=sl(),d=Ho(n,Uo(l,o.v7_relativeSplatPath),c,"path"===s),f=JSON.stringify(d);return e.useEffect(()=>u(JSON.parse(f),{replace:r,state:a,relative:s}),[u,f,s,r,a]),null}function _l(e){uo(!1)}function kl(t){let n=t.basename,r=void 0===n?"/":n,a=t.children,s=void 0===a?null:a,i=t.location,o=t.navigationType,l=void 0===o?ao.Pop:o,c=t.navigator,u=t.static,d=void 0!==u&&u,f=t.future;nl()&&uo(!1);let h=r.replace(/^\/*/,"/"),p=e.useMemo(()=>({basename:h,navigator:c,static:d,future:Ko({v7_relativeSplatPath:!1},f)}),[h,f,c,d]);"string"===typeof i&&(i=go(i));let m=i,g=m.pathname,v=void 0===g?"/":g,x=m.search,y=void 0===x?"":x,b=m.hash,w=void 0===b?"":b,_=m.state,k=void 0===_?null:_,j=m.ke
2y,N=void 0===j?"default":j,S=e.useMemo(()=>{let e=Oo(v,h);return null==e?null:{location:{pathname:e,search:y,hash:w,state:k,key:N},navigationType:l}},[h,v,y,w,k,N,l]);return null==S?null:e.createElement(Xo.Provider,{value:p},e.createElement(Qo.Provider,{children:s,value:S}))}function jl(e){let t=e.children,n=e.location;return ll(Nl(t),n)}new Promise(()=>{});e.Component;function Nl(t,n){void 0===n&&(n=[]);let r=[];return e.Children.forEach(t,(t,a)=>{if(!e.isValidElement(t))return;let s=[...n,a];if(t.type===e.Fragment)return void r.push.apply(r,Nl(t.props.children,s));t.type!==_l&&uo(!1),t.props.index&&t.props.children&&uo(!1);let i={id:t.props.id||s.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(i.children=Nl(t.props.children,s)),r.push(i)}),r}function Sl(){return Sl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sl.apply(null,arguments)}function Cl(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const El=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"];try{window.__reactRouterVersion="6"}catch(d){}new Map;const Tl=t.startTransition;io.flushSync,t.useId;function Il(t){let n=t.basename,r=t.children,a=t.future,s=t.window,i=e.useRef();null==i.current&&(i.current=function(e){return void 0===e&&(e={}),vo(function(e,t){let n=e.location;return po("",{pathname:n.pathname,search:n.search,hash:n.hash},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"===typeof t?t:mo(t)},null,e)}({window:s,v5Compat:!0}));let o=i.current,c=l(e.useState({action:o.action,location:o.location}),2),u=c[0],d=c[1],f=(a||{}).v7_startTransition,h=e.useCallback(e=>{f&&Tl?Tl(()=>d(e)):d(e)},[d,f]);return e.useLayoutEffect(()=>o.listen(h),[o,h]),e.useEffect(()=>bl(a),[a]),e.createElement(kl,{basename:n,children:r,location:u.location,navigationType:u.action,navigator:o,future:a})}const Pl="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,Rl=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ol=e.forwardRef(function(t,n){let r,a=t.onClick,s=t.relative,i=t.reloadDocument,o=t.replace,l=t.state,c=t.target,u=t.to,f=t.preventScrollReset,h=t.viewTransition,p=Cl(t,El),m=e.useContext(Xo).basename,g=!1;if("string"===typeof u&&Rl.test(u)&&(r=u,Pl))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),n=Oo(t.pathname,m);t.origin===e.origin&&null!=n?u=n+t.search+t.hash:g=!0}catch(d){}let v=function(t,n){let r=(void 0===n?{}:n).relative;nl()||uo(!1);let a=e.useContext(Xo),s=a.basename,i=a.navigator,o=ol(t,{relative:r}),l=o.hash,c=o.pathname,u=o.search,d=c;return"/"!==s&&(d="/"===c?s:Bo([s,c])),i.createHref({pathname:d,search:u,hash:l})}(u,{relative:s}),x=function(t,n){let r=void 0===n?{}:n,a=r.target,s=r.replace,i=r.state,o=r.preventScrollReset,l=r.relative,c=r.viewTransition,u=sl(),d=rl(),f=ol(t,{relative:l});return e.useCallback(e=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(e,a)){e.preventDefault();let n=void 0!==s?s:mo(d)===mo(f);u(t,{replace:n,state:i,preventScrollReset:o,relative:l,viewTransition:c})}},[d,u,f,s,i,a,t,o,l,c])}(u,{replace:o,state:l,target:c,preventScrollReset:f,relative:s,viewTransition:h});return e.createElement("a",Sl({},p,{href:r||v,onClick:g||i?a:function(e){a&&a(e),e.defaultPrevented||x(e)},ref:n,target:c}))});var Al,Dl;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Al||(Al={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Dl||(Dl={}));var Ml=n(5173),Fl=n.n(Ml),Ll=n(8161),Ul=n.n(Ll),Hl=n(6366),zl=n.n(Hl),Bl=n(2123),Wl=n.n(Bl),ql="bodyAttributes",Vl="htmlAttributes",$l="titleAttributes",Gl={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},Yl=(Object.keys(Gl).map(function(e){return Gl[e]}),"charset"),Kl="cssText",Zl="href",Jl="http-equiv",Xl="innerHTML",Ql="itemprop",ec="name",tc="property",nc="rel",rc="src",ac="target",sc={accesskey:"accessKey",charset
2:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},ic="defaultTitle",oc="defer",lc="encodeSpecialCharacters",cc="onChangeClientState",uc="titleTemplate",dc=Object.keys(sc).reduce(function(e,t){return e[sc[t]]=t,e},{}),fc=[Gl.NOSCRIPT,Gl.SCRIPT,Gl.STYLE],hc="data-react-helmet",pc="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mc=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),gc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vc=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},xc=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},yc=function(e){var t=jc(e,Gl.TITLE),n=jc(e,uc);if(n&&t)return n.replace(/%s/g,function(){return Array.isArray(t)?t.join(""):t});var r=jc(e,ic);return t||r||void 0},bc=function(e){return jc(e,cc)||function(){}},wc=function(e,t){return t.filter(function(t){return"undefined"!==typeof t[e]}).map(function(t){return t[e]}).reduce(function(e,t){return gc({},e,t)},{})},_c=function(e,t){return t.filter(function(e){return"undefined"!==typeof e[Gl.BASE]}).map(function(e){return e[Gl.BASE]}).reverse().reduce(function(t,n){if(!t.length)for(var r=Object.keys(n),a=0;a<r.length;a++){var s=r[a].toLowerCase();if(-1!==e.indexOf(s)&&n[s])return t.concat(n)}return t},[])},kc=function(e,t,n){var r={};return n.filter(function(t){return!!Array.isArray(t[e])||("undefined"!==typeof t[e]&&Tc("Helmet: "+e+' should be of type "Array". Instead found type "'+pc(t[e])+'"'),!1)}).map(function(t){return t[e]}).reverse().reduce(function(e,n){var a={};n.filter(function(e){for(var n=void 0,s=Object.keys(e),i=0;i<s.length;i++){var o=s[i],l=o.toLowerCase();-1===t.indexOf(l)||n===nc&&"canonical"===e[n].toLowerCase()||l===nc&&"stylesheet"===e[l].toLowerCase()||(n=l),-1===t.indexOf(o)||o!==Xl&&o!==Kl&&o!==Ql||(n=o)}if(!n||!e[n])return!1;var c=e[n].toLowerCase();return r[n]||(r[n]={}),a[n]||(a[n]={}),!r[n][c]&&(a[n][c]=!0,!0)}).reverse().forEach(function(t){return e.push(t)});for(var s=Object.keys(a),i=0;i<s.length;i++){var o=s[i],l=Wl()({},r[o],a[o]);r[o]=l}return e},[]).reverse()},jc=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.hasOwnProperty(t))return r[t]}return null},Nc=function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){Nc(t)},0)}}(),Sc=function(e){return clearTimeout(e)},Cc="undefined"!==typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Nc:n.g.requestAnimationFrame||Nc,Ec="undefined"!==typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Sc:n.g.cancelAnimationFrame||Sc,Tc=function(e){return console&&"function"===typeof console.warn&&console.warn(e)},Ic=null,Pc=function(e,t){var n=e.baseTag,r=e.bodyAttributes,a=e.htmlAttributes,s=e.linkTags,i=e.metaTags,o=e.noscriptTags,l=e.onChangeClientState,c=e.scriptTags,u=e.styleTags,d=e.title,f=e.titleAttributes;Ac(Gl.BODY,r),Ac(Gl.HTML,a),Oc(d,f);var h={baseTag:Dc(Gl.BASE,n),linkTags:Dc(Gl.LINK,s),metaTags:Dc(Gl.META,i),noscriptTags:Dc(Gl.NOSCRIPT,o),scriptTags:Dc(Gl.SCRIPT,c),styleTags:Dc(Gl.STYLE,u)},p={},m={};Object.keys(h).forEach(function(e){var t=h[e],n=t.newTags,r=t.oldTags;n.length&&(p[e]=n),r.length&&(m[e]=h[e].oldTags)}),t&&t(),l(e,p,m)},Rc=function(e){return Array.isArray(e)?e.join(""):e},Oc=function(e,t){"undefined"!==typeof e&&document.title!==e&&(document.title=Rc(e)),Ac(Gl.TITLE,t)},Ac=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute(hc),a=r?r.split(","):[],s=[].concat(a),i=Object.keys(t),o=0;o<i.length;o++){var l=i[o],c=t[l]||"";n.getAttribute(l)!==c&&n.setAttribute(l,c),-1===a.indexOf(l)&&a.push(l);var u=s.indexOf(l);-1!==u&&s.splice(u,1)}for(var d=s.length-1;d>=0;d--)n.removeAttribute(s[d]);a.length===s.length?n.removeAttribute(hc):n.getAttribute(hc)!==i.join(",")&&n.setAttribute(hc,i.join(","))}},Dc=function(e,t){var n=document.head||document.querySelector(Gl.HEAD),r=n.querySelectorAll(e+"["+hc+"]"),a=Array.prototype.slice.call(r),s=[],i=void 0;return t&&t.length&&t.forEach(function(t){var n=document.createElement(e);for(var r in t)if(t.hasOwnProperty(r))if(r===Xl)n.innerHTML=t.innerHTML;else if(r===Kl)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{var o="undefined"===typeof t[r]?"":t[r];n.setAttribute(r,o)}n.setAttribute(hc,"true"),a.some(function(e,t){return i=t,n.isEqualNode(e)})?a.splice(i,1):s.push(n)}),a.forEach(function(e){return e.parentNode.removeChild(e)}
2),s.forEach(function(e){return n.appendChild(e)}),{oldTags:a,newTags:s}},Mc=function(e){return Object.keys(e).reduce(function(t,n){var r="undefined"!==typeof e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r},"")},Fc=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce(function(t,n){return t[sc[n]||n]=e[n],t},t)},Lc=function(t,n,r){switch(t){case Gl.TITLE:return{toComponent:function(){return function(t,n,r){var a,s=((a={key:n})[hc]=!0,a),i=Fc(r,s);return[e.createElement(Gl.TITLE,i,n)]}(0,n.title,n.titleAttributes)},toString:function(){return function(e,t,n,r){var a=Mc(n),s=Rc(t);return a?"<"+e+" "+hc+'="true" '+a+">"+xc(s,r)+"</"+e+">":"<"+e+" "+hc+'="true">'+xc(s,r)+"</"+e+">"}(t,n.title,n.titleAttributes,r)}};case ql:case Vl:return{toComponent:function(){return Fc(n)},toString:function(){return Mc(n)}};default:return{toComponent:function(){return function(t,n){return n.map(function(n,r){var a,s=((a={key:r})[hc]=!0,a);return Object.keys(n).forEach(function(e){var t=sc[e]||e;if(t===Xl||t===Kl){var r=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:r}}else s[t]=n[e]}),e.createElement(t,s)})}(t,n)},toString:function(){return function(e,t,n){return t.reduce(function(t,r){var a=Object.keys(r).filter(function(e){return!(e===Xl||e===Kl)}).reduce(function(e,t){var a="undefined"===typeof r[t]?t:t+'="'+xc(r[t],n)+'"';return e?e+" "+a:a},""),s=r.innerHTML||r.cssText||"",i=-1===fc.indexOf(e);return t+"<"+e+" "+hc+'="true" '+a+(i?"/>":">"+s+"</"+e+">")},"")}(t,n,r)}}}},Uc=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,a=e.htmlAttributes,s=e.linkTags,i=e.metaTags,o=e.noscriptTags,l=e.scriptTags,c=e.styleTags,u=e.title,d=void 0===u?"":u,f=e.titleAttributes;return{base:Lc(Gl.BASE,t,r),bodyAttributes:Lc(ql,n,r),htmlAttributes:Lc(Vl,a,r),link:Lc(Gl.LINK,s,r),meta:Lc(Gl.META,i,r),noscript:Lc(Gl.NOSCRIPT,o,r),script:Lc(Gl.SCRIPT,l,r),style:Lc(Gl.STYLE,c,r),title:Lc(Gl.TITLE,{title:d,titleAttributes:f},r)}},Hc=function(t){var n,r;return r=n=function(n){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,n.apply(this,arguments))}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,n),r.prototype.shouldComponentUpdate=function(e){return!zl()(this.props,e)},r.prototype.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case Gl.SCRIPT:case Gl.NOSCRIPT:return{innerHTML:t};case Gl.STYLE:return{cssText:t}}throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},r.prototype.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren,a=e.newChildProps,s=e.nestedChildren;return gc({},r,((t={})[n.type]=[].concat(r[n.type]||[],[gc({},a,this.mapNestedChildrenToProps(n,s))]),t))},r.prototype.mapObjectTypeChildren=function(e){var t,n,r=e.child,a=e.newProps,s=e.newChildProps,i=e.nestedChildren;switch(r.type){case Gl.TITLE:return gc({},a,((t={})[r.type]=i,t.titleAttributes=gc({},s),t));case Gl.BODY:return gc({},a,{bodyAttributes:gc({},s)});case Gl.HTML:return gc({},a,{htmlAttributes:gc({},s)})}return gc({},a,((n={})[r.type]=gc({},s),n))},r.prototype.mapArrayTypeChildrenToProps=function(e,t){var n=gc({},t);return Object.keys(e).forEach(function(t){var r;n=gc({},n,((r={})[t]=e[t],r))}),n}
2,r.prototype.warnOnInvalidChildren=function(e,t){return!0},r.prototype.mapChildrenToProps=function(t,n){var r=this,a={};return e.Children.forEach(t,function(e){if(e&&e.props){var t=e.props,s=t.children,i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce(function(t,n){return t[dc[n]||n]=e[n],t},t)}(vc(t,["children"]));switch(r.warnOnInvalidChildren(e,s),e.type){case Gl.LINK:case Gl.META:case Gl.NOSCRIPT:case Gl.SCRIPT:case Gl.STYLE:a=r.flattenArrayTypeChildren({child:e,arrayTypeChildren:a,newChildProps:i,nestedChildren:s});break;default:n=r.mapObjectTypeChildren({child:e,newProps:n,newChildProps:i,nestedChildren:s})}}}),n=this.mapArrayTypeChildrenToProps(a,n)},r.prototype.render=function(){var n=this.props,r=n.children,a=vc(n,["children"]),s=gc({},a);return r&&(s=this.mapChildrenToProps(r,s)),e.createElement(t,s)},mc(r,null,[{key:"canUseDOM",set:function(e){t.canUseDOM=e}}]),r}(e.Component),n.propTypes={base:Fl().object,bodyAttributes:Fl().object,children:Fl().oneOfType([Fl().arrayOf(Fl().node),Fl().node]),defaultTitle:Fl().string,defer:Fl().bool,encodeSpecialCharacters:Fl().bool,htmlAttributes:Fl().object,link:Fl().arrayOf(Fl().object),meta:Fl().arrayOf(Fl().object),noscript:Fl().arrayOf(Fl().object),onChangeClientState:Fl().func,script:Fl().arrayOf(Fl().object),style:Fl().arrayOf(Fl().object),title:Fl().string,titleAttributes:Fl().object,titleTemplate:Fl().string},n.defaultProps={defer:!0,encodeSpecialCharacters:!0},n.peek=t.peek,n.rewind=function(){var e=t.rewind();return e||(e=Uc({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),e},r}(Ul()(function(e){return{baseTag:_c([Zl,ac],e),bodyAttributes:wc(ql,e),defer:jc(e,oc),encode:jc(e,lc),htmlAttributes:wc(Vl,e),linkTags:kc(Gl.LINK,[nc,Zl],e),metaTags:kc(Gl.META,[ec,Yl,Jl,tc,Ql],e),noscriptTags:kc(Gl.NOSCRIPT,[Xl],e),onChangeClientState:bc(e),scriptTags:kc(Gl.SCRIPT,[rc,Xl],e),styleTags:kc(Gl.STYLE,[Kl],e),title:yc(e),titleAttributes:wc($l,e)}},function(e){Ic&&Ec(Ic),e.defer?Ic=Cc(function(){Pc(e,function(){Ic=null})}):(Pc(e),Ic=null)},Uc)(function(){return null}));Hc.renderStatic=Hc.rewind;var zc=n(579);const Bc=t=>{let n=t.isLoading,r=void 0===n||n,a=t.children;const s=l((0,e.useState)(r),2),i=s[0],o=s[1];return(0,e.useEffect)(()=>{if(!r){const e=setTimeout(()=>{o(!1)},150);return()=>clearTimeout(e)}o(!0)},[r]),(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)("div",{className:"fixed inset-0 bg-white dark:bg-gray-900 flex items-center justify-center z-50 transition-opacity duration-150 ".concat(i?"opacity-100":"opacity-0 pointer-events-none"),children:(0,zc.jsx)("div",{className:"text-center",children:(0,zc.jsx)("img",{src:"/branding/TriEvents_Loading_Big_Text.gif",alt:"TriEvents Loading",className:"mx-auto w-64 md:w-[500px] h-auto"})})}),(0,zc.jsx)("div",{className:"transition-opacity duration-150 ".concat(i?"opacity-0":"opacity-100"),children:a})]})};function Wc(e){return Wc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wc(e)}function qc(e){var t=function(e,t){if("object"!=Wc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Wc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Wc(t)?t:t+""}function Vc(e,t,n){return(t=qc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$c(Object(n),!0).forEach(function(t){Vc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$c(Object(n)).forEac
2h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Yc(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}const Kc=["message"];var Zc=Array(12).fill(0),Jc=t=>{let n=t.visible,r=t.className;return e.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":n},e.createElement("div",{className:"sonner-spinner"},Zc.map((t,n)=>e.createElement("div",{className:"sonner-loading-bar",key:"spinner-bar-".concat(n)}))))},Xc=e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},e.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"})),Qc=e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},e.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"})),eu=e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},e.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"})),tu=e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},e.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"})),nu=e.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"},e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ru=1,au=new 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 n=e.message,r=Yc(e,Kc),a="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:ru++,s=this.toasts.find(e=>e.id===a),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),s?this.toasts=this.toasts.map(t=>t.id===a?(this.publish(Gc(Gc(Gc({},t),e),{},{id:a,title:n})),Gc(Gc(Gc({},t),e),{}
2,{id:a,dismissible:i,title:n})):t):this.addToast(Gc(Gc({title:n},r),{},{dismissible:i,id:a})),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create(Gc(Gc({},t),{},{message:e})),this.error=(e,t)=>this.create(Gc(Gc({},t),{},{message:e,type:"error"})),this.success=(e,t)=>this.create(Gc(Gc({},t),{},{type:"success",message:e})),this.info=(e,t)=>this.create(Gc(Gc({},t),{},{type:"info",message:e})),this.warning=(e,t)=>this.create(Gc(Gc({},t),{},{type:"warning",message:e})),this.loading=(e,t)=>this.create(Gc(Gc({},t),{},{type:"loading",message:e})),this.promise=(t,n)=>{if(!n)return;let r;void 0!==n.loading&&(r=this.create(Gc(Gc({},n),{},{promise:t,type:"loading",message:n.loading,description:"function"!=typeof n.description?n.description:void 0})));let a,s=t instanceof Promise?t:t(),i=void 0!==r,o=s.then(async t=>{if(a=["resolve",t],e.isValidElement(t))i=!1,this.create({id:r,type:"default",message:t});else if(su(t)&&!t.ok){i=!1;let e="function"==typeof n.error?await n.error("HTTP error! status: ".concat(t.status)):n.error,a="function"==typeof n.description?await n.description("HTTP error! status: ".concat(t.status)):n.description;this.create({id:r,type:"error",message:e,description:a})}else if(void 0!==n.success){i=!1;let e="function"==typeof n.success?await n.success(t):n.success,a="function"==typeof n.description?await n.description(t):n.description;this.create({id:r,type:"success",message:e,description:a})}}).catch(async e=>{if(a=["reject",e],void 0!==n.error){i=!1;let t="function"==typeof n.error?await n.error(e):n.error,a="function"==typeof n.description?await n.description(e):n.description;this.create({id:r,type:"error",message:t,description:a})}}).finally(()=>{var e;i&&(this.dismiss(r),r=void 0),null==(e=n.finally)||e.call(n)}),l=()=>new Promise((e,t)=>o.then(()=>"reject"===a[0]?t(a[1]):e(a[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let n=(null==t?void 0:t.id)||ru++;return this.create(Gc({jsx:e(n),id:n},t)),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},su=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,iu=(e,t)=>{let n=(null==t?void 0:t.id)||ru++;return au.addToast(Gc(Gc({title:e},t),{},{id:n})),n},ou=Object.assign(iu,{success:au.success,info:au.info,warning:au.warning,error:au.error,custom:au.custom,message:au.message,promise:au.promise,dismiss:au.dismiss,loading:au.loading},{getHistory:()=>au.toasts,getToasts:()=>au.getActiveToasts()});function lu(e){return void 0!==e.label}!function(e){let t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).insertAt;if(!e||"undefined"==typeof document)return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}(':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;
2left: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}
2: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%);
2--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%)}\n');function cu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}var uu=t=>{var n,r,a,s,i,o,c,u,d,f,h;let p=t.invert,m=t.toast,g=t.unstyled,v=t.interacting,x=t.setHeights,y=t.visibleToasts,b=t.heights,w=t.index,_=t.toasts,k=t.expanded,j=t.removeToast,N=t.defaultRichColors,S=t.closeButton,C=t.style,E=t.cancelButtonStyle,T=t.actionButtonStyle,I=t.className,P=void 0===I?"":I,R=t.descriptionClassName,O=void 0===R?"":R,A=t.duration,D=t.position,M=t.gap,F=t.loadingIcon,L=t.expandByDefault,U=t.classNames,H=t.icons,z=t.closeButtonAriaLabel,B=void 0===z?"Close toast":z,W=t.pauseWhenPageIsHidden,q=l(e.useState(null),2),V=q[0],$=q[1],G=l(e.useState(null),2),Y=G[0],K=G[1],Z=l(e.useState(!1),2),J=Z[0],X=Z[1],Q=l(e.useState(!1),2),ee=Q[0],te=Q[1],ne=l(e.useState(!1),2),re=ne[0],ae=ne[1],se=l(e.useState(!1),2),ie=se[0],oe=se[1],le=l(e.useState(!1),2),ce=le[0],ue=le[1],de=l(e.useState(0),2),fe=de[0],he=de[1],pe=l(e.useState(0),2),me=pe[0],ge=pe[1],ve=e.useRef(m.duration||A||4e3),xe=e.useRef(null),ye=e.useRef(null),be=0===w,we=w+1<=y,_e=m.type,ke=!1!==m.dismissible,je=m.className||"",Ne=m.descriptionClassName||"",Se=e.useMemo(()=>b.findIndex(e=>e.toastId===m.id)||0,[b,m.id]),Ce=e.useMemo(()=>{var e;return null!=(e=m.closeButton)?e:S},[m.closeButton,S]),Ee=e.useMemo(()=>m.duration||A||4e3,[m.duration,A]),Te=e.useRef(0),Ie=e.useRef(0),Pe=e.useRef(0),Re=e.useRef(null),Oe=l(D.split("-"),2),Ae=Oe[0],De=Oe[1],Me=e.useMemo(()=>
2b.reduce((e,t,n)=>n>=Se?e:e+t.height,0),[b,Se]),Fe=(()=>{let t=l(e.useState(document.hidden),2),n=t[0],r=t[1];return e.useEffect(()=>{let e=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),n})(),Le=m.invert||p,Ue="loading"===_e;Ie.current=e.useMemo(()=>Se*M+Me,[Se,Me]),e.useEffect(()=>{ve.current=Ee},[Ee]),e.useEffect(()=>{X(!0)},[]),e.useEffect(()=>{let e=ye.current;if(e){let t=e.getBoundingClientRect().height;return ge(t),x(e=>[{toastId:m.id,height:t,position:m.position},...e]),()=>x(e=>e.filter(e=>e.toastId!==m.id))}},[x,m.id]),e.useLayoutEffect(()=>{if(!J)return;let e=ye.current,t=e.style.height;e.style.height="auto";let n=e.getBoundingClientRect().height;e.style.height=t,ge(n),x(e=>e.find(e=>e.toastId===m.id)?e.map(e=>e.toastId===m.id?Gc(Gc({},e),{},{height:n}):e):[{toastId:m.id,height:n,position:m.position},...e])},[J,m.title,m.description,x,m.id]);let He=e.useCallback(()=>{te(!0),he(Ie.current),x(e=>e.filter(e=>e.toastId!==m.id)),setTimeout(()=>{j(m)},200)},[m,j,x,Ie]);return e.useEffect(()=>{if(m.promise&&"loading"===_e||m.duration===1/0||"loading"===m.type)return;let e;return k||v||W&&Fe?(()=>{if(Pe.current<Te.current){let e=(new Date).getTime()-Te.current;ve.current=ve.current-e}Pe.current=(new Date).getTime()})():ve.current!==1/0&&(Te.current=(new Date).getTime(),e=setTimeout(()=>{var e;null==(e=m.onAutoClose)||e.call(m,m),He()},ve.current)),()=>clearTimeout(e)},[k,v,m,_e,W,Fe,He]),e.useEffect(()=>{m.delete&&He()},[He,m.delete]),e.createElement("li",{tabIndex:0,ref:ye,className:cu(P,je,null==U?void 0:U.toast,null==(n=null==m?void 0:m.classNames)?void 0:n.toast,null==U?void 0:U.default,null==U?void 0:U[_e],null==(r=null==m?void 0:m.classNames)?void 0:r[_e]),"data-sonner-toast":"","data-rich-colors":null!=(a=m.richColors)?a:N,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":J,"data-promise":!!m.promise,"data-swiped":ce,"data-removed":ee,"data-visible":we,"data-y-position":Ae,"data-x-position":De,"data-index":w,"data-front":be,"data-swiping":re,"data-dismissible":ke,"data-type":_e,"data-invert":Le,"data-swipe-out":ie,"data-swipe-direction":Y,"data-expanded":!!(k||L&&J),style:Gc(Gc({"--index":w,"--toasts-before":w,"--z-index":_.length-w,"--offset":"".concat(ee?fe:Ie.current,"px"),"--initial-height":L?"auto":"".concat(me,"px")},C),m.style),onDragEnd:()=>{ae(!1),$(null),Re.current=null},onPointerDown:e=>{Ue||!ke||(xe.current=new Date,he(Ie.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(ae(!0),Re.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,n,r;if(ie||!ke)return;Re.current=null;let a=Number((null==(e=ye.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),s=Number((null==(t=ye.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=(new Date).getTime()-(null==(n=xe.current)?void 0:n.getTime()),o="x"===V?a:s,l=Math.abs(o)/i;if(Math.abs(o)>=20||l>.11)return he(Ie.current),null==(r=m.onDismiss)||r.call(m,m),K("x"===V?a>0?"right":"left":s>0?"down":"up"),He(),oe(!0),void ue(!1);ae(!1),$(null)},onPointerMove:e=>{var n,r,a,s;if(!Re.current||!ke||(null==(n=window.getSelection())?void 0:n.toString().length)>0)return;let i=e.clientY-Re.current.y,o=e.clientX-Re.current.x,c=null!=(r=t.swipeDirections)?r:function(e){let t=l(e.split("-"),2),n=t[0],r=t[1],a=[];return n&&a.push(n),r&&a.push(r),a}(D);!V&&(Math.abs(o)>1||Math.abs(i)>1)&&$(Math.abs(o)>Math.abs(i)?"x":"y");let u={x:0,y:0};"y"===V?(c.includes("top")||c.includes("bottom"))&&(c.includes("top")&&i<0||c.includes("bottom")&&i>0)&&(u.y=i):"x"===V&&(c.includes("left")||c.includes("right"))&&(c.includes("left")&&o<0||c.includes("right")&&o>0)&&(u.x=o),(Math.abs(u.x)>0||Math.abs(u.y)>0)&&ue(!0),null==(a=ye.current)||a.style.setProperty("--swipe-amount-x","".concat(u.x,"px")),null==(s=ye.current)||s.style.setProperty("--swipe-amount-y","".concat(u.y,"px"))}},Ce&&!m.jsx?e.createElement("button",{"aria-label":B,"data-disabled":Ue,"data-close-button":!0,onClick:Ue||!ke?()=>{}:()=>{var e;He(),null==(e=m.onDismiss)||e.call(m,m)},className:cu(null==U?void 0:U.closeButton,null==(s=null==m?void 0:m.classNames)?void 0:s.closeButton)},null!=(i=null==H?void 0:H.close)?i:nu):null,m.jsx||(0,e.isValidElement)(m.title)?m.jsx?m.jsx:"function"==typeof m.title?m.title():m.title:e.createElement(e.Fragment,null,_e||m.icon||m.promise?e.createElement("div",{"data-icon":"",className:cu(null==U?void 0:U.icon,null==(o=null==m?void 0:m.classNames)?void 0:o.icon)},m.promise||"loading"===m.type&&!m.icon?m.icon||function(){var t,n,r;return null!=H&&H.loading?e.createElement("div",{className:cu(null==U?void 0:U.loader,null==(t=null==m?void 0:m.classNames)?void 0:t.loader,"sonner-loader"),"data-visible":"loading"===_e},H.loading):F?e.createElement("div",{className:cu(null==U?void 0:U.loader,null==(n=null==m?void 0:m.classNames)?void 0:n.loader,"sonner-loader"),"data-visible":"loading"===_e},F):e.createElement(Jc,{className:cu(null==U?void 0:U.loader,null==(r=null==m?void 0:m.classNames)?void 0:r.loader),visible:"loading"===_e})}():null,"loading"!==m.type?m.icon||(null==H?void 0:H[_e])||(e=>{switch(e){case"success":return Xc;case"info":return eu;case"warning":return Qc;case"error":return tu;default:return null}})(_e):null):null,e.createElement("div",{"data-content":"",className:cu(null==U?void 0:U.content,null==(c=null==m?void 0:m.classNames)?void 0:c.content)},e.createElement("div",{"data-title":"",className:cu(null==U?void 0:U.title,null==(u=null==m?void 0:m.classNames)?void 0:u.title)},"function"==typeof m.title?m.title():m.title),m.description?e.createElement("div",{"data-description":"",className:cu(O,Ne,null==U?void 0:U.description,null==(d=null==m?void 0:m.classNames)?void 0:d.description)},"function"==typeof m.description?m.description():m.description):null),(0,e.isValidElement)(m.cancel)?m.cancel:m.cancel&&lu(m.cancel)?e.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||E,onClick:e=>{var t,n;lu(m.cancel)&&ke&&(null==(n=(t=m.cancel).onClick)||n.call(t,e),He())},className:cu(null==U?void 0:U.cancelButton,null==(f=null==m?void 0:m.classNames)?void 0:f.cancelButton)},m.cancel.label):null,(0,e.isValidElement)(m.action)?m.action:m.action&&lu(m.action)?e.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||T,onClick:e=>{var t,n;lu(m.action)&&(null==(n=(t=m.action).onClick)||n.call(t,e),!e.defaultPrevented&&He())},className:cu(null==U?void 0:U.actionButton,null==(h=null==m?void 0:m.classNames)?void 0:h.actionButton)},m.action.label):null))};function du(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}function fu(e,t){let n={};return[e,t].forEach((e,t)=>{let r=1===t,a=r?"--mobile-offset":"--offset",s=r?"16px":"32px";function i(e){["top","right","bottom","left"].forEach(t=>{n["".concat(a,"-").concat(t)]="number"==typeof e?"".concat(e,"px"):e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?n["".concat(a,"-").concat(t)]=s:n["".concat(a,"-").concat(t)]="number"==typeof e[t]?"".concat(e[t],"px"):e[t]}):i(s)}),n}var hu=(0,e.forwardRef)(function(t,n){let r=t.invert,a=t.position,s=void 0===a?"bottom-right":a,i=t.hotkey,o=void 0===i?["altKey","KeyT"]:i,c=t.expand,u=t.closeButton,d=t.className,f=t.offset,h=t.mobileOffset,p=t.theme,m=void 0===p?"light":p,g=t.richColors,v=t.duration,x=t.style,b=t.visibleToasts,w=void 0===b?3:b,_=t.toastOptions,k=t.dir,j=void 0===k?du():k,N=t.gap,S=void 0===N?14:N,C=t.loadingIcon,E=t.icons,T=t.containerAriaLabel,I=void 0===T?"Notifications":T,P=t.pauseWhenPageIsHidden,R=l(e.useState([]),2),O=R[0],A=R[1],D=e.useMemo(()=>Array.from(new Set([s].concat(O.filter(e=>e.position).map(e=>e.position)))),[O,s]),M=l(e.useState([]),2),F=M[0],U=M[1],H=l(e.useState(!1),2),z=H[0],B=H[1],W=l(e.useState(!1),2),q=W[0],V=W[1],$=l(e.useState("system"!==m?m:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
2k":"light"),2),G=$[0],Y=$[1],K=e.useRef(null),Z=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),J=e.useRef(null),X=e.useRef(!1),Q=e.useCallback(e=>{A(t=>{var n;return null!=(n=t.find(t=>t.id===e.id))&&n.delete||au.dismiss(e.id),t.filter(t=>t.id!==e.id)})},[]);return e.useEffect(()=>au.subscribe(e=>{e.dismiss?A(t=>t.map(t=>t.id===e.id?Gc(Gc({},t),{},{delete:!0}):t)):setTimeout(()=>{so.flushSync(()=>{A(t=>{let n=t.findIndex(t=>t.id===e.id);return-1!==n?[...t.slice(0,n),Gc(Gc({},t[n]),e),...t.slice(n+1)]:[e,...t]})})})}),[]),e.useEffect(()=>{if("system"!==m)return void Y(m);if("system"===m&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),"undefined"==typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",e=>{let t=e.matches;Y(t?"dark":"light")})}catch(y){e.addListener(e=>{let t=e.matches;try{Y(t?"dark":"light")}catch(L){console.error(L)}})}},[m]),e.useEffect(()=>{O.length<=1&&B(!1)},[O]),e.useEffect(()=>{let e=e=>{var t,n;o.every(t=>e[t]||e.code===t)&&(B(!0),null==(t=K.current)||t.focus()),"Escape"===e.code&&(document.activeElement===K.current||null!=(n=K.current)&&n.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),e.useEffect(()=>{if(K.current)return()=>{J.current&&(J.current.focus({preventScroll:!0}),J.current=null,X.current=!1)}},[K.current]),e.createElement("section",{ref:n,"aria-label":"".concat(I," ").concat(Z),tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((n,a)=>{var s;let i=l(n.split("-"),2),o=i[0],p=i[1];return O.length?e.createElement("ol",{key:n,dir:"auto"===j?du():j,tabIndex:-1,ref:K,className:d,"data-sonner-toaster":!0,"data-theme":G,"data-y-position":o,"data-lifted":z&&O.length>1&&!c,"data-x-position":p,style:Gc(Gc({"--front-toast-height":"".concat((null==(s=F[0])?void 0:s.height)||0,"px"),"--width":"".concat(356,"px"),"--gap":"".concat(S,"px")},x),fu(f,h)),onBlur:e=>{X.current&&!e.currentTarget.contains(e.relatedTarget)&&(X.current=!1,J.current&&(J.current.focus({preventScroll:!0}),J.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||X.current||(X.current=!0,J.current=e.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{q||B(!1)},onDragEnd:()=>B(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||V(!0)},onPointerUp:()=>V(!1)},O.filter(e=>!e.position&&0===a||e.position===n).map((a,s)=>{var i,o;return e.createElement(uu,{key:a.id,icons:E,index:s,toast:a,defaultRichColors:g,duration:null!=(i=null==_?void 0:_.duration)?i:v,className:null==_?void 0:_.className,descriptionClassName:null==_?void 0:_.descriptionClassName,invert:r,visibleToasts:w,closeButton:null!=(o=null==_?void 0:_.closeButton)?o:u,interacting:q,position:n,style:null==_?void 0:_.style,unstyled:null==_?void 0:_.unstyled,classNames:null==_?void 0:_.classNames,cancelButtonStyle:null==_?void 0:_.cancelButtonStyle,actionButtonStyle:null==_?void 0:_.actionButtonStyle,removeToast:Q,toasts:O.filter(e=>e.position==a.position),heights:F.filter(e=>e.position==a.position),setHeights:U,expandByDefault:c,gap:S,loadingIcon:C,expanded:z,pauseWhenPageIsHidden:P,swipeDirections:t.swipeDirections})})):null}))});var pu=n(8252),mu=n.n(pu),gu=n(6744),vu=n.n(gu),xu=n(9205),yu=n.n(xu),bu=n(8483),wu=n.n(bu);const _u={appInfo:{appName:"Trievents",apiDomain:"https://api.trievents.ca",websiteDomain:"https://trievents.ca"},usesDynamicLoginMethods:!0,style:"\n[data-supertokens~=tenants-link] {\n    margin-top: 8px;\n}\n",recipeList:[yu().init(),vu().init({tokenTransferMethod:"header",override:{functions:e=>Gc(Gc({},e),{},{getTokenTransferMethod:()=>"header"})}}),wu().init({override:{functions:e=>Gc(Gc({},e),{},{getTenantId:async()=>{const e=localStorage.getItem("tenantId");return null===e?void 0:e}})}})]},ku=()=>localStorage.getItem("tenantId"),ju=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Nu=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];
2return t.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()};var Su={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"};const Cu=["color","size","strokeWidth","absoluteStrokeWidth","className","children","iconNode"],Eu=(0,e.forwardRef)((t,n)=>{let r=t.color,a=void 0===r?"currentColor":r,s=t.size,i=void 0===s?24:s,o=t.strokeWidth,c=void 0===o?2:o,u=t.absoluteStrokeWidth,d=t.className,f=void 0===d?"":d,h=t.children,p=t.iconNode,m=Yc(t,Cu);return(0,e.createElement)("svg",Gc(Gc(Gc({ref:n},Su),{},{width:i,height:i,stroke:a,strokeWidth:u?24*Number(c)/Number(i):c,className:Nu("lucide",f)},!h&&!(e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(m)&&{"aria-hidden":"true"}),m),[...p.map(t=>{let n=l(t,2),r=n[0],a=n[1];return(0,e.createElement)(r,a)}),...Array.isArray(h)?h:[h]])}),Tu=["className"],Iu=(t,n)=>{const r=(0,e.forwardRef)((r,a)=>{let s=r.className,i=Yc(r,Tu);return(0,e.createElement)(Eu,Gc({ref:a,iconNode:n,className:Nu("lucide-".concat((o=ju(t),o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())),"lucide-".concat(t),s)},i));var o});return r.displayName=ju(t),r},Pu=Iu("layout-dashboard",[["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"}]]),Ru=Iu("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),Ou=Iu("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),Au=Iu("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"}]]),Du=Iu("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"}]]),Mu=[{name:"Dashboard",href:"/dashboard",icon:Pu},{name:"Members",href:"members",icon:Ru},{name:"Email Dashboard",href:"/email-dashboard",icon:Ou},{name:"Transactions",href:"/transactions",icon:Au},{name:"Finances",href:"/finances",icon:Du}];var Fu=n(5946),Lu=n.n(Fu);const Uu=Iu("log-out",[["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"}]]),Hu=()=>{const e=sl();return(0,zc.jsxs)("button",{onClick:async()=>{try{await Lu().signOut(),e("/auth")}catch(t){e("/auth")}},className:"flex items-center gap-3 rounded-lg px-3 py-2 text-md bg-primary text-primary-foreground w-full",children:[(0,zc.jsx)(Uu,{className:"h-4 w-4"}),(0,zc.jsx)("span",{children:"Logout"})]})};function zu(e,t){let n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).checkForDefaultPrevented,r=void 0===n||n;return function(n){if(null===e||void 0===e||e(n),!1===r||!n.defaultPrevented)return null===t||void 0===t?void 0:t(n)}}function Bu(e,t){if("function"===typeof e)return e(t);null!==e&&void 0!==e&&(e.current=t)}function Wu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{let n=!1;const r=t.map(t=>{const r=Bu(t,e);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let e=0;e<r.length;e++){const n=r[e];"function"==typeof n?n():Bu(t[e],null)}}}}function qu(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.useCallback(Wu(...n),n)}const Vu=["children"],$u=["scope","children"];function Gu(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[];const a=()=>{const n=r.map(t=>e.createContext(t));return function(r){const a=(null===r||void 0===r?void 0:r[t])||n;return e.useMemo(()=>({["__scope".concat(t)]:Gc(Gc({},r),{},{[t]:a})}),[r,a])}};return a.scopeName=t,[function(n,a){const s=e.createContext(a),i=r.length;r=[...r,a];const o=n=>{var r;const a=n.scope,o=n.children,l=Yc(n,$u),c=(null===a||void 0===a||null===(r=a[t])||void 0===r?void 0:r[i])||s,u=e.useMemo(()=>l,Object.values(l));return(0,zc.jsx)(c.Provider,{value:u,children:o})};return o.displayName=n+"Provider",[o,function(r,o){var l;const c=(null===o||void 0===o||null===(l=o[t])||void 0===l?void 0:l[i])||s,u=e.useContext(c);if(u)return u;if(void 0!==a)return a;throw new Error("`".concat(r,"` must be used within `").concat(n,"`"))}]},Yu(a,...n)]}function Yu(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a=n[0];if(1===n.length)return a;const s=()=>{const t=n.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(n){const r=t.reduce((e,t)=>
2{let r=t.useScope,a=t.scopeName;const s=r(n)["__scope".concat(a)];return Gc(Gc({},e),s)},{});return e.useMemo(()=>({["__scope".concat(a.scopeName)]:r}),[r])}};return s.scopeName=a.scopeName,s}const Ku=["children"],Zu=["children"];function Ju(t){const n=Qu(t),r=e.forwardRef((t,r)=>{const a=t.children,s=Yc(t,Ku),i=e.Children.toArray(a),o=i.find(nd);if(o){const t=o.props.children,a=i.map(n=>n===o?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n);return(0,zc.jsx)(n,Gc(Gc({},s),{},{ref:r,children:e.isValidElement(t)?e.cloneElement(t,void 0,a):null}))}return(0,zc.jsx)(n,Gc(Gc({},s),{},{ref:r,children:a}))});return r.displayName="".concat(t,".Slot"),r}var Xu=Ju("Slot");function Qu(t){const n=e.forwardRef((t,n)=>{const r=t.children,a=Yc(t,Zu);if(e.isValidElement(r)){const t=function(e){var t,n;let r=null===(t=Object.getOwnPropertyDescriptor(e.props,"ref"))||void 0===t?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null===(n=Object.getOwnPropertyDescriptor(e,"ref"))||void 0===n?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const n=Gc({},t);for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=function(){const e=s(...arguments);return a(...arguments),e}:a&&(n[r]=a):"style"===r?n[r]=Gc(Gc({},a),s):"className"===r&&(n[r]=[a,s].filter(Boolean).join(" "))}return Gc(Gc({},e),n)}(a,r.props);return r.type!==e.Fragment&&(s.ref=n?Wu(n,t):t),e.cloneElement(r,s)}return e.Children.count(r)>1?e.Children.only(null):null});return n.displayName="".concat(t,".SlotClone"),n}var ed=Symbol("radix.slottable");function td(e){const t=e=>{let t=e.children;return(0,zc.jsx)(zc.Fragment,{children:t})};return t.displayName="".concat(e,".Slottable"),t.__radixId=ed,t}function nd(t){return e.isValidElement(t)&&"function"===typeof t.type&&"__radixId"in t.type&&t.type.__radixId===ed}const rd=["asChild"];var ad=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const r=Ju("Primitive.".concat(n)),a=e.forwardRef((e,t)=>{const a=e.asChild,s=Yc(e,rd),i=a?r:n;return"undefined"!==typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,zc.jsx)(i,Gc(Gc({},s),{},{ref:t}))});return a.displayName="Primitive.".concat(n),Gc(Gc({},t),{},{[n]:a})},{});function sd(e,t){e&&so.flushSync(()=>e.dispatchEvent(t))}function id(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>function(){for(var e,t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return null===(e=n.current)||void 0===e?void 0:e.call(n,...r)},[])}const od=["disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss"];var ld,cd="dismissableLayer.update",ud="dismissableLayer.pointerDownOutside",dd="dismissableLayer.focusOutside",fd=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hd=e.forwardRef((t,n)=>{var r;const a=t.disableOutsidePointerEvents,s=void 0!==a&&a,i=t.onEscapeKeyDown,o=t.onPointerDownOutside,c=t.onFocusOutside,u=t.onInteractOutside,d=t.onDismiss,f=Yc(t,od),h=e.useContext(fd),p=l(e.useState(null),2),m=p[0],g=p[1],v=null!==(r=null===m||void 0===m?void 0:m.ownerDocument)&&void 0!==r?r:null===globalThis||void 0===globalThis?void 0:globalThis.document,x=l(e.useState({}),2)[1],y=qu(n,e=>g(e)),b=Array.from(h.layers),w=l([...h.layersWithOutsidePointerEventsDisabled].slice(-1),1)[0],_=b.indexOf(w),k=m?b.indexOf(m):-1,j=h.layersWithOutsidePointerEventsDisabled.size>0,N=k>=_,S=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===globalThis||void 0===globalThis?void 0:globalThis.document;const r=id(t),a=e.useRef(!1),s=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!a.current){let t=function(){gd(ud,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",s.current),s.current=t,n.addEventListener("click",s.current,{once:!0})):t()}
2else n.removeEventListener("click",s.current);a.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",s.current)}},[n,r]),{onPointerDownCapture:()=>a.current=!0}}(e=>{const t=e.target,n=[...h.branches].some(e=>e.contains(t));N&&!n&&(null===o||void 0===o||o(e),null===u||void 0===u||u(e),e.defaultPrevented||null===d||void 0===d||d())},v),C=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===globalThis||void 0===globalThis?void 0:globalThis.document;const r=id(t),a=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!a.current){gd(dd,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}(e=>{const t=e.target;[...h.branches].some(e=>e.contains(t))||(null===c||void 0===c||c(e),null===u||void 0===u||u(e),e.defaultPrevented||null===d||void 0===d||d())},v);return function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===globalThis||void 0===globalThis?void 0:globalThis.document;const r=id(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[r,n])}(e=>{k===h.layers.size-1&&(null===i||void 0===i||i(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))},v),e.useEffect(()=>{if(m)return s&&(0===h.layersWithOutsidePointerEventsDisabled.size&&(ld=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),md(),()=>{s&&1===h.layersWithOutsidePointerEventsDisabled.size&&(v.body.style.pointerEvents=ld)}},[m,v,s,h]),e.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),md())},[m,h]),e.useEffect(()=>{const e=()=>x({});return document.addEventListener(cd,e),()=>document.removeEventListener(cd,e)},[]),(0,zc.jsx)(ad.div,Gc(Gc({},f),{},{ref:y,style:Gc({pointerEvents:j?N?"auto":"none":void 0},t.style),onFocusCapture:zu(t.onFocusCapture,C.onFocusCapture),onBlurCapture:zu(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:zu(t.onPointerDownCapture,S.onPointerDownCapture)}))});hd.displayName="DismissableLayer";var pd=e.forwardRef((t,n)=>{const r=e.useContext(fd),a=e.useRef(null),s=qu(n,a);return e.useEffect(()=>{const e=a.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,zc.jsx)(ad.div,Gc(Gc({},t),{},{ref:s}))});function md(){const e=new CustomEvent(cd);document.dispatchEvent(e)}function gd(e,t,n,r){let a=r.discrete;const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),a?sd(s,i):s.dispatchEvent(i)}pd.displayName="DismissableLayerBranch";var vd=null!==globalThis&&void 0!==globalThis&&globalThis.document?e.useLayoutEffect:()=>{},xd=t[" useId ".trim().toString()]||(()=>{}),yd=0;function bd(t){const n=l(e.useState(xd()),2),r=n[0],a=n[1];return vd(()=>{t||a(e=>null!==e&&void 0!==e?e:String(yd++))},[t]),t||(r?"radix-".concat(r):"")}const wd=["top","right","bottom","left"],_d=Math.min,kd=Math.max,jd=Math.round,Nd=Math.floor,Sd=e=>({x:e,y:e}),Cd={left:"right",right:"left",bottom:"top",top:"bottom"},Ed={start:"end",end:"start"};function Td(e,t,n){return kd(e,_d(t,n))}function Id(e,t){return"function"===typeof e?e(t):e}function Pd(e){return e.split("-")[0]}function Rd(e){return e.split("-")[1]}function Od(e){return"x"===e?"y":"x"}function Ad(e){return"y"===e?"height":"width"}const Dd=new Set(["top","bottom"]);function Md(e){return Dd.has(Pd(e))?"y":"x"}function Fd(e){return Od(Md(e))}function Ld(e){return e.replace(/start|end/g,e=>Ed[e])}const Ud=["left","right"],Hd=["right","left"],zd=["top","bottom"],Bd=["bottom","top"];function Wd(e,t,n,r){const a=Rd(e);let s=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Hd:Ud:t?Ud:Hd;case"left":case"right":return t?zd:Bd;default:return[]}}(Pd(e),"start"===n,r);return a&&(s=s.map(e=>e+"-"+a),t&&(s=s.concat(s.map(Ld)))),s}function qd(e){return e.replace(/left|right|bottom|top/g,e=>Cd[e])}function Vd(e){return"number"!==typeof e?function(e){return Gc({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}function $d(e){const t=e.x,n=e.y,r=e.width,a=e.height;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}const Gd=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],Yd=["strategy"],Kd=["mainAxis","crossAxis","limiter"],Zd=["apply"];function Jd(e,t,n){let r=e.reference,a=e.floating;const s=Md(t),i=Fd(t),o=Ad(i),l=Pd(t),c="y"===s,u=r.x+r.width/2-a.width/2,d=r.y+r.height/2-a.height/2,f=r[o]/2-a[o]/2;let h;switch(l){case"top":h={x:u,y:r.y-a.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-a.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Rd(t)){case"start":h[i]-=f*(n&&c?-1:1);break;case"end":h[i]+=f*(n&&c?-1:1)}return h}async function Xd(e,t){var n;void 0===t&&(t={});
2const r=e.x,a=e.y,s=e.platform,i=e.rects,o=e.elements,l=e.strategy,c=Id(t,e),u=c.boundary,d=void 0===u?"clippingAncestors":u,f=c.rootBoundary,h=void 0===f?"viewport":f,p=c.elementContext,m=void 0===p?"floating":p,g=c.altBoundary,v=void 0!==g&&g,x=c.padding,y=Vd(void 0===x?0:x),b=o[v?"floating"===m?"reference":"floating":m],w=$d(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(b)))||n?b:b.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(o.floating)),boundary:d,rootBoundary:h,strategy:l})),_="floating"===m?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(o.floating)),j=await(null==s.isElement?void 0:s.isElement(k))&&await(null==s.getScale?void 0:s.getScale(k))||{x:1,y:1},N=$d(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:k,strategy:l}):_);return{top:(w.top-N.top+y.top)/j.y,bottom:(N.bottom-w.bottom+y.bottom)/j.y,left:(w.left-N.left+y.left)/j.x,right:(N.right-w.right+y.right)/j.x}}function Qd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ef(e){return wd.some(t=>e[t]>=0)}const tf=new Set(["left","top"]);function nf(){return"undefined"!==typeof window}function rf(e){return of(e)?(e.nodeName||"").toLowerCase():"#document"}function af(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function sf(e){var t;return null==(t=(of(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function of(e){return!!nf()&&(e instanceof Node||e instanceof af(e).Node)}function lf(e){return!!nf()&&(e instanceof Element||e instanceof af(e).Element)}function cf(e){return!!nf()&&(e instanceof HTMLElement||e instanceof af(e).HTMLElement)}function uf(e){return!(!nf()||"undefined"===typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof af(e).ShadowRoot)}const df=new Set(["inline","contents"]);function ff(e){const t=jf(e),n=t.overflow,r=t.overflowX,a=t.overflowY,s=t.display;return/auto|scroll|overlay|hidden|clip/.test(n+a+r)&&!df.has(s)}const hf=new Set(["table","td","th"]);function pf(e){return hf.has(rf(e))}const mf=[":popover-open",":modal"];function gf(e){return mf.some(t=>{try{return e.matches(t)}catch(bn){return!1}})}const vf=["transform","translate","scale","rotate","perspective"],xf=["transform","translate","scale","rotate","perspective","filter"],yf=["paint","layout","strict","content"];function bf(e){const t=wf(),n=lf(e)?jf(e):e;return vf.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||xf.some(e=>(n.willChange||"").includes(e))||yf.some(e=>(n.contain||"").includes(e))}function wf(){return!("undefined"===typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const _f=new Set(["html","body","#document"]);function kf(e){return _f.has(rf(e))}function jf(e){return af(e).getComputedStyle(e)}function Nf(e){return lf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sf(e){if("html"===rf(e))return e;const t=e.assignedSlot||e.parentNode||uf(e)&&e.host||sf(e);return uf(t)?t.host:t}function Cf(e){const t=Sf(e);return kf(t)?e.ownerDocument?e.ownerDocument.body:e.body:cf(t)&&ff(t)?t:Cf(t)}function Ef(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const a=Cf(e),s=a===(null==(r=e.ownerDocument)?void 0:r.body),i=af(a);if(s){const e=Tf(i);return t.concat(i,i.visualViewport||[],ff(a)?a:[],e&&n?Ef(e):[])}return t.concat(a,Ef(a,[],n))}function Tf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function If(e){const t=jf(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=cf(e),s=a?e.offsetWidth:n,i=a?e.offsetHeight:r,o=jd(n)!==s||jd(r)!==i;return o&&(n=s,r=i),{width:n,height:r,$:o}}function Pf(e){return lf(e)?e:e.contextElement}function Rf(e){const t=Pf(e);if(!cf(t))return Sd(1);const n=t.getBoundingClientRect(),r=If(t),a=r.width,s=r.height,i=r.$;let o=(i?jd(n.width):n.width)/a,l=(i?jd(n.height):n.height)/s;return o&&Number.isFinite(o)||(o=1),l&&Number.isFinite(l)||(l=1),{x:o,y:l}}const Of=Sd(0);function Af(e){const t=af(e);
vendor: 5,138 bytes, line 2
2return wf()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Of}function Df(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),s=Pf(e);let i=Sd(1);t&&(r?lf(r)&&(i=Rf(r)):i=Rf(e));const o=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==af(e))&&t}(s,n,r)?Af(s):Sd(0);let l=(a.left+o.x)/i.x,c=(a.top+o.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(s){const e=af(s),t=r&&lf(r)?af(r):r;let n=e,a=Tf(n);for(;a&&r&&t!==n;){const e=Rf(a),t=a.getBoundingClientRect(),r=jf(a),s=t.left+(a.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=s,c+=i,n=af(a),a=Tf(n)}}return $d({width:u,height:d,x:l,y:c})}function Mf(e,t){const n=Nf(e).scrollLeft;return t?t.left+n:Df(sf(e)).left+n}function Ff(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Mf(e,r)),y:r.top+t.scrollTop}}const Lf=new Set(["absolute","fixed"]);function Uf(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=af(e),r=sf(e),a=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,o=0,l=0;if(a){s=a.width,i=a.height;const e=wf();(!e||e&&"fixed"===t)&&(o=a.offsetLeft,l=a.offsetTop)}return{width:s,height:i,x:o,y:l}}(e,n);else if("document"===t)r=function(e){const t=sf(e),n=Nf(e),r=e.ownerDocument.body,a=kd(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=kd(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Mf(e);const o=-n.scrollTop;return"rtl"===jf(r).direction&&(i+=kd(t.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:o}}(sf(e));else if(lf(t))r=function(e,t){const n=Df(e,!0,"fixed"===t),r=n.top+e.clientTop,a=n.left+e.clientLeft,s=cf(e)?Rf(e):Sd(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:a*s.x,y:r*s.y}}(t,n);else{const n=Af(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $d(r)}function Hf(e,t){const n=Sf(e);return!(n===t||!lf(n)||kf(n))&&("fixed"===jf(n).position||Hf(n,t))}function zf(e,t,n){const r=cf(t),a=sf(t),s="fixed"===n,i=Df(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const l=Sd(0);function c(){l.x=Mf(a)}if(r||!r&&!s)if(("body"!==rf(t)||ff(a))&&(o=Nf(t)),r){const e=Df(t,!0,s,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&c();s&&!r&&a&&c();const u=!a||r||s?Sd(0):Ff(a,o);return{x:i.left+o.scrollLeft-l.x-u.x,y:i.top+o.scrollTop-l.y-u.y,width:i.width,height:i.height}}function Bf(e){return"static"===jf(e).position}function Wf(e,t){if(!cf(e)||"fixed"===jf(e).position)return null;if(t)return t(e);let n=e.offsetParent;return sf(e)===n&&(n=n.ownerDocument.body),n}function qf(e,t){const n=af(e);if(gf(e))return n;if(!cf(e)){let t=Sf(e);for(;t&&!kf(t);){if(lf(t)&&!Bf(t))return t;t=Sf(t)}return n}let r=Wf(e,t);for(;r&&pf(r)&&Bf(r);)r=Wf(r,t);return r&&kf(r)&&Bf(r)&&!bf(r)?n:r||function(e){let t=Sf(e);for(;cf(t)&&!kf(t);){if(bf(t))return t;if(gf(t))return null;t=Sf(t)}return null}(e)||n}const Vf={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let t=e.elements,n=e.rect,r=e.offsetParent;const a="fixed"===e.strategy,s=sf(r),i=!!t&&gf(t.floating);if(r===s||i&&a)return n;let o={scrollLeft:0,scrollTop:0},l=Sd(1);const c=Sd(0),u=cf(r);if((u||!u&&!a)&&(("body"!==rf(r)||ff(s))&&(o=Nf(r)),cf(r))){const e=Df(r);l=Rf(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const d=!s||u||a?Sd(0):Ff(s,o,!0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-o.scrollLeft*l.x+c.x+d.x,y:n.y*l.y-o.scrollTop*l.y+c.y+d.y}},getDocumentElement:sf,getClippingRect:function(e){let t=e.element,n=e.boundary,r=e.rootBoundary,a=e.strategy;const s=[..."clippingAncestors"===n?gf(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ef(e,[],!1).filter(e=>lf(e)&&"body"!==rf(e)),a=null;const s="fixed"===jf(e).position;let i=s?Sf(e):e;for(;lf(i)&&!kf(i);){const t=jf(i),n=bf(i);n||"fixed"!==t.position||(a=null),(s?!n&&!a:!n&&"static"===t.position&&a&&Lf.has(a.position)||ff(i)&&!n&&Hf(e,i))?r=r.filter(e=>e!==i):a=t,i=Sf(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=s[0],o=s.reduce((e,n)=>{const r=Uf(t,n,a);return e.top=kd(r.top,e.top),e.right=_d(r.right,e.right),e.bottom=_d(r.bottom,e.bottom),e.left=kd(r.left,e.left),e},Uf(t,i,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:qf,getElementRects:async function(e){const t=this.getOffsetParent||qf,n=this.getDimensions,r=await n(e.floating);return{reference:zf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const t=If(e);return{width:t.width,height:t.height}},getScale:Rf,isElement:lf,isRTL:function(e){return"rtl"===jf(e).direction}};function $f(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gf(e,t,n,r){void 0===r&&(r={});const a=r,s=a.ancestorScroll,i=void 0===s||s,o=a.ancestorResize,c=void 0===o||o,u=a.elementResize,d=void 0===u?"function"===typeof ResizeObserver:u,f=a.layoutShift,h=void 0===f?"function"===typeof IntersectionObserver:f,p=a.animationFrame,m=void 0!==p&&p,g=Pf(e),v=i||c?[...g?Ef(g):[],...Ef(t)]:[];
2v.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),c&&e.addEventListener("resize",n)});const x=g&&h?function(e,t){let n,r=null;const a=sf(e);function s(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(o,l){void 0===o&&(o=!1),void 0===l&&(l=1),s();const c=e.getBoundingClientRect(),u=c.left,d=c.top,f=c.width,h=c.height;if(o||t(),!f||!h)return;const p={rootMargin:-Nd(d)+"px "+-Nd(a.clientWidth-(u+f))+"px "+-Nd(a.clientHeight-(d+h))+"px "+-Nd(u)+"px",threshold:kd(0,_d(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||$f(c,e.getBoundingClientRect())||i(),m=!1}try{r=new IntersectionObserver(g,Gc(Gc({},p),{},{root:a.ownerDocument}))}catch(bn){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),s}(g,n):null;let y,b=-1,w=null;d&&(w=new ResizeObserver(e=>{let r=l(e,1)[0];r&&r.target===g&&w&&(w.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var e;null==(e=w)||e.observe(t)})),n()}),g&&!m&&w.observe(g),w.observe(t));let _=m?Df(e):null;return m&&function t(){const r=Df(e);_&&!$f(_,r)&&n();_=r,y=requestAnimationFrame(t)}(),n(),()=>{var e;v.forEach(e=>{i&&e.removeEventListener("scroll",n),c&&e.removeEventListener("resize",n)}),null==x||x(),null==(e=w)||e.disconnect(),w=null,m&&cancelAnimationFrame(y)}}const Yf=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const a=t.x,s=t.y,i=t.placement,o=t.middlewareData,l=await async function(e,t){const n=e.placement,r=e.platform,a=e.elements,s=await(null==r.isRTL?void 0:r.isRTL(a.floating)),i=Pd(n),o=Rd(n),l="y"===Md(n),c=tf.has(i)?-1:1,u=s&&l?-1:1,d=Id(t,e);let f="number"===typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis},h=f.mainAxis,p=f.crossAxis,m=f.alignmentAxis;return o&&"number"===typeof m&&(p="end"===o?-1*m:m),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}(t,e);return i===(null==(n=o.offset)?void 0:n.placement)&&null!=(r=o.arrow)&&r.alignmentOffset?{}:{x:a+l.x,y:s+l.y,data:Gc(Gc({},l),{},{placement:i})}}}},Kf=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const n=t.x,r=t.y,a=t.placement,s=Id(e,t),i=s.mainAxis,o=void 0===i||i,l=s.crossAxis,c=void 0!==l&&l,u=s.limiter,d=void 0===u?{fn:e=>({x:e.x,y:e.y})}:u,f=Yc(s,Kd),h={x:n,y:r},p=await Xd(t,f),m=Md(Pd(a)),g=Od(m);let v=h[g],x=h[m];if(o){const e="y"===g?"bottom":"right";v=Td(v+p["y"===g?"top":"left"],v,v-p[e])}if(c){const e="y"===m?"bottom":"right";x=Td(x+p["y"===m?"top":"left"],x,x-p[e])}const y=d.fn(Gc(Gc({},t),{},{[g]:v,[m]:x}));return Gc(Gc({},y),{},{data:{x:y.x-n,y:y.y-r,enabled:{[g]:o,[m]:c}}})}}},Zf=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const a=t.placement,s=t.middlewareData,i=t.rects,o=t.initialPlacement,l=t.platform,c=t.elements,u=Id(e,t),d=u.mainAxis,f=void 0===d||d,h=u.crossAxis,p=void 0===h||h,m=u.fallbackPlacements,g=u.fallbackStrategy,v=void 0===g?"bestFit":g,x=u.fallbackAxisSideDirection,y=void 0===x?"none":x,b=u.flipAlignment,w=void 0===b||b,_=Yc(u,Gd);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const k=Pd(a),j=Md(o),N=Pd(o)===o,S=await(null==l.isRTL?void 0:l.isRTL(c.floating)),C=m||(N||!w?[qd(o)]:function(e){const t=qd(e);return[Ld(e),t,Ld(t)]}(o)),E="none"!==y;!m&&E&&C.push(...Wd(o,w,y,S));const T=[o,...C],I=await Xd(t,_),P=[];let R=(null==(r=s.flip)?void 0:r.overflows)||[];if(f&&P.push(I[k]),p){const e=function(e,t,n){void 0===n&&(n=!1);const r=Rd(e),a=Fd(e),s=Ad(a);let i="x"===a?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=qd(i)),[i,qd(i)]}(a,i,S);P.push(I[e[0]],I[e[1]])}if(R=[...R,{placement:a,overflows:P}],!P.every(e=>e<=0)){var O,A;const e=((null==(O=s.flip)?void 0:O.index)||0)+1,t=T[e];if(t){if(!("alignment"===p&&j!==Md(t))||R.every(e=>e.overflows[0]>0&&Md(e.placement)===j))return{data:{index:e,overflows:R},reset:{placement:t}}}let n=null==(A=R.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:A.placement;if(!n)switch(v){case"bestFit":{var D;const e=null==(D=R.filter(e=>{if(E){const t=Md(e.placement);return t===j||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>
2e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:D[0];e&&(n=e);break}case"initialPlacement":n=o}if(a!==n)return{reset:{placement:n}}}return{}}}},Jf=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const a=t.placement,s=t.rects,i=t.platform,o=t.elements,l=Id(e,t),c=l.apply,u=void 0===c?()=>{}:c,d=Yc(l,Zd),f=await Xd(t,d),h=Pd(a),p=Rd(a),m="y"===Md(a),g=s.floating,v=g.width,x=g.height;let y,b;"top"===h||"bottom"===h?(y=h,b=p===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(b=h,y="end"===p?"top":"bottom");const w=x-f.top-f.bottom,_=v-f.left-f.right,k=_d(x-f[y],w),j=_d(v-f[b],_),N=!t.middlewareData.shift;let S=k,C=j;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(C=_),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(S=w),N&&!p){const e=kd(f.left,0),t=kd(f.right,0),n=kd(f.top,0),r=kd(f.bottom,0);m?C=v-2*(0!==e||0!==t?e+t:kd(f.left,f.right)):S=x-2*(0!==n||0!==r?n+r:kd(f.top,f.bottom))}await u(Gc(Gc({},t),{},{availableWidth:C,availableHeight:S}));const E=await i.getDimensions(o.floating);return v!==E.width||x!==E.height?{reset:{rects:!0}}:{}}}},Xf=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const n=t.rects,r=Id(e,t),a=r.strategy,s=void 0===a?"referenceHidden":a,i=Yc(r,Yd);switch(s){case"referenceHidden":{const e=Qd(await Xd(t,Gc(Gc({},i),{},{elementContext:"reference"})),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ef(e)}}}case"escaped":{const e=Qd(await Xd(t,Gc(Gc({},i),{},{altBoundary:!0})),n.floating);return{data:{escapedOffsets:e,escaped:ef(e)}}}default:return{}}}}},Qf=e=>({name:"arrow",options:e,async fn(t){const n=t.x,r=t.y,a=t.placement,s=t.rects,i=t.platform,o=t.elements,l=t.middlewareData,c=Id(e,t)||{},u=c.element,d=c.padding;if(null==u)return{};const f=Vd(void 0===d?0:d),h={x:n,y:r},p=Fd(a),m=Ad(p),g=await i.getDimensions(u),v="y"===p,x=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",w=s.reference[m]+s.reference[p]-h[p]-s.floating[m],_=h[p]-s.reference[p],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(u));let j=k?k[b]:0;j&&await(null==i.isElement?void 0:i.isElement(k))||(j=o.floating[b]||s.floating[m]);const N=w/2-_/2,S=j/2-g[m]/2-1,C=_d(f[x],S),E=_d(f[y],S),T=C,I=j-g[m]-E,P=j/2-g[m]/2+N,R=Td(T,P,I),O=!l.arrow&&null!=Rd(a)&&P!==R&&s.reference[m]/2-(P<T?C:E)-g[m]/2<0,A=O?P<T?P-T:P-I:0;return{[p]:h[p]+A,data:Gc({[p]:R,centerOffset:P-R-A},O&&{alignmentOffset:A}),reset:O}}}),eh=function(e){return void 0===e&&(e={}),{options:e,fn(t){const n=t.x,r=t.y,a=t.placement,s=t.rects,i=t.middlewareData,o=Id(e,t),l=o.offset,c=void 0===l?0:l,u=o.mainAxis,d=void 0===u||u,f=o.crossAxis,h=void 0===f||f,p={x:n,y:r},m=Md(a),g=Od(m);let v=p[g],x=p[m];const y=Id(c,t),b="number"===typeof y?{mainAxis:y,crossAxis:0}:Gc({mainAxis:0,crossAxis:0},y);if(d){const e="y"===g?"height":"width",t=s.reference[g]-s.floating[e]+b.mainAxis,n=s.reference[g]+s.reference[e]-b.mainAxis;v<t?v=t:v>n&&(v=n)}if(h){var w,_;const e="y"===g?"width":"height",t=tf.has(Pd(a)),n=s.reference[m]-s.floating[e]+(t&&(null==(w=i.offset)?void 0:w[m])||0)+(t?0:b.crossAxis),r=s.reference[m]+s.reference[e]+(t?0:(null==(_=i.offset)?void 0:_[m])||0)-(t?b.crossAxis:0);x<n?x=n:x>r&&(x=r)}return{[g]:v,[m]:x}}}},th=(e,t,n)=>{const r=new Map,a=Gc({platform:Vf},n),s=Gc(Gc({},a.platform),{},{_c:r});return(async(e,t,n)=>{const r=n.placement,a=void 0===r?"bottom":r,s=n.strategy,i=void 0===s?"absolute":s,o=n.middleware,l=void 0===o?[]:o,c=n.platform,u=l.filter(Boolean),d=await(null==c.isRTL?void 0:c.isRTL(t));let f=await c.getElementRects({reference:e,floating:t,strategy:i}),h=Jd(f,a,d),p=h.x,m=h.y,g=a,v={},x=0;for(let b=0;b<u.length;b++){const n=u[b],r=n.name,s=n.fn,o=await s({x:p,y:m,initialPlacement:a,placement:g,strategy:i,middlewareData:v,rects:f,platform:c,elements:{reference:e,floating:t}}),l=o.x,h=o.y,w=o.data,_=o.reset;if(p=null!=l?l:p,m=null!=h?h:m,v=Gc(Gc({},v),{},{[r]:Gc(Gc({},v[r]),w)}),_&&x<=50){if(x++,"object"===typeof _){_.placement&&(g=_.placement),_.rects&&(f=!0===_.rects?await c.getElementRects({reference:e,floating:t,strategy:i}):_.rects);var y=Jd(f,g,d);p=y.x,m=y.y}b=-1}}return{x:p,y:m,placement:g,strategy:i,middlewareData:v}})(e,t,Gc(Gc({},a),{},{platform:s}))};var nh="undefined"!==typeof document?e.useLayoutEffect:function(){};function rh(e,t){if(e===t)return!0;
2if(typeof e!==typeof t)return!1;if("function"===typeof e&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&"object"===typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!rh(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!==r--;){const n=a[r];if(("_owner"!==n||!e.$$typeof)&&!rh(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ah(e){if("undefined"===typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sh(e,t){const n=ah(e);return Math.round(t*n)/n}function ih(t){const n=e.useRef(t);return nh(()=>{n.current=t}),n}const oh=(e,t)=>Gc(Gc({},Yf(e)),{},{options:[e,t]}),lh=(e,t)=>Gc(Gc({},Kf(e)),{},{options:[e,t]}),ch=(e,t)=>Gc(Gc({},eh(e)),{},{options:[e,t]}),uh=(e,t)=>Gc(Gc({},Zf(e)),{},{options:[e,t]}),dh=(e,t)=>Gc(Gc({},Jf(e)),{},{options:[e,t]}),fh=(e,t)=>Gc(Gc({},Xf(e)),{},{options:[e,t]}),hh=(e,t)=>Gc(Gc({},(e=>({name:"arrow",options:e,fn(t){const n="function"===typeof e?e(t):e,r=n.element,a=n.padding;return r&&(s=r,{}.hasOwnProperty.call(s,"current"))?null!=r.current?Qf({element:r.current,padding:a}).fn(t):{}:r?Qf({element:r,padding:a}).fn(t):{};var s}}))(e)),{},{options:[e,t]}),ph=["children","width","height"];var mh=e.forwardRef((e,t)=>{const n=e.children,r=e.width,a=void 0===r?10:r,s=e.height,i=void 0===s?5:s,o=Yc(e,ph);return(0,zc.jsx)(ad.svg,Gc(Gc({},o),{},{ref:t,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,zc.jsx)("polygon",{points:"0,0 30,0 15,10"})}))});mh.displayName="Arrow";var gh=mh;function vh(t){const n=l(e.useState(void 0),2),r=n[0],a=n[1];return vd(()=>{if(t){a({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let r,s;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,s=t.blockSize}else r=t.offsetWidth,s=t.offsetHeight;a({width:r,height:s})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}a(void 0)},[t]),r}const xh=["__scopePopper","virtualRef"],yh=["__scopePopper","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","onPlaced"],bh=["__scopePopper"];var wh="Popper",_h=l(Gu(wh),2),kh=_h[0],jh=_h[1],Nh=l(kh(wh),2),Sh=Nh[0],Ch=Nh[1],Eh=t=>{const n=t.__scopePopper,r=t.children,a=l(e.useState(null),2),s=a[0],i=a[1];return(0,zc.jsx)(Sh,{scope:n,anchor:s,onAnchorChange:i,children:r})};Eh.displayName=wh;var Th="PopperAnchor",Ih=e.forwardRef((t,n)=>{const r=t.__scopePopper,a=t.virtualRef,s=Yc(t,xh),i=Ch(Th,r),o=e.useRef(null),l=qu(n,o);return e.useEffect(()=>{i.onAnchorChange((null===a||void 0===a?void 0:a.current)||o.current)}),a?null:(0,zc.jsx)(ad.div,Gc(Gc({},s),{},{ref:l}))});Ih.displayName=Th;var Ph="PopperContent",Rh=l(kh(Ph),2),Oh=Rh[0],Ah=Rh[1],Dh=e.forwardRef((t,n)=>{var r,a,s,i,o,c,u,d;const f=t.__scopePopper,h=t.side,p=void 0===h?"bottom":h,m=t.sideOffset,g=void 0===m?0:m,v=t.align,x=void 0===v?"center":v,y=t.alignOffset,b=void 0===y?0:y,w=t.arrowPadding,_=void 0===w?0:w,k=t.avoidCollisions,j=void 0===k||k,N=t.collisionBoundary,S=void 0===N?[]:N,C=t.collisionPadding,E=void 0===C?0:C,T=t.sticky,I=void 0===T?"partial":T,P=t.hideWhenDetached,R=void 0!==P&&P,O=t.updatePositionStrategy,A=void 0===O?"optimized":O,D=t.onPlaced,M=Yc(t,yh),F=Ch(Ph,f),L=l(e.useState(null),2),U=L[0],H=L[1],z=qu(n,e=>H(e)),B=l(e.useState(null),2),W=B[0],q=B[1],V=vh(W),$=null!==(r=null===V||void 0===V?void 0:V.width)&&void 0!==r?r:0,G=null!==(a=null===V||void 0===V?void 0:V.height)&&void 0!==a?a:0,Y=p+("center"!==x?"-"+x:""),K="number"===typeof E?E:Gc({top:0,right:0,bottom:0,left:0},E),Z=Array.isArray(S)?S:[S],J=Z.length>0,X={padding:K,boundary:Z.filter(Uh),altBoundary:J},Q=function(t){void 0===t&&(t={});const n=t,r=n.placement,a=void 0===r?"bottom":r,s=n.strategy,i=void 0===s?"absolute":s,o=n.middleware,c=void 0===o?[]:o,u=n.platform,d=n.elements,f=void 0===d?{}:d,h=f.reference,p=f.floating,m=n.transform,g=void 0===m||m,v=n.whileElementsMounted,x=n.open,y=l(e.useState({x:0,y:0,strategy:i,placement:a,middlewareData:{},isPositioned:!1}),2),b=y[0],w=y[1],_=l(e.useState(c),2),k=_[0],j=_[1];rh(k,c)||j(c);const N=l(e.useState(null),2),S=N[0],C=N[1],E=l(e.useState(null),2),T=E[0],I=E[1],P=e.useCallback(e=>
2{e!==D.current&&(D.current=e,C(e))},[]),R=e.useCallback(e=>{e!==M.current&&(M.current=e,I(e))},[]),O=h||S,A=p||T,D=e.useRef(null),M=e.useRef(null),F=e.useRef(b),L=null!=v,U=ih(v),H=ih(u),z=ih(x),B=e.useCallback(()=>{if(!D.current||!M.current)return;const e={placement:a,strategy:i,middleware:k};H.current&&(e.platform=H.current),th(D.current,M.current,e).then(e=>{const t=Gc(Gc({},e),{},{isPositioned:!1!==z.current});W.current&&!rh(F.current,t)&&(F.current=t,so.flushSync(()=>{w(t)}))})},[k,a,i,H,z]);nh(()=>{!1===x&&F.current.isPositioned&&(F.current.isPositioned=!1,w(e=>Gc(Gc({},e),{},{isPositioned:!1})))},[x]);const W=e.useRef(!1);nh(()=>(W.current=!0,()=>{W.current=!1}),[]),nh(()=>{if(O&&(D.current=O),A&&(M.current=A),O&&A){if(U.current)return U.current(O,A,B);B()}},[O,A,B,U,L]);const q=e.useMemo(()=>({reference:D,floating:M,setReference:P,setFloating:R}),[P,R]),V=e.useMemo(()=>({reference:O,floating:A}),[O,A]),$=e.useMemo(()=>{const e={position:i,left:0,top:0};if(!V.floating)return e;const t=sh(V.floating,b.x),n=sh(V.floating,b.y);return g?Gc(Gc({},e),{},{transform:"translate("+t+"px, "+n+"px)"},ah(V.floating)>=1.5&&{willChange:"transform"}):{position:i,left:t,top:n}},[i,g,V.floating,b.x,b.y]);return e.useMemo(()=>Gc(Gc({},b),{},{update:B,refs:q,elements:V,floatingStyles:$}),[b,B,q,V,$])}({strategy:"fixed",placement:Y,whileElementsMounted:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Gf(...t,{animationFrame:"always"===A})},elements:{reference:F.anchor},middleware:[oh({mainAxis:g+G,alignmentAxis:b}),j&&lh(Gc({mainAxis:!0,crossAxis:!1,limiter:"partial"===I?ch():void 0},X)),j&&uh(Gc({},X)),dh(Gc(Gc({},X),{},{apply:e=>{let t=e.elements,n=e.rects,r=e.availableWidth,a=e.availableHeight;const s=n.reference,i=s.width,o=s.height,l=t.floating.style;l.setProperty("--radix-popper-available-width","".concat(r,"px")),l.setProperty("--radix-popper-available-height","".concat(a,"px")),l.setProperty("--radix-popper-anchor-width","".concat(i,"px")),l.setProperty("--radix-popper-anchor-height","".concat(o,"px"))}})),W&&hh({element:W,padding:_}),Hh({arrowWidth:$,arrowHeight:G}),R&&fh(Gc({strategy:"referenceHidden"},X))]}),ee=Q.refs,te=Q.floatingStyles,ne=Q.placement,re=Q.isPositioned,ae=Q.middlewareData,se=l(zh(ne),2),ie=se[0],oe=se[1],le=id(D);vd(()=>{re&&(null===le||void 0===le||le())},[re,le]);const ce=null===(s=ae.arrow)||void 0===s?void 0:s.x,ue=null===(i=ae.arrow)||void 0===i?void 0:i.y,de=0!==(null===(o=ae.arrow)||void 0===o?void 0:o.centerOffset),fe=l(e.useState(),2),he=fe[0],pe=fe[1];return vd(()=>{U&&pe(window.getComputedStyle(U).zIndex)},[U]),(0,zc.jsx)("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:Gc(Gc({},te),{},{transform:re?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[null===(c=ae.transformOrigin)||void 0===c?void 0:c.x,null===(u=ae.transformOrigin)||void 0===u?void 0:u.y].join(" ")},(null===(d=ae.hide)||void 0===d?void 0:d.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}),dir:t.dir,children:(0,zc.jsx)(Oh,{scope:f,placedSide:ie,onArrowChange:q,arrowX:ce,arrowY:ue,shouldHideArrow:de,children:(0,zc.jsx)(ad.div,Gc(Gc({"data-side":ie,"data-align":oe},M),{},{ref:z,style:Gc(Gc({},M.style),{},{animation:re?void 0:"none"})}))})})});Dh.displayName=Ph;var Mh="PopperArrow",Fh={top:"bottom",right:"left",bottom:"top",left:"right"},Lh=e.forwardRef(function(e,t){const n=e.__scopePopper,r=Yc(e,bh),a=Ah(Mh,n),s=Fh[a.placedSide];return(0,zc.jsx)("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:(0,zc.jsx)(gh,Gc(Gc({},r),{},{ref:t,style:Gc(Gc({},r.style),{},{display:"block"})}))})});function Uh(e){return null!==e}Lh.displayName=Mh;var Hh=e=>({name:"transformOrigin",options:e,fn(t){var n,r,a,s,i;const o=t.placement,c=t.rects,u=t.middlewareData,d=0!==(null===(n=u.arrow)||void 0===n?void 0:n.centerOffset),f=d?0:e.arrowWidth,h=d?0:e.arrowHeight,p=l(zh(o),2),m=p[0],g={start:"0%",center:"50%",end:"100%"}[p[1]],v=(null!==(r=null===(a=u.arrow)||void 0===a?void 0:a.x)&&void 0!==r?r:0)+f/2,x=(null!==(s=null===(i=u.arrow)||void 0===i?void 0:i.y)&&void 0!==s?s:0)+h/2;let y="",b="";return"bottom"===m?(y=d?g:"".concat(v,"px"),b="".concat(-h,"px")):"top"===m?(y=d?g:"".concat(v,"px"),b="".concat(c.floating.height+h,"px")):"right"===m?(y="".concat(-h,"px"),b=d?g:"".concat(x,"px")):"left"===m&&(y="".concat(c.floating.width+h,"px"),b=d?g:"".concat(x,"px")),{data:{x:y,y:b}}}});function zh(e){const t=l(e.split("-"),2),n=t[0],r=t[1];return[n,void 0===r?"center":r]}var Bh=Eh,Wh=Ih,qh=Dh,Vh=Lh;const $h=["container"];
2var Gh=e.forwardRef((t,n)=>{var r;const a=t.container,s=Yc(t,$h),i=l(e.useState(!1),2),o=i[0],c=i[1];vd(()=>c(!0),[]);const u=a||o&&(null===globalThis||void 0===globalThis||null===(r=globalThis.document)||void 0===r?void 0:r.body);return u?so.createPortal((0,zc.jsx)(ad.div,Gc(Gc({},s),{},{ref:n})),u):null});Gh.displayName="Portal";var Yh=t=>{const n=t.present,r=t.children,a=function(t){const n=l(e.useState(),2),r=n[0],a=n[1],s=e.useRef(null),i=e.useRef(t),o=e.useRef("none"),c=t?"mounted":"unmounted",u=l(function(t,n){return e.useReducer((e,t)=>{const r=n[e][t];return null!==r&&void 0!==r?r:e},t)}(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),2),d=u[0],f=u[1];return e.useEffect(()=>{const e=Kh(s.current);o.current="mounted"===d?e:"none"},[d]),vd(()=>{const e=s.current,n=i.current;if(n!==t){const r=o.current,a=Kh(e);if(t)f("MOUNT");else if("none"===a||"none"===(null===e||void 0===e?void 0:e.display))f("UNMOUNT");else{f(n&&r!==a?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,f]),vd(()=>{if(r){var e;let t;const n=null!==(e=r.ownerDocument.defaultView)&&void 0!==e?e:window,a=e=>{const a=Kh(s.current).includes(e.animationName);if(e.target===r&&a&&(f("ANIMATION_END"),!i.current)){const e=r.style.animationFillMode;r.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=e)})}},l=e=>{e.target===r&&(o.current=Kh(s.current))};return r.addEventListener("animationstart",l),r.addEventListener("animationcancel",a),r.addEventListener("animationend",a),()=>{n.clearTimeout(t),r.removeEventListener("animationstart",l),r.removeEventListener("animationcancel",a),r.removeEventListener("animationend",a)}}f("ANIMATION_END")},[r,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:e.useCallback(e=>{s.current=e?getComputedStyle(e):null,a(e)},[])}}(n),s="function"===typeof r?r({present:a.isPresent}):e.Children.only(r),i=qu(a.ref,function(e){var t,n;let r=null===(t=Object.getOwnPropertyDescriptor(e.props,"ref"))||void 0===t?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null===(n=Object.getOwnPropertyDescriptor(e,"ref"))||void 0===n?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(s));return"function"===typeof r||a.isPresent?e.cloneElement(s,{ref:i}):null};function Kh(e){return(null===e||void 0===e?void 0:e.animationName)||"none"}Yh.displayName="Presence";var Zh=t[" useInsertionEffect ".trim().toString()]||vd;function Jh(t){let n=t.prop,r=t.defaultProp,a=t.onChange,s=void 0===a?()=>{}:a,i=t.caller;const o=function(t){let n=t.defaultProp,r=t.onChange;const a=e.useState(n),s=l(a,2),i=s[0],o=s[1],c=e.useRef(i),u=e.useRef(r);return Zh(()=>{u.current=r},[r]),e.useEffect(()=>{var e;c.current!==i&&(null===(e=u.current)||void 0===e||e.call(u,i),c.current=i)},[i,c]),[i,o,u]}({defaultProp:r,onChange:s}),c=l(o,3),u=c[0],d=c[1],f=c[2],h=void 0!==n,p=h?n:u;{const t=e.useRef(void 0!==n);e.useEffect(()=>{const e=t.current;if(e!==h){const t=e?"controlled":"uncontrolled",n=h?"controlled":"uncontrolled";console.warn("".concat(i," is changing from ").concat(t," to ").concat(n,". 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."))}t.current=h},[h,i])}const m=e.useCallback(e=>{if(h){const r=function(e){return"function"===typeof e}(e)?e(n):e;var t;if(r!==n)null===(t=f.current)||void 0===t||t.call(f,r)}else d(e)},[h,n,d,f]);return[p,m]}Symbol("RADIX:SYNC_STATE");var Xh=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"}),Qh=e.forwardRef((e,t)=>(0,zc.jsx)(ad.span,Gc(Gc({},e),{},{ref:t,style:Gc(Gc({},Xh),e.style)})));Qh.displayName="VisuallyHidden";var ep=Qh;const tp=["__scopeTooltip"],np=["forceMount","side"],rp=["__scopeTooltip","children","aria-label","onEscapeKeyDown","onPointerDownOutside"],ap=["__scopeTooltip"];var sp=l(Gu("Tooltip",[jh]),2),ip=sp[0],op=(sp[1],jh()),lp="TooltipProvider",cp="tooltip.open",up=l(ip(lp),2),dp=up[0],fp=up[1],h
2p=t=>{const n=t.__scopeTooltip,r=t.delayDuration,a=void 0===r?700:r,s=t.skipDelayDuration,i=void 0===s?300:s,o=t.disableHoverableContent,l=void 0!==o&&o,c=t.children,u=e.useRef(!0),d=e.useRef(!1),f=e.useRef(0);return e.useEffect(()=>{const e=f.current;return()=>window.clearTimeout(e)},[]),(0,zc.jsx)(dp,{scope:n,isOpenDelayedRef:u,delayDuration:a,onOpen:e.useCallback(()=>{window.clearTimeout(f.current),u.current=!1},[]),onClose:e.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.current=!0,i)},[i]),isPointerInTransitRef:d,onPointerInTransitChange:e.useCallback(e=>{d.current=e},[]),disableHoverableContent:l,children:c})};hp.displayName=lp;var pp="Tooltip",mp=l(ip(pp),2),gp=mp[0],vp=mp[1],xp=t=>{const n=t.__scopeTooltip,r=t.children,a=t.open,s=t.defaultOpen,i=t.onOpenChange,o=t.disableHoverableContent,c=t.delayDuration,u=fp(pp,t.__scopeTooltip),d=op(n),f=l(e.useState(null),2),h=f[0],p=f[1],m=bd(),g=e.useRef(0),v=null!==o&&void 0!==o?o:u.disableHoverableContent,x=null!==c&&void 0!==c?c:u.delayDuration,y=e.useRef(!1),b=l(Jh({prop:a,defaultProp:null!==s&&void 0!==s&&s,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(cp))):u.onClose(),null===i||void 0===i||i(e)},caller:pp}),2),w=b[0],_=b[1],k=e.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),j=e.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,_(!0)},[_]),N=e.useCallback(()=>{window.clearTimeout(g.current),g.current=0,_(!1)},[_]),S=e.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,_(!0),g.current=0},x)},[x,_]);return e.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),(0,zc.jsx)(Bh,Gc(Gc({},d),{},{children:(0,zc.jsx)(gp,{scope:n,contentId:m,open:w,stateAttribute:k,trigger:h,onTriggerChange:p,onTriggerEnter:e.useCallback(()=>{u.isOpenDelayedRef.current?S():j()},[u.isOpenDelayedRef,S,j]),onTriggerLeave:e.useCallback(()=>{v?N():(window.clearTimeout(g.current),g.current=0)},[N,v]),onOpen:j,onClose:N,disableHoverableContent:v,children:r})}))};xp.displayName=pp;var yp="TooltipTrigger",bp=e.forwardRef((t,n)=>{const r=t.__scopeTooltip,a=Yc(t,tp),s=vp(yp,r),i=fp(yp,r),o=op(r),l=qu(n,e.useRef(null),s.onTriggerChange),c=e.useRef(!1),u=e.useRef(!1),d=e.useCallback(()=>c.current=!1,[]);return e.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,zc.jsx)(Wh,Gc(Gc({asChild:!0},o),{},{children:(0,zc.jsx)(ad.button,Gc(Gc({"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute},a),{},{ref:l,onPointerMove:zu(t.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||i.isPointerInTransitRef.current||(s.onTriggerEnter(),u.current=!0))}),onPointerLeave:zu(t.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:zu(t.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:zu(t.onFocus,()=>{c.current||s.onOpen()}),onBlur:zu(t.onBlur,s.onClose),onClick:zu(t.onClick,s.onClose)}))}))});bp.displayName=yp;var wp="TooltipPortal",_p=l(ip(wp,{forceMount:void 0}),2),kp=_p[0],jp=_p[1],Np=e=>{const t=e.__scopeTooltip,n=e.forceMount,r=e.children,a=e.container,s=vp(wp,t);return(0,zc.jsx)(kp,{scope:t,forceMount:n,children:(0,zc.jsx)(Yh,{present:n||s.open,children:(0,zc.jsx)(Gh,{asChild:!0,container:a,children:r})})})};Np.displayName=wp;var Sp="TooltipContent",Cp=e.forwardRef((e,t)=>{const n=jp(Sp,e.__scopeTooltip),r=e.forceMount,a=void 0===r?n.forceMount:r,s=e.side,i=void 0===s?"top":s,o=Yc(e,np),l=vp(Sp,e.__scopeTooltip);return(0,zc.jsx)(Yh,{present:a||l.open,children:l.disableHoverableContent?(0,zc.jsx)(Op,Gc(Gc({side:i},o),{},{ref:t})):(0,zc.jsx)(Ep,Gc(Gc({side:i},o),{},{ref:t}))})}),Ep=e.forwardRef((t,n)=>{const r=vp(Sp,t.__scopeTooltip),a=fp(Sp,t.__scopeTooltip),s=e.useRef(null),i=qu(n,s),o=l(e.useState(null),2),c=o[0],u=o[1],d=r.trigger,f=r.onClose,h=s.current,p=a.onPointerInTransitChange,m=e.useCallback(()=>{u(null),p(!1)},[p]),g=e.useCallback((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,a,s)){case s:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),s=function(e){const t=e.slice();return t.sort((e,t)=>
2e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const t=e[r];for(;n.length>=2;){const e=n[n.length-1],r=n[n.length-2];if(!((e.x-r.x)*(t.y-r.y)>=(e.y-r.y)*(t.x-r.x)))break;n.pop()}n.push(t)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...a,...function(e){const t=e.top,n=e.right,r=e.bottom,a=e.left;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}(t.getBoundingClientRect())]);u(s),p(!0)},[p]);return e.useEffect(()=>()=>m(),[m]),e.useEffect(()=>{if(d&&h){const e=e=>g(e,h),t=e=>g(e,d);return d.addEventListener("pointerleave",e),h.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),h.removeEventListener("pointerleave",t)}}},[d,h,g,m]),e.useEffect(()=>{if(c){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=(null===d||void 0===d?void 0:d.contains(t))||(null===h||void 0===h?void 0:h.contains(t)),a=!function(e,t){const n=e.x,r=e.y;let a=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const e=t[s],o=t[i],l=e.x,c=e.y,u=o.x,d=o.y;c>r!==d>r&&n<(u-l)*(r-c)/(d-c)+l&&(a=!a)}return a}(n,c);r?m():a&&(m(),f())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,h,c,f,m]),(0,zc.jsx)(Op,Gc(Gc({},t),{},{ref:i}))}),Tp=l(ip(pp,{isInside:!1}),2),Ip=Tp[0],Pp=Tp[1],Rp=td("TooltipContent"),Op=e.forwardRef((t,n)=>{const r=t.__scopeTooltip,a=t.children,s=t["aria-label"],i=t.onEscapeKeyDown,o=t.onPointerDownOutside,l=Yc(t,rp),c=vp(Sp,r),u=op(r),d=c.onClose;return e.useEffect(()=>(document.addEventListener(cp,d),()=>document.removeEventListener(cp,d)),[d]),e.useEffect(()=>{if(c.trigger){const e=e=>{const t=e.target;null!==t&&void 0!==t&&t.contains(c.trigger)&&d()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,d]),(0,zc.jsx)(hd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,zc.jsxs)(qh,Gc(Gc(Gc({"data-state":c.stateAttribute},u),l),{},{ref:n,style:Gc(Gc({},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:[(0,zc.jsx)(Rp,{children:a}),(0,zc.jsx)(Ip,{scope:r,isInside:!0,children:(0,zc.jsx)(ep,{id:c.contentId,role:"tooltip",children:s||a})})]}))})});Cp.displayName=Sp;var Ap="TooltipArrow",Dp=e.forwardRef((e,t)=>{const n=e.__scopeTooltip,r=Yc(e,ap),a=op(n);return Pp(Ap,n).isInside?null:(0,zc.jsx)(Vh,Gc(Gc(Gc({},a),r),{},{ref:t}))});Dp.displayName=Ap;var Mp=hp,Fp=xp,Lp=bp,Up=Np,Hp=Cp;function zp(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=zp(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Bp(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=zp(e))&&(r&&(r+=" "),r+=t);return r}const Wp=(e,t)=>{var n;if(0===e.length)return t.classGroupId;const r=e[0],a=t.nextPart.get(r),s=a?Wp(e.slice(1),a):void 0;if(s)return s;if(0===t.validators.length)return;const i=e.join("-");return null===(n=t.validators.find(e=>(0,e.validator)(i)))||void 0===n?void 0:n.classGroupId},qp=/^\[(.+)\]$/,Vp=e=>{if(qp.test(e)){const t=qp.exec(e)[1],n=null===t||void 0===t?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},$p=e=>{const t=e.theme,n=e.classGroups,r={nextPart:new Map,validators:[]};for(const a in n)Gp(n[a],r,a,t);return r},Gp=(e,t,n,r)=>{e.forEach(e=>{if("string"===typeof e){return void((""===e?t:Yp(t,e)).classGroupId=n)}if("function"===typeof e)return Kp(e)?void Gp(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});
2Object.entries(e).forEach(e=>{let a=l(e,2),s=a[0],i=a[1];Gp(i,Yp(t,s),n,r)})})},Yp=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Kp=e=>e.isThemeGetter,Zp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(a,s)=>{n.set(a,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(a(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):a(e,t)}}},Jp=e=>{const t=e.prefix,n=e.experimentalParseClassName;let r=e=>{const t=[];let n,r=0,a=0,s=0;for(let l=0;l<e.length;l++){let i=e[l];if(0===r&&0===a){if(":"===i){t.push(e.slice(s,l)),s=l+1;continue}if("/"===i){n=l;continue}}"["===i?r++:"]"===i?r--:"("===i?a++:")"===i&&a--}const i=0===t.length?e:e.substring(s),o=Xp(i);return{modifiers:t,hasImportantModifier:o!==i,baseClassName:o,maybePostfixModifierPosition:n&&n>s?n-s:void 0}};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Xp=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,Qp=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const n=[];let r=[];return e.forEach(e=>{"["===e[0]||t[e]?(n.push(...r.sort(),e),r=[]):r.push(e)}),n.push(...r.sort()),n}},em=e=>Gc({cache:Zp(e.cacheSize),parseClassName:Jp(e),sortModifiers:Qp(e)},(e=>{const t=$p(e),n=e.conflictingClassGroups,r=e.conflictingClassGroupModifiers;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),Wp(n,t)||Vp(e)},getConflictingClassGroupIds:(e,t)=>{const a=n[e]||[];return t&&r[e]?[...a,...r[e]]:a}}})(e)),tm=/\s+/;function nm(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=rm(e))&&(r&&(r+=" "),r+=t);return r}const rm=e=>{if("string"===typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=rm(e[r]))&&(n&&(n+=" "),n+=t);return n};function am(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let a,s,i,o=function(t){const r=n.reduce((e,t)=>t(e),e());return a=em(r),s=a.cache.get,i=a.cache.set,o=l,l(t)};function l(e){const t=s(e);if(t)return t;const n=((e,t)=>{const n=t.parseClassName,r=t.getClassGroupId,a=t.getConflictingClassGroupIds,s=t.sortModifiers,i=[],o=e.trim().split(tm);let l="";for(let c=o.length-1;c>=0;c-=1){const e=o[c],t=n(e),u=t.isExternal,d=t.modifiers,f=t.hasImportantModifier,h=t.baseClassName,p=t.maybePostfixModifierPosition;if(u){l=e+(l.length>0?" "+l:l);continue}let m=!!p,g=r(m?h.substring(0,p):h);if(!g){if(!m){l=e+(l.length>0?" "+l:l);continue}if(g=r(h),!g){l=e+(l.length>0?" "+l:l);continue}m=!1}const v=s(d).join(":"),x=f?v+"!":v,y=x+g;if(i.includes(y))continue;i.push(y);const b=a(g,m);for(let n=0;n<b.length;++n){const e=b[n];i.push(x+e)}l=e+(l.length>0?" "+l:l)}return l})(e,a);return i(e,n),n}return function(){return o(nm.apply(null,arguments))}}const sm=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},im=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,om=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lm=/^\d+\/\d+$/,cm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,um=/\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$/,dm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pm=e=>lm.test(e),mm=e=>!!e&&!Number.isNaN(Number(e)),gm=e=>!!e&&Number.isInteger(Number(e)),vm=e=>e.endsWith("%")&&mm(e.slice(0,-1)),xm=e=>cm.test(e),ym=()=>!0,bm=e=>um.test(e)&&!dm.test(e),wm=()=>!1,_m=e=>fm.test(e),km=e=>hm.test(e),jm=e=>!Sm(e)&&!Rm(e),Nm=e=>Um(e,Wm,wm),Sm=e=>im.test(e),Cm=e=>Um(e,qm,bm),Em=e=>Um(e,Vm,mm),Tm=e=>Um(e,zm,wm),Im=e=>Um(e,Bm,km),Pm=e=>Um(e,Gm,_m),Rm=e=>om.test(e),Om=e=>Hm(e,qm),Am=e=>Hm(e,$m),Dm=e=>Hm(e,zm),Mm=e=>Hm(e,Wm),Fm=e=>Hm(e,Bm),Lm=e=>Hm(e,Gm,!0),Um=(e,t,n)=>{const r=im.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},Hm=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=om.exec(e);return!!r&&(r[1]?t(r[1]):n)},zm=e=>"position"===e||"percentage"===e,Bm=e=>"image"===e||"url"===e,Wm=e=>"length"===e||"size"===e||"bg-size"===e,qm=e=>"length"===e,Vm=e=>"number"===e,$m=e=>"family-name"===e,Gm=e=>"shadow"===e,Ym=(Symbol.toStringTag,()=>{const e=sm("color"),t=sm("font"),n=sm("text"),r=sm("font-weight"),a=sm("tracking"),s=sm("leading"),i=sm("breakpoint"),o=sm("container"),l=sm("spacing"),c=sm("radius"),u=sm("shadow"),d=sm("inset-shadow"),f=sm("text-shadow"),h=sm("drop-shadow"),p=sm("blur"),m=sm("perspective"),g=sm("aspect"),v=sm("ease"),x=sm("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Rm,Sm],b=()=>[Rm,Sm,l],w=()=>[pm,"full","auto",...b()],_=()=>[gm,"none","subgrid",Rm,Sm],k=()=>["auto",{span:["full",gm,Rm,Sm]},gm,Rm,Sm],j=()=>[gm,"auto",Rm,Sm],N=()=>["auto","min","max","fr",Rm,Sm],S=()=>["auto",...b()],C=()=>[pm,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],E=()=>[e,Rm,Sm],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Dm,Tm,{position:[Rm,Sm]}],I=()=>["auto","cover","contain",Mm,Nm,{size:[Rm,Sm]}],P=()=>[vm,Om,Cm],R=()=>["","none","full",c,Rm,Sm],O=()=>["",mm,Om,Cm],A=()=>[mm,vm,Dm,Tm],D=()=>["","none",p,Rm,Sm],M=()=>["none",mm,Rm,Sm],F=()=>["none",mm,Rm,Sm],L=()=>[mm,Rm,Sm],U=()=>[pm,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xm],breakpoint:[xm],color:[ym],container:[xm],"drop-shadow":[xm],ease:["in","out","in-out"],font:[jm],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xm],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xm],shadow:[xm],spacing:["px",mm],text:[xm],"text-shadow":[xm],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pm,Sm,Rm,g]}
vendor: 5,347 bytes, line 2
2],container:["container"],columns:[{columns:[mm,Sm,Rm,o]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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"],sr:["sr-only","not-sr-only"],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:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[gm,"auto",Rm,Sm]}],basis:[{basis:[pm,"full","auto",o,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[mm,pm,"auto","initial","none",Sm]}],grow:[{grow:["",mm,Rm,Sm]}],shrink:[{shrink:["",mm,Rm,Sm]}],order:[{order:[gm,"first","last","none",Rm,Sm]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:S()}],mx:[{mx:S()}],my:[{my:S()}],ms:[{ms:S()}],me:[{me:S()}],mt:[{mt:S()}],mr:[{mr:S()}],mb:[{mb:S()}],ml:[{ml:S()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:C()}],w:[{w:[o,"screen",...C()]}],"min-w":[{"min-w":[o,"screen","none",...C()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...C()]}],h:[{h:["screen","lh",...C()]}],"min-h":[{"min-h":["screen","lh","none",...C()]}],"max-h":[{"max-h":["screen","lh",...C()]}],"font-size":[{text:["base",n,Om,Cm]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Rm,Em]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vm,Sm]}],"font-family":[{font:[Am,Sm,t]}],"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:[a,Rm,Sm]}],"line-clamp":[{"line-clamp":[mm,"none",Rm,Em]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",Rm,Sm]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Rm,Sm]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","
2wavy"]}],"text-decoration-thickness":[{decoration:[mm,"from-font","auto",Rm,Cm]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[mm,"auto",Rm,Sm]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Rm,Sm]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Rm,Sm]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gm,Rm,Sm],radial:["",Rm,Sm],conic:[gm,Rm,Sm]},Fm,Im]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:O()}],"border-w-x":[{"border-x":O()}],"border-w-y":[{"border-y":O()}],"border-w-s":[{"border-s":O()}],"border-w-e":[{"border-e":O()}],"border-w-t":[{"border-t":O()}],"border-w-r":[{"border-r":O()}],"border-w-b":[{"border-b":O()}],"border-w-l":[{"border-l":O()}],"divide-x":[{"divide-x":O()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":O()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[mm,Rm,Sm]}],"outline-w":[{outline:["",mm,Om,Cm]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",u,Lm,Pm]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",d,Lm,Pm]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[mm,Cm]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":O()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",f,Lm,Pm]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[mm,Rm,Sm]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[mm]}],"mask-image-linear-from-pos":[{"mask-linear-from":A()}],"mask-image-linear-to-pos":[{"mask-linear-to":A()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":A()}],"mask-image-t-to-pos":[{"mask-t-to":A()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":A()}],"mask-image-r-to-pos":[{"mask-r-to":A()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":A()}],"mask-image-b-to-pos":[{"mask-b-to":A()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":A()}],"mask-image-l-to-pos":[{"mask-l-to":A()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":A()}],"mask-image-x-to-pos":[{"mask-x-to":A()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":A()}],"mask-image-y-to-pos":[{"mask-y-to":A()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[Rm,Sm]}],"mask-image-radial-from-pos":[{"mask-radial-from":A()}],"mask-image-radial-to-pos":[{"mask-radial-to":A()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[mm]}],"mask-image-conic-from-pos":[{"mask-conic-from":A()}],"mask-image-conic-to-pos":[{"mask-conic-to":A()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Rm,Sm]}],filter:[{filter:["","none",Rm,Sm]}],blur:[{blur:D()}],brightness:[{brightness:[mm,Rm,Sm]}],contrast:[{contrast:[mm,Rm,Sm]}],"drop-shadow":[{"drop-shadow":["","none",h,Lm,Pm]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",mm,Rm,Sm]}],"hue-rotate":[{"hue-rotate":[mm,Rm,Sm]}],invert:[{invert:["",mm,Rm,Sm]}],saturate:[{saturate:[mm,Rm,Sm]}],sepia:[{sepia:["",mm,Rm,Sm]}],"backdrop-filter":[{"backdrop-filter":["","none",Rm,Sm]}],"backdrop-blur":[{"backdrop-blur":D()}],"backdrop-brightness":[{"backdrop-brightness":[mm,Rm,Sm]}],"backdrop-contrast":[{"backdrop-contrast":[mm,Rm,Sm]}],"backdrop-grayscale":[{"backdrop-grayscale":["",mm,Rm,Sm]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[mm,Rm,Sm]}],"backdrop-invert":[{"backdrop-invert":["",mm,Rm,Sm]}],"backdrop-opacity":[{"backdrop-opacity":[mm,Rm,Sm]}],"backdrop-saturate":[{"backdrop-saturate":[mm,Rm,Sm]}],"backdrop-sepia":[{"backdrop-sepia":["",mm,Rm,Sm]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Rm,Sm]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[mm,"initial",Rm,Sm]}],ease:[{ease:["linear","initial",v,Rm,Sm]}],delay:[{delay:[mm,Rm,Sm]}],animate:[{animate:["none",x,Rm,Sm]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Rm,Sm]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:M()}],"rotate-x":[{"rotate-x":M()}],"rotate-y":[{"rotate-y":M()}],"rotate-z":[{"rotate-z":M()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[Rm,Sm,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:U()}],"translate-x":[{"translate-x":U()}],"translate-y":[{"translate-y":U()}],"translate-z":[{"translate-z":U()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}
vendor: 4,616 bytes, line 2
2],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Rm,Sm]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"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"]}],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",Rm,Sm]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[mm,Om,Cm,Em]}],stroke:[{stroke:["none",...E()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),Km=am(Ym);function Zm(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Km(Bp(t))}const Jm=["className","sideOffset"],Xm=Mp,Qm=Fp,eg=Lp,tg=e.forwardRef((e,t)=>
2{let n=e.className,r=e.sideOffset,a=void 0===r?4:r,s=Yc(e,Jm);return(0,zc.jsx)(Up,{children:(0,zc.jsx)(Hp,Gc({ref:t,sideOffset:a,className:Zm("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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 origin-[--radix-tooltip-content-transform-origin]",n)},s))})});tg.displayName=Hp.displayName;const ng=()=>{const t=l((0,e.useState)(null),2),n=t[0],r=t[1],a=l((0,e.useState)(!0),2),s=a[0],i=a[1],o=l((0,e.useState)(null),2),c=o[0],u=o[1];return(0,e.useEffect)(()=>{(async()=>{try{const e=await(async()=>{const e=ku();if(!e)throw new Error("No tenant ID found in storage");try{const t=await fetch("".concat("https://api.trievents.ca","/organizations/").concat(e),{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error("Failed to fetch organization details");return await t.json()}catch(c){throw console.error("Error fetching organization details:",c),c}})();r(e)}catch(e){u(e instanceof Error?e:new Error("Failed to fetch organization"))}finally{i(!1)}})()},[]),{organization:n,loading:s,error:c}},rg=()=>{const e=sl(),t=ku(),n=e=>{const n=e.startsWith("/")?e:"/".concat(e);return t?"/".concat(t).concat(n):n};return{navigateWithTenant:t=>{e(n(t))},getTenantPath:n,tenantId:t}};function ag(e){if(null==e)throw new TypeError("Cannot destructure "+e)}const sg=["class","className"],ig=e=>"boolean"===typeof e?"".concat(e):0===e?"0":e,og=Bp,lg=(e,t)=>n=>{var r;if(null==(null===t||void 0===t?void 0:t.variants))return og(e,null===n||void 0===n?void 0:n.class,null===n||void 0===n?void 0:n.className);const a=t.variants,s=t.defaultVariants,i=Object.keys(a).map(e=>{const t=null===n||void 0===n?void 0:n[e],r=null===s||void 0===s?void 0:s[e];if(null===t)return null;const i=ig(t)||ig(r);return a[e][i]}),o=n&&Object.entries(n).reduce((e,t)=>{let n=l(t,2),r=n[0],a=n[1];return void 0===a||(e[r]=a),e},{}),c=null===t||void 0===t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let n=t.class,r=t.className,a=Yc(t,sg);return Object.entries(a).every(e=>{let t=l(e,2),n=t[0],r=t[1];return Array.isArray(r)?r.includes(Gc(Gc({},s),o)[n]):Gc(Gc({},s),o)[n]===r})?[...e,n,r]:e},[]);return og(e,i,c,null===n||void 0===n?void 0:n.class,null===n||void 0===n?void 0:n.className)},cg=Iu("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const ug=["className","variant","size","asChild"],dg=lg("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:scale-105",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),fg=e.forwardRef((e,t)=>{let n=e.className,r=e.variant,a=e.size,s=e.asChild,i=void 0!==s&&s,o=Yc(e,ug);const l=i?Xu:"button";return(0,zc.jsx)(l,Gc({className:Zm(dg({variant:r,size:a,className:n})),ref:t},o))});fg.displayName="Button";const hg=["className","type"],pg=e.forwardRef((e,t)=>{let n=e.className,r=e.type,a=Yc(e,hg);return(0,zc.jsx)("input",Gc({type:r,className:Zm("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors 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-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:t},a))});pg.displayName="Input";const mg=["decorative","orientation"];var gg="horizontal",vg=["horizontal","vertical"],xg=e.forwardRef((e,t)=>
2{const n=e.decorative,r=e.orientation,a=void 0===r?gg:r,s=Yc(e,mg),i=function(e){return vg.includes(e)}(a)?a:gg,o=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return(0,zc.jsx)(ad.div,Gc(Gc(Gc({"data-orientation":i},o),s),{},{ref:t}))});xg.displayName="Separator";var yg=xg;const bg=["className","orientation","decorative"],wg=e.forwardRef((e,t)=>{let n=e.className,r=e.orientation,a=void 0===r?"horizontal":r,s=e.decorative,i=void 0===s||s,o=Yc(e,bg);return(0,zc.jsx)(yg,Gc({ref:t,decorative:i,orientation:a,className:Zm("shrink-0 bg-border","horizontal"===a?"h-[1px] w-full":"h-full w-[1px]",n)},o))});wg.displayName=yg.displayName;const _g=["loop","trapped","onMountAutoFocus","onUnmountAutoFocus"];var kg="focusScope.autoFocusOnMount",jg="focusScope.autoFocusOnUnmount",Ng={bubbles:!1,cancelable:!0},Sg=e.forwardRef((t,n)=>{const r=t.loop,a=void 0!==r&&r,s=t.trapped,i=void 0!==s&&s,o=t.onMountAutoFocus,c=t.onUnmountAutoFocus,u=Yc(t,_g),d=l(e.useState(null),2),f=d[0],h=d[1],p=id(o),m=id(c),g=e.useRef(null),v=qu(n,e=>h(e)),x=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(i){let e=function(e){if(x.paused||!f)return;const t=e.target;f.contains(t)?g.current=t:Ig(g.current,{select:!0})},t=function(e){if(x.paused||!f)return;const t=e.relatedTarget;null!==t&&(f.contains(t)||Ig(g.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Ig(f)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return f&&r.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[i,f,x.paused]),e.useEffect(()=>{if(f){Pg.add(x);const t=document.activeElement;if(!f.contains(t)){const n=new CustomEvent(kg,Ng);f.addEventListener(kg,p),f.dispatchEvent(n),n.defaultPrevented||(!function(e){let t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).select,n=void 0!==t&&t;const r=document.activeElement;for(const a of e)if(Ig(a,{select:n}),document.activeElement!==r)return}((e=Cg(f),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Ig(f))}return()=>{f.removeEventListener(kg,p),setTimeout(()=>{const e=new CustomEvent(jg,Ng);f.addEventListener(jg,m),f.dispatchEvent(e),e.defaultPrevented||Ig(null!==t&&void 0!==t?t:document.body,{select:!0}),f.removeEventListener(jg,m),Pg.remove(x)},0)}}var e},[f,p,m,x]);const y=e.useCallback(e=>{if(!a&&!i)return;if(x.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,r=function(e){const t=Cg(e),n=Eg(t,e),r=Eg(t.reverse(),e);return[n,r]}(t),s=l(r,2),i=s[0],o=s[1];i&&o?e.shiftKey||n!==o?e.shiftKey&&n===i&&(e.preventDefault(),a&&Ig(o,{select:!0})):(e.preventDefault(),a&&Ig(i,{select:!0})):n===t&&e.preventDefault()}},[a,i,x.paused]);return(0,zc.jsx)(ad.div,Gc(Gc({tabIndex:-1},u),{},{ref:v,onKeyDown:y}))});function Cg(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Eg(e,t){for(const n of e)if(!Tg(n,{upTo:t}))return n}function Tg(e,t){let n=t.upTo;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==n&&e===n)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Ig(e){let t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).select,n=void 0!==t&&t;if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&n&&e.select()}}Sg.displayName="FocusScope";var Pg=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null===n||void 0===n||n.pause()),e=Rg(e,t),e.unshift(t)},remove(t){var n;e=Rg(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function Rg(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Og=0;function Ag(){e.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:Dg()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:Dg()),Og++,()=>{1===Og&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
2=>e.remove()),Og--}},[])}function Dg(){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 Mg=function(){return Mg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Mg.apply(this,arguments)};function Fg(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}Object.create;function Lg(e,t,n){if(n||2===arguments.length)for(var r,a=0,s=t.length;a<s;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;var Ug="right-scroll-bar-position",Hg="width-before-scroll-bar";function zg(e,t){return"function"===typeof e?e(t):e&&(e.current=t),e}var Bg="undefined"!==typeof window?e.useLayoutEffect:e.useEffect,Wg=new WeakMap;function qg(t,n){var r=function(t,n){var r=(0,e.useState)(function(){return{value:t,callback:n,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0];return r.callback=n,r.facade}(n||null,function(e){return t.forEach(function(t){return zg(t,e)})});return Bg(function(){var e=Wg.get(r);if(e){var n=new Set(e),a=new Set(t),s=r.current;n.forEach(function(e){a.has(e)||zg(e,null)}),a.forEach(function(e){n.has(e)||zg(e,s)})}Wg.set(r,t)},[t]),r}function Vg(e){return e}function $g(e,t){void 0===t&&(t=Vg);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var a=t(e,r);return n.push(a),function(){n=n.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var a=n;n=[],a.forEach(e),t=n}var s=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(s)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}};return a}var Gg=function(e){void 0===e&&(e={});var t=$g(null);return t.options=Mg({async:!0,ssr:!1},e),t}(),Yg=function(){},Kg=e.forwardRef(function(t,n){var r=e.useRef(null),a=e.useState({onScrollCapture:Yg,onWheelCapture:Yg,onTouchMoveCapture:Yg}),s=a[0],i=a[1],o=t.forwardProps,l=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,h=t.sideCar,p=t.noRelative,m=t.noIsolation,g=t.inert,v=t.allowPinchZoom,x=t.as,y=void 0===x?"div":x,b=t.gapMode,w=Fg(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,k=qg([r,n]),j=Mg(Mg({},w),s);return e.createElement(e.Fragment,null,d&&e.createElement(_,{sideCar:Gg,removeScrollBar:u,shards:f,noRelative:p,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:r,gapMode:b}),o?e.cloneElement(e.Children.only(l),Mg(Mg({},j),{ref:k})):e.createElement(y,Mg({},j,{className:c,ref:k}),l))});Kg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Kg.classNames={fullWidth:Hg,zeroRight:Ug};var Zg,Jg=function(t){var n=t.sideCar,r=Fg(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=n.read();if(!a)throw new Error("Sidecar medium not found");return e.createElement(a,Mg({},r))};Jg.isSideCarExport=!0;function Xg(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Zg||n.nc;return t&&e.setAttribute("nonce",t),e}var Qg=function(){var e=0,t=null;return{add:function(n){var r,a;0==e&&(t=Xg())&&(a=n,(r=t).styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ev=function(){var t=function(){var t=Qg();return function(n,r){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&r])}}();return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},tv={left:0,top:0,right:0,gap:0},nv=function(e){return parseInt(e||"",10)||0},rv=function(e){if(void 0===e&&(e="margin"),"undefined"===typeof window)return tv;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[nv(n),nv(r),nv(a)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},av=ev(),sv="data-scroll-locked",iv=function(e,t,n,r){var a=e.left,s=e.top,i=e.right,o=e.gap;return void 0===n&&(n="margin"),"\n  .".concat("with-scroll-bars-hidden"," {\n   overflow: hidden ").concat(r,";\n   padding-right: ").concat(o,"px ").concat(r,";\n  }\n  body[").concat(sv,"] {\n    overflow: hidden ").concat(r,";\n    overscroll-behavior: contain;\n    ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n    padding-left: ".concat(a,"px;\n    padding-top: ").concat(s,"px;\n    padding-right: ").concat(i,"px;\n    margin-left:0;\n    margin-top:0;\n    margin-right: ").concat(o,"px ").concat(r,";\n    "),"padding"===n&&"padding-right: ".concat(o,"px ").concat(r,";
2")].filter(Boolean).join(""),"\n  }\n  \n  .").concat(Ug," {\n    right: ").concat(o,"px ").concat(r,";\n  }\n  \n  .").concat(Hg," {\n    margin-right: ").concat(o,"px ").concat(r,";\n  }\n  \n  .").concat(Ug," .").concat(Ug," {\n    right: 0 ").concat(r,";\n  }\n  \n  .").concat(Hg," .").concat(Hg," {\n    margin-right: 0 ").concat(r,";\n  }\n  \n  body[").concat(sv,"] {\n    ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n  }\n")},ov=function(){var e=parseInt(document.body.getAttribute(sv)||"0",10);return isFinite(e)?e:0},lv=function(t){var n=t.noRelative,r=t.noImportant,a=t.gapMode,s=void 0===a?"margin":a;e.useEffect(function(){return document.body.setAttribute(sv,(ov()+1).toString()),function(){var e=ov()-1;e<=0?document.body.removeAttribute(sv):document.body.setAttribute(sv,e.toString())}},[]);var i=e.useMemo(function(){return rv(s)},[s]);return e.createElement(av,{styles:iv(i,!n,s,r?"":"!important")})},cv=!1;if("undefined"!==typeof window)try{var uv=Object.defineProperty({},"passive",{get:function(){return cv=!0,!0}});window.addEventListener("test",uv,uv),window.removeEventListener("test",uv,uv)}catch(XF){cv=!1}var dv=!!cv&&{passive:!1},fv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},hv=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!==typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),pv(e,r)){var a=mv(e,r);if(a[1]>a[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pv=function(e,t){return"v"===e?function(e){return fv(e,"overflowY")}(t):function(e){return fv(e,"overflowX")}(t)},mv=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},gv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vv=function(e){return[e.deltaX,e.deltaY]},xv=function(e){return e&&"current"in e?e.current:e},yv=function(e){return"\n  .block-interactivity-".concat(e," {pointer-events: none;}\n  .allow-interactivity-").concat(e," {pointer-events: all;}\n")},bv=0,wv=[];function _v(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kv=(jv=function(t){var n=e.useRef([]),r=e.useRef([0,0]),a=e.useRef(),s=e.useState(bv++)[0],i=e.useState(ev)[0],o=e.useRef(t);e.useEffect(function(){o.current=t},[t]),e.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var e=Lg([t.lockRef.current],(t.shards||[]).map(xv),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=e.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var n,s=gv(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-s[0],c="deltaY"in e?e.deltaY:i[1]-s[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=hv(d,u);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=hv(d,u)),!f)return!1;if(!a.current&&"changedTouches"in e&&(l||c)&&(a.current=n),!n)return!0;var h=a.current||n;return function(e,t,n,r,a){var s=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=s*r,o=n.target,l=t.contains(o),c=!1,u=i>0,d=0,f=0;do{if(!o)break;var h=mv(e,o),p=h[0],m=h[1]-h[2]-s*p;(p||m)&&pv(e,o)&&(d+=m,f+=p);var g=o.parentNode;o=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(u&&(a&&Math.abs(d)<1||!a&&i>d)||!u&&(a&&Math.abs(f)<1||!a&&-i>f))&&(c=!0),c}(h,t,e,"h"===h?l:c,!0)},[]),c=e.useCallback(function(e){var t=e;if(wv.length&&wv[wv.length-1]===i){var r="deltaY"in t?vv(t):gv(t),a=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)})[0];if(a&&a.should)t.cancelable&&t.preventDefault();
2else if(!a){var s=(o.current.shards||[]).map(xv).filter(Boolean).filter(function(e){return e.contains(t.target)});(s.length>0?l(t,s[0]):!o.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),u=e.useCallback(function(e,t,r,a){var s={name:e,delta:t,target:r,should:a,shadowParent:_v(r)};n.current.push(s),setTimeout(function(){n.current=n.current.filter(function(e){return e!==s})},1)},[]),d=e.useCallback(function(e){r.current=gv(e),a.current=void 0},[]),f=e.useCallback(function(e){u(e.type,vv(e),e.target,l(e,t.lockRef.current))},[]),h=e.useCallback(function(e){u(e.type,gv(e),e.target,l(e,t.lockRef.current))},[]);e.useEffect(function(){return wv.push(i),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,dv),document.addEventListener("touchmove",c,dv),document.addEventListener("touchstart",d,dv),function(){wv=wv.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,dv),document.removeEventListener("touchmove",c,dv),document.removeEventListener("touchstart",d,dv)}},[]);var p=t.removeScrollBar,m=t.inert;return e.createElement(e.Fragment,null,m?e.createElement(i,{styles:yv(s)}):null,p?e.createElement(lv,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},Gg.useMedium(jv),Jg);var jv,Nv=e.forwardRef(function(t,n){return e.createElement(Kg,Mg({},t,{ref:n,sideCar:kv}))});Nv.classNames=Kg.classNames;const Sv=Nv;var Cv=function(e){return"undefined"===typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ev=new WeakMap,Tv=new WeakMap,Iv={},Pv=0,Rv=function(e){return e&&(e.host||Rv(e.parentNode))},Ov=function(e,t,n,r){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Rv(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Iv[n]||(Iv[n]=new WeakMap);var s=Iv[n],i=[],o=new Set,l=new Set(a),c=function(e){e&&!o.has(e)&&(o.add(e),c(e.parentNode))};a.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(o.has(e))u(e);else try{var t=e.getAttribute(r),a=null!==t&&"false"!==t,l=(Ev.get(e)||0)+1,c=(s.get(e)||0)+1;Ev.set(e,l),s.set(e,c),i.push(e),1===l&&a&&Tv.set(e,!0),1===c&&e.setAttribute(n,"true"),a||e.setAttribute(r,"true")}catch(d){console.error("aria-hidden: cannot operate on ",e,d)}})};return u(t),o.clear(),Pv++,function(){i.forEach(function(e){var t=Ev.get(e)-1,a=s.get(e)-1;Ev.set(e,t),s.set(e,a),t||(Tv.has(e)||e.removeAttribute(r),Tv.delete(e)),a||e.removeAttribute(n)}),--Pv||(Ev=new WeakMap,Ev=new WeakMap,Tv=new WeakMap,Iv={})}},Av=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=t||Cv(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),Ov(r,a,n,"aria-hidden")):function(){return null}};const Dv=["__scopeDialog"],Mv=["forceMount"],Fv=["__scopeDialog"],Lv=["forceMount"],Uv=["__scopeDialog","trapFocus","onOpenAutoFocus","onCloseAutoFocus"],Hv=["__scopeDialog"],zv=["__scopeDialog"],Bv=["__scopeDialog"];var Wv="Dialog",qv=l(Gu(Wv),2),Vv=qv[0],$v=(qv[1],l(Vv(Wv),2)),Gv=$v[0],Yv=$v[1],Kv=t=>{const n=t.__scopeDialog,r=t.children,a=t.open,s=t.defaultOpen,i=t.onOpenChange,o=t.modal,c=void 0===o||o,u=e.useRef(null),d=e.useRef(null),f=l(Jh({prop:a,defaultProp:null!==s&&void 0!==s&&s,onChange:i,caller:Wv}),2),h=f[0],p=f[1];return(0,zc.jsx)(Gv,{scope:n,triggerRef:u,contentRef:d,contentId:bd(),titleId:bd(),descriptionId:bd(),open:h,onOpenChange:p,onOpenToggle:e.useCallback(()=>p(e=>!e),[p]),modal:c,children:r})};Kv.displayName=Wv;var Zv="DialogTrigger",Jv=e.forwardRef((e,t)=>{const n=e.__scopeDialog,r=Yc(e,Dv),a=Yv(Zv,n),s=qu(t,a.triggerRef);return(0,zc.jsx)(ad.button,Gc(Gc({type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":xx(a.open)},r),{},{ref:s,onClick:zu(e.onClick,a.onOpenToggle)}))});Jv.displayName=Zv;var Xv="DialogPortal",Qv=l(Vv(Xv,{forceMount:void 0}),2),ex=Qv[0],tx=Qv[1],nx=t=>{const n=t.__scopeDialog,r=t.forceMount,a=t.children,s=t.container,i=Yv(Xv,n);return(0,zc.jsx)(ex,{scope:n,forceMount:r,children:e.Children.map(a,e=>(0,zc.jsx)(Yh,{present:r||i.open,children:(0,zc.jsx)(Gh,{asChild:!0,container:s,children:e})}))})};nx.displayName=Xv;var rx="DialogOverlay",ax=e.forwardRef((e,t)=>
2{const n=tx(rx,e.__scopeDialog),r=e.forceMount,a=void 0===r?n.forceMount:r,s=Yc(e,Mv),i=Yv(rx,e.__scopeDialog);return i.modal?(0,zc.jsx)(Yh,{present:a||i.open,children:(0,zc.jsx)(ix,Gc(Gc({},s),{},{ref:t}))}):null});ax.displayName=rx;var sx=Ju("DialogOverlay.RemoveScroll"),ix=e.forwardRef((e,t)=>{const n=e.__scopeDialog,r=Yc(e,Fv),a=Yv(rx,n);return(0,zc.jsx)(Sv,{as:sx,allowPinchZoom:!0,shards:[a.contentRef],children:(0,zc.jsx)(ad.div,Gc(Gc({"data-state":xx(a.open)},r),{},{ref:t,style:Gc({pointerEvents:"auto"},r.style)}))})}),ox="DialogContent",lx=e.forwardRef((e,t)=>{const n=tx(ox,e.__scopeDialog),r=e.forceMount,a=void 0===r?n.forceMount:r,s=Yc(e,Lv),i=Yv(ox,e.__scopeDialog);return(0,zc.jsx)(Yh,{present:a||i.open,children:i.modal?(0,zc.jsx)(cx,Gc(Gc({},s),{},{ref:t})):(0,zc.jsx)(ux,Gc(Gc({},s),{},{ref:t}))})});lx.displayName=ox;var cx=e.forwardRef((t,n)=>{const r=Yv(ox,t.__scopeDialog),a=e.useRef(null),s=qu(n,r.contentRef,a);return e.useEffect(()=>{const e=a.current;if(e)return Av(e)},[]),(0,zc.jsx)(dx,Gc(Gc({},t),{},{ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zu(t.onCloseAutoFocus,e=>{var t;e.preventDefault(),null===(t=r.triggerRef.current)||void 0===t||t.focus()}),onPointerDownOutside:zu(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:zu(t.onFocusOutside,e=>e.preventDefault())}))}),ux=e.forwardRef((t,n)=>{const r=Yv(ox,t.__scopeDialog),a=e.useRef(!1),s=e.useRef(!1);return(0,zc.jsx)(dx,Gc(Gc({},t),{},{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{var n,i;(null===(n=t.onCloseAutoFocus)||void 0===n||n.call(t,e),e.defaultPrevented)||(a.current||null===(i=r.triggerRef.current)||void 0===i||i.focus(),e.preventDefault());a.current=!1,s.current=!1},onInteractOutside:e=>{var n,i;null===(n=t.onInteractOutside)||void 0===n||n.call(t,e),e.defaultPrevented||(a.current=!0,"pointerdown"===e.detail.originalEvent.type&&(s.current=!0));const o=e.target;(null===(i=r.triggerRef.current)||void 0===i?void 0:i.contains(o))&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&s.current&&e.preventDefault()}}))}),dx=e.forwardRef((t,n)=>{const r=t.__scopeDialog,a=t.trapFocus,s=t.onOpenAutoFocus,i=t.onCloseAutoFocus,o=Yc(t,Uv),l=Yv(ox,r),c=e.useRef(null),u=qu(n,c);return Ag(),(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(Sg,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:(0,zc.jsx)(hd,Gc(Gc({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":xx(l.open)},o),{},{ref:u,onDismiss:()=>l.onOpenChange(!1)}))}),(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(kx,{titleId:l.titleId}),(0,zc.jsx)(jx,{contentRef:c,descriptionId:l.descriptionId})]})]})}),fx="DialogTitle",hx=e.forwardRef((e,t)=>{const n=e.__scopeDialog,r=Yc(e,Hv),a=Yv(fx,n);return(0,zc.jsx)(ad.h2,Gc(Gc({id:a.titleId},r),{},{ref:t}))});hx.displayName=fx;var px="DialogDescription",mx=e.forwardRef((e,t)=>{const n=e.__scopeDialog,r=Yc(e,zv),a=Yv(px,n);return(0,zc.jsx)(ad.p,Gc(Gc({id:a.descriptionId},r),{},{ref:t}))});mx.displayName=px;var gx="DialogClose",vx=e.forwardRef((e,t)=>{const n=e.__scopeDialog,r=Yc(e,Bv),a=Yv(gx,n);return(0,zc.jsx)(ad.button,Gc(Gc({type:"button"},r),{},{ref:t,onClick:zu(e.onClick,()=>a.onOpenChange(!1))}))});function xx(e){return e?"open":"closed"}vx.displayName=gx;var yx="DialogTitleWarning",bx=function(t,n){const r=e.createContext(n),a=t=>{const n=t.children,a=Yc(t,Vu),s=e.useMemo(()=>a,Object.values(a));return(0,zc.jsx)(r.Provider,{value:s,children:n})};return a.displayName=t+"Provider",[a,function(a){const s=e.useContext(r);if(s)return s;if(void 0!==n)return n;throw new Error("`".concat(a,"` must be used within `").concat(t,"`"))}]}(yx,{contentName:ox,titleName:fx,docsSlug:"dialog"}),wx=l(bx,2),_x=(wx[0],wx[1]),kx=t=>{let n=t.titleId;const r=_x(yx),a="`".concat(r.contentName,"` requires a `").concat(r.titleName,"` for the component to be accessible for screen reader users.\n\nIf you want to hide the `").concat(r.titleName,"`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/").concat(r.docsSlug);return e.useEffect(()=>{if(n){document.getElementById(n)||console.error(a)}},[a,n]),null},jx=t=>{let n=t.contentRef,r=t.descriptionId;const a=_x("DialogDescriptionWarning"),s="Warning: Missing `Description` or `aria-describedby={undefined}` for {".concat(a.contentName,"}.");return e.useEffect(()=>{var e;const t=null===(e=n.current)||void 0===e?void 0:e.getAttribute("aria-describedby");if(r&&t){document.getElementById(r)||console.warn(s)}},[s,n,r]),null},Nx=Kv,Sx=Jv,Cx=nx,Ex=ax,Tx=lx,Ix=hx,Px=mx,Rx=vx;const Ox=Iu("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
2],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ax=["className"],Dx=["side","className","children"],Mx=["className"],Fx=["className"],Lx=["className"],Ux=Nx,Hx=Cx,zx=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Ax);return(0,zc.jsx)(Ex,Gc(Gc({className:Zm("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",n)},r),{},{ref:t}))});zx.displayName=Ex.displayName;const Bx=lg("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{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"}}),Wx=e.forwardRef((e,t)=>{let n=e.side,r=void 0===n?"right":n,a=e.className,s=e.children,i=Yc(e,Dx);return(0,zc.jsxs)(Hx,{children:[(0,zc.jsx)(zx,{}),(0,zc.jsxs)(Tx,Gc(Gc({ref:t,className:Zm(Bx({side:r}),a)},i),{},{children:[(0,zc.jsxs)(Rx,{className:"absolute right-4 top-4 roun
2ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,zc.jsx)(Ox,{className:"h-4 w-4"}),(0,zc.jsx)("span",{className:"sr-only",children:"Close"})]}),s]}))]})});Wx.displayName=Tx.displayName;const qx=e=>{let t=e.className,n=Yc(e,Mx);return(0,zc.jsx)("div",Gc({className:Zm("flex flex-col space-y-2 text-center sm:text-left",t)},n))};qx.displayName="SheetHeader";const Vx=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Fx);return(0,zc.jsx)(Ix,Gc({ref:t,className:Zm("text-lg font-semibold text-foreground",n)},r))});Vx.displayName=Ix.displayName;const $x=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Lx);return(0,zc.jsx)(Px,Gc({ref:t,className:Zm("text-sm text-muted-foreground",n)},r))});$x.displayName=Px.displayName;const Gx=["className"];function Yx(e){let t=e.className,n=Yc(e,Gx);return(0,zc.jsx)("div",Gc({className:Zm("animate-pulse rounded-md bg-primary/10",t)},n))}const Kx=["defaultOpen","open","onOpenChange","className","style","children"],Zx=["side","variant","collapsible","className","children"],Jx=["className","onClick"],Xx=["className"],Qx=["className"],ey=["className"],ty=["className"],ny=["className"],ry=["className"],ay=["className"],sy=["className"],iy=["className","asChild"],oy=["className","asChild"],ly=["className"],cy=["className"],uy=["className"],dy=["asChild","isActive","variant","size","tooltip","className"],fy=["className","asChild","showOnHover"],hy=["className"],py=["className","showIcon"],my=["className"],gy=["asChild","size","isActive","className"],vy=e.createContext(null);function xy(){const t=e.useContext(vy);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const yy=e.forwardRef((t,n)=>{let r=t.defaultOpen,a=void 0===r||r,s=t.open,i=t.onOpenChange,o=t.className,c=t.style,u=t.children,d=Yc(t,Kx);const f=function(){const t=l(e.useState(void 0),2),n=t[0],r=t[1];return e.useEffect(()=>{const e=window.matchMedia("(max-width: ".concat(767,"px)")),t=()=>{r(window.innerWidth<768)};return e.addEventListener("change",t),r(window.innerWidth<768),()=>e.removeEventListener("change",t)},[]),!!n}(),h=l(e.useState(!1),2),p=h[0],m=h[1],g=l(e.useState(a),2),v=g[0],x=g[1],y=null!==s&&void 0!==s?s:v,b=e.useCallback(e=>{const t="function"===typeof e?e(y):e;i?i(t):x(t),document.cookie="".concat("sidebar_state","=").concat(t,"; path=/; max-age=").concat(604800)},[i,y]),w=e.useCallback(()=>f?m(e=>!e):b(e=>!e),[f,b,m]),_=y?"expanded":"collapsed",k=e.useMemo(()=>({state:_,open:y,setOpen:b,isMobile:f,openMobile:p,setOpenMobile:m,toggleSidebar:w}),[_,y,b,f,p,m,w]);return(0,zc.jsx)(vy.Provider,{value:k,children:(0,zc.jsx)(Xm,{delayDuration:0,children:(0,zc.jsx)("div",Gc(Gc({style:Gc({"--sidebar-width":"16rem","--sidebar-width-icon":"3rem"},c),className:Zm("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:n},d),{},{children:u}))})})});yy.displayName="SidebarProvider";const by=e.forwardRef((e,t)=>{let n=e.side,r=void 0===n?"left":n,a=e.variant,s=void 0===a?"sidebar":a,i=e.collapsible,o=void 0===i?"offcanvas":i,l=e.className,c=e.children,u=Yc(e,Zx);const d=xy(),f=d.isMobile,h=d.state,p=d.openMobile,m=d.setOpenMobile;return"none"===o?(0,zc.jsx)("div",Gc(Gc({className:Zm("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",l),ref:t},u),{},{children:c})):f?(0,zc.jsx)(Ux,Gc(Gc({open:p,onOpenChange:m},u),{},{children:(0,zc.jsxs)(Wx,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:r,children:[(0,zc.jsxs)(qx,{className:"sr-only",children:[(0,zc.jsx)(Vx,{children:"Sidebar"}),(0,zc.jsx)($x,{children:"Displays the mobile sidebar."})]}),(0,zc.jsx)("div",{className:"flex h-full w-full flex-col",children:c})]})})):(0,zc.jsxs)("div",{ref:t,className:"group peer hidden text-sidebar-foreground md:block","data-state":h,"data-collapsible":"collapsed"===h?o:"","data-variant":s,"data-side":r,children:[(0,zc.jsx)("div",{className:Zm("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===s||"inset"===s?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,zc.jsx)("div",Gc(Gc({className:Zm("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex","left"===r?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===s||"inset"===s?"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",l)},u),{},{children:(0,zc.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:c})}))]})});by.displayName="Sidebar";e.forwardRef((e,t)=>
2{let n=e.className,r=e.onClick,a=Yc(e,Jx);const s=xy().toggleSidebar;return(0,zc.jsxs)(fg,Gc(Gc({ref:t,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Zm("h-7 w-7",n),onClick:e=>{null===r||void 0===r||r(e),s()}},a),{},{children:[(0,zc.jsx)(cg,{}),(0,zc.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]}))}).displayName="SidebarTrigger";e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Xx);const a=xy().toggleSidebar;return(0,zc.jsx)("button",Gc({ref:t,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:Zm("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",n)},r))}).displayName="SidebarRail";e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Qx);return(0,zc.jsx)("main",Gc({ref:t,className:Zm("relative flex w-full flex-1 flex-col bg-background","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",n)},r))}).displayName="SidebarInset";e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,ey);return(0,zc.jsx)(pg,Gc({ref:t,"data-sidebar":"input",className:Zm("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",n)},r))}).displayName="SidebarInput";e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,ty);return(0,zc.jsx)("div",Gc({ref:t,"data-sidebar":"header",className:Zm("flex flex-col gap-2 p-2",n)},r))}).displayName="SidebarHeader";e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,ny);return(0,zc.jsx)("div",Gc({ref:t,"data-sidebar":"footer",className:Zm("flex flex-col gap-2 p-2",n)},r))}).displayName="SidebarFooter";e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,ry);return(0,zc.jsx)(wg,Gc({ref:t,"data-sidebar":"separator",className:Zm("mx-2 w-auto bg-sidebar-border",n)},r))}).displayName="SidebarSeparator";e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,ay);return(0,zc.jsx)("div",Gc({ref:t,"data-sidebar":"content",className:Zm("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n)},r))}).displayName="SidebarContent";e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,sy);return(0,zc.jsx)("div",Gc({ref:t,"data-sidebar":"group",className:Zm("relative flex w-full min-w-0 flex-col p-2",n)},r))}).displayName="SidebarGroup";e.forwardRef((e,t)=>{let n=e.className,r=e.asChild,a=void 0!==r&&r,s=Yc(e,iy);const i=a?Xu:"div";return(0,zc.jsx)(i,Gc({ref:t,"data-sidebar":"group-label",className:Zm("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,opacity] 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",n)},s))}).displayName="SidebarGroupLabel";e.forwardRef((e,t)=>{let n=e.className,r=e.asChild,a=void 0!==r&&r,s=Yc(e,oy);const i=a?Xu:"button";return(0,zc.jsx)(i,Gc({ref:t,"data-sidebar":"group-action",className:Zm("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",n)},s))}).displayName="SidebarGroupAction";e.forwardRef((e,t)=>
2{let n=e.className,r=Yc(e,ly);return(0,zc.jsx)("div",Gc({ref:t,"data-sidebar":"group-content",className:Zm("w-full text-sm",n)},r))}).displayName="SidebarGroupContent";e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,cy);return(0,zc.jsx)("ul",Gc({ref:t,"data-sidebar":"menu",className:Zm("flex w-full min-w-0 flex-col gap-1",n)},r))}).displayName="SidebarMenu";e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,uy);return(0,zc.jsx)("li",Gc({ref:t,"data-sidebar":"menu-item",className:Zm("group/menu-item relative",n)},r))}).displayName="SidebarMenuItem";const wy=lg("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"}}),_y=e.forwardRef((e,t)=>{let n=e.asChild,r=void 0!==n&&n,a=e.isActive,s=void 0!==a&&a,i=e.variant,o=void 0===i?"default":i,l=e.size,c=void 0===l?"default":l,u=e.tooltip,d=e.className,f=Yc(e,dy);const h=r?Xu:"button",p=xy(),m=p.isMobile,g=p.state,v=(0,zc.jsx)(h,Gc({ref:t,"data-sidebar":"menu-button","data-size":c,"data-active":s,className:Zm(wy({variant:o,size:c}),d)},f));return u?("string"===typeof u&&(u={children:u}),(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:v}),(0,zc.jsx)(tg,Gc({side:"right",align:"center",hidden:"collapsed"!==g||m},u))]})):v});_y.displayName="SidebarMenuButton";e.forwardRef((e,t)=>{let n=e.className,r=e.asChild,a=void 0!==r&&r,s=e.showOnHover,i=void 0!==s&&s,o=Yc(e,fy);const l=a?Xu:"button";return(0,zc.jsx)(l,Gc({ref:t,"data-sidebar":"menu-action",className:Zm("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",i&&"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",n)},o))}).displayName="SidebarMenuAction";e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,hy);return(0,zc.jsx)("div",Gc({ref:t,"data-sidebar":"menu-badge",className:Zm("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",n)},r))}).displayName="SidebarMenuBadge";e.forwardRef((t,n)=>{let r=t.className,a=t.showIcon,s=void 0!==a&&a,i=Yc(t,py);const o=e.useMemo(()=>"".concat(Math.floor(40*Math.random())+50,"%"),[]);return(0,zc.jsxs)("div",Gc(Gc({ref:n,"data-sidebar":"menu-skeleton",className:Zm("flex h-8 items-center gap-2 rounded-md px-2",r)},i),{},{children:[s&&(0,zc.jsx)(Yx,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,zc.jsx)(Yx,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]}))}).displayName="SidebarMenuSkeleton";e.forwardRef((e,t)=>
2{let n=e.className,r=Yc(e,my);return(0,zc.jsx)("ul",Gc({ref:t,"data-sidebar":"menu-sub",className:Zm("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",n)},r))}).displayName="SidebarMenuSub";e.forwardRef((e,t)=>{let n=Object.assign({},(ag(e),e));return(0,zc.jsx)("li",Gc({ref:t},n))}).displayName="SidebarMenuSubItem";const ky=e.forwardRef((e,t)=>{let n=e.asChild,r=void 0!==n&&n,a=e.size,s=void 0===a?"md":a,i=e.isActive,o=e.className,l=Yc(e,gy);const c=r?Xu:"a";return(0,zc.jsx)(c,Gc({ref:t,"data-sidebar":"menu-sub-button","data-size":s,"data-active":i,className:Zm("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground","sm"===s&&"text-xs","md"===s&&"text-sm","group-data-[collapsible=icon]:hidden",o)},l))});ky.displayName="SidebarMenuSubButton";const jy=Iu("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function Ny(){const e=ng(),t=e.organization,n=e.loading,r=e.error,a=rg().getTenantPath,s=rl();return(0,zc.jsx)(by,{className:"hidden lg:block h-screen",children:(0,zc.jsxs)("div",{className:"flex h-full flex-col px-3 py-4 pb-0 justify-between",children:[(0,zc.jsxs)("div",{className:"flex flex-col",children:[(0,zc.jsx)("div",{className:"flex flex-col gap-2 mb-7 mt-3 ",children:(0,zc.jsxs)("div",{className:"flex items-center gap-3",children:[(0,zc.jsx)("div",{className:"flex flex-shrink-0 items-center justify-center w-8 h-8 rounded-full bg-primary text-white text-sm font-bold shadow-sm",children:null!==t&&void 0!==t&&t.name?t.name.charAt(0):"O"}),(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("h2",{className:"text-lg font-semibold truncate whitespace-nowrap overflow-hidden flex-1",children:n?"Loading...":r?"Error":(null===t||void 0===t?void 0:t.name)||"Organization"})}),(0,zc.jsx)(tg,{children:(null===t||void 0===t?void 0:t.name)||"Organization"})]})})]})}),(0,zc.jsx)("nav",{className:"flex-1 space-y-3",children:Mu.map(e=>{const t=(e=>{const t=s.pathname,n=a(e);return"/dashboard"===e?t===n||t.includes("/events/")||t.includes("/event/"):t===n})(e.href);return(0,zc.jsxs)("a",{href:a(e.href),className:"flex items-center gap-3 rounded-lg px-3 py-2 text-md transition-colors ".concat(t?"bg-primary text-primary-foreground":"hover:bg-accent hover:text-accent-foreground"),children:[(0,zc.jsx)(e.icon,{className:"h-4 w-4"}),(0,zc.jsx)("span",{children:e.name})]},e.name)})})]}),(0,zc.jsxs)("div",{className:"flex flex-col space-y-3",children:[(0,zc.jsxs)("a",{href:"mailto:[email protected]?subject=%5BBug%20Report%5D%20Issue%20with%20TriEvents%20Platform",className:"flex items-center gap-3 rounded-lg px-3 py-2 text-md text-gray-600 hover:bg-gray-100 transition-colors",children:[(0,zc.jsx)(jy,{className:"h-4 w-4"}),(0,zc.jsx)("span",{children:"Report an Issue"})]}),(0,zc.jsx)(Hu,{}),(0,zc.jsx)("div",{className:"flex pt-4 pb-6 justify-center items-center",children:(0,zc.jsx)("img",{src:"/branding/TriEvents_Logo.png",alt:"TriEvents",className:"h-6"})})]})]})})}function Sy(e){let t=e.isOpen,n=e.onClose;const r=ng(),a=r.organization,s=r.loading,i=r.error,o=rl(),l=rg().getTenantPath;return t?(0,zc.jsxs)("div",{className:"fixed inset-0 z-50 lg:hidden",children:[(0,zc.jsx)("div",{className:"fixed inset-0 bg-black/50",onClick:n,"aria-hidden":"true"}),(0,zc.jsx)("div",{className:"fixed inset-y-0 left-0 w-3/4 max-w-sm bg-background shadow-xl animate-in slide-in-from-left",children:(0,zc.jsxs)("div",{className:"flex h-full flex-col px-4 py-6",children:[(0,zc.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,zc.jsx)("h2",{className:"text-lg font-semibold truncate whitespace-nowrap overflow-hidden flex-1",title:null===a||void 0===a?void 0:a.name,children:s?"Loading...":i?"Error":(null===a||void 0===a?void 0:a.name)||"Organization"}),(0,zc.jsx)("button",{onClick:n,className:"p-2 rounded-lg hover:bg-accent","aria-label":"Close menu",children:(0,zc.jsx)(Ox,{className:"h-6 w-6"})})]}),(0,zc.jsx)("nav",{className:"flex-1 space-y-2",children:Mu.map(e=>{const t=(e=>{const t=o.pathname,n=l(e);return"/dashboard"===e?t===n||t.includes("/events/")||t.includes("/event/"):t===n})(e.href);return(0,zc.jsxs)("a",{href:l(e.href),onClick:n,className:"flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-colors ".concat(t?"bg-primary text-primary-foreground":"hover:bg-accent hover:text-accent-foreground"),children:[(0,zc.jsx)(e.icon,{className:"h-5 w-5"}),(0,zc.jsx)("span",{children:e.name})]},e.name)})}),(0,zc.jsxs)("div",{className:"mt-auto pt-6 border-t border-gray-200 space-y-3",children:[(0,zc.jsxs)("a",{href:"mailto:[email protected]?subject=%5BBug%20Report%5D%20Issue%20with%20TriEvents%20Platform",className:"flex items-center gap-3 rounded-lg px-3 py-2 text-sm text-gray-600 hover:bg-gray-100 transition-colors",onClick:n,children:[(0,zc.jsx)(jy,{className:"h-5 w-5"}),(0,zc.jsx)("span",{children:"Report an Issue"})]}),(0,zc.jsx)(Hu,{})]})]})})]}):null}const Cy=Iu("menu",[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]]);function Ey(t){let n=t.children;const r=l((0,e.useState)(!1),2),a=r[0],s=r[1];return(0,zc.jsx)(yy,{defaultOpen:!0,children:(0,zc.jsxs)("div",{className:"relative min-h-screen w-full",children:[(0,zc.jsx)("div",{className:"hidden lg:block",children:(0,zc.jsx)(Ny,{})}),(0,zc.jsxs)("div",{className:"lg:hidden",children:[(0,zc.jsx)("button",{onClick:()=>s(!0),className:"fixed top-4 left-4 z-40 p-2 bg-background rounded-lg shadow-md hover:bg-accent","aria-label":"Open menu",children:(0,zc.jsx)(Cy,{className:"h-6 w-6"})}),(0,zc.jsx)(Sy,{isOpen:a,onClose:()=>s(!1)})]}),(0,zc.jsx)("div",{className:"lg:pl-64 min-h-screen",children:(0,zc.jsx)("main",{className:"w-full h-full",children:(0,zc.jsx)("div",{className:"pt-20 lg:pt-24 max-w-7xl mx-auto px-8 lg:px-16",children:n})})})]})})}var Ty=n(2740),Iy=n.n(Ty),Py=n(7324),Ry=n.n(Py);const Oy=["children"],Ay=["children"];var Dy,My,Fy=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Fy||{}),Ly={rel:["amphtml","canonical","alternate"]},Uy={type:["application/ld+json"]}
2,Hy={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},zy=Object.values(Fy),By={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Wy=Object.entries(By).reduce((e,t)=>{let n=l(t,2),r=n[0];return e[n[1]]=r,e},{}),qy="data-rh",Vy="defaultTitle",$y="defer",Gy="encodeSpecialCharacters",Yy="onChangeClientState",Ky="titleTemplate",Zy="prioritizeSeoTags",Jy=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},Xy=e=>{let t=Jy(e,"title");const n=Jy(e,Ky);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=Jy(e,Vy);return t||r||void 0},Qy=e=>Jy(e,Yy)||(()=>{}),eb=(e,t)=>t.filter(t=>"undefined"!==typeof t[e]).map(t=>t[e]).reduce((e,t)=>Gc(Gc({},e),t),{}),tb=(e,t)=>t.filter(e=>"undefined"!==typeof e.base).map(e=>e.base).reverse().reduce((t,n)=>{if(!t.length){const r=Object.keys(n);for(let a=0;a<r.length;a+=1){const s=r[a].toLowerCase();if(-1!==e.indexOf(s)&&n[s])return t.concat(n)}}return t},[]),nb=(e,t,n)=>{const r={};return n.filter(t=>{return!!Array.isArray(t[e])||("undefined"!==typeof t[e]&&(n="Helmet: ".concat(e,' should be of type "Array". Instead found type "').concat(typeof t[e],'"'),console&&"function"===typeof console.warn&&console.warn(n)),!1);var n}).map(t=>t[e]).reverse().reduce((e,n)=>{const a={};n.filter(e=>{let n;const s=Object.keys(e);for(let r=0;r<s.length;r+=1){const a=s[r],i=a.toLowerCase();-1===t.indexOf(i)||"rel"===n&&"canonical"===e[n].toLowerCase()||"rel"===i&&"stylesheet"===e[i].toLowerCase()||(n=i),-1===t.indexOf(a)||"innerHTML"!==a&&"cssText"!==a&&"itemprop"!==a||(n=a)}if(!n||!e[n])return!1;const i=e[n].toLowerCase();return r[n]||(r[n]={}),a[n]||(a[n]={}),!r[n][i]&&(a[n][i]=!0,!0)}).reverse().forEach(t=>e.push(t));const s=Object.keys(a);for(let t=0;t<s.length;t+=1){const e=s[t],n=Gc(Gc({},r[e]),a[e]);r[e]=n}return e},[]).reverse()},rb=(e,t)=>{if(Array.isArray(e)&&e.length)for(let n=0;n<e.length;n+=1){if(e[n][t])return!0}return!1},ab=e=>Array.isArray(e)?e.join(""):e,sb=(e,t)=>Array.isArray(e)?e.reduce((e,n)=>(((e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1})(n,t)?e.priority.push(n):e.default.push(n),e),{priority:[],default:[]}):{default:e,priority:[]},ib=(e,t)=>Gc(Gc({},e),{},{[t]:void 0}),ob=["noscript","script","style"],lb=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},cb=e=>Object.keys(e).reduce((t,n)=>{const r="undefined"!==typeof e[n]?"".concat(n,'="').concat(e[n],'"'):"".concat(n);return t?"".concat(t," ").concat(r):r},""),ub=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((t,n)=>(t[By[n]||n]=e[n],t),t)},db=(t,n)=>n.map((n,r)=>{const a={key:r,[qy]:!0};return Object.keys(n).forEach(e=>{const t=By[e]||e;if("innerHTML"===t||"cssText"===t){const e=n.innerHTML||n.cssText;a.dangerouslySetInnerHTML={__html:e}}else a[t]=n[e]}),e.createElement(t,a)}),fb=function(t,n){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];switch(t){case"title":return{toComponent:()=>((t,n,r)=>{const a=ub(r,{key:n,[qy]:!0});return[e.createElement("title",a,n)]})(0,n.title,n.titleAttributes),toString:()=>((e,t,n,r)=>{const a=cb(n),s=ab(t);return a?"<".concat(e," ").concat(qy,'="true" ').concat(a,">").concat(lb(s,r),"</").concat(e,">"):"<".concat(e," ").concat(qy,'="true">').concat(lb(s,r),"</").concat(e,">")})(t,n.title,n.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>ub(n),toString:()=>cb(n)};default:return{toComponent:()=>db(t,n),toString:()=>function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t.reduce((t,r)=>{const a=r,s=Object.keys(a).filter(e=>!("innerHTML"===e||"cssText"===e)).reduce((e,t)=>
2{const r="undefined"===typeof a[t]?t:"".concat(t,'="').concat(lb(a[t],n),'"');return e?"".concat(e," ").concat(r):r},""),i=a.innerHTML||a.cssText||"",o=-1===ob.indexOf(e);return"".concat(t,"<").concat(e," ").concat(qy,'="true" ').concat(s).concat(o?"/>":">".concat(i,"</").concat(e,">"))},"")}(t,n,r)}}},hb=e=>{const t=e.baseTag,n=e.bodyAttributes,r=e.encode,a=void 0===r||r,s=e.htmlAttributes,i=e.noscriptTags,o=e.styleTags,l=e.title,c=void 0===l?"":l,u=e.titleAttributes,d=e.prioritizeSeoTags;let f=e.linkTags,h=e.metaTags,p=e.scriptTags,m={toComponent:()=>{},toString:()=>""};if(d){var g=(e=>{let t=e.metaTags,n=e.linkTags,r=e.scriptTags,a=e.encode;const s=sb(t,Hy),i=sb(n,Ly),o=sb(r,Uy);return{priorityMethods:{toComponent:()=>[...db("meta",s.priority),...db("link",i.priority),...db("script",o.priority)],toString:()=>"".concat(fb("meta",s.priority,a)," ").concat(fb("link",i.priority,a)," ").concat(fb("script",o.priority,a))},metaTags:s.default,linkTags:i.default,scriptTags:o.default}})(e);m=g.priorityMethods,f=g.linkTags,h=g.metaTags,p=g.scriptTags}return{priority:m,base:fb("base",t,a),bodyAttributes:fb("bodyAttributes",n,a),htmlAttributes:fb("htmlAttributes",s,a),link:fb("link",f,a),meta:fb("meta",h,a),noscript:fb("noscript",i,a),script:fb("script",p,a),style:fb("style",o,a),title:fb("title",{title:c,titleAttributes:u},a)}},pb=[],mb=!("undefined"===typeof window||!window.document||!window.document.createElement),gb=class{constructor(e,t){Vc(this,"instances",[]),Vc(this,"canUseDOM",mb),Vc(this,"context",void 0),Vc(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?pb:this.instances,add:e=>{(this.canUseDOM?pb:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?pb:this.instances).indexOf(e);(this.canUseDOM?pb:this.instances).splice(t,1)}}}),this.context=e,this.canUseDOM=t||!1,t||(e.helmet=hb({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},vb=e.createContext({}),xb=(Dy=class t extends e.Component{constructor(e){super(e),Vc(this,"helmetData",void 0),this.helmetData=new gb(this.props.context||{},t.canUseDOM)}render(){return e.createElement(vb.Provider,{value:this.helmetData.value},this.props.children)}},Vc(Dy,"canUseDOM",mb),Dy),yb=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll("".concat(e,"[").concat(qy,"]")),a=[].slice.call(r),s=[];let i;return t&&t.length&&t.forEach(t=>{const n=document.createElement(e);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))if("innerHTML"===e)n.innerHTML=t.innerHTML;else if("cssText"===e)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{const r=e,a="undefined"===typeof t[r]?"":t[r];n.setAttribute(e,a)}n.setAttribute(qy,"true"),a.some((e,t)=>(i=t,n.isEqualNode(e)))?a.splice(i,1):s.push(n)}),a.forEach(e=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)}),s.forEach(e=>n.appendChild(e)),{oldTags:a,newTags:s}},bb=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(qy),a=r?r.split(","):[],s=[...a],i=Object.keys(t);for(const o of i){const e=t[o]||"";n.getAttribute(o)!==e&&n.setAttribute(o,e),-1===a.indexOf(o)&&a.push(o);const r=s.indexOf(o);-1!==r&&s.splice(r,1)}for(let o=s.length-1;o>=0;o-=1)n.removeAttribute(s[o]);a.length===s.length?n.removeAttribute(qy):n.getAttribute(qy)!==i.join(",")&&n.setAttribute(qy,i.join(","))},wb=(e,t)=>{const n=e.baseTag,r=e.bodyAttributes,a=e.htmlAttributes,s=e.linkTags,i=e.metaTags,o=e.noscriptTags,l=e.onChangeClientState,c=e.scriptTags,u=e.styleTags,d=e.title,f=e.titleAttributes;bb("body",r),bb("html",a),((e,t)=>{"undefined"!==typeof e&&document.title!==e&&(document.title=ab(e)),bb("title",t)})(d,f);const h={baseTag:yb("base",n),linkTags:yb("link",s),metaTags:yb("meta",i),noscriptTags:yb("noscript",o),scriptTags:yb("script",c),styleTags:yb("style",u)},p={},m={};Object.keys(h).forEach(e=>{const t=h[e],n=t.newTags,r=t.oldTags;n.length&&(p[e]=n),r.length&&(m[e]=h[e].oldTags)}),t&&t(),l(e,p,m)},_b=null,kb=e=>{_b&&cancelAnimationFrame(_b),e.defer?_b=requestAnimationFrame(()=>{wb(e,()=>{_b=null})}):(wb(e),_b=null)},jb=class extends e.Component{constructor(){super(...arguments),Vc(this,"rendered",!1)}shouldComponentUpdate(e){return!Ry()(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){this.props.context.helmetInstances.remove(this),this.emitChange()}emitChange(){const e=this.props.context,t=e.helmetInstances,n=e.setHelmet;let r=null;const a=(s=t.get().map(e=>{const t=Gc({},e.props);return delete t.context,t}),{baseTag:tb(["href"],s),bodyAttributes:eb("bodyAttributes",s),defer:Jy(s,$y),encode:Jy(s,Gy),htmlAttributes:eb("htmlAttributes",s),linkTags:nb("link",["rel","href"],s),metaTags:nb("meta",["name","charset","http-equiv","property","itemprop"],s),noscriptTags:nb("noscript",["innerHTML"],s),onChangeClientState:Qy(s),scriptTags:nb("script",["src","innerHTML"],s),styleTags:nb("style",["cssText"],s),title:Xy(s),titleAttributes:eb("titleAttributes",s),prioritizeSeoTags:rb(s,Zy)});var s;xb.canUseDOM?kb(a):hb&&(r=hb(a)),n(r)}init(){if(this.rendered)return;this.rendered=!0;this.props.context.helmetInstances.add(this),this.emitChange()}render(){return this.init(),null}},Nb=(Vc(My=class extends e.Component{shouldComponentUpdate(e){return!zl()(ib(this.props,"helmetData"),ib(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error("<".concat(e.type," /> elements are self-closing and can not contain children. Refer to our API for more information."))}}flattenArrayTypeChildren(e,t,n,r){return Gc(Gc({},t),{},{[e.type]:[...t[e.type]||[],Gc(Gc({},n),this.mapNestedChildrenToProps(e,r))]})}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return Gc(Gc({},t),{},{[e.type]:r,titleAttributes:Gc({},n)});case"body":return Gc(Gc({},t),{},{bodyAttributes:Gc({},n)});case"html":return Gc(Gc({},t),{},{htmlAttributes:Gc({},n)});default:return Gc(Gc({},t),{},{[e.type]:Gc({},n)})}}mapArrayTypeChildrenToProps(e,t){let n=Gc({},t);return Object.keys(e).forEach(t=>{n=Gc(Gc({},n),{},{[t]:e[t]})}),n}
2warnOnInvalidChildren(e,t){return Iy()(zy.some(t=>e.type===t),"function"===typeof e.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types ".concat(zy.join(", ")," are allowed. Helmet does not support rendering <").concat(e.type,"> elements. Refer to our API for more information.")),Iy()(!t||"string"===typeof t||Array.isArray(t)&&!t.some(e=>"string"!==typeof e),"Helmet expects a string as a child of <".concat(e.type,">. Did you forget to wrap your children in braces? ( <").concat(e.type,">{``}</").concat(e.type,"> ) Refer to our API for more information.")),!0}mapChildrenToProps(t,n){let r={};return e.Children.forEach(t,e=>{if(!e||!e.props)return;const t=e.props,a=t.children,s=Yc(t,Oy),i=Object.keys(s).reduce((e,t)=>(e[Wy[t]||t]=s[t],e),{});let o=e.type;switch("symbol"===typeof o?o=o.toString():this.warnOnInvalidChildren(e,a),o){case"Symbol(react.fragment)":n=this.mapChildrenToProps(a,n);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(e,r,i,a);break;default:n=this.mapObjectTypeChildren(e,n,i,a)}}),this.mapArrayTypeChildrenToProps(r,n)}render(){const t=this.props,n=t.children,r=Yc(t,Ay);let a=Gc({},r),s=r.helmetData;if(n&&(a=this.mapChildrenToProps(n,a)),s&&!(s instanceof gb)){s=new gb(s.context,!0),delete a.helmetData}return s?e.createElement(jb,Gc(Gc({},a),{},{context:s.value})):e.createElement(vb.Consumer,null,t=>e.createElement(jb,Gc(Gc({},a),{},{context:t})))}},"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),My);const Sb=["className"],Cb=["className"],Eb=["className"],Tb=["className"],Ib=["className"],Pb=["className"],Rb=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Sb);return(0,zc.jsx)("div",Gc({ref:t,className:Zm("rounded-lg border bg-card text-card-foreground shadow-sm",n)},r))});Rb.displayName="Card";const Ob=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Cb);return(0,zc.jsx)("div",Gc({ref:t,className:Zm("flex flex-col space-y-1.5 p-6",n)},r))});Ob.displayName="CardHeader";const Ab=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Eb);return(0,zc.jsx)("h3",Gc({ref:t,className:Zm("text-2xl font-semibold leading-none tracking-tight",n)},r))});Ab.displayName="CardTitle";const Db=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Tb);return(0,zc.jsx)("p",Gc({ref:t,className:Zm("text-sm text-muted-foreground",n)},r))});Db.displayName="CardDescription";const Mb=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Ib);return(0,zc.jsx)("div",Gc({ref:t,className:Zm("p-6 pt-0",n)},r))});Mb.displayName="CardContent";const Fb=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Pb);return(0,zc.jsx)("div",Gc({ref:t,className:Zm("flex items-center p-6 pt-0",n)},r))});Fb.displayName="CardFooter";const Lb=()=>(0,zc.jsx)("footer",{className:"bg-gray-900 text-white py-8 md:py-10",children:(0,zc.jsxs)("div",{className:"container mx-auto px-4",children:[(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 md:gap-8 text-center",children:[(0,zc.jsxs)("div",{className:"mb-6 md:mb-0",children:[(0,zc.jsx)("h4",{className:"font-semibold mb-3 text-base",children:"Social"}),(0,zc.jsxs)("ul",{className:"space-y-2 text-gray-400",children:[(0,zc.jsx)("li",{children:(0,zc.jsx)("a",{href:"https://instagram.com/tricode.cloud",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors text-sm",children:"Instagram"})}),(0,zc.jsx)("li",{children:(0,zc.jsx)("a",{href:"https://linkedin.com/company/tricode-cloud",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors text-sm",children:"LinkedIn"})})]})]}),(0,zc.jsxs)("div",{className:"mb-6 md:mb-0",children:[(0,zc.jsx)("h4",{className:"font-semibold mb-3 text-base",children:"Company"}),(0,zc.jsxs)("ul",{className:"space-y-2 text-gray-400",children:[(0,zc.jsx)("li",{children:(0,zc.jsx)("a",{href:"https://tricode.cloud/about-us",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors text-sm",children:"About Us"})}),(0,zc.jsx)("li",{children:(0,zc.jsx)("a",{href:"https://tricode.cloud/team",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors text-sm",children:"Team"})}),(0,zc.jsx)("li",{children:(0,zc.jsx)("a",{href:"https://tricode.cloud/contact",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors text-sm",children:"Contact Us"})})]})]}),(0,zc.jsxs)("div",{className:"mb-6 md:mb-0",children:[(0,zc.jsx)("h4",{className:"font-semibold mb-3 text-base",children:"Products"}),(0,zc.jsxs)("ul",{className:"space-y-2 text-gray-400",children:[(0,zc.jsx)("li",{children:(0,zc.jsx)("a",{href:"https://tricode.cloud/trievents",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors text-sm",children:"TriEvents"})}),(0,zc.jsx)("li",{children:(0,zc.jsx)("a",{href:"https://tricode.cloud/trihire",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors text-sm",children:"TriHire"})})]})]})]}),(0,zc.jsx)("div",{className:"border-t border-gray-800 mt-6 pt-6 text-center text-gray-400",children:(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row justify-center items-center space-y-2 md:space-y-0 md:space-x-4",children:[(0,zc.jsxs)("div",{className:"flex flex-col md:hidden items-center space-y-1",children:[(0,zc.jsx)("a",{href:"https://tricode.cloud/trievents/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors text-sm",children:"Terms of Service"}),(0,zc.jsx)("a",{href:"https://tricode.cloud/trievents/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors text-sm",children:"Privacy Policy"})]}),(0,zc.jsx)("span",{className:"md:flex hidden",children:"\xa9 2025 Tricode Cloud. All rights reserved."}),(0,zc.jsx)("span",{className:"md:hidden",children:"\xa9 2025 Tricode Cloud. All rights reserved."}),(0,zc.jsx)("span",{className:"hidden md:inline",children:"\u2022"}),(0,zc.jsx)("a",{href:"https://tricode.cloud/trievents/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"hidden md:inline hover:text-white transition-colors text-sm",children:"Terms of Service"}),(0,zc.jsx)("span",{className:"hidden md:inline",children:"\u2022"}),(0,zc.jsx)("a",{href:"https://tricode.cloud/trievents/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hidden md:inline hover:text-white transition-colors text-sm",children:"Privacy Policy"})]})})]})}),Ub=()=>{const e=sl();return(0,zc.jsxs)(xb,{children:[(0,zc.jsxs)(Nb,{children:[(0,zc.jsx)("title",{children:"TriEvents - Event Management Made Simple"}),(0,zc.jsx)("meta",{name:"description",content:"Event ticketing has never been easier. Post your event for free and sell at competitive per ticket fees."}),(0,zc.jsx)("meta",{property:"og:type",content:"website"}),(0,zc.jsx)("meta",{property:"og:url",content:"https://trievents.ca/"}),(0,zc.jsx)("meta",{property:"og:title",content:"TriEvents - Event Management Made Simple"}),(0,zc.jsx)("meta",{property:"og:description",content:"Event ticketing has never been easier. Post your event for free and sell at competitive per ticket fees."}),(0,zc.jsx)("meta",{property:"og:image",content:"/branding/TriEvents_Logo.png"}
2),(0,zc.jsx)("meta",{property:"og:image:width",content:"1200"}),(0,zc.jsx)("meta",{property:"og:image:height",content:"630"}),(0,zc.jsx)("meta",{property:"twitter:card",content:"summary_large_image"}),(0,zc.jsx)("meta",{property:"twitter:url",content:"https://trievents.ca/"}),(0,zc.jsx)("meta",{property:"twitter:title",content:"TriEvents - Event Management Made Simple"}),(0,zc.jsx)("meta",{property:"twitter:description",content:"Event ticketing has never been easier. Post your event for free and sell at competitive per ticket fees."}),(0,zc.jsx)("meta",{property:"twitter:image",content:"/branding/TriEvents_Logo.png"})]}),(0,zc.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,zc.jsxs)("section",{className:"relative overflow-hidden min-h-screen flex items-center",style:{background:"linear-gradient(45deg, #f804b4 0%, #08ccc4 100%)"},children:[(0,zc.jsx)("div",{className:"absolute inset-0 bg-black/20"}),(0,zc.jsx)("div",{className:"relative container mx-auto px-4 py-20 lg:py-32 w-full",children:(0,zc.jsxs)("div",{className:"text-center text-white",children:[(0,zc.jsx)("div",{className:"mb-12",children:(0,zc.jsxs)("div",{className:"inline-block bg-white rounded-lg p-8 shadow-2xl relative",children:[(0,zc.jsx)("div",{className:"absolute left-1 top-0 bottom-0 w-3 flex flex-col justify-center",children:(0,zc.jsx)("div",{className:"space-y-2",children:[...Array(8)].map((e,t)=>(0,zc.jsx)("div",{className:"w-3 h-3 bg-gradient-to-r from-transparent via-gray-400 to-transparent rounded-full"},t))})}),(0,zc.jsx)("div",{className:"absolute right-1 top-0 bottom-0 w-3 flex flex-col justify-center",children:(0,zc.jsx)("div",{className:"space-y-2",children:[...Array(8)].map((e,t)=>(0,zc.jsx)("div",{className:"w-3 h-3 bg-gradient-to-l from-transparent via-gray-400 to-transparent rounded-full"},t))})}),(0,zc.jsx)("img",{src:"/branding/TriEvents_Loading_Big_Text.gif",alt:"TriEvents Logo",className:"w-64 md:w-80 h-auto"})]})}),(0,zc.jsx)("h1",{className:"text-4xl md:text-6xl font-bold mb-8 leading-tight",children:"Event Management Made Simple"}),(0,zc.jsx)("p",{className:"text-xl md:text-2xl mb-12 max-w-3xl mx-auto opacity-90 leading-relaxed",children:"The complete platform for organizations to create, manage, and host successful events. From ticketing to attendee management, we've got you covered."}),(0,zc.jsx)("div",{className:"flex justify-center",children:(0,zc.jsx)(fg,{onClick:()=>{e("/auth")},size:"lg",className:"text-lg px-16 py-4 transform hover:scale-105 transition-transform duration-200",children:"Get Started"})})]})})]}),(0,zc.jsx)("section",{className:"py-20 bg-gray-50",children:(0,zc.jsxs)("div",{className:"container mx-auto px-4",children:[(0,zc.jsxs)("div",{className:"text-center mb-16",children:[(0,zc.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Everything You Need to Host Amazing Events"}),(0,zc.jsx)("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"Our comprehensive platform provides all the tools your organization needs to create successful events from start to finish."})]}),(0,zc.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[{title:"Event Management",description:"Create, organize, and manage events with ease. From small meetups to large conferences.",icon:"\ud83c\udfaf"},{title:"Ticket Sales",description:"Sell tickets directly through our platform with secure payment processing.",icon:"\ud83c\udfab"},{title:"Attendee Management",description:"Track registrations, manage attendee lists, and communicate with participants.",icon:"\ud83d\udc65"},{title:"Organization Tools",description:"Manage your organization, members, and finances all in one place.",icon:"\ud83c\udfe2"},{title:"QR Code Validation",description:"Instant ticket validation with QR codes and real-time attendee tracking at events.",icon:"\ud83d\udcf1"},{title:"Bursary System",description:"Offer financial assistance to attendees through our integrated bursary system.",icon:"\ud83d\udcb0"}].map((e,t)=>(0,zc.jsxs)(Rb,{className:"hover:shadow-lg transition-all duration-300 transform hover:-translate-y-1",children:[(0,zc.jsxs)(Ob,{children:[(0,zc.jsx)("div",{className:"text-4xl mb-4",children:e.icon}),(0,zc.jsx)(Ab,{className:"text-xl",children:e.title})]}),(0,zc.jsx)(Mb,{children:(0,zc.jsx)(Db,{className:"text-base",children:e.description})})]},t))})]})}),(0,zc.jsx)("section",{className:"py-20 bg-white",children:(0,zc.jsxs)("div",{className:"container mx-auto px-4",children:[(0,zc.jsxs)("div",{className:"text-center mb-16",children:[(0,zc.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"How It Works"}),(0,zc.jsx)("p",{className:"text-xl text-muted-foreground",children:"Get started in just a few simple steps"})]}),(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[(0,zc.jsxs)("div",{className:"text-center",children:[(0,zc.jsx)("div",{className:"w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,zc.jsx)("span",{className:"text-2xl font-bold text-purple-600",children:"1"})}),(0,zc.jsx)("h3",{className:"text-xl font-semibold mb-2",children:"Create Your Organization"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Set up your organization profile and invite team members to collaborate."})]}),(0,zc.jsxs)("div",{className:"text-center",children:[(0,zc.jsx)("div",{className:"w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,zc.jsx)("span",{className:"text-2xl font-bold text-purple-600",children:"2"})}),(0,zc.jsx)("h3",{className:"text-xl font-semibold mb-2",children:"Plan Your Event"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Create events, set up ticketing, and configure all the details."})]}),(0,zc.jsxs)("div",{className:"text-center",children:[(0,zc.jsx)("div",{className:"w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,zc.jsx)("span",{className:"text-2xl font-bold text-purple-600",children:"3"})}),(0,zc.jsx)("h3",{className:"text-xl font-semibold mb-2",children:"Host & Manage"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Sell tickets, manage attendees, and host your successful event."})]})]})]})}),(0,zc.jsx)(Lb,{})]})]})}
2,Hb=Iu("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),zb=Iu("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),Bb=()=>{var t;const n=rl(),r=sl(),a=Qi(),s=(null===(t=n.state)||void 0===t?void 0:t.errorCode)||404;(0,e.useEffect)(()=>{document.title="Error ".concat(s),a&&a.capture("error_page_accessed",{error_code:s,error_message:i(),current_path:n.pathname,referrer:document.referrer||"direct",user_agent:navigator.userAgent,timestamp:(new Date).toISOString()})},[s,a,n.pathname]);const i=()=>{switch(s){case 404:return"The page you're looking for doesn't exist or has been moved.";case 403:return"You don't have permission to access this page.";case 500:return"Something went wrong on our end. Please try again later.";default:return"An unexpected error occurred."}};return(0,zc.jsx)("div",{className:"min-h-screen flex flex-col items-center justify-center bg-background p-4",children:(0,zc.jsxs)("div",{className:"w-full max-w-2xl space-y-8 text-center",children:[(0,zc.jsx)("div",{className:"flex items-center justify-center mb-8",children:(0,zc.jsx)(Hb,{className:"h-16 w-16 text-destructive"})}),(0,zc.jsxs)("h1",{className:"text-4xl font-bold",children:["Error ",s]}),(0,zc.jsx)("p",{className:"text-xl text-muted-foreground",children:i()}),(0,zc.jsx)("div",{className:"flex justify-center my-12",children:(0,zc.jsx)("img",{src:"/branding/TriEvents_Logo.png",alt:"TriEvents Logo",className:"w-64 h-auto"})}),(0,zc.jsxs)(fg,{onClick:()=>r("/auth"),className:"gap-2 text-base px-6 py-2",size:"lg",children:[(0,zc.jsx)(zb,{className:"h-5 w-5"}),"Return Home"]})]})})},Wb=e=>{let t=e.loading,n=void 0===t||t,r=e.children;return(0,zc.jsx)(Bc,{isLoading:n,children:r})},qb=t=>{let n=t.children,r=t.className,a=void 0===r?"":r,s=t.maxHeight,i=void 0===s?"max-h-48":s;const o=(0,e.useRef)(null),c=l((0,e.useState)(!1),2),u=c[0],d=c[1];return(0,e.useEffect)(()=>{const e=()=>{if(o.current){const e=o.current,t=e.scrollHeight,n=e.clientHeight;d(t>n)}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n]),(0,zc.jsx)("div",{className:"".concat(u?"border border-gray-200 rounded-md p-3":""," ").concat(a),children:(0,zc.jsx)("div",{ref:o,className:"whitespace-pre-line break-words ".concat(i," overflow-y-auto"),children:n})})};var Vb=e.forwardRef((e,t)=>(0,zc.jsx)(ad.label,Gc(Gc({},e),{},{ref:t,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null===(n=e.onMouseDown)||void 0===n||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));Vb.displayName="Label";var $b=Vb;const Gb=["className"],Yb=lg("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Kb=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Gb);return(0,zc.jsx)($b,Gc({ref:t,className:Zm(Yb(),n)},r))});Kb.displayName=$b.displayName;const Zb=["className"],Jb=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Zb);return(0,zc.jsx)("textarea",Gc({className:Zm("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
2ing-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",n),ref:t},r))});function Xb(t){const n=e.useRef({value:t,previous:t});return e.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}Jb.displayName="Textarea";const Qb=["__scopeCheckbox","onKeyDown","onClick"],ew=["__scopeCheckbox","name","checked","defaultChecked","required","disabled","value","onCheckedChange","form"],tw=["__scopeCheckbox","forceMount"],nw=["__scopeCheckbox"];var rw="Checkbox",aw=l(Gu(rw),2),sw=aw[0],iw=(aw[1],l(sw(rw),2)),ow=iw[0],lw=iw[1];function cw(t){const n=t.__scopeCheckbox,r=t.checked,a=t.children,s=t.defaultChecked,i=t.disabled,o=t.form,c=t.name,u=t.onCheckedChange,d=t.required,f=t.value,h=void 0===f?"on":f,p=t.internal_do_not_use_render,m=l(Jh({prop:r,defaultProp:null!==s&&void 0!==s&&s,onChange:u,caller:rw}),2),g=m[0],v=m[1],x=l(e.useState(null),2),y=x[0],b=x[1],w=l(e.useState(null),2),_=w[0],k=w[1],j=e.useRef(!1),N=!y||(!!o||!!y.closest("form")),S={checked:g,disabled:i,setChecked:v,control:y,setControl:b,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:j,required:d,defaultChecked:!xw(s)&&s,isFormControl:N,bubbleInput:_,setBubbleInput:k};return(0,zc.jsx)(ow,Gc(Gc({scope:n},S),{},{children:vw(p)?p(S):a}))}var uw="CheckboxTrigger",dw=e.forwardRef((t,n)=>{let r=t.__scopeCheckbox,a=t.onKeyDown,s=t.onClick,i=Yc(t,Qb);const o=lw(uw,r),l=o.control,c=o.value,u=o.disabled,d=o.checked,f=o.required,h=o.setControl,p=o.setChecked,m=o.hasConsumerStoppedPropagationRef,g=o.isFormControl,v=o.bubbleInput,x=qu(n,h),y=e.useRef(d);return e.useEffect(()=>{const e=null===l||void 0===l?void 0:l.form;if(e){const t=()=>p(y.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[l,p]),(0,zc.jsx)(ad.button,Gc(Gc({type:"button",role:"checkbox","aria-checked":xw(d)?"mixed":d,"aria-required":f,"data-state":yw(d),"data-disabled":u?"":void 0,disabled:u,value:c},i),{},{ref:x,onKeyDown:zu(a,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:zu(s,e=>{p(e=>!!xw(e)||!e),v&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})}))});dw.displayName=uw;var fw=e.forwardRef((e,t)=>{const n=e.__scopeCheckbox,r=e.name,a=e.checked,s=e.defaultChecked,i=e.required,o=e.disabled,l=e.value,c=e.onCheckedChange,u=e.form,d=Yc(e,ew);return(0,zc.jsx)(cw,{__scopeCheckbox:n,checked:a,defaultChecked:s,disabled:o,required:i,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:e=>{let r=e.isFormControl;return(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(dw,Gc(Gc({},d),{},{ref:t,__scopeCheckbox:n})),r&&(0,zc.jsx)(gw,{__scopeCheckbox:n})]})}})});fw.displayName=rw;var hw="CheckboxIndicator",pw=e.forwardRef((e,t)=>{const n=e.__scopeCheckbox,r=e.forceMount,a=Yc(e,tw),s=lw(hw,n);return(0,zc.jsx)(Yh,{present:r||xw(s.checked)||!0===s.checked,children:(0,zc.jsx)(ad.span,Gc(Gc({"data-state":yw(s.checked),"data-disabled":s.disabled?"":void 0},a),{},{ref:t,style:Gc({pointerEvents:"none"},e.style)}))})});pw.displayName=hw;var mw="CheckboxBubbleInput",gw=e.forwardRef((t,n)=>{let r=t.__scopeCheckbox,a=Yc(t,nw);const s=lw(mw,r),i=s.control,o=s.hasConsumerStoppedPropagationRef,l=s.checked,c=s.defaultChecked,u=s.required,d=s.disabled,f=s.name,h=s.value,p=s.form,m=s.bubbleInput,g=qu(n,s.setBubbleInput),v=Xb(l),x=vh(i);e.useEffect(()=>{const e=m;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,r=!o.current;if(v!==l&&n){const t=new Event("click",{bubbles:r});e.indeterminate=xw(l),n.call(e,!xw(l)&&l),e.dispatchEvent(t)}},[m,v,l,o]);const y=e.useRef(!xw(l)&&l);return(0,zc.jsx)(ad.input,Gc(Gc({type:"checkbox","aria-hidden":!0,defaultChecked:null!==c&&void 0!==c?c:y.current,required:u,disabled:d,name:f,value:h,form:p},a),{},{tabIndex:-1,ref:g,style:Gc(Gc(Gc({},a.style),x),{},{position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"})}))});function vw(e){return"function"===typeof e}function xw(e){return"indeterminate"===e}function yw(e){return xw(e)?"indeterminate":e?"checked":"unchecked"}gw.displayName=mw;const bw=Iu("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),ww=["className"],_w=e.forwardRef((e,t)=>
2{let n=e.className,r=Yc(e,ww);return(0,zc.jsx)(fw,Gc(Gc({ref:t,className:Zm("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n)},r),{},{children:(0,zc.jsx)(pw,{className:Zm("flex items-center justify-center text-current"),children:(0,zc.jsx)(bw,{className:"h-4 w-4"})})}))});_w.displayName=fw.displayName;const kw=["className","variant"],jw=lg("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 Nw(e){let t=e.className,n=e.variant,r=Yc(e,kw);return(0,zc.jsx)("div",Gc({className:Zm(jw({variant:n}),t)},r))}const Sw=["className","variant"],Cw=["className"],Ew=["className"],Tw=lg("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Iw=e.forwardRef((e,t)=>{let n=e.className,r=e.variant,a=Yc(e,Sw);return(0,zc.jsx)("div",Gc({ref:t,role:"alert",className:Zm(Tw({variant:r}),n)},a))});Iw.displayName="Alert";const Pw=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Cw);return(0,zc.jsx)("h5",Gc({ref:t,className:Zm("mb-1 font-medium leading-none tracking-tight",n)},r))});Pw.displayName="AlertTitle";const Rw=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Ew);return(0,zc.jsx)("div",Gc({ref:t,className:Zm("text-sm [&_p]:leading-relaxed",n)},r))});Rw.displayName="AlertDescription";const Ow=["className"],Aw=["className","children"],Dw=["className"],Mw=["className"],Fw=["className"],Lw=["className"],Uw=Nx,Hw=Sx,zw=Cx,Bw=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Ow);return(0,zc.jsx)(Ex,Gc({ref:t,className:Zm("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",n)},r))});Bw.displayName=Ex.displayName;const Ww=e.forwardRef((e,t)=>{let n=e.className,r=e.children,a=Yc(e,Aw);return(0,zc.jsxs)(zw,{children:[(0,zc.jsx)(Bw,{}),(0,zc.jsxs)(Tx,Gc(Gc({ref:t,className:Zm("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",n)},a),{},{children:[r,(0,zc.jsxs)(Rx,{className:"absolute right-4 top-4 roun
2ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,zc.jsx)(Ox,{className:"h-4 w-4"}),(0,zc.jsx)("span",{className:"sr-only",children:"Close"})]})]}))]})});Ww.displayName=Tx.displayName;const qw=e=>{let t=e.className,n=Yc(e,Dw);return(0,zc.jsx)("div",Gc({className:Zm("flex flex-col space-y-1.5 text-center sm:text-left",t)},n))};qw.displayName="DialogHeader";const Vw=e=>{let t=e.className,n=Yc(e,Mw);return(0,zc.jsx)("div",Gc({className:Zm("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},n))};Vw.displayName="DialogFooter";const $w=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Fw);return(0,zc.jsx)(Ix,Gc({ref:t,className:Zm("text-lg font-semibold leading-none tracking-tight",n)},r))});$w.displayName=Ix.displayName;const Gw=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,Lw);return(0,zc.jsx)(Px,Gc({ref:t,className:Zm("text-sm text-muted-foreground",n)},r))});Gw.displayName=Px.displayName;const Yw=Iu("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Kw=async(e,t)=>{const n=await fetch("".concat("https://api.trievents.ca","/stripe-connect/create-checkout-session"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({priceId:e,metadata:t})});if(!n.ok){const e=await n.json();throw new Error(e.error||"HTTP error! status: ".concat(n.status))}return n.json()},Zw=async e=>{const t=await fetch("".concat("https://api.trievents.ca","/tickets/get-tickets-left-for-price/").concat(e),{credentials:"include",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error("Failed to fetch tickets available for price");return t.json()},Jw=async e=>await Promise.all(e.map(async e=>{try{const t=await Zw(e.uuid);return Gc(Gc({},e),{},{tickets_available:t||0})}catch(t){return console.error("Error fetching tickets available:",t),Gc(Gc({},e),{},{tickets_available:0})}}));async function Xw(e){const t=await fetch("".concat("https://api.trievents.ca","/events/event/").concat(e));if(!t.ok)throw new Error("Failed to fetch event details");return t.json()}async function Qw(e){const t=await fetch("".concat("https://api.trievents.ca","/prices/event/").concat(e),{credentials:"include",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error("Failed to fetch prices for event");return t.json()}const e_=(t,n)=>{const r=l((0,e.useState)(null),2),a=r[0],s=r[1],i=l((0,e.useState)([]),2),o=i[0],c=i[1],u=l((0,e.useState)(0),2),d=u[0],f=u[1],h=l((0,e.useState)(!0),2),p=h[0],m=h[1];return(0,e.useEffect)(()=>{if(!t)return;(async()=>{try{const e=l(await Promise.all([Xw(t),Qw(t)]),2),n=e[0],r=e[1];s(n);const a=await Jw(r);c(a);const i=a.reduce((e,t)=>e+(t.tickets_available||0),0);f(i),setTimeout(()=>m(!1),1e3)}catch(e){console.error("Error fetching data:",e),n("/error",{state:{errorCode:e instanceof Error?e.message:"Unknown error"}})}})()},[t,n]),{event:a,prices:o,eventTicketsLeft:d,loading:p}},t_=(t,n,r)=>{const a=l((0,e.useState)(!1),2),s=a[0],i=a[1],o=l((0,e.useState)(""),2),c=o[0],u=o[1],d=l((0,e.useState)(""),2),f=d[0],h=d[1],p=l((0,e.useState)(null),2),m=p[0],g=p[1],v=l((0,e.useState)(""),2),x=v[0],y=v[1];return{requestBursary:s,setRequestBursary:i,bursaryMessage:c,setBursaryMessage:u,bursaryAmount:f,bursaryError:x,setBursaryError:y,selectedBursaryOption:m,handleBursaryAmountChange:e=>{const t=e.target.value;if(h(t),t&&r){const e=n.find(e=>e.stripe_price_id===r);if(e){const n=e.unit_amount/100,r=parseFloat(t);y(r>n?"Bursary amount cannot exceed ticket price ($".concat(n,")"):r<0?"Bursary amount cannot be negative":"")}}else y("")},handleBursaryOptionSelect:e=>{if(r){const t=n.find(e=>e.stripe_price_id===r);if(t){const n=t.unit_amount/100;if(e.amount>n)return void y("Bursary amount cannot exceed ticket price ($".concat(n,")"))}}g(e),h(e.amount.toString()),y("")},handleBursaryMessageChange:e=>{const t=e.target.value;u(t),x&&x.includes("bursary request")&&y("")},resetBursaryState:()=>{h(""),u(""),g(null),y("")}}};const n_=()=>{const t=l((0,e.useState)(""),2),n=t[0],r=t[1],a=(0,e.useCallback)(e=>e&&""!==e.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:"Please enter a valid email address":"Email is required",[]),s=(0,e.useCallback)(()=>{r("")},[]);return{emailError:n,validateEmail:a,setEmailError:r,clearEmailError:s}},r_=()=>{const t=l((0,e.useState)(""),2),n=t[0],r=t[1],a=(0,e.useCallback)(e=>{const t=e.replace(/\D/g,"");return e&&""!==e.trim()?t.length<10?"Please enter a valid phone number (at least 10 digits)":t.length>15?"Phone number appears to be too long":null:"Phone number is required"},[]),s=(0,e.useCallback)(e=>e.replace(/[^\d\s\-+()]/g,""),[]),i=(0,e.useCallback)(()=>{r("")},[]);return{phoneError:n,validatePhone:a,filterPhoneInput:s,setPhoneError:r,clearPhoneError:i}},a_=()=>{const t=il().uuid,n=sl(),r=Qi(),a=e_(t,n),s=a.event,i=a.prices,o=a.eventTicketsLeft,c=a.loading,u=l((0,e.useState)(""),2),d=u[0],f=u[1],h=l((0,e.useState)(""),2),p=h[0],m=h[1],g=l((0,e.useState)(""),2),v=g[0],x=g[1],y=l((0,e.useState)(""),2),b=y[0],w=y[1],_=l((0,e.useState)(!1),2),k=_[0],j=_[1],N=l((0,e.useState)(!1),2),S=N[0],C=N[1];(0,e.useEffect)(()=>{s&&r&&!c&&r.capture("event_page_viewed",{event_name:s.title,event_uuid:s.uuid,organization_uuid:s.org_uuid,ticket_prices_available:i.length,event_date:s.date,event_location:s.location,tickets_remaining:o})},[s,r,c,i.length,o]);const E=t_(0,i,d),T=E.requestBursary,I=E.setRequestBursary,P=E.bursaryMessage,R=(E.setBursaryMessage,E.bursaryAmount),O=E.bursaryError,A=E.setBursaryError,D=E.selectedBursaryOption,M=E.handleBursaryAmountChange,F=E.handleBursaryOptionSelect,L=E.handleBursaryMessageChange,U=E.resetBursaryState,H=n_(),z=H.emailError,B=H.validateEmail,W=H.setEmailError,q=H.clearEmailError,V=r_(),$=V.phoneError,G=V.validatePhone,Y=V.filterPhoneInput,K=V.setPhoneError,Z=V.clearPhoneError;return!s||c?(0,zc.jsx)(Wb,{}):s.ticket_sales_active?(0,zc.jsxs)("div",{className:"relative min-h-screen bg-gradient-to-br from-blue-50 via-white to-teal-50 overflow-x-hidden",children:[(0,zc.jsx)(xb,{children:(0,zc.jsxs)(Nb,{children:[(0,zc.jsx)("title",{children:s.title}),(0,zc.jsx)("meta",{name:"description",content:s.description,"data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"og:type",content:"website","data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"og:title",content:s.title,"data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"og:description",content:s.description,"data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"og:image",content:"","data-react-helmet":"true"}
2),(0,zc.jsx)("meta",{property:"og:image:width",content:"1200","data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"og:image:height",content:"630","data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"twitter:card",content:"summary_large_image","data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"twitter:title",content:s.title,"data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"twitter:description",content:s.description,"data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"twitter:image",content:"","data-react-helmet":"true"})]})}),(0,zc.jsxs)("div",{className:"container mx-auto px-4 md:px-8 lg:px-12 pt-6 md:pt-24 pb-8 relative z-10",children:[(0,zc.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_2.5fr] gap-8 xl:gap-20 min-h-[80vh]",children:[(0,zc.jsxs)("div",{className:"flex flex-col",children:[(0,zc.jsxs)(Rb,{className:"w-full shadow-xl border-0 bg-white/90 backdrop-blur-md p-0",children:[(0,zc.jsx)(Ob,{className:"p-0",children:(0,zc.jsx)("div",{className:"relative h-64 w-full flex items-center justify-center bg-gradient-to-tr from-blue-100 via-blue-50 to-teal-100 rounded-t-2xl overflow-hidden",children:(0,zc.jsx)("div",{className:"flex flex-col items-center justify-center w-full h-full",children:(0,zc.jsx)("div",{className:"rounded-full bg-blue-200/60 w-24 h-24 flex items-center justify-center mb-2 shadow-md",children:(0,zc.jsx)("span",{className:"text-5xl text-blue-400 font-bold",children:"\ud83c\udfab"})})})})}),(0,zc.jsx)(Mb,{className:"pt-4 px-6 pb-0",children:(0,zc.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,zc.jsx)(Ab,{className:"text-2xl font-bold text-blue-900 mb-1",children:s.title}),(0,zc.jsx)(qb,{className:"mb-4",children:(0,zc.jsx)(Db,{className:"text-base text-gray-700 mb-2",children:s.description})}),(0,zc.jsxs)("div",{className:"flex flex-wrap gap-2 text-sm text-blue-800 mb-2",children:[(0,zc.jsx)(Nw,{variant:"outline",className:"bg-blue-100 text-blue-700 border-blue-200",children:(()=>{const e=l(s.date.split("T")[0].split("-"),3),t=e[0],n=e[1],r=e[2];return new Date(parseInt(t),parseInt(n)-1,parseInt(r)).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})()}),(0,zc.jsxs)(Nw,{variant:"outline",className:"bg-blue-100 text-blue-700 border-blue-200",children:[new Date("2000-01-01T".concat(s.time_start)).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})," - ",new Date("2000-01-01T".concat(s.time_end)).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]}),(0,zc.jsx)(Nw,{variant:"outline",className:"bg-blue-100 text-blue-700 border-blue-200",children:s.location})]}),(0,zc.jsxs)("div",{className:"flex flex-col gap-1 text-sm text-gray-500",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"whitespace-nowrap",children:"Contact Email:"}),(0,zc.jsx)("a",{href:"mailto:".concat(s.contact_email),className:"text-blue-600 hover:text-teal-600 font-medium underline underline-offset-2 truncate",title:s.contact_email,children:s.contact_email})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"whitespace-nowrap",children:"Contact Phone:"}),(0,zc.jsx)("a",{href:"tel:".concat(s.contact_number),className:"text-blue-600 hover:text-teal-600 font-medium underline underline-offset-2 truncate",title:s.contact_number,children:s.contact_number})]})]})]})}),(0,zc.jsxs)(Fb,{className:"flex flex-col items-center w-full pt-0",children:[(0,zc.jsx)(wg,{className:"my-4 w-full"}),(0,zc.jsxs)("div",{className:"flex items-center justify-between w-full px-6",children:[(0,zc.jsx)("div",{className:"flex items-center space-x-2",children:(0,zc.jsxs)(Nw,{variant:"secondary",className:"bg-blue-100 text-blue-700 border-0",children:[o," tickets left"]})}),(0,zc.jsx)("a",{href:"mailto:".concat(s.contact_email),className:"text-sm text-blue-600 hover:text-teal-600 font-semibold",children:"Contact Support"})]}),(0,zc.jsxs)("div",{className:"flex flex-col items-center mt-4 text-xs text-gray-400 w-full",children:[(0,zc.jsx)("img",{src:"/branding/TriEvents_Logo.png",alt:"TriEvents",className:"h-6 mb-1"}),(0,zc.jsx)("span",{children:"Secure checkout powered by Stripe"})]})]})]}),(0,zc.jsxs)("div",{className:"hidden lg:flex mt-12 flex-col items-center gap-6 text-center text-gray-500",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-3",children:[(0,zc.jsx)("div",{className:"h-px w-24 bg-gradient-to-r from-transparent via-gray-300 to-transparent"}),(0,zc.jsx)("span",{className:"text-base font-medium",children:"Platform Support"}),(0,zc.jsx)("div",{className:"h-px w-24 bg-gradient-to-r from-transparent via-gray-300 to-transparent"})]}),(0,zc.jsxs)("div",{className:"flex flex-col items-center gap-3 text-sm",children:[(0,zc.jsx)("p",{className:"text-gray-600",children:"Having trouble with our platform?"}),(0,zc.jsx)("p",{className:"text-gray-500",children:"Contact Tricode Cloud Support"}),(0,zc.jsx)("a",{href:"mailto:[email protected]",className:"text-blue-600 hover:text-teal-600 transition-colors",children:"[email protected]"})]})]})]}),(0,zc.jsx)("div",{className:"flex flex-col",children:(0,zc.jsxs)(Rb,{className:"w-full shadow-lg border-0",children:[(0,zc.jsxs)(Ob,{className:"mb-0",children:[(0,zc.jsx)(Ab,{className:"text-blue-900",children:"Event Registration"}),(0,zc.jsx)(Db,{children:"Please enter the name and email of the person attending the event."})]}),(0,zc.jsxs)(Mb,{className:"pt-0",children:[(0,zc.jsxs)("div",{className:"space-y-4 mt
2-0",children:[(0,zc.jsx)(Kb,{className:"text-blue-800",children:"Select Ticket Type"}),(0,zc.jsx)("div",{className:"space-y-3",children:i.map((e,t)=>(0,zc.jsx)(Rb,{className:Zm("transition-all border-2 border-transparent bg-blue-50/40 shadow-sm hover:shadow-md hover:bg-blue-100/60 cursor-pointer",d===e.stripe_price_id&&"border-blue-500 bg-blue-100/80 shadow-md",0===e.tickets_available&&"cursor-not-allowed hover:shadow-sm hover:bg-blue-50/40",t===i.length-1&&"mb-4"),onClick:()=>e.tickets_available>0&&(e=>{if(f(e),r&&s){const t=i.find(t=>t.stripe_price_id===e);r.capture("ticket_type_selected",{event_name:s.title,event_uuid:s.uuid,organization_uuid:s.org_uuid,ticket_type:(null===t||void 0===t?void 0:t.nickname)||"Unknown",ticket_price:t?t.unit_amount/100:0})}T&&U()})(e.stripe_price_id),children:(0,zc.jsx)(Mb,{className:"p-4",children:(0,zc.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zc.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,zc.jsx)(Yw,{className:Zm("h-5 w-5 flex-shrink-0",d===e.stripe_price_id?"fill-blue-600 text-blue-600":"text-gray-400",0===e.tickets_available&&"text-gray-300")}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("p",{className:Zm("font-medium text-blue-900",0===e.tickets_available&&"line-through text-gray-600"),children:e.nickname}),(0,zc.jsx)("p",{className:"text-sm text-gray-500",children:e.description})]})]}),(0,zc.jsxs)("div",{className:"text-right",children:[(0,zc.jsxs)("p",{className:Zm("font-bold text-blue-800",0===e.tickets_available&&"text-gray-600"),children:["$",(e.unit_amount/100).toFixed(2)]}),e.tickets_available>0?(0,zc.jsxs)(Nw,{variant:"secondary",className:"bg-blue-100 text-blue-700 border-0 whitespace-nowrap",children:[e.tickets_available," available"]}):(0,zc.jsx)(Nw,{variant:"destructive",className:"bg-red-100 text-red-600 border-0 font-medium whitespace-nowrap",children:"Sold Out"})]})]})})},e.stripe_price_id))})]}),(0,zc.jsx)("div",{className:"mt-8 mb-6",children:(0,zc.jsx)(wg,{})}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"name",className:"text-blue-800",children:"Name"}),(0,zc.jsx)(pg,{id:"name",placeholder:"Alan Turing",value:v,onChange:e=>x(e.target.value)})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"email",className:"text-blue-800",children:"Email"}),(0,zc.jsx)(pg,{id:"email",type:"email",placeholder:"[email protected]",value:p,onChange:e=>{const t=e.target.value;if(m(t),t){const e=B(t);W(e||"")}else q()},className:Zm(z&&"border-red-500")}),z&&(0,zc.jsx)("p",{className:"text-sm text-red-500",children:z})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"phone",className:"text-blue-800",children:"Phone Number"}),(0,zc.jsx)(pg,{id:"phone",type:"tel",placeholder:"441-908-6404",value:b,onChange:e=>{const t=Y(e.target.value);if(w(t),t){const e=G(t);K(e||"")}else Z()},className:Zm($&&"border-red-500"),required:!0}),$&&(0,zc.jsx)("p",{className:"text-sm text-red-500",children:$})]}),s.bursary_enabled&&(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(wg,{}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)(_w,{id:"bursary",checked:T,onCheckedChange:e=>{I(e),e||U()},className:"border border-blue-300 bg-white ring-1 ring-blue-200 focus:ring-2 focus:ring-blue-400 data-[state=checked]:bg-blue-600 data-[state=checked]:border-blue-500 data-[state=checked]:ring-blue-400"}),(0,zc.jsx)(Kb,{htmlFor:"bursary",className:"text-blue-800 select-none cursor-pointer",children:"Request financial assistance (bursary)"})]}),T&&(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsx)(Iw,{className:"bg-blue-50 border-blue-200 text-blue-800",children:(0,zc.jsxs)(Rw,{children:[(0,zc.jsx)("strong",{children:"Important:"})," You will pay the full ticket price and will be refunded the bursary amount if your request is accepted. If you have any questions, please contact the event organizer."]})}),"fixed"===s.bursary_type&&s.bursary_options&&(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{className:"text-blue-800",htmlFor:"bursaryOptionSelect",children:"Select Bursary Option"}),(0,zc.jsxs)("select",{id:"bursaryOptionSelect",className:"block w-full rounded-lg border border-blue-300 px-4 py-2 text-base focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-blue-500",value:(null===D||void 0===D?void 0:D.amount.toString())||"",onChange:e=>{var t;const n=e.target.value;if(!n)return void U();const r=null===(t=s.bursary_options)||void 0===t?void 0:t.find(e=>e.amount.toString()===n);r&&F(r)},children:[(0,zc.jsx)("option",{value:"",children:"Select an option"}),s.bursary_options.map((e,t)=>{const n=i.find(e=>e.stripe_price_id===d),r=n?n.unit_amount/100:null,a=null!==r&&e.amount>r;return(0,zc.jsxs)("option",{value:e.amount,disabled:a,children:["$",e.amount," - ",e.description,a?" (Exceeds ticket price of $".concat(r,")"):""]},t)}
2)]})]}),"custom"===s.bursary_type&&(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"bursaryAmount",className:"text-blue-800",children:"Bursary Amount (CAD)"}),(0,zc.jsx)(pg,{id:"bursaryAmount",type:"number",placeholder:"0.00",value:R,onChange:M,min:"0",step:"0.01",className:Zm(O&&"border-red-500")})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"bursaryMessage",className:"text-blue-800",children:"Why do you need a bursary?"}),(0,zc.jsx)(Jb,{id:"bursaryMessage",placeholder:"Please explain why you need a bursary...",value:P,onChange:L,className:"h-24 resize-none",maxLength:500}),(0,zc.jsx)("div",{className:"flex justify-between items-center mt-1",children:(0,zc.jsxs)("p",{className:"text-muted-foreground text-sm",children:[500-P.length," characters remaining"]})})]}),O&&(0,zc.jsx)("p",{className:"text-sm text-red-500",children:O})]})]})]})]})]}),(0,zc.jsx)(Fb,{children:(0,zc.jsx)("div",{className:"w-full space-y-3",children:(0,zc.jsx)(fg,{className:"w-full bg-[#23d6e4] hover:bg-[#11c4d1] text-white text-lg font-semibold shadow-md border-0",size:"lg",onClick:async()=>{if(!s||!t)return;const e=B(p);if(e)return void W(e);const n=G(b);if(n)K(n);else if(!T||!O){if(T){if("fixed"===s.bursary_type&&!D)return void A("Please select a bursary option");if(!P.trim())return void A("Please provide a reason for your bursary request")}setTimeout(()=>{j(!0)},150)}},disabled:!d||!v||!p||!b||!!z||!!$||T&&(!R||!P||!!O),children:"Continue to Payment"})})})]})})]}),(0,zc.jsxs)("div",{className:"lg:hidden mt-12 flex flex-col items-center gap-6 text-center text-gray-500",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-3",children:[(0,zc.jsx)("div",{className:"h-px w-24 bg-gradient-to-r from-transparent via-gray-300 to-transparent"}),(0,zc.jsx)("span",{className:"text-base font-medium",children:"Platform Support"}),(0,zc.jsx)("div",{className:"h-px w-24 bg-gradient-to-r from-transparent via-gray-300 to-transparent"})]}),(0,zc.jsxs)("div",{className:"flex flex-col items-center gap-3 text-sm",children:[(0,zc.jsx)("p",{className:"text-gray-600",children:"Having trouble with our platform?"}),(0,zc.jsx)("p",{className:"text-gray-500",children:"Contact Tricode Cloud Support"}),(0,zc.jsx)("a",{href:"mailto:[email protected]",className:"text-blue-600 hover:text-teal-600 transition-colors",children:"[email protected]"})]})]})]}),(0,zc.jsx)("div",{className:"mt-16 md:mt-24",children:(0,zc.jsx)(Lb,{})}),(0,zc.jsx)(Uw,{open:k,onOpenChange:j,children:(0,zc.jsxs)(Ww,{className:"sm:max-w-md",children:[(0,zc.jsxs)(qw,{children:[(0,zc.jsx)($w,{children:"Terms of Service & Privacy Policy"}),(0,zc.jsx)(Gw,{children:"Before proceeding to payment, please review and agree to our terms."})]}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"text-sm text-gray-600 space-y-2",children:[(0,zc.jsxs)("p",{children:["By proceeding with this purchase, you agree to our"," ",(0,zc.jsx)("a",{href:"https://tricode.cloud/trievents/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Terms of Service"})," ","and"," ",(0,zc.jsx)("a",{href:"https://tricode.cloud/trievents/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Privacy Policy"}),"."]}),(0,zc.jsx)("p",{children:"Your personal information will be used to process your ticket purchase and may be shared with the event organizer for event management purposes."})]}),(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)(_w,{id:"agree-terms",checked:S,onCheckedChange:e=>C(e),className:"h-5 w-5 border-2 data-[state=checked]:bg-black data-[state=checked]:border-black"}),(0,zc.jsx)(Kb,{htmlFor:"agree-terms",className:"text-sm",children:"I agree to the Terms of Service and Privacy Policy"})]})]}),(0,zc.jsxs)(Vw,{className:"flex flex-col sm:flex-row gap-3 sm:gap-0",children:[(0,zc.jsx)(fg,{onClick:async()=>{if(S){if(s&&t)try{const e=i.find(e=>e.stripe_price_id===d);if(!e)return void alert("Selected ticket type not found. Please try again.");if(await Zw(e.uuid)<=0)return void alert("Sorry, this ticket type is no longer available. Please refresh the page to see current availability.");const n={event_uuid:t,organization_uuid:s.org_uuid,stripe_product_id:s.stripe_product_id,stripe_price_id:d,ticket_name:v,ticket_email:p,ticket_phone:b,request_bursary:!!T||void 0,bursary_amount:T?Math.round(100*parseFloat(R)):null,bursary_message:T?P:null},a=await Kw(d,n);if(r&&s){const e=i.find(e=>e.stripe_price_id===d);r.capture("checkout_initiated",{event_name:s.title,event_uuid:s.uuid,organization_uuid:s.org_uuid,ticket_type:(null===e||void 0===e?void 0:e.nickname)||"Unknown",ticket_price:e?e.unit_amount/100:0,request_bursary:T,bursary_amount:T?parseFloat(R):null})}a.url?window.location.href=a.url:alert("There was an error redirecting to the checkout page. Please try again.")}catch(e){alert("Error: ".concat(e instanceof Error?e.message:"There was an error creating the checkout session. Please try again."))}}else alert("Please agree to the Terms of Service and Privacy Policy to continue.")},disabled:!S,className:"w-full sm:w-auto transition-transform duration-200 hover:scale-105",children:"Proceed to Payment"}),(0,zc.jsx)(fg,{variant:"outline",onClick:()=>j(!1),className:"w-full sm:w-auto transition-transform duration-200 hover:scale-105",children:"Cancel"})]})]})})]}):(0,zc.jsx)("div",{className:"relative min-h-screen bg-gradient-to-br from-blue-50 via-white to-teal-50 overflow-x-hidden flex items-center justify-center",children:(0,zc.jsx)("div",{className:"container mx-auto px-4 py-12 relative z-10",children:(0,zc.jsxs)(Rb,{className:"w-full max-w-2xl mx-auto 
2shadow-2xl border-0 bg-white/95 backdrop-blur-md",children:[(0,zc.jsxs)(Ob,{className:"text-center space-y-6 py-12",children:[(0,zc.jsx)("div",{className:"flex justify-center mb-4",children:(0,zc.jsx)("img",{src:"/branding/TriEvents_Logo.png",alt:"TriEvents",className:"h-8 md:h-12"})}),(0,zc.jsx)(Ab,{className:"text-3xl font-bold text-blue-900",children:"Ticket Sales Disabled"}),(0,zc.jsx)(Db,{className:"text-lg text-gray-600",children:"Ticket sales for this event are currently not available."})]}),(0,zc.jsx)(Mb,{className:"px-8 pb-8",children:(0,zc.jsx)(Iw,{variant:"destructive",className:"text-center relative py-8",children:(0,zc.jsx)(Rw,{className:"text-center text-base",children:"The event organizer has temporarily disabled ticket sales for this event. This does not affect tickets that have already been purchased."})})}),(0,zc.jsxs)(Fb,{className:"flex flex-col items-center gap-6 pb-12",children:[(0,zc.jsx)("div",{className:"text-sm text-gray-500 text-center w-full",children:"Need assistance? Contact the event organizer:"}),(0,zc.jsxs)("div",{className:"flex flex-col items-center gap-3 text-sm",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"text-gray-600 font-medium",children:"Email:"}),(0,zc.jsx)("a",{href:"mailto:".concat(s.contact_email),className:"text-blue-600 hover:text-teal-600 font-medium",children:s.contact_email})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"text-gray-600 font-medium",children:"Phone:"}),(0,zc.jsx)("a",{href:"tel:".concat(s.contact_number),className:"text-blue-600 hover:text-teal-600 font-medium",children:s.contact_number})]})]})]})]})})})},s_=Iu("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),i_=()=>{const e=rl(),t=new URLSearchParams(e.search).get("session_id");ku();return t?(0,zc.jsxs)("div",{className:"relative min-h-screen bg-gradient-to-br from-blue-50 via-white to-teal-50 overflow-x-hidden",children:[(0,zc.jsx)("div",{className:"container mx-auto px-4 md:px-8 lg:px-12 pt-12 md:pt-32 pb-8 relative z-10",children:(0,zc.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,zc.jsxs)(Rb,{className:"w-full shadow-xl border-0 bg-white/90 backdrop-blur-md",children:[(0,zc.jsxs)(Ob,{className:"text-center pb-0",children:[(0,zc.jsx)("div",{className:"flex justify-center mb-4",children:(0,zc.jsx)("div",{className:"rounded-full bg-green-100 p-3",children:(0,zc.jsx)(s_,{className:"h-12 w-12 text-green-600"})})}),(0,zc.jsx)(Ab,{className:"text-3xl font-bold text-blue-900",children:"Checkout Complete!"}),(0,zc.jsx)(Db,{className:"text-lg text-gray-600 mt-2",children:"Your ticket has been successfully purchased."})]}),(0,zc.jsx)(Mb,{className:"pt-6",children:(0,zc.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,zc.jsxs)(Nw,{variant:"secondary",className:"bg-blue-100 text-blue-700 border-0 break-all text-center px-4 py-2",children:["Session ID: ",t]}),(0,zc.jsx)("p",{className:"text-sm text-gray-500 text-center",children:"You will receive your ticket and receipt via email soon."}),(0,zc.jsx)("p",{className:"text-sm text-gray-500 text-center",children:"If you have any questions about your purchase, please contact the event organizer."})]})}),(0,zc.jsxs)(Fb,{className:"flex flex-col items-center w-full pt-0",children:[(0,zc.jsx)(wg,{className:"my-4 w-full"}),(0,zc.jsx)("div",{className:"flex flex-col items-center gap-4 w-full",children:(0,zc.jsxs)("div",{className:"flex flex-col items-center mt-4 text-xs text-gray-400 w-full",children:[(0,zc.jsx)("img",{src:"/branding/TriEvents_Logo.png",alt:"TriEvents",className:"h-6 mb-1"}),(0,zc.jsx)("span",{children:"Secure checkout powered by Stripe"})]})})]})]}),(0,zc.jsxs)("div",{className:"mt-12 flex flex-col items-center gap-6 text-center text-gray-500",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-3",children:[(0,zc.jsx)("div",{className:"h-px w-24 bg-gradient-to-r from-transparent via-gray-300 to-transparent"}),(0,zc.jsx)("span",{className:"text-base font-medium",children:"Platform Support"}),(0,zc.jsx)("div",{className:"h-px w-24 bg-gradient-to-r from-transparent via-gray-300 to-transparent"})]}),(0,zc.jsxs)("div",{className:"flex flex-col items-center gap-3 text-sm",children:[(0,zc.jsx)("p",{className:"text-gray-600",children:"Having trouble with our platform?"}),(0,zc.jsx)("p",{className:"text-gray-500",children:"Contact Tricode Cloud Support"}),(0,zc.jsx)("a",{href:"mailto:[email protected]",className:"text-blue-600 hover:text-teal-600 transition-colors",children:"[email protected]"})]})]})]})}),(0,zc.jsx)("div",{className:"mt-16 md:mt-24",children:(0,zc.jsx)(Lb,{})})]}):(0,zc.jsx)("div",{children:"Loading..."})},o_=Iu("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),l_=t=>{let n=t.eventUuid,r=t.primaryColor,a=t.secondaryColor,s=t.gradientFrom,i=t.gradientTo,o=t.logoUrl,c=t.customDateText,u=t.customLinks,d=void 0===u?[]:u,f=t.customStyles,h=void 0===f?{}:f,p=t.logoSize,m=void 0===p?220:p,g=t.ticketsBadgeClass,v=t.cropLogoToCircle,x=void 0!==v&&v,y=t.logoBorderRadius,b=t.hidePhoneNumber,w=void 0!==b&&b,_=t.customBursaryInstructions,k=t.hideTicketsAvailable,j=void 0!==k&&k,N=t.photos,S=void 0===N?[]:N,C=t.requiredEmailDomain;const E=sl(),T=Qi(),I=e_(n,E),P=I.event,R=I.prices,O=I.eventTicketsLeft,A=I.loading,D=l((0,e.useState)(""),2),M=D[0],F=D[1],L=l((0,e.useState)(""),2),U=L[0],H=L[1],z=l((0,e.useState)(""),2),B=z[0],W=z[1],q=l((0,e.useState)(""),2),V=q[0],$=q[1],G=l((0,e.useState)(!1),2),Y=G[0],K=G[1],Z=l((0,e.useState)(!1),2),J=Z[0],X=Z[1];(0,e.useEffect)(()=>{P&&T&&!A&&T.capture("event_page_viewed",{event_name:P.title,event_uuid:P.uuid,organization_uuid:P.org_uuid,ticket_prices_available:R.length,event_date:P.date,event_location:P.location,tickets_remaining:O})},[P,T,A,R.length,O]);const Q=t_(0,R,M),ee=Q.requestBursary,te=Q.setRequestBursary,ne=Q.bursaryMessage,re=(Q.setBursaryMessage,Q.bursaryAmount),ae=Q.bursaryError,se=Q.setBursaryError,ie=Q.selectedBursaryOption,oe=Q.handleBursaryAmountChange,le=Q.handleBursaryOptionSelect,ce=Q.handleBursaryMessageChange,ue=Q.resetBursaryState,de=n_(),fe=de.emailError,he=de.validateEmail,pe=de.setEmailError,me=de.clearEmailError,ge=r_(),ve=ge.phone
2Error,xe=ge.validatePhone,ye=ge.filterPhoneInput,be=ge.setPhoneError,we=ge.clearPhoneError,_e=h.tagBg||"bg-blue-100 border-blue-200 text-blue-700",ke={height:m,width:m,objectFit:x?"cover":"contain",borderRadius:y||(x?"50%":"0")};return!P||A?(0,zc.jsx)(Wb,{}):P.ticket_sales_active?(0,zc.jsxs)("div",{className:"relative min-h-screen bg-gradient-to-br ".concat(s," ").concat(i," overflow-x-hidden"),children:[(0,zc.jsx)(xb,{children:(0,zc.jsxs)(Nb,{children:[(0,zc.jsx)("title",{children:P.title}),(0,zc.jsx)("meta",{name:"description",content:P.description,"data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"og:type",content:"website","data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"og:title",content:P.title,"data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"og:description",content:P.description,"data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"og:image",content:o,"data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"og:image:width",content:"1200","data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"og:image:height",content:"630","data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"twitter:card",content:"summary_large_image","data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"twitter:title",content:P.title,"data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"twitter:description",content:P.description,"data-react-helmet":"true"}),(0,zc.jsx)("meta",{property:"twitter:image",content:o,"data-react-helmet":"true"})]})}),(0,zc.jsxs)("div",{className:"container mx-auto px-4 md:px-8 lg:px-12 pt-6 md:pt-24 pb-8 relative z-10",children:[(0,zc.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_2.5fr] gap-8 xl:gap-20 min-h-[80vh]",children:[(0,zc.jsxs)("div",{className:"flex flex-col",children:[(0,zc.jsxs)(Rb,{className:Zm("w-full shadow-xl border-0 p-0 bg-white/80 backdrop-blur rounded-2xl",h.cardBg),children:[(0,zc.jsx)(Ob,{className:"p-0 rounded-t-2xl overflow-hidden",style:{height:m+32},children:(0,zc.jsx)("div",{className:Zm("relative w-full flex items-center justify-center rounded-t-2xl overflow-hidden",h.headerBg),style:{height:m+32},children:(0,zc.jsx)("div",{className:"flex flex-col items-center justify-center w-full h-full",children:(0,zc.jsx)("div",{className:"rounded-full flex items-center justify-center shadow-md ".concat(h.headerBg||""),style:{width:m+4,height:m+4},children:(0,zc.jsx)("img",{src:o,alt:P.title,style:ke})})})})}),(0,zc.jsx)(Mb,{className:"pt-4 px-6 pb-0",children:(0,zc.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,zc.jsx)(Ab,{className:"text-2xl font-bold mb-1",style:{color:r},children:P.title}),(0,zc.jsx)(qb,{className:"mb-4",children:(0,zc.jsx)(Db,{className:"text-base text-gray-700",children:P.description})}),(0,zc.jsxs)("div",{className:"flex flex-wrap gap-2 text-sm mb-2",style:{color:a},children:[(0,zc.jsx)(Nw,{variant:"outline",className:_e,children:c||(()=>{const e=l(P.date.split("T")[0].split("-"),3),t=e[0],n=e[1],r=e[2];return new Date(parseInt(t),parseInt(n)-1,parseInt(r)).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})()}),(0,zc.jsx)(Nw,{variant:"outline",className:_e,children:P.location})]}),d.length>0&&(0,zc.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,zc.jsx)("h3",{className:"text-sm font-semibold",style:{color:r},children:"Important Links"}),(0,zc.jsx)("div",{className:"flex flex-wrap gap-2",children:d.map((e,t)=>(0,zc.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm px-3 py-1 rounded-full border transition-all duration-200 hover:scale-105 hover:shadow-md",style:{color:r,borderColor:r,backgroundColor:"".concat(r,"10")},children:e.alias},t))})]}),(0,zc.jsxs)("div",{className:"flex flex-col gap-1 text-sm text-gray-500 mt-4",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"whitespace-nowrap",children:"Contact Email:"}),(0,zc.jsx)("a",{href:"mailto:".concat(P.contact_email),className:"text-blue-600 hover:text-teal-600 font-medium truncate",title:P.contact_email,children:P.contact_email})]}),!w&&(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"whitespace-nowrap",children:"Contact Phone:"}),(0,zc.jsx)("a",{href:"tel:".concat(P.contact_number),className:"text-blue-600 hover:text-teal-600 font-medium truncate",title:P.contact_number,children:P.contact_number})]})]})]})}),(0,zc.jsxs)(Fb,{className:"flex flex-col items-center w-full pt-0",children:[(0,zc.jsx)(wg,{className:"my-4 w-full"}),(0,zc.jsxs)("div",{className:"flex items-center justify-between w-full px-6",children:[(0,zc.jsx)("div",{className:"flex items-center space-x-2",children:!j&&(0,zc.jsxs)(Nw,{variant:"secondary",className:"".concat(g||_e," whitespace-nowrap"),children:[O," tickets left"]})}),(0,zc.jsx)("a",{href:"mailto:".concat(P.contact_email),className:"text-sm font-semibold",style:{color:r},children:"Contact Support"})]}),(0,zc.jsxs)("div",{className:"flex flex-col items-center mt-4 text-xs text-gray-400 w-full",children:[(0,zc.jsx)("img",{src:"/branding/TriEvents_Logo.png",alt:"TriEvents",className:"h-6 mb-1"}),(0,zc.jsx)("span",{children:"Secure checkout powered by Stripe"})]})]})]}),(0,zc.jsxs)("div",{className:"hidden lg:flex mt-12 flex-col items-center gap-6 text-center text-white",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-3",children:[(0,zc.jsx)("div",{className:"h-px w-24 bg-gradient-to-r from-transparent via-gray-300 to-transparent"}),(0,zc.jsx)("span",{className:"text-base font-medium",children:"Platform Support"}),(0,zc.jsx)("div",{className:"h-px w-24 bg-gradient-to-r from-transparent via-gray-300 to-transparent"})]}),(0,zc.jsxs)("div",{className:"flex flex-col items-center gap-3 text-sm",children:[(0,zc.jsx)("p",{className:"",children:"Having trouble with our platform?"}),(0,zc.jsx)("p",{className:"",children:"Contact Tricode Cloud Support"}),(0,zc.jsx)("a",{href:"mailto:[email protected]",className:"text-blue-400 hover:text-teal-600 transition-colors",children:"[email protected]"})]})]})]}),(0,zc.jsx)("div",{className:"flex flex-col",children:(0,zc.jsxs)(Rb,{className:"w-full shadow-lg border-0",style:{backgroundColor:h.cardBg||"white"},children:[(0,zc.jsxs)(Ob,{className:"mb-0",children:[(0,zc.jsx)(Ab,{style:{color:r},children:"Event Registration"}),(0,zc.jsx)(Db,{children:"Please enter the name and email of the person attending the event."})]}),(0,zc.jsxs)(Mb,{className:"pt-0",children:[(0,zc.jsxs)("div",{className:"space-y-4 mt
2-0",children:[(0,zc.jsx)(Kb,{style:{color:r},children:"Select Ticket Type"}),(0,zc.jsx)("div",{className:"space-y-3",children:R.map((e,t)=>(0,zc.jsx)(Rb,{className:Zm("transition-all border-2 border-transparent shadow-sm hover:shadow-md cursor-pointer",M===e.stripe_price_id&&"border-blue-500 shadow-md",0===e.tickets_available&&"cursor-not-allowed hover:shadow-sm",t===R.length-1&&"mb-4"),style:{backgroundColor:M===e.stripe_price_id?"".concat(r,"20"):"".concat(r,"10"),borderColor:M===e.stripe_price_id?r:"transparent"},onClick:()=>e.tickets_available>0&&(e=>{if(F(e),T&&P){const t=R.find(t=>t.stripe_price_id===e);T.capture("ticket_type_selected",{event_name:P.title,event_uuid:P.uuid,organization_uuid:P.org_uuid,ticket_type:(null===t||void 0===t?void 0:t.nickname)||"Unknown",ticket_price:t?t.unit_amount/100:0})}ee&&ue()})(e.stripe_price_id),children:(0,zc.jsx)(Mb,{className:"p-4",children:(0,zc.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zc.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,zc.jsx)(Yw,{className:Zm("h-5 w-5 flex-shrink-0",M===e.stripe_price_id?"fill-current":"text-gray-400",0===e.tickets_available&&"text-gray-300"),style:{color:M===e.stripe_price_id?r:void 0}}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("p",{className:Zm("font-medium",0===e.tickets_available&&"line-through text-gray-600"),style:{color:r},children:e.nickname}),(0,zc.jsx)("p",{className:"text-sm text-gray-500",children:e.description})]})]}),(0,zc.jsxs)("div",{className:"text-right",children:[(0,zc.jsxs)("p",{className:Zm("font-bold",0===e.tickets_available&&"text-gray-600"),style:{color:r},children:["$",(e.unit_amount/100).toFixed(2)]}),!j&&(e.tickets_available>0?(0,zc.jsxs)(Nw,{variant:"secondary",className:"".concat(g||_e," whitespace-nowrap"),children:[e.tickets_available," available"]}):(0,zc.jsx)(Nw,{variant:"destructive",className:"bg-red-100 text-red-600 border-0 font-medium",children:"Sold Out"}))]})]})})},e.stripe_price_id))})]}),(0,zc.jsx)("div",{className:"mt-8 mb-6",children:(0,zc.jsx)(wg,{})}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"name",style:{color:r},children:"Name"}),(0,zc.jsx)(pg,{id:"name",placeholder:"Alan Turing",value:B,onChange:e=>W(e.target.value)})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"email",style:{color:r},children:"Email"}),(0,zc.jsx)(pg,{id:"email",type:"email",placeholder:"[email protected]",value:U,onChange:e=>{const t=e.target.value;if(H(t),t){const e=he(t);e?pe(e):C&&!t.endsWith(C)?pe("Email must end with ".concat(C)):pe("")}else me()},className:Zm(fe&&"border-red-500")}),fe&&(0,zc.jsx)("p",{className:"text-sm text-red-500",children:fe})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"phone",style:{color:r},children:"Phone Number"}),(0,zc.jsx)(pg,{id:"phone",type:"tel",placeholder:"441-908-6404",value:V,onChange:e=>{const t=ye(e.target.value);if($(t),t){const e=xe(t);be(e||"")}else we()},className:Zm(ve&&"border-red-500"),required:!0}),ve&&(0,zc.jsx)("p",{className:"text-sm text-red-500",children:ve})]}),P.bursary_enabled&&(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(wg,{}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)(_w,{id:"bursary",checked:ee,onCheckedChange:e=>{te(e),e||ue()},className:"border border-blue-300 bg-white ring-1 ring-blue-200 focus:ring-2 focus:ring-blue-400 data-[state=checked]:bg-blue-600 data-[state=checked]:border-blue-500 data-[state=checked]:ring-blue-400"}),(0,zc.jsx)(Kb,{htmlFor:"bursary",style:{color:r},className:"select-none cursor-pointer",children:"Request financial assistance (bursary)"}),(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)(o_,{className:"h-4 w-4 text-gray-400 hover:text-gray-600 cursor-help"})}),(0,zc.jsx)(tg,{className:"max-w-xs",children:(0,zc.jsx)("p",{children:"A bursary is financial aid to help cover event costs. You pay full price initially and receive a partial refund if approved based on financial need."})})]})})]}),ee&&(0,zc.jsxs)("div",{className:"space-y-4",children:[_&&(0,zc.jsx)(Iw,{className:"bg-amber-50 border-amber-200 text-amber-800",children:(0,zc.jsx)(Rw,{children:(0,zc.jsx)("div",{dangerouslySetInnerHTML:{__html:_}})})}),(0,zc.jsx)(Iw,{className:"bg-blue-50 border-blue-200 text-blue-800",children:(0,zc.jsxs)(Rw,{children:[(0,zc.jsx)("strong",{children:"Important:"})," You will pay the full ticket price and will be refunded the bursary amount if your request is accepted. If you have any questions, please contact the event organizer."]})}),"fixed"===P.bursary_type&&P.bursary_options&&(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{style:{color:r},htmlFor:"bursaryOptionSelect",children:"Select Bursary Option"}),(0,zc.jsxs)("select",{id:"bursaryOptionSelect",className:"block w-full rounded-lg border border-blue-300 px-4 py-2 text-base focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-blue-500",value:(null===ie||void 0===ie?void 0:ie.amount.toString())||"",onChange:e=>{var t;const n=e.target.value;if(!n)return void ue();const r=null===(t=P.bursary_options)||void 0===t?void 0:t.find(e=>e.amount.toString()===n);r&&le(r)},children:[(0,zc.jsx)("option",{value:"",children:"Select an option"}),P.bursary_options.map((e,t)=>{const n=R.find(e=>e.stripe_price_id===M),r=n?n.unit_amount/100:null,a=null!==r&&e.amount>r;return(0,zc.jsxs)("option",{value:e.amount,disabled:a,children:["$",e.amount," - ",e.description,a?" (Exceeds ticket price of $".concat(r,")"):""]},t)}
2)]})]}),"custom"===P.bursary_type&&(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"bursaryAmount",style:{color:r},children:"Bursary Amount (CAD)"}),(0,zc.jsx)(pg,{id:"bursaryAmount",type:"number",placeholder:"0.00",value:re,onChange:oe,min:"0",step:"0.01",className:Zm(ae&&"border-red-500")})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"bursaryMessage",style:{color:r},children:"Why do you need a bursary?"}),(0,zc.jsx)(Jb,{id:"bursaryMessage",placeholder:"Please explain why you need a bursary...",value:ne,onChange:ce,className:"h-24 resize-none",maxLength:500}),(0,zc.jsx)("div",{className:"flex justify-between items-center mt-1",children:(0,zc.jsxs)("p",{className:"text-muted-foreground text-sm",style:{color:r},children:[500-ne.length," characters remaining"]})})]}),ae&&(0,zc.jsx)("p",{className:"text-sm text-red-500",children:ae})]})]})]})]})]}),(0,zc.jsx)(Fb,{children:(0,zc.jsx)(fg,{className:"w-full text-white font-semibold py-6 text-lg shadow-lg hover:shadow-xl hover:brightness-75 transition-all duration-200",style:{backgroundColor:r,backgroundImage:"none"},onClick:async()=>{if(!P||!n)return;const e=he(U);if(e)return void pe(e);if(C&&!U.endsWith(C))return void pe("Email must end with ".concat(C));const t=xe(V);if(t)be(t);else if(!ee||!ae){if(ee){if("fixed"===P.bursary_type&&!ie)return void se("Please select a bursary option");if(!ne.trim())return void se("Please provide a reason for your bursary request")}setTimeout(()=>{K(!0)},150)}},disabled:!M||!B||!U||!V||!!fe||!!ve||ee&&(!re||!ne||!!ae),children:"Continue to Payment"})})]})})]}),S.length>0&&(0,zc.jsxs)("div",{className:"mt-12",children:[(0,zc.jsxs)("div",{className:"text-center mb-8",children:[(0,zc.jsx)("h2",{className:"text-3xl font-bold mb-2 text-white",children:"Event Photos"}),(0,zc.jsx)("p",{className:"text-white/80 text-lg",children:"Take a look at some highlights from previous events"})]}),(0,zc.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.map((e,t)=>(0,zc.jsx)("div",{className:"aspect-[4/3] rounded-xl overflow-hidden shadow-2xl hover:shadow-3xl transition-all duration-300 hover:scale-105",children:(0,zc.jsx)("img",{src:e,alt:"Event photo ".concat(t+1),className:"w-full h-full object-cover"})},t))})]}),(0,zc.jsxs)("div",{className:"lg:hidden mt-12 flex flex-col items-center gap-6 text-center text-white",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-3",children:[(0,zc.jsx)("div",{className:"h-px w-24 bg-gradient-to-r from-transparent via-gray-300 to-transparent"}),(0,zc.jsx)("span",{className:"text-base font-medium",children:"Platform Support"}),(0,zc.jsx)("div",{className:"h-px w-24 bg-gradient-to-r from-transparent via-gray-300 to-transparent"})]}),(0,zc.jsxs)("div",{className:"flex flex-col items-center gap-3 text-sm",children:[(0,zc.jsx)("p",{className:"",children:"Having trouble with our platform?"}),(0,zc.jsx)("p",{className:"",children:"Contact Tricode Cloud Support"}),(0,zc.jsx)("a",{href:"mailto:[email protected]",className:"text-blue-400 hover:text-teal-600 transition-colors",children:"[email protected]"})]})]})]}),(0,zc.jsx)("div",{className:"mt-16 md:mt-24",children:(0,zc.jsx)(Lb,{})}),(0,zc.jsx)(Uw,{open:Y,onOpenChange:K,children:(0,zc.jsxs)(Ww,{className:"sm:max-w-md",children:[(0,zc.jsxs)(qw,{children:[(0,zc.jsx)($w,{children:"Terms of Service & Privacy Policy"}),(0,zc.jsx)(Gw,{children:"Before proceeding to payment, please review and agree to our terms."})]}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"text-sm text-gray-600 space-y-2",children:[(0,zc.jsxs)("p",{children:["By proceeding with this purchase, you agree to our"," ",(0,zc.jsx)("a",{href:"https://tricode.cloud/trievents/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Terms of Service"})," ","and"," ",(0,zc.jsx)("a",{href:"https://tricode.cloud/trievents/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Privacy Policy"}),"."]}),(0,zc.jsx)("p",{children:"Your personal information will be used to process your ticket purchase and may be shared with the event organizer for event management purposes."})]}),(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)(_w,{id:"agree-terms",checked:J,onCheckedChange:e=>X(e),className:"h-5 w-5 border-2 data-[state=checked]:bg-black data-[state=checked]:border-black"}),(0,zc.jsx)(Kb,{htmlFor:"agree-terms",className:"text-sm",children:"I agree to the Terms of Service and Privacy Policy"})]})]}),(0,zc.jsxs)(Vw,{className:"flex flex-col sm:flex-row gap-3 sm:gap-0",children:[(0,zc.jsx)(fg,{onClick:async()=>
2{if(J){if(P&&n)try{const e=R.find(e=>e.stripe_price_id===M);if(!e)return void alert("Selected ticket type not found. Please try again.");if(await Zw(e.uuid)<=0)return void alert("Sorry, this ticket type is no longer available. Please refresh the page to see current availability.");const t={event_uuid:n,organization_uuid:P.org_uuid,stripe_product_id:P.stripe_product_id,stripe_price_id:M,ticket_name:B,ticket_email:U,ticket_phone:V,request_bursary:!!ee||void 0,bursary_amount:ee?Math.round(100*parseFloat(re)):null,bursary_message:ee?ne:null},r=await Kw(M,t);if(T&&P){const e=R.find(e=>e.stripe_price_id===M);T.capture("checkout_initiated",{event_name:P.title,event_uuid:P.uuid,organization_uuid:P.org_uuid,ticket_type:(null===e||void 0===e?void 0:e.nickname)||"Unknown",ticket_price:e?e.unit_amount/100:0,request_bursary:ee,bursary_amount:ee?parseFloat(re):null})}r.url?window.location.href=r.url:alert("There was an error redirecting to the checkout page. Please try again.")}catch(e){alert("Error: ".concat(e instanceof Error?e.message:"There was an error creating the checkout session. Please try again."))}}else alert("Please agree to the Terms of Service and Privacy Policy to continue.")},disabled:!J,className:"w-full sm:w-auto transition-transform duration-200 hover:scale-105",children:"Proceed to Payment"}),(0,zc.jsx)(fg,{variant:"outline",onClick:()=>K(!1),className:"w-full sm:w-auto transition-transform duration-200 hover:scale-105",children:"Cancel"})]})]})})]}):(0,zc.jsx)("div",{className:"relative min-h-screen bg-gradient-to-br ".concat(s," ").concat(i," overflow-x-hidden flex items-center justify-center"),children:(0,zc.jsx)("div",{className:"container mx-auto px-4 py-12 relative z-10",children:(0,zc.jsxs)(Rb,{className:"w-full max-w-2xl mx-auto shadow-2xl border-0 bg-white/95 backdrop-blur-md",children:[(0,zc.jsxs)(Ob,{className:"text-center space-y-6 py-8",children:[(0,zc.jsx)("div",{className:"flex justify-center mb-4",children:(0,zc.jsx)("img",{src:o,alt:P.title,className:"h-8 md:h-12"})}),(0,zc.jsx)(Ab,{className:"text-3xl font-bold",style:{color:r},children:"Ticket Sales Disabled"}),(0,zc.jsx)(Db,{className:"text-lg text-gray-600",children:"Ticket sales for this event are currently not available."})]}),(0,zc.jsx)(Mb,{className:"px-8 pb-8",children:(0,zc.jsx)(Iw,{variant:"destructive",className:"text-center relative py-6",children:(0,zc.jsx)(Rw,{className:"text-center text-base",children:"The event organizer has temporarily disabled ticket sales for this event. This does not affect tickets that have already been purchased."})})}),(0,zc.jsxs)(Fb,{className:"flex flex-col items-center gap-4 pb-8",children:[(0,zc.jsx)("div",{className:"text-sm text-gray-500 text-center w-full",children:"Need assistance? Contact the event organizer:"}),(0,zc.jsxs)("div",{className:"flex flex-col items-center gap-2 text-sm",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"text-gray-600 font-medium",children:"Email:"}),(0,zc.jsx)("a",{href:"mailto:".concat(P.contact_email),className:"text-blue-600 hover:text-teal-600",children:P.contact_email})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"text-gray-600 font-medium",children:"Phone:"}),(0,zc.jsx)("a",{href:"tel:".concat(P.contact_number),className:"text-blue-600 hover:text-teal-600",children:P.contact_number})]})]})]})]})})})},c_=()=>{il().uuid;return(0,zc.jsx)(l_,{primaryColor:"#00285a",secondaryColor:"#c60601",gradientFrom:"from-[#00285a]",gradientTo:"to-[#c60601]",logoUrl:"/branding/orientation/Logo-Zoomed.png",customDateText:"September 6 - 13, 2026",customLinks:[],customStyles:{headerBg:"bg-[#f8c700]/20",cardBg:"bg-white",buttonGradient:"linear-gradient(to right, #c60601, #f8c700)",buttonHoverGradient:"linear-gradient(to right, #c60601, #ffe066)",tagBg:"bg-[#00285a] text-white"},ticketsBadgeClass:"bg-[#f8c700] text-[#00285a]",eventUuid:"1d59473c-fbbb-406f-9d70-534bd25ee8ab",hidePhoneNumber:!0,hideTicketsAvailable:!0,photos:["/branding/orientation/computing-photos/comport_1.JPG","/branding/orientation/computing-photos/comport_2.JPG","/branding/orientation/computing-photos/comport_3.JPG","/branding/orientation/computing-photos/comport_4.jpg","/branding/orientation/computing-photos/comport_5.jpg","/branding/orientation/computing-photos/comport_6.JPG"]})},u_=()=>{il().uuid;return(0,zc.jsx)(l_,{primaryColor:"#8b0300",secondaryColor:"#ffffff",gradientFrom:"from-[#fff]",gradientTo:"to-[#8b0300]",logoUrl:"/branding/orientation/nursing.png",customDateText:"September 6 - 13, 2026",customLinks:[],customStyles:{headerBg:"bg-[#8b0300]/10",cardBg:"bg-white",buttonGradient:"linear-gradient(to right, #8b0300, #ffffff)",buttonHoverGradient:"linear-gradient(to right, #8b0300, #ffcccc)",tagBg:"bg-[#8b0300] text-white"},cropLogoToCircle:!0,eventUuid:"4b1110bf-c5fb-4aa7-92df-d61eac5a6d47",hidePhoneNumber:!0,hideTicketsAvailable:!0})},d_=()=>{il().uuid;return(0,zc.jsx)(l_,{primaryColor:"#031586",secondaryColor:"#ffffff",gradientFrom:"from-[#fff]",gradientTo:"to-[#031586]",logoUrl:"/branding/orientation/healthsci-logo.png",customDateText:"September 6 - 13, 2026",customLinks:[],customStyles:{headerBg:"bg-[#031586]/10",cardBg:"bg-white/80",buttonGradient:"linear-gradient(to right, #031586, #ffffff)",buttonHoverGradient:"linear-gradient(to right, #031586, #b3c6ff)",tagBg:"bg-[#031586] text-white"},logoSize:240,cropLogoToCircle:!0,eventUuid:"b9fd3148-a4ce-4b6f-bf53-8435c965830d",hidePhoneNumber:!0,hideTicketsAvailable:!0})},f_=()=>{il().uuid;return(0,zc.jsx)(l_,{primaryColor:"#6D2C3D",secondaryColor:"#c4a86f",gradientFrom:"from-[#6D2C3D]",gradientTo:"to-[#85384c]",logoUrl:"/branding/orientation/smith-logo.jpg",customDateText:"September 6 - 13, 2026",customLinks:[],customStyles:{headerBg:"bg-[#c4a86f]/20",cardBg:"bg-white",buttonGradient:"linear-gradient(to right, #6D2C3D, #c4a86f)",buttonHoverGradient:"linear-gradient(to right, #6D2C3D, #d4b87f)",tagBg:"bg-[#6D2C3D] text-white"},ticketsBadgeClass:"bg-[#c4a86f] text-[#6D2C3D]",logoSize:200,cropLogoToCircle:!0,hidePhoneNumber:!0,customBursaryInstructions:"The Fall Orientation Bursary/Fee Waiver Program helps Commerce students cover costs associated with Orientation. By checking 'Request financial assistance (bursary)', your application will be reviewed by the C
2ommerce Office and assessed by Queen's Financial Aid. The Financial Aid Office determines eligibility based on financial need. The Commerce Executive on Orientation does not assess or have access to students' financial aid information. Successful applicants will be notified of the outcome of their application, and refunds will be issued to the original method of payment at least 7 days before September 6th , 2026 (the first day of Fall Orientation). If you are not able to pay the Orientation fee up front, please email [email protected], and we will do our best to assist you. <b>Applications must be received BEFORE August 4th, 2026 @11:59 PM EST to be eligible for consideration.</b> ",hideTicketsAvailable:!0,requiredEmailDomain:"@queensu.ca",eventUuid:"71c86142-9a4c-46de-bf30-f41db9570b9b"})},h_=()=>{il().uuid;return(0,zc.jsx)(l_,{primaryColor:"#000000",secondaryColor:"#1a5f7a",gradientFrom:"from-[#606060]",gradientTo:"to-[#000000]",logoUrl:"/branding/orientation/asterisk.JPEG",customLinks:[],customStyles:{headerBg:"bg-[#000000]",cardBg:"bg-white",buttonGradient:"linear-gradient(to right, #1a5f7a, #000000)",buttonHoverGradient:"linear-gradient(to right, #000000, #1a5f7a)",tagBg:"bg-[#1a5f7a] text-white"},cropLogoToCircle:!1,eventUuid:"392bad47-ae92-468f-a933-1299280b0514",hidePhoneNumber:!0,hideTicketsAvailable:!0})};function p_(e){let t=e.featureName,n=e.message,r=e.className,a=void 0===r?"":r;const s="".concat(t," is temporarily disabled"),i=n||s;return(0,zc.jsx)("div",{className:"bg-muted/50 p-4 rounded-lg border border-red-300 ".concat(a),children:(0,zc.jsx)("p",{className:"text-sm text-red-600",children:i})})}const m_={async checkTenantExists(e){const t=e.trim().toLowerCase(),n=await fetch("".concat("https://api.trievents.ca","/tenants/").concat(encodeURIComponent(t),"/exists"));if(!n.ok)throw new Error("Failed to check tenant existence");return(await n.json()).exists}},g_=()=>{const t=l((0,e.useState)(""),2),n=t[0],r=t[1],a=l((0,e.useState)(""),2),s=a[0],i=a[1],o=sl();return{orgId:n,setOrgId:r,error:s,setError:i,handleJoinOrg:async e=>{var t;
2if(e.preventDefault(),n.trim())try{if(!await m_.checkTenantExists(n))return void i("Organization does not exist");localStorage.removeItem("tenantId"),t=n.trim(),localStorage.setItem("tenantId",t.toLowerCase()),i(""),o("/".concat(n.trim(),"/login"))}catch(s){console.error("Error checking organization:",s),i("Error checking organization. Please try again.")}else i("Please enter your organization ID")},handleCreateOrg:()=>{o("/organization/create")}}};function v_(){const t=Qi(),n=l((0,e.useState)(!0),2),r=n[0],a=n[1],s=l((0,e.useState)(!0),2),i=s[0],o=s[1];return(0,e.useEffect)(()=>{if(!t)return void o(!1);(async()=>{try{const e=await t.isFeatureEnabled("organization-onboarding");a(Boolean(e))}catch(e){console.error("Error checking organization-onboarding flag:",e),a(!0)}finally{o(!1)}})()},[t]),{isEnabled:r,loading:i}}const x_=()=>{const e=g_(),t=e.orgId,n=e.setOrgId,r=e.error,a=e.setError,s=e.handleJoinOrg,i=e.handleCreateOrg,o=v_(),l=o.isEnabled,c=o.loading;return(0,zc.jsx)("div",{className:"min-h-screen flex items-center justify-center px-4 py-12",style:{background:"linear-gradient(45deg, #f804b4 0%, #08ccc4 100%)"},children:(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row w-[90%] sm:w-[85%] md:w-[75%] lg:w-[65%] xl:w-[55%] max-w-3xl rounded-lg overflow-hidden bg-white shadow-2xl",children:[(0,zc.jsx)("div",{className:"w-full md:w-1/2 bg-white p-6 md:p-12",children:(0,zc.jsxs)("div",{className:"w-full max-w-[280px] mx-auto flex flex-col h-full",children:[(0,zc.jsxs)("div",{className:"flex flex-col items-center",children:[(0,zc.jsx)("div",{className:"bg-white",children:(0,zc.jsx)("img",{src:"/branding/TriEvents_Loading_Big_Text.gif",alt:"TriEvents Logo",className:"w-40 sm:w-48 h-auto"})}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center text-sm mt-2 mb-6",children:"Create your organization and start managing events"})]}),c?(0,zc.jsx)("div",{className:"mt-4 md:mt-auto w-full max-w-[280px] text-center text-muted-foreground",children:"Loading..."}):l?(0,zc.jsx)(fg,{onClick:i,className:"mt-4 md:mt-auto w-full max-w-[280px] transition-transform hover:scale-105",size:"lg",children:"Create Organization"}):(0,zc.jsx)("div",{className:"mt-4 md:mt-auto w-full max-w-[280px]",children:(0,zc.jsx)(p_,{featureName:"Organization creation"})})]})}),(0,zc.jsx)("div",{className:"w-full md:w-1/2 bg-white p-6 md:p-12",children:(0,zc.jsx)("div",{className:"w-full max-w-[280px] mx-auto flex flex-col h-full",children:(0,zc.jsxs)("div",{className:"flex flex-col items-center",children:[(0,zc.jsx)("h1",{className:"text-2xl font-semibold text-foreground mb-3 text-center",children:"Join or Login"}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center text-sm mt-0.5 mb-6",children:"Already have an organization? Enter your organization ID to continue"}),(0,zc.jsxs)("form",{onSubmit:s,className:"w-full",children:[(0,zc.jsxs)("div",{className:"w-full mb-6 relative",children:[(0,zc.jsx)(Kb,{className:"text-sm font-medium mb-2 block",htmlFor:"orgId",children:"Organization ID"}),(0,zc.jsx)(pg,{className:Zm("w-full",r&&"border-destructive focus-visible:ring-destructive"),placeholder:"Enter your organization ID",type:"text",id:"orgId",value:t,onChange:e=>{n(e.target.value),a("")},required:!0})]}),r&&(0,zc.jsx)(Iw,{variant:"destructive",className:"mb-6",children:(0,zc.jsx)(Rw,{children:r})}),(0,zc.jsx)(fg,{type:"submit",className:"w-full max-w-[280px] transition-transform hover:scale-105",size:"lg",children:"Continue to Organization"})]})]})})})]})})},y_=Iu("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),b_=()=>{const t=sl(),n=l((0,e.useState)({name:"",email:"",password:"",confirmPassword:"",orgName:"",orgId:"",orgDescription:""}),2),r=n[0],a=n[1],s=l((0,e.useState)(""),2),i=s[0],o=s[1],c=l((0,e.useState)(""),2),u=c[0],d=c[1];return{formData:r,error:i,passwordError:u,handleChange:e=>{const t=e.target,n=t.name,s=t.value;if(a(e=>Gc(Gc({},e),{},{[n]:s})),o(""),"confirmPassword"===n||"password"===n)"confirmPassword"===n&&s!==r.password||"password"===n&&s!==r.confirmPassword?d("Passwords do not match"):d("");else if("orgId"===n){/^[a-zA-Z0-9-_]{3,50}$/.test(s)||o("Organization ID must be 3-50 characters long and can only contain letters, numbers, hyphens, and underscores")}},handleSubmit:async e=>{if(e.preventDefault(),r.name&&r.email&&r.password&&r.confirmPassword&&r.orgName&&r.orgId&&r.orgDescription?r.password!==r.confirmPassword?(o("Passwords do not match"),0):r.password.length<8?(o("Password must be at least 8 characters long"),0):/[a-z]/.test(r.password)?/[A-Z]/.test(r.password)?/\d/.test(r.password)?/[!@#$%^&*(),.?":{}|<>]/.test(r.password)?/^[a-zA-Z0-9-_]{3,50}$/.test(r.orgId)||(o("Organization ID must be 3-50 characters long and can only contain letters, numbers, hyphens, and underscores"),0):(o("Password must contain at least one special character"),0):(o("Password must contain at least one number"),0):(o("Password must contain at least one uppercase letter"),0):(o("Password must contain at least one lowercase letter"),0):(o("Please fill in all fields"),0))try{const e=await(async e=>{try{const t=e.trim().toLowerCase(),n=await fetch("".concat("https://api.trievents.ca","/tenants/").concat(encodeURIComponent(t),"/exists"));if(!n.ok)throw new Error("Failed to check organization existence");return(await n.json()).exists}catch(i){throw console.error("Error checking organization:",i),new Error("Error checking organization. Please try again.")}})(r.orgId);if(e)return void o("This organization ID is already taken. Please choose a different one.");(e=>{sessionStorage.setItem("orgCreationData",JSON.stringify(e)),sessionStorage.setItem("fromOrgCreate","true")})({name:r.name,email:r.email,password:r.password,orgId:r.orgId,orgName:r.orgName,orgDescription:r.orgDescription}),t("/organization/onboarding")}catch(XF){XF instanceof Error?o(XF.message):o("Oops! Something went wrong.")}}}},w_=()=>{const t=sl(),n=b_(),r=n.formData,a=n.error,s=n.passwordError,i=n.handleChange,o=n.handleSubmit,l=v_(),c=l.isEnabled,u=l.loading;if((0,e.useEffect)(()=>{u||c||t("/auth")},[c,u,t]),u)return(0,zc.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,zc.jsxs)("div",{className:"text-center",children:[(0,zc.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Loading..."})]})});if(!c)return(0,zc.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,zc.jsxs)("div",{className:"text-center",children:[(0,zc.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Redirecting..."})]})});return(0,zc.jsx)("div",{className:"min-h-screen flex items-center justify-center px-4 py-12",style:{background:"linear-gradient(45deg, #f804b4 0%, #08ccc4 100%)"},children:(0,zc.jsx)("div",{className:"flex flex-col w-[90%] sm:w-[85%] md:w-[75%] lg:w-[65%] xl:w-[55%] max-w-3xl rounded-lg overflow-hidden bg-white shadow-2xl",children:(0,zc.jsx)("div",{className:"w-full bg-white p-2 px-6",children:(0,zc.jsxs)("div",{className:"w-full max-w-[600px] mx-auto flex flex-col h-[calc(100vh-160px)]",children:[(0,zc.jsxs)("div",{className:"flex flex-col items-center relative mb-2",children:[(0,zc.jsx)("div",{className:"bg-white p-4 pb-0 rounded-lg",children:(0,zc.jsx)("img",{src:"/branding/TriEvents_Loading_Big_Text.gif",alt:"TriEvents Logo",className:"w-40 sm:w-48 h-auto"})}),(0,zc.jsx)("h1",{className:"text-xl sm:text-2xl font-semibold text-foreground text-center",children:"Create Your Organization"}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center text-sm max-w-[500px] font-medium mt
2-0.5 mb-4",children:"Fill in your information and organization details to get started"})]}),(0,zc.jsx)("div",{className:"flex-1 overflow-y-auto rounded-lg pt-6 border bg-gray-50 scrollbar-thin scrollbar-track-muted/20 scrollbar-thumb-muted/40 hover:scrollbar-thumb-muted/60",children:(0,zc.jsxs)("form",{id:"create-org-form",onSubmit:o,className:"w-full mx-auto px-3",children:[(0,zc.jsx)(Rb,{className:"mb-6",children:(0,zc.jsxs)(Mb,{className:"pt-6",children:[(0,zc.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-4",children:"User Information"}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"name",children:"Name"}),(0,zc.jsx)(pg,{id:"name",name:"name",value:r.name,onChange:i,required:!0})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"email",children:"Email"}),(0,zc.jsx)(pg,{type:"email",id:"email",name:"email",value:r.email,onChange:i,required:!0})]}),(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"password",children:"Password"}),(0,zc.jsx)(pg,{type:"password",id:"password",name:"password",value:r.password,onChange:i,required:!0})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"confirmPassword",children:"Confirm Password"}),(0,zc.jsx)(pg,{type:"password",id:"confirmPassword",name:"confirmPassword",value:r.confirmPassword,onChange:i,required:!0}),s&&(0,zc.jsx)("p",{className:"text-destructive text-sm",children:s})]})]}),(0,zc.jsxs)("div",{className:"text-xs text-muted-foreground space-y-1",children:[(0,zc.jsx)("p",{className:"font-medium",children:"Password Requirements:"}),(0,zc.jsxs)("ul",{className:"list-disc list-inside space-y-0.5",children:[(0,zc.jsx)("li",{children:"At least 8 characters long"}),(0,zc.jsx)("li",{children:"At least one lowercase letter (a-z)"}),(0,zc.jsx)("li",{children:"At least one uppercase letter (A-Z)"}),(0,zc.jsx)("li",{children:"At least one number (0-9)"}),(0,zc.jsxs)("li",{children:['At least one special character (!@#$%^&*(),.?":',"|<>)"]})]})]})]})]})}),(0,zc.jsx)(Rb,{className:"mb-6",children:(0,zc.jsxs)(Mb,{className:"pt-6",children:[(0,zc.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-4",children:"Organization Information"}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"orgName",children:"Organization Name"}),(0,zc.jsx)(pg,{id:"orgName",name:"orgName",value:r.orgName,onChange:i,required:!0})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"orgId",children:"Organization ID"}),(0,zc.jsx)(pg,{id:"orgId",name:"orgId",value:r.orgId,onChange:i,required:!0})]})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"orgDescription",children:"Organization Description"}),(0,zc.jsx)(Jb,{id:"orgDescription",name:"orgDescription",value:r.orgDescription,onChange:i,required:!0,className:"h-24 resize-none"})]})]})]})}),a&&(0,zc.jsx)(Iw,{variant:"destructive",className:"mb-4 bg-white",children:(0,zc.jsx)(Rw,{children:a})})]})}),(0,zc.jsx)("div",{className:"sticky bottom-0 left-0 right-0 bg-white py-4",children:(0,zc.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row items-center justify-between gap-4",children:[(0,zc.jsxs)(fg,{variant:"outline",onClick:()=>t("/auth"),className:"transform hover:scale-105 transition-all duration-200 w-full sm:w-auto",children:[(0,zc.jsx)(y_,{className:"h-4 w-4 mr-2"}),"Back"]}),(0,zc.jsx)(fg,{type:"submit",form:"create-org-form",size:"lg",className:"w-full sm:w-[280px] transition-transform hover:scale-105",children:"Continue"})]})})]})})})})};function __(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,i,o=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){c=!0,a=e}
2finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return k_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k_(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var j_=e.createContext(null);j_.displayName="ConnectComponents";var N_,S_=function(t){var n=t.connectInstance,r=t.children;return e.createElement(j_.Provider,{value:{connectInstance:n}},r)},C_=function(t){var n=__(e.useState(null),2),r=n[0],a=n[1],s=function(){var t=e.useContext(j_);if(!t)throw new Error("Could not find Components context; You need to wrap the part of your app in an <ConnectComponentsProvider> provider.");return t}().connectInstance,i=e.useRef(null),o=e.createElement("div",{style:{width:"100%"},"data-stripe-connect-js-wrapper":!0,ref:i});return e.useLayoutEffect(function(){if(null!==i.current&&null===r){var e=s.create(t);if(a(e),null!==e){try{e.setAttribute("reactSdkAnalytics","3.3.24")}catch(d){console.log("Error setting React Sdk version with error message: ",d)}for(;i.current.firstChild;)i.current.removeChild(i.current.firstChild);i.current.appendChild(e)}}},[s,t]),{wrapper:o,component:r}},E_=function(t,n,r){e.useEffect(function(){if(t)try{r(t,n)}catch(e){return void console.error("Error when calling setter! ",e)}},[t,n,r])},T_=function(e){var t=e.defaultFilters,n=e.onLoadError,r=e.onLoaderStart,a=C_("payments"),s=a.wrapper,i=a.component;return E_(i,r,function(e,t){e.setOnLoaderStart(t)}),E_(i,n,function(e,t){e.setOnLoadError(t)}),E_(i,t,function(e,t){e.setDefaultFilters(t)}),s},I_=function(e){var t=e.onLoadError,n=e.onLoaderStart,r=C_("payouts"),a=r.wrapper,s=r.component;return E_(s,n,function(e,t){e.setOnLoaderStart(t)}),E_(s,t,function(e,t){e.setOnLoadError(t)}),a},P_=function(e){var t=e.onExit,n=e.recipientTermsOfServiceUrl,r=e.fullTermsOfServiceUrl,a=e.privacyPolicyUrl,s=e.skipTermsOfServiceCollection,i=e.collectionOptions,o=e.onLoadError,l=e.onLoaderStart,c=e.onStepChange,u=C_("account-onboarding"),d=u.wrapper,f=u.component;return E_(f,n,function(e,t){return e.setRecipientTermsOfServiceUrl(t)}),E_(f,r,function(e,t){return e.setFullTermsOfServiceUrl(t)}),E_(f,a,function(e,t){return e.setPrivacyPolicyUrl(t)}),E_(f,s,function(e,t){return e.setSkipTermsOfServiceCollection(t)}),E_(f,i,function(e,t){return e.setCollectionOptions(t)}),E_(f,t,function(e,t){return e.setOnExit(t)}),E_(f,l,function(e,t){e.setOnLoaderStart(t)}),E_(f,o,function(e,t){e.setOnLoadError(t)}),E_(f,c,function(e,t){return e.setOnStepChange(t)}),d},R_=function(e){var t=e.collectionOptions,n=e.onLoadError,r=e.onLoaderStart,a=C_("account-management"),s=a.wrapper,i=a.component;return E_(i,t,function(e,t){return e.setCollectionOptions(t)}),E_(i,r,function(e,t){e.setOnLoaderStart(t)}),E_(i,n,function(e,t){e.setOnLoadError(t)}),s},O_=function(e){var t=e.collectionOptions,n=e.onNotificationsChange,r=e.onLoadError,a=e.onLoaderStart,s=C_("notification-banner"),i=s.wrapper,o=s.component;return E_(o,t,function(e,t){return e.setCollectionOptions(t)}),E_(o,n,function(e,t){return e.setOnNotificationsChange(t)}),E_(o,a,function(e,t){e.setOnLoaderStart(t)}),E_(o,r,function(e,t){e.setOnLoadError(t)}),i},A_=function(e){var t=e.onLoadError,n=e.onLoaderStart,r=C_("documents"),a=r.wrapper,s=r.component;return E_(s,n,function(e,t){e.setOnLoaderStart(t)}),E_(s,t,function(e,t){e.setOnLoadError(t)}),a},D_=function(e){var t=e.onLoadError,n=e.onLoaderStart,r=C_("balances"),a=r.wrapper,s=r.component;return E_(s,n,function(e,t){e.setOnLoaderStart(t)}),E_(s,t,function(e,t){e.setOnLoadError(t)}),a};!function(e){e.exit="exit",e.close="close",e.instantPayoutCreated="instantpayoutcreated"}(N_||(N_={}));const M_={setOnLoadError:e=>{},setOnLoaderStart:e=>{}},F_={"account-onboarding":{setFullTermsOfServiceUrl:e=>{},setRecipientTermsOfServiceUrl:e=>{},setPrivacyPolicyUrl:e=>{},setSkipTermsOfServiceCollection:e=>{},setCollectionOptions:e=>{},setOnExit:e=>{},setOnStepChange:e=>{}},"account-management":{setCollectionOptions:e=>{}}
2,"notification-banner":{setCollectionOptions:e=>{},setOnNotificationsChange:e=>{}},"issuing-card":{setDefaultCard:e=>{},setCardSwitching:e=>{},setFetchEphemeralKey:e=>{},setShowSpendControls:e=>{}},"issuing-cards-list":{setFetchEphemeralKey:e=>{},setShowSpendControls:e=>{},setIssuingProgram:e=>{}},"financial-account":{setFinancialAccount:e=>{}},"financial-account-transactions":{setFinancialAccount:e=>{}},payments:{setDefaultFilters:e=>{}},"payment-details":{setPayment:e=>{},setOnClose:e=>{}},"payment-disputes":{setPayment:e=>{},setOnDisputesLoaded:e=>{}},"tax-settings":{setHideProductTaxCodeSelector:e=>{},setDisplayHeadOfficeCountries:e=>{},setOnTaxSettingsUpdated:e=>{}},"tax-registrations":{setOnAfterTaxRegistrationAdded:e=>{},setDisplayCountries:e=>{}}},L_={"account-onboarding":"stripe-connect-account-onboarding","disputes-list":"stripe-connect-disputes-list",payments:"stripe-connect-payments","payment-details":"stripe-connect-payment-details","payment-disputes":"stripe-connect-payment-disputes",payouts:"stripe-connect-payouts","payouts-list":"stripe-connect-payouts-list",balances:"stripe-connect-balances","account-management":"stripe-connect-account-management","notification-banner":"stripe-connect-notification-banner","issuing-card":"stripe-connect-issuing-card","issuing-cards-list":"stripe-connect-issuing-cards-list","financial-account":"stripe-connect-financial-account","financial-account-transactions":"stripe-connect-financial-account-transactions",documents:"stripe-connect-documents","tax-registrations":"stripe-connect-tax-registrations","tax-settings":"stripe-connect-tax-settings"},U_="loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used",H_="https://connect-js.stripe.com/v1.0/connect.js";let z_=null;const B_=e=>!(!e||"object"!==typeof e||!("init"in e)||"function"!==typeof e.init),W_=()=>(null!==z_||(z_=new Promise((e,t)=>{if("undefined"!==typeof window){if(B_(window.StripeConnect)){console.warn(U_);const t=V_(window.StripeConnect);return void e(t)}try{let n=document.querySelectorAll('script[src="'.concat(H_,'"]'))[0]||document.querySelectorAll('script[src="'.concat("https://connect-js.stripe.com/v0.1/connect.js",'"]'))[0]||null;n?console.warn(U_):n||(n=(()=>{const e=document.createElement("script");if(e.src=H_,!document.head)throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");return document.head.appendChild(e),e})()),n.addEventListener("load",()=>{if(B_(window.StripeConnect)){const t=V_(window.StripeConnect);e(t)}else t(new Error("Connect.js did not load the necessary objects"))}),n.addEventListener("error",()=>{t(new Error("Failed to load Connect.js"))})}catch(n){t(n)}}else t("ConnectJS won't load when rendering code in the server - it can only be loaded on a browser. This error is expected when loading ConnectJS in SSR environments, like NextJS. It will have no impact in the UI, however if you wish to avoid it, you can switch to the `pure` version of the connect.js loader: https://github.com/stripe/connect-js#importing-loadconnect-without-side-effects.")})),z_),q_=(e,t)=>{var n;const r=(()=>{try{return t.fetchClientSecret()}catch(e){return Promise.reject(e)}})(),a=null!==(n=t.metaOptions)&&void 0!==n?n:{},s=e.then(e=>e.initialize(Object.assign(Object.assign({},t),{metaOptions:Object.assign(Object.assign({},a),{eagerClientSecretPromise:r})})));return{create:e=>{let t=L_[e];t||(t=e);const n=document.createElement(t),r=(e=>e in F_)(e)?F_[e]:{},a=Object.assign(Object.assign({},r),M_);for(const i in a)n[i]=function(e){s.then(()=>{this["".concat(i,"InternalOnly")](e)})};return s.then(t=>{if(!n.isConnected&&!n.setConnector){const e=n.style.display;n.style.display="none",document.body.appendChild(n),document.body.removeChild(n),n.style.display=e}if(!n||!n.setConnector)throw new Error("Element ".concat(e," was not transformed into a custom element. Are you using a documented component? See https://docs.stripe.com/connect/supported-embedded-components for a list of supported components"));n.setConnector(t.connect)}),n},update:e=>{s.then(t=>{t.update(e)})},debugInstance:()=>s,logout:()=>s.then(e=>e.logout())}},V_=e=>{window.StripeConnect=window.StripeConnect||{},window.StripeConnect.optimizedLoading=!0;return{initialize:t=>{var n;const r=null!==(n=t.metaOptions)&&void 0!==n?n:{};return e.init(Object.assign(Object.assign({},t),{metaOptions:Object.assign(Object.assign({},r),{sdk:!0,sdkOptions:{sdkVersion:"3.3.25"}})}))}}},$_=Promise.resolve().then(()=>W_());let G_=!1;$_.catch(e=>{G_||console.warn(e)});const Y_=t=>{const n=l((0,e.useState)(void 0),2),r=n[0],a=n[1];return(0,e.useEffect)(()=>
2{if(t){const e=async()=>{const e=await fetch("".concat("https://api.trievents.ca","/stripe-connect/account_session"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:t})});if(e.ok){return(await e.json()).client_secret}{const t=(await e.json()).error;throw new Error("An error occurred: ".concat(t))}};(async()=>{try{const n=await(t={publishableKey:"pk_live_51R6aCqRpQEZx0TlJZt3si1vNBqlcQGRbuMck1iJ9ejcsDp5ESxIa1toVytgZVGN69zsRmB53islsC9XyIONn8lfK00CrR31EdF",fetchClientSecret:e,appearance:{overlays:"dialog",variables:{colorPrimary:"#635BFF"}}},G_=!0,q_($_,t));a(n)}catch(n){console.error("Failed to initialize Stripe Connect:",n)}var t})()}},[t]),r};var K_=n(7143);class Z_{static async createStripeAccount(){const e=await fetch("".concat(this.API_URL,"/stripe-connect/account"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error("Failed to create account");return(await e.json()).account}static async createAccountSession(e){const t=await fetch("".concat(this.API_URL,"/stripe-connect/account_session"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:e})});if(!t.ok)throw new Error("Failed to create account session");return t.json()}static async createOrganization(e,t){const n=await fetch("".concat(this.API_URL,"/tenants"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenantId:e.orgId,email:e.email,password:e.password,name:e.name,orgName:e.orgName,orgDescription:e.orgDescription,stripeAccountId:t})});if(!n.ok){const e=await n.json();throw new Error(e.error||"Failed to create tenant and user")}localStorage.setItem("tenantId",e.orgId.toLowerCase());if("OK"!==(await(0,K_.signIn)({formFields:[{id:"email",value:e.email},{id:"password",value:e.password}]})).status)throw new Error("Failed to sign in after signup")}}Z_.API_URL="https://api.trievents.ca";const J_=Iu("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),X_=Iu("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);function Q_(){const t=sl(),n=(()=>{const t=l((0,e.useState)(!1),2),n=t[0],r=t[1],a=l((0,e.useState)(!1),2),s=a[0],i=a[1],o=l((0,e.useState)(null),2),c=o[0],u=o[1],d=l((0,e.useState)(),2),f=d[0],h=d[1],p=(0,e.useRef)(!1),m=sl(),g=rl();return(0,e.useEffect)(()=>{if(!sessionStorage.getItem("fromOrgCreate"))return void m("/auth");const e=()=>{f&&p.current,sessionStorage.removeItem("fromOrgCreate"),sessionStorage.removeItem("orgCreationData"),m("/auth")};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[g,m,f]),(0,e.useEffect)(()=>()=>{f&&p.current},[f]),{accountCreatePending:n,onboardingExited:!1,onboardingCompleted:s,error:c,connectedAccountId:f,isCompletedRef:p,handleStartSetup:async()=>{try{r(!0);const e=await Z_.createStripeAccount();h(e),await Z_.createAccountSession(e)}catch(c){console.error("Error:",c),u(c instanceof Error?c.message:"An unknown error occurred")}finally{r(!1)}},handleQuit:()=>{sessionStorage.removeItem("fromOrgCreate"),sessionStorage.removeItem("orgCreationData"),m("/auth")},handleOnboardingComplete:()=>{p.current=!0,i(!0)},setError:u}})(),r=n.accountCreatePending,a=n.onboardingCompleted,s=n.error,i=n.connectedAccountId,o=n.handleStartSetup,c=n.handleQuit,u=n.handleOnboardingComplete,d=(t=>{const n=l((0,e.useState)(null),2),r=n[0],a=n[1],s=sl();return{error:r,setError:a,createOrganization:async()=>{try{const e=JSON.parse(sessionStorage.getItem("orgCreationData")||"");if(!e)throw new Error("No organization data found");if(!t)throw new Error("No connected account ID found");await Z_.createOrganization(e,t),sessionStorage.removeItem("orgCreationData"),sessionStorage.removeItem("fromOrgCreate"),s("/".concat(e.orgId,"/dashboard"))}catch(r){console.error("Error creating organization:",r),a(r instanceof Error?r.message:"An unknown error occurred")}}}})(i),f=d.error,h=d.createOrganization,p=Y_(i),m=v_(),g=m.isEnabled,v=m.loading;if((0,e.useEffect)(()=>{v||g||t("/auth")},[g,v,t]),v)return(0,zc.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,zc.jsxs)("div",{className:"text-center",children:[(0,zc.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Loading..."})]})});if(!g)return(0,zc.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,zc.jsxs)("div",{className:"text-center",children:[(0,zc.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Redirecting..."})]})});const x=s||f;return(0,zc.jsx)("div",{className:"min-h-screen flex items-center justify-center px-4 py-12",style:{background:"linear-gradient(45deg, #f804b4 0%, #08ccc4 100%)"},children:(0,zc.jsx)("div",{className:"flex flex-col w-[90%] sm:w-[85%] md:w-[75%] lg:w-[65%] xl:w-[55%] max-w-3xl rounded-lg overflow-hidden bg-white shadow-2xl",children:(0,zc.jsx)("div",{className:"w-full bg-white p-2 px-6",children:(0,zc.jsxs)("div",{className:"w-full max-w-[600px] mx-auto flex flex-col h-[calc(100vh-160px)]",children:[(0,zc.jsxs)("div",{className:"flex flex-col items-center relative mb-2",children:[(0,zc.jsx)("div",{className:"bg-white p-4 pb-0 rounded-lg",children:(0,zc.jsx)("img",{src:"/branding/TriEvents_Loading_Big_Text.gif",alt:"TriEvents Logo",className:"w-40 sm:w-48 h-auto"})}),(0,zc.jsx)("h1",{className:"text-xl sm:text-2xl font-semibold text-foreground text-center",children:"Account Onboarding"}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center text-sm max-w-[500px] font-medium mt
2-0.5 mb-4",children:"Complete your account setup to start accepting payments"})]}),(0,zc.jsx)("div",{className:"flex-1 overflow-y-auto rounded-lg pt-6 border bg-gray-50 scrollbar-thin scrollbar-track-muted/20 scrollbar-thumb-muted/40 hover:scrollbar-thumb-muted/60",children:(0,zc.jsxs)("div",{className:"w-full mx-auto px-3",children:[x&&(0,zc.jsx)(Iw,{variant:"destructive",className:"mb-4 bg-white",children:(0,zc.jsx)(Rw,{children:x})}),(0,zc.jsx)(Rb,{className:"mb-6",children:(0,zc.jsxs)(Mb,{className:"pt-6",children:[!i&&(0,zc.jsx)("div",{className:"text-center",children:(0,zc.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground mb-4 bg-yellow-50 p-3 rounded-lg border border-yellow-200",children:[(0,zc.jsx)(J_,{className:"h-5 w-5 flex-shrink-0 text-yellow-600"}),(0,zc.jsx)("p",{children:"For the best experience, we recommend completing this setup on a desktop device."})]})}),r&&(0,zc.jsxs)("div",{className:"flex flex-col items-center justify-center py-8",children:[(0,zc.jsx)(X_,{className:"h-8 w-8 animate-spin text-primary mb-4"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Creating your account..."})]}),a&&(0,zc.jsxs)("div",{className:"flex flex-col items-center justify-center py-8",children:[(0,zc.jsx)(X_,{className:"h-8 w-8 animate-spin text-primary mb-4"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Setting up your organization..."})]}),p&&!r&&!a&&(0,zc.jsx)("div",{className:"md:block overflow-x-auto md:overflow-x-visible -mx-3 md:mx-0",children:(0,zc.jsx)("div",{className:"md:min-w-0 min-w-[600px] px-3 md:px-0",children:(0,zc.jsx)(S_,{connectInstance:p,children:(0,zc.jsx)(P_,{onExit:()=>{u(),i&&h()}})})})})]})})]})}),(0,zc.jsx)("div",{className:"sticky bottom-0 left-0 right-0 bg-white py-4",children:(0,zc.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row items-center justify-between gap-4",children:[(0,zc.jsxs)(fg,{variant:"outline",onClick:c,className:"transform hover:scale-105 transition-all duration-200 w-full sm:w-auto",children:[(0,zc.jsx)(y_,{className:"h-4 w-4 mr-2"}),"Quit"]}),!i&&!r&&!a&&(0,zc.jsx)(fg,{onClick:o,size:"lg",className:"w-full sm:w-[280px] transition-transform hover:scale-105",children:r?"Creating Account...":"Start Setup"})]})})]})})})})}const ek={async signIn(e,t,n){try{return await(0,K_.signIn)({formFields:[{id:"email",value:e},{id:"password",value:t}],options:{preAPIHook:async e=>{if(e.requestInit.credentials="include",n){const t=JSON.parse(e.requestInit.body);t.hcaptchaToken=n,e.requestInit.body=JSON.stringify(t)}return e}}})}catch(a){var r;if(429===(null===(r=a.response)||void 0===r?void 0:r.status)){const e=await a.response.json();return{status:"WRONG_CREDENTIALS_ERROR",requiresCaptcha:e.requiresCaptcha||!1,error:e.error||"Too many failed attempts. Please complete the CAPTCHA."}}throw a}}},tk=t=>{let n=t.siteKey,r=t.onVerify,a=t.onError,s=t.theme,i=void 0===s?"light":s,o=t.size,l=void 0===o?"normal":o;const c=(0,e.useRef)(null);return(0,e.useEffect)(()=>{const e=document.createElement("script");return e.src="https://js.hcaptcha.com/1/api.js?onload=onHCaptchaLoaded&render=explicit",e.async=!0,window.onHCaptchaLoaded=()=>{c.current&&window.hcaptcha&&window.hcaptcha.render(c.current,{sitekey:n,theme:i,size:l,callback:r,"error-callback":a})},document.head.appendChild(e),()=>{document.head.removeChild(e),delete window.onHCaptchaLoaded}},[n,i,l,r,a]),(0,zc.jsx)("div",{ref:c})},nk=()=>{const t=sl(),n=rg().navigateWithTenant,r=(()=>{const t=l((0,e.useState)(""),2),n=t[0],r=t[1],a=l((0,e.useState)(""),2),s=a[0],i=a[1],o=l((0,e.useState)({}),2),c=o[0],u=o[1],d=rg().navigateWithTenant,f=l((0,e.useState)(!1),2),h=f[0],p=f[1],m=l((0,e.useState)(null),2),g=m[0],v=m[1],x=l((0,e.useState)(null),2),y=x[0],b=x[1];return{email:n,setEmail:r,password:s,setPassword:i,errors:c,handleSignIn:async e=>{e.preventDefault(),u({}),b(null);try{const e=await ek.signIn(n,s,g||void 0);if(e.requiresCaptcha)return p(!0),void b(e.error||"Please complete the CAPTCHA to continue.");if("FIELD_ERROR"===e.status){var t;const n={};
2null===(t=e.formFields)||void 0===t||t.forEach(e=>{"email"===e.id&&(n.email=e.error)}),u(n)}else"WRONG_CREDENTIALS_ERROR"===e.status?u({general:"Email password combination is incorrect."}):"SIGN_IN_NOT_ALLOWED"===e.status?u({general:e.reason||"Sign in not allowed."}):(p(!1),v(null),d("/dashboard"))}catch(XF){console.error("Login error:",XF),XF instanceof Error&&"isSuperTokensGeneralError"in XF&&!0===XF.isSuperTokensGeneralError?u({general:XF.message}):u({general:"Oops! Something went wrong."})}},showCaptcha:h,setShowCaptcha:p,captchaToken:g,setCaptchaToken:v,captchaError:y,setCaptchaError:b}})(),a=r.email,s=r.setEmail,i=r.password,o=r.setPassword,c=r.errors,u=r.handleSignIn,d=r.showCaptcha,f=(r.setShowCaptcha,r.captchaToken,r.setCaptchaToken),h=r.captchaError,p=r.setCaptchaError;return(0,zc.jsx)("div",{className:"min-h-screen flex items-center justify-center px-4 py-12",style:{background:"linear-gradient(45deg, #f804b4 0%, #08ccc4 100%)"},children:(0,zc.jsx)("div",{className:"w-full max-w-lg bg-white rounded-lg shadow-2xl overflow-hidden",children:(0,zc.jsxs)("div",{className:"px-8 py-6",children:[(0,zc.jsxs)("div",{className:"flex flex-col items-center",children:[(0,zc.jsx)("img",{src:"/branding/TriEvents_Loading_Big_Text.gif",alt:"TriEvents Logo",className:"w-40 sm:w-48 h-auto mb-2"}),(0,zc.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:"Organization Login"}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center text-sm mt-0.5 mb-4",children:"Login to your organization account"})]}),(0,zc.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[c.general&&(0,zc.jsx)(Iw,{variant:"destructive",className:"mb-2",children:(0,zc.jsx)(Rw,{children:c.general})}),(0,zc.jsxs)("div",{className:"space-y-1.5",children:[(0,zc.jsx)(Kb,{htmlFor:"email",children:"Email"}),(0,zc.jsx)(pg,{type:"email",id:"email",name:"email",placeholder:"Enter your email",value:a,onChange:e=>s(e.target.value),required:!0,className:c.email?"border-destructive":""}),c.email&&(0,zc.jsx)("p",{className:"text-sm text-destructive",children:c.email})]}),(0,zc.jsxs)("div",{className:"space-y-1.5",children:[(0,zc.jsx)(Kb,{htmlFor:"password",children:"Password"}),(0,zc.jsx)(pg,{type:"password",id:"password",name:"password",placeholder:"Enter your password",value:i,onChange:e=>o(e.target.value),required:!0,className:c.password?"border-destructive":""}),c.password&&(0,zc.jsx)("p",{className:"text-sm text-destructive",children:c.password})]}),d&&(0,zc.jsxs)("div",{className:"mb-2",children:[(0,zc.jsx)(tk,{siteKey:"a27ec588-31d4-4804-8d46-59c2d0a2d946",onVerify:f,onError:()=>p("CAPTCHA verification failed")}),h&&(0,zc.jsx)(Iw,{variant:"destructive",className:"mt-2",children:(0,zc.jsx)(Rw,{children:h})})]}),(0,zc.jsxs)("div",{className:"space-y-3",children:[(0,zc.jsx)(fg,{type:"submit",size:"lg",className:"w-full transition-transform hover:scale-105",children:"Login"}),(0,zc.jsx)(fg,{variant:"ghost",onClick:()=>n("/auth/reset-password"),className:"w-full transition-transform hover:scale-105",children:"Forgot password?"})]}),(0,zc.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row items-center justify-between gap-4 pt-2",children:[(0,zc.jsxs)(fg,{variant:"outline",onClick:()=>t("/auth"),className:"transform hover:scale-105 transition-all duration-200 w-full sm:w-auto",children:[(0,zc.jsx)(y_,{className:"h-4 w-4 mr-2"}),"Back"]}),(0,zc.jsx)(fg,{variant:"outline",onClick:()=>n("/join"),className:"transform hover:scale-105 transition-all duration-200 w-full sm:w-auto",children:"Join Organization"})]})]})]})})})},rk=()=>{const t=l((0,e.useState)({name:"",email:"",password:"",confirmPassword:"",accessCode:""}),2),n=t[0],r=t[1],a=l((0,e.useState)(""),2),s=a[0],i=a[1],o=rg().navigateWithTenant,c=ku();return{formData:n,error:s,handleInputChange:(e,t)=>
2{r(n=>Gc(Gc({},n),{},{[e]:t}))},handleSubmit:async e=>{if(e.preventDefault(),i(""),n.password!==n.confirmPassword?(i("Passwords do not match"),0):n.password.length<8?(i("Password must be at least 8 characters long"),0):/[a-z]/.test(n.password)?/[A-Z]/.test(n.password)?/\d/.test(n.password)?/[!@#$%^&*(),.?":{}|<>]/.test(n.password)||(i("Password must contain at least one special character"),0):(i("Password must contain at least one number"),0):(i("Password must contain at least one uppercase letter"),0):(i("Password must contain at least one lowercase letter"),0))if(c)try{const e=await(async(e,t)=>{const n=e.toLowerCase(),r=await fetch("".concat("https://api.trievents.ca","/organizations/").concat(n,"/join"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){const e=await r.json();throw new Error(e.error||"Failed to join organization")}return r.json()})(c,{email:n.email,password:n.password,name:n.name,accessCode:n.accessCode});localStorage.setItem("tenantId",e.tenantId.toLowerCase());"OK"===(await(0,K_.signIn)({formFields:[{id:"email",value:n.email},{id:"password",value:n.password}]})).status?o("/dashboard"):i("Failed to sign in after signup")}catch(s){s instanceof Error?"Email already exists"===s.message?i("This email is already registered in this organization. Please login instead."):"Organization not found"===s.message?i("This organization does not exist."):"Invalid access code"===s.message?i("The access code you provided is incorrect."):i(s.message):i("Oops! Something went wrong.")}else i("Organization ID not found")}}},ak=()=>{const e=sl(),t=rg().navigateWithTenant,n=rk(),r=n.formData,a=n.error,s=n.handleInputChange,i=n.handleSubmit;return(0,zc.jsx)("div",{className:"min-h-screen flex items-center justify-center px-4 py-12",style:{background:"linear-gradient(45deg, #f804b4 0%, #08ccc4 100%)"},children:(0,zc.jsx)("div",{className:"w-full max-w-lg bg-white rounded-lg shadow-2xl overflow-hidden",children:(0,zc.jsxs)("div",{className:"px-8 py-6",children:[(0,zc.jsxs)("div",{className:"flex flex-col items-center",children:[(0,zc.jsx)("img",{src:"/branding/TriEvents_Loading_Big_Text.gif",alt:"TriEvents Logo",className:"w-40 sm:w-48 h-auto mb-2"}),(0,zc.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:"Join Organization"}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center text-sm mt-0.5 mb-4",children:"Create an account to join this organization"})]}),(0,zc.jsx)("div",{className:"h-[300px] overflow-y-auto rounded-lg border bg-gray-50 scrollbar-thin scrollbar-track-muted/20 scrollbar-thumb-muted/40 hover:scrollbar-thumb-muted/60",children:(0,zc.jsxs)("form",{onSubmit:i,className:"space-y-4 p-4",children:[a&&(0,zc.jsx)(Iw,{variant:"destructive",className:"mb-2",children:(0,zc.jsx)(Rw,{children:a})}),(0,zc.jsx)(Rb,{children:(0,zc.jsxs)(Mb,{className:"pt-6 space-y-4",children:[(0,zc.jsxs)("div",{className:"space-y-1.5",children:[(0,zc.jsx)(Kb,{htmlFor:"name",children:"Name"}),(0,zc.jsx)(pg,{type:"text",id:"name",name:"name",placeholder:"Enter your name",value:r.name,onChange:e=>s("name",e.target.value),required:!0})]}),(0,zc.jsxs)("div",{className:"space-y-1.5",children:[(0,zc.jsx)(Kb,{htmlFor:"email",children:"Email"}),(0,zc.jsx)(pg,{type:"email",id:"email",name:"email",placeholder:"Enter your email",value:r.email,onChange:e=>s("email",e.target.value),required:!0})]}),(0,zc.jsxs)("div",{className:"space-y-1.5",children:[(0,zc.jsx)(Kb,{htmlFor:"password",children:"Password"}),(0,zc.jsx)(pg,{type:"password",id:"password",name:"password",placeholder:"Enter your password",value:r.password,onChange:e=>s("password",e.target.value),required:!0})]}),(0,zc.jsxs)("div",{className:"space-y-1.5",children:[(0,zc.jsx)(Kb,{htmlFor:"confirmPassword",children:"Confirm Password"}),(0,zc.jsx)(pg,{type:"password",id:"confirmPassword",name:"confirmPassword",placeholder:"Confirm your password",value:r.confirmPassword,onChange:e=>s("confirmPassword",e.target.value),required:!0})]}),(0,zc.jsxs)("div",{className:"text-xs text-muted-foreground space-y-1",children:[(0,zc.jsx)("p",{className:"font-medium",children:"Password Requirements:"}),(0,zc.jsxs)("ul",{className:"list-disc list-inside space-y-0.5",children:[(0,zc.jsx)("li",{children:"At least 8 characters long"}),(0,zc.jsx)("li",{children:"At least one lowercase letter (a-z)"}),(0,zc.jsx)("li",{children:"At least one uppercase letter (A-Z)"}),(0,zc.jsx)("li",{children:"At least one number (0-9)"}),(0,zc.jsxs)("li",{children:['At least one special character (!@#$%^&*(),.?":',"|<>)"]})]})]}),(0,zc.jsxs)("div",{className:"space-y-1.5",children:[(0,zc.jsx)(Kb,{htmlFor:"accessCode",children:"Access Code"}),(0,zc.jsx)(pg,{type:"text",id:"accessCode",name:"accessCode",placeholder:"Enter organization access code",value:r.accessCode,onChange:e=>s("accessCode",e.target.value),required:!0})]})]})})]})}),(0,zc.jsx)("div",{className:"space-y-3 mt-4",children:(0,zc.jsx)(fg,{type:"submit",size:"lg",className:"w-full transition-transform hover:scale-105",onClick:i,children:"Join Organization"})}),(0,zc.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row items-center justify-between gap-4 pt-4 mt-4",children:[(0,zc.jsxs)(fg,{variant:"outline",onClick:()=>e("/auth"),className:"transform hover:scale-105 transition-all duration-200 w-full sm:w-auto",children:[(0,zc.jsx)(y_,{className:"h-4 w-4 mr-2"}),"Back"]}),(0,zc.jsx)(fg,{variant:"outline",onClick:()=>
2t("/login"),className:"transform hover:scale-105 transition-all duration-200 w-full sm:w-auto",children:"Login to Organization"})]})]})})})},sk=()=>{const t=l((0,e.useState)({email:"",password:"",confirmPassword:""}),2),n=t[0],r=t[1],a=l((0,e.useState)(!1),2),s=a[0],i=a[1],o=l((0,e.useState)(""),2),c=o[0],u=o[1],d=l((0,e.useState)(!1),2),f=d[0],h=d[1],p=il();return{formData:n,emailSent:s,passwordError:c,resetSuccess:f,handleInputChange:(e,t)=>{r(n=>Gc(Gc({},n),{},{[e]:t}))},handleRequestSubmit:async e=>{e.preventDefault();try{await(async e=>{if(!(await fetch("".concat("https://api.trievents.ca","/auth/password/reset/request"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)})).ok)throw new Error("Failed to request password reset")})({email:n.email,tenantId:p.orgId||""}),i(!0)}catch(t){console.error("Error requesting password reset:",t)}},handleResetSubmit:async e=>{if(e.preventDefault(),u(""),n.password!==n.confirmPassword?(u("Passwords do not match"),0):n.password.length<8?(u("Password must be at least 8 characters long"),0):/[a-z]/.test(n.password)?/[A-Z]/.test(n.password)?/\d/.test(n.password)?/[!@#$%^&*(),.?":{}|<>]/.test(n.password)||(u("Password must contain at least one special character"),0):(u("Password must contain at least one number"),0):(u("Password must contain at least one uppercase letter"),0):(u("Password must contain at least one lowercase letter"),0))try{const e=new URLSearchParams(window.location.search).get("token");if(!e)return void u("Reset token is missing");await(async e=>{const t=await fetch("".concat("https://api.trievents.ca","/auth/password/reset"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)});if(!t.ok){if("Invalid reset token"===(await t.json()).error)throw new Error("Reset link is invalid, please request a new one");throw new Error("Failed to reset password")}})({token:e,newPassword:n.password,tenantId:p.orgId||""}),h(!0)}catch(t){t instanceof Error?u(t.message):u("Oops! Something went wrong.")}}}},ik=()=>{const e=rg().navigateWithTenant,t=sk(),n=t.formData,r=t.emailSent,a=t.passwordError,s=t.resetSuccess,i=t.handleInputChange,o=t.handleRequestSubmit,l=t.handleResetSubmit,c=new URLSearchParams(window.location.search),u=!r&&!c.has("token");return(0,zc.jsx)("div",{className:"min-h-screen flex items-center justify-center px-4 py-12",style:{background:"linear-gradient(45deg, #f804b4 0%, #08ccc4 100%)"},children:(0,zc.jsx)("div",{className:"w-full max-w-lg bg-white rounded-lg shadow-2xl overflow-hidden",children:(0,zc.jsxs)("div",{className:"px-8 py-6",children:[(0,zc.jsxs)("div",{className:"flex flex-col items-center",children:[(0,zc.jsx)("img",{src:"/branding/TriEvents_Loading_Big_Text.gif",alt:"TriEvents Logo",className:"w-40 sm:w-48 h-auto"}),u&&(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:"Reset Password"}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center text-sm mt-0.5 mb-4",children:"We will send an email to reset your password"})]}),c.has("token")&&!s&&(0,zc.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:"Reset Password"}),s&&(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:"Success!"}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center text-sm mt-0.5 mb-4",children:"Your password has been successfully reset!"})]})]}),u&&(0,zc.jsxs)("form",{onSubmit:o,className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"space-y-1.5",children:[(0,zc.jsx)(Kb,{htmlFor:"email",children:"Email"}),(0,zc.jsx)(pg,{type:"email",id:"email",name:"email",placeholder:"Enter your email",value:n.email,onChange:e=>i("email",e.target.value),required:!0})]}),(0,zc.jsx)(fg,{type:"submit",size:"lg",className:"w-full transition-transform hover:scale-105",children:"Send Email"})]}),r&&(0,zc.jsx)(Iw,{className:"mt-4",children:(0,zc.jsx)(Rw,{children:"If this email is part of this organization, an email has been sent with a link to reset your password!"})}),c.has("token")&&!s&&(0,zc.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"space-y-1.5",children:[(0,zc.jsx)(Kb,{htmlFor:"password",children:"New Password"}),(0,zc.jsx)(pg,{type:"password",id:"password",name:"password",placeholder:"Enter your new password",value:n.password,onChange:e=>i("password",e.target.value),required:!0})]}),(0,zc.jsxs)("div",{className:"space-y-1.5",children:[(0,zc.jsx)(Kb,{htmlFor:"confirmPassword",children:"Confirm New Password"}),(0,zc.jsx)(pg,{type:"password",id:"confirmPassword",name:"confirmPassword",placeholder:"Confirm your new password",value:n.confirmPassword,onChange:e=>i("confirmPassword",e.target.value),required:!0})]}),(0,zc.jsxs)("div",{className:"text-xs text-muted-foreground space-y-1",children:[(0,zc.jsx)("p",{className:"font-medium",children:"Password Requirements:"}),(0,zc.jsxs)("ul",{className:"list-disc list-inside space-y-0.5",children:[(0,zc.jsx)("li",{children:"At least 8 characters long"}),(0,zc.jsx)("li",{children:"At least one lowercase letter (a-z)"}),(0,zc.jsx)("li",{children:"At least one uppercase letter (A-Z)"}),(0,zc.jsx)("li",{children:"At least one number (0-9)"}),(0,zc.jsxs)("li",{children:['At least one special character (!@#$%^&*(),.?":',"|<>)"]})]})]}),a&&(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:a})}),(0,zc.jsx)(fg,{type:"submit",size:"lg",className:"w-full transition-transform hover:scale-105",children:"Reset Password"})]}),(0,zc.jsx)("div",{className:"flex flex-col-reverse sm:flex-row items-center justify-between gap-6 pt-4",children:(0,zc.jsxs)(fg,{variant:"outline",onClick:()=>
2e("/login"),className:"transform hover:scale-105 transition-all duration-200 w-full sm:w-auto",children:[(0,zc.jsx)(y_,{className:"h-4 w-4 mr-2"}),"Back"]})})]})})})},ok=t=>{let n=t.children;const r=l((0,e.useState)(!0),2),a=r[0],s=r[1],i=l((0,e.useState)(!1),2),o=i[0],c=i[1],u=rg().navigateWithTenant;return(0,e.useEffect)(()=>{(async()=>{try{const e=await Lu().doesSessionExist();c(e)}catch(XF){c(!1)}finally{s(!1)}})()},[]),a?(0,zc.jsx)(Wb,{loading:!0}):o?(u("/dashboard"),(0,zc.jsx)(Wb,{loading:!0})):(0,zc.jsx)(zc.Fragment,{children:n})},lk={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function ck(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const uk={date:ck({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ck({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ck({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},dk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function fk(e){return(t,n)=>{let r;if("formatting"===(null!==n&&void 0!==n&&n.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,a=null!==n&&void 0!==n&&n.width?String(n.width):t;r=e.formattingValues[a]||e.formattingValues[t]}else{const t=e.defaultWidth,a=null!==n&&void 0!==n&&n.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const hk={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:fk({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:fk({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:fk({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:fk({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:fk({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function pk(e){return function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(o,e=>e.test(i)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(o,e=>e.test(i));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}const mk={ordinalNumber:(gk={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.match(gk.matchPattern);if(!n)return null;const r=n[0],a=e.match(gk.parsePattern);if(!a)return null;let s=gk.valueCallback?gk.valueCallback(a[0]):a[0];return s=t.valueCallback?t.valueCallback(s):s,{value:s,rest:e.slice(r.length)}}),era:pk({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:pk({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:pk({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:pk({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:pk({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var gk;const vk={code:"en-US",formatDistance:(e,t,n)=>{let r;const a=lk[e];return r="string"===typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),null!==n&&void 0!==n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:uk,formatRelative:(e,t,n,r)=>dk[e],localize:hk,match:mk,options:{weekStartsOn:0,firstWeekContainsDate:1}};let xk={};function yk(){return xk}Math.pow(10,8);const bk=6048e5;function wk(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"===typeof e&&"[object Date]"===t?new e.constructor(+e):"number"===typeof e||"[object Number]"===t||"string"===typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function _k(e){const t=wk(e);return t.setHours(0,0,0,0),t}function kk(e){const t=wk(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function jk(e,t){const n=_k(e),r=_k(t),a=+n-kk(n),s=+r-kk(r);return Math.round((a-s)/864e5)}function Nk(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Sk(e){const t=wk(e),n=Nk(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Ck(e){const t=wk(e);return jk(t,Sk(t))+1}function Ek(e,t){var n,r,a,s,i,o;const l=yk(),c=null!==(n=null!==(r=null!==(a=null!==(s=null===t||void 0===t?void 0:t.weekStartsOn)&&void 0!==s?s:null===t||void 0===t||null===(i=t.locale)||void 0===i||null===(i=i.options)||void 0===i?void 0:i.weekStartsOn)&&void 0!==a?a:l.weekStartsOn)&&void 0!==r?r:null===(o=l.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.weekStartsOn)&&void 0!==n?n:0,u=wk(e),d=u.getDay(),f=(d<c?7:0)+d-c;return u.setDate(u.getDate()-f),u.setHours(0,0,0,0),u}function Tk(e){return Ek(e,{weekStartsOn:1}
vendor: 11,716 bytes, line 2
2)}function Ik(e){const t=wk(e),n=t.getFullYear(),r=Nk(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=Tk(r),s=Nk(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const i=Tk(s);return t.getTime()>=a.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Pk(e){const t=Ik(e),n=Nk(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Tk(n)}function Rk(e){const t=wk(e),n=+Tk(t)-+Pk(t);return Math.round(n/bk)+1}function Ok(e,t){var n,r,a,s,i,o;const l=wk(e),c=l.getFullYear(),u=yk(),d=null!==(n=null!==(r=null!==(a=null!==(s=null===t||void 0===t?void 0:t.firstWeekContainsDate)&&void 0!==s?s:null===t||void 0===t||null===(i=t.locale)||void 0===i||null===(i=i.options)||void 0===i?void 0:i.firstWeekContainsDate)&&void 0!==a?a:u.firstWeekContainsDate)&&void 0!==r?r:null===(o=u.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==n?n:1,f=Nk(e,0);f.setFullYear(c+1,0,d),f.setHours(0,0,0,0);const h=Ek(f,t),p=Nk(e,0);p.setFullYear(c,0,d),p.setHours(0,0,0,0);const m=Ek(p,t);return l.getTime()>=h.getTime()?c+1:l.getTime()>=m.getTime()?c:c-1}function Ak(e,t){var n,r,a,s,i,o;const l=yk(),c=null!==(n=null!==(r=null!==(a=null!==(s=null===t||void 0===t?void 0:t.firstWeekContainsDate)&&void 0!==s?s:null===t||void 0===t||null===(i=t.locale)||void 0===i||null===(i=i.options)||void 0===i?void 0:i.firstWeekContainsDate)&&void 0!==a?a:l.firstWeekContainsDate)&&void 0!==r?r:null===(o=l.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==n?n:1,u=Ok(e,t),d=Nk(e,0);d.setFullYear(u,0,c),d.setHours(0,0,0,0);return Ek(d,t)}function Dk(e,t){const n=wk(e),r=+Ek(n,t)-+Ak(n,t);return Math.round(r/bk)+1}function Mk(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Fk={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Mk("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):Mk(n+1,2)},d:(e,t)=>Mk(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>Mk(e.getHours()%12||12,t.length),H:(e,t)=>Mk(e.getHours(),t.length),m:(e,t)=>Mk(e.getMinutes(),t.length),s:(e,t)=>Mk(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return Mk(Math.trunc(r*Math.pow(10,n-3)),t.length)}},Lk="midnight",Uk="noon",Hk="morning",zk="afternoon",Bk="evening",Wk="night",qk={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return Fk.y(e,t)},Y:function(e,t,n,r){const a=Ok(e,r),s=a>0?a:1-a;if("YY"===t){return Mk(s%100,2)}return"Yo"===t?n.ordinalNumber(s,{unit:"year"}):Mk(s,t.length)},R:function(e,t){return Mk(Ik(e),t.length)},u:function(e,t){return Mk(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Mk(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Mk(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Fk.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Mk(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=Dk(e,r);return"wo"===t?n.ordinalNumber(a,{unit:"week"}):Mk(a,t.length)},I:function(e,t,n){const r=Rk(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):Mk(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Fk.d(e,t)},D:function(e,t,n){const r=Ck(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):Mk(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Mk(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Mk(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=0===r?7:r;switch(t){case"i":return String(a);case"ii":return Mk(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(a=12===r?Uk:0===r?Lk:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(a=r>=17?Bk:r>=12?zk:r>=4?Hk:Wk,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return Fk.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Fk.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):Mk(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):Mk(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Fk.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Fk.s(e,t)},S:function(e,t){return Fk.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return $k(r);case"XXXX":case"XX":return Gk(r);default:return Gk(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return $k(r);case"xxxx":case"xx":return Gk(r);default:return Gk(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vk(r,":");default:return"GMT"+Gk(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vk(r,":");default:return"GMT"+Gk(r,":")}},t:function(e,t,n){return Mk(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return Mk(e.getTime(),t.length)}};function Vk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),s=r%60;return 0===s?n+String(a):n+String(a)+t+Mk(s,2)}function $k(e,t){if(e%60===0){return(e>0?"-":"+")+Mk(Math.abs(e)/60,2)}return Gk(e,t)}function Gk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e>0?"-":"+",r=Math.abs(e);return n+Mk(Math.trunc(r/60),2)+t+Mk(r%60,2)}const Yk=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Kk=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Zk={p:Kk,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Yk(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"})}return s.replace("{{date}}",Yk(r,t)).replace("{{time}}",Kk(a,t))}},Jk=/^D+$/,Xk=/^Y+$/,Qk=["D","DD","YY","YYYY"];function ej(e){return e instanceof Date||"object"===typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function tj(e){if(!ej(e)&&"number"!==typeof e)return!1;const t=wk(e);return!isNaN(Number(t))}const nj=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rj=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,aj=/^'([^]*?)'?$/,sj=/''/g,ij=/[a-zA-Z]/;function oj(e,t,n){var r,a,s,i,o,l,c,u,d,f,h,p,m,g;const v=yk(),x=null!==(r=null!==(a=null===n||void 0===n?void 0:n.locale)&&void 0!==a?a:v.locale)&&void 0!==r?r:vk,y=null!==(s=null!==(i=null!==(o=null!==(l=null===n||void 0===n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null===n||void 0===n||null===(c=n.locale)||void 0===c||null===(c=c.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==o?o:v.firstWeekContainsDate)&&void 0!==i?i:null===(u=v.locale)||void 0===u||null===(u=u.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==s?s:1,b=null!==(d=null!==(f=null!==(h=null!==(p=null===n||void 0===n?void 0:n.weekStartsOn)&&void 0!==p?p:null===n||void 0===n||null===(m=n.locale)||void 0===m||null===(m=m.options)||void 0===m?void 0:m.weekStartsOn)&&void 0!==h?h:v.weekStartsOn)&&void 0!==f?f:null===(g=v.locale)||void 0===g||null===(g=g.options)||void 0===g?void 0:g.weekStartsOn)&&void 0!==d?d:0,w=wk(e);if(!tj(w))throw new RangeError("Invalid time value");let _=t.match(rj).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,Zk[t])(e,x.formatLong)}return e}).join("").match(nj).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:lj(e)};if(qk[t])return{isToken:!0,value:e};
2if(t.match(ij))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});x.localize.preprocessor&&(_=x.localize.preprocessor(w,_));const k={firstWeekContainsDate:y,weekStartsOn:b,locale:x};return _.map(r=>{if(!r.isToken)return r.value;const a=r.value;(null!==n&&void 0!==n&&n.useAdditionalWeekYearTokens||!function(e){return Xk.test(e)}(a))&&(null!==n&&void 0!==n&&n.useAdditionalDayOfYearTokens||!function(e){return Jk.test(e)}(a))||function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return"Use `".concat(e.toLowerCase(),"` instead of `").concat(e,"` (in `").concat(t,"`) for formatting ").concat(r," to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")}(e,t,n);if(console.warn(r),Qk.includes(e))throw new RangeError(r)}(a,t,String(e));return(0,qk[a[0]])(w,a,x.localize,k)}).join("")}function lj(e){const t=e.match(aj);return t?t[1].replace(sj,"'"):e}const cj=Iu("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const uj=function(e){let t=e.children,n=e.showCreateEvent,r=void 0!==n&&n;const a=ng(),s=a.organization,i=a.loading,o=a.error,l=rg().getTenantPath;return i?(0,zc.jsx)(Wb,{}):o?(0,zc.jsx)(Rb,{className:"border-2 h-full flex items-center justify-center",children:(0,zc.jsxs)(Mb,{className:"text-center space-y-4 py-8",children:[(0,zc.jsx)("h2",{className:"text-2xl font-bold",children:"Organization Not Found"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:o instanceof Error?o.message:String(o)}),(0,zc.jsx)(fg,{asChild:!0,variant:"default",size:"lg",children:(0,zc.jsx)(Ol,{to:"/",children:"Return Home"})})]})}):s?(0,zc.jsxs)("div",{children:[r&&(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,zc.jsx)(Rb,{className:"flex-1",children:(0,zc.jsx)(Mb,{className:"p-8",children:(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("h1",{className:"text-4xl font-bold tracking-tight",children:s.name}),(0,zc.jsx)(wg,{className:"mt-3 h-[2px] bg-black/10"})]}),(0,zc.jsx)("div",{className:"max-h-12 overflow-y-auto",children:(0,zc.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed",children:s.description})})]})})}),(0,zc.jsx)(Rb,{className:"w-full md:w-[300px] h-fit",children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("h3",{className:"text-lg font-semibold",children:"Ready to create something amazing?"}),(0,zc.jsx)("p",{className:"text-muted-foreground mt-1",children:"Start planning your next event"})]}),(0,zc.jsx)(fg,{asChild:!0,size:"lg",className:"w-full gap-3 text-lg transition-transform duration-200 hover:scale-105",children:(0,zc.jsxs)(Ol,{to:l("/events/create"),children:[(0,zc.jsx)(cj,{className:"h-6 w-6 stroke-[3.5]"}),"Create Event"]})})]})})})]}),t]}),!r&&(0,zc.jsx)("div",{children:t})]}):(0,zc.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,zc.jsxs)("div",{className:"text-center",children:[(0,zc.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Loading organization..."})]})})},dj=Iu("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),fj=Iu("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);function hj(e){const t=wk(e);return t.setDate(1),t.setHours(0,0,0,0),t}function pj(e){const t=wk(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function mj(e,t){const n=wk(e),r=wk(t);return n.getFullYear()===r.getFullYear()}function gj(e){const t=wk(e),n=t.getFullYear(),r=t.getMonth(),a=Nk(e,0);return a.setFullYear(n,r+1,0),a.setHours(0,0,0,0),a.getDate()}function vj(e,t){const n=wk(e),r=n.getFullYear(),a=n.getDate(),s=Nk(e,0);s.setFullYear(r,t,15),s.setHours(0,0,0,0);const i=gj(s);return n.setMonth(t,Math.min(a,i)),n}function xj(e,t){const n=wk(e);return isNaN(+n)?Nk(e,NaN):(n.setFullYear(t),n)}function yj(e,t){const n=wk(e),r=wk(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function bj(e,t){const n=wk(e);if(isNaN(t))return Nk(e,NaN);if(!t)return n;const r=n.getDate(),a=Nk(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);return r>=a.getDate()?a:(n.setFullYear(a.getFullYear(),a.getMonth(),r),n)}function wj(e,t){const n=wk(e),r=wk(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function _j(e,t){return+wk(e)<+wk(t)}function kj(e,t){const n=wk(e);return isNaN(t)?Nk(e,NaN):t?(n.setDate(n.getDate()+t),n):n}function jj(e,t){return+_k(e)===+_k(t)}function Nj(e,t){const n=wk(e),r=wk(t);return n.getTime()>r.getTime()}function Sj(e,t){return kj(e,-t)}function Cj(e,t){return kj(e,7*t)}function Ej(e,t){return bj(e,12*t)}function Tj(e,t){var n,r,a,s,i,o;const l=yk(),c=null!==(n=null!==(r=null!==(a=null!==(s=null===t||void 0===t?void 0:t.weekStartsOn)&&void 0!==s?s:null===t||void 0===t||null===(i=t.locale)||void 0===i||null===(i=i.options)||void 0===i?void 0:i.weekStartsOn)&&void 0!==a?a:l.weekStartsOn)&&void 0!==r?r:null===(o=l.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.weekStartsOn)&&void 0!==n?n:0,u=wk(e),d=u.getDay(),f=6+(d<c?-7:0)-(d-c);return u.setDate(u.getDate()+f),u.setHours(23,59,59,999),u}function Ij(e){return Tj(e,{weekStartsOn:1}
2)}function Pj(e){let t;return e.forEach(function(e){const n=wk(e);(void 0===t||t<n||isNaN(Number(n)))&&(t=n)}),t||new Date(NaN)}function Rj(e){let t;return e.forEach(e=>{const n=wk(e);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function Oj(e){return Math.trunc(+wk(e)/1e3)}function Aj(e,t,n){const r=Ek(e,n),a=Ek(t,n),s=+r-kk(r),i=+a-kk(a);return Math.round((s-i)/bk)}function Dj(e){const t=wk(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function Mj(e,t){return Aj(Dj(e),hj(e),t)+1}var Fj=function(){return Fj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Fj.apply(this,arguments)};function Lj(e,t,n){if(n||2===arguments.length)for(var r,a=0,s=t.length;a<s;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}function Uj(e){return"multiple"===e.mode}function Hj(e){return"range"===e.mode}function zj(e){return"single"===e.mode}"function"===typeof SuppressedError&&SuppressedError;var Bj={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var Wj=Object.freeze({__proto__:null,formatCaption:function(e,t){return oj(e,"LLLL y",t)},formatDay:function(e,t){return oj(e,"d",t)},formatMonthCaption:function(e,t){return oj(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return oj(e,"cccccc",t)},formatYearCaption:function(e,t){return oj(e,"yyyy",t)}}),qj=Object.freeze({__proto__:null,labelDay:function(e,t,n){return oj(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return oj(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});function Vj(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,a=e.toMonth,s=e.fromDate,i=e.toDate;return r?s=hj(r):t&&(s=new Date(t,0,1)),a?i=pj(a):n&&(i=new Date(n,11,31)),{fromDate:s?_k(s):void 0,toDate:i?_k(i):void 0}}var $j=(0,e.createContext)(void 0);function Gj(e){var t,n,r=e.initialProps,a=function(){var e=Bj,t=vk,n=new Date;return{captionLayout:"buttons",classNames:e,formatters:Wj,labels:qj,locale:t,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:n,mode:"default"}}(),s=Vj(r),i=s.fromDate,o=s.toDate,l=null!==(t=r.captionLayout)&&void 0!==t?t:a.captionLayout;"buttons"===l||i&&o||(l="buttons"),(zj(r)||Uj(r)||Hj(r))&&(n=r.onSelect);var c=Fj(Fj(Fj({},a),r),{captionLayout:l,classNames:Fj(Fj({},a.classNames),r.classNames),components:Fj({},r.components),formatters:Fj(Fj({},a.formatters),r.formatters),fromDate:i,labels:Fj(Fj({},a.labels),r.labels),mode:r.mode||a.mode,modifiers:Fj(Fj({},a.modifiers),r.modifiers),modifiersClassNames:Fj(Fj({},a.modifiersClassNames),r.modifiersClassNames),onSelect:n,styles:Fj(Fj({},a.styles),r.styles),toDate:o});return(0,zc.jsx)($j.Provider,{value:c,children:e.children})}function Yj(){var t=(0,e.useContext)($j);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function Kj(e){var t=Yj(),n=t.locale,r=t.classNames,a=t.styles,s=t.formatters.formatCaption;return(0,zc.jsx)("div",{className:r.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:s(e.displayMonth,{locale:n})})}function Zj(e){return(0,zc.jsx)("svg",Fj({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:(0,zc.jsx)("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.7
278175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Jj(e){var t,n,r=e.onChange,a=e.value,s=e.children,i=e.caption,o=e.className,l=e.style,c=Yj(),u=null!==(n=null===(t=c.components)||void 0===t?void 0:t.IconDropdown)&&void 0!==n?n:Zj;return(0,zc.jsxs)("div",{className:o,style:l,children:[(0,zc.jsx)("span",{className:c.classNames.vhidden,children:e["aria-label"]}),(0,zc.jsx)("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:a,onChange:r,children:s}),(0,zc.jsxs)("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[i,(0,zc.jsx)(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function Xj(e){var t,n=Yj(),r=n.fromDate,a=n.toDate,s=n.styles,i=n.locale,o=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return(0,zc.jsx)(zc.Fragment,{});if(!a)return(0,zc.jsx)(zc.Fragment,{});var d=[];if(mj(r,a))for(var f=hj(r),h=r.getMonth();h<=a.getMonth();h++)d.push(vj(f,h));else for(f=hj(new Date),h=0;h<=11;h++)d.push(vj(f,h));var p=null!==(t=null===c||void 0===c?void 0:c.Dropdown)&&void 0!==t?t:Jj;return(0,zc.jsx)(p,{name:"months","aria-label":u(),className:l.dropdown_month,style:s.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=vj(hj(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:o(e.displayMonth,{locale:i}),children:d.map(function(e){return(0,zc.jsx)("option",{value:e.getMonth(),children:o(e,{locale:i})},e.getMonth())})})}function Qj(e){var t,n=e.displayMonth,r=Yj(),a=r.fromDate,s=r.toDate,i=r.locale,o=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,f=[];if(!a)return(0,zc.jsx)(zc.Fragment,{});if(!s)return(0,zc.jsx)(zc.Fragment,{});for(var h=a.getFullYear(),p=s.getFullYear(),m=h;m<=p;m++)f.push(xj(Sk(new Date),m));var g=null!==(t=null===c||void 0===c?void 0:c.Dropdown)&&void 0!==t?t:Jj;return(0,zc.jsx)(g,{name:"years","aria-label":d(),className:l.dropdown_year,style:o.dropdown_year,onChange:function(t){var r=xj(hj(n),Number(t.target.value));e.onChange(r)},value:n.getFullYear(),caption:u(n,{locale:i}),children:f.map(function(e){return(0,zc.jsx)("option",{value:e.getFullYear(),children:u(e,{locale:i})},e.getFullYear())})})}function eN(){var t=Yj(),n=function(e){var t=e.month,n=e.defaultMonth,r=e.today,a=t||n||r||new Date,s=e.toDate,i=e.fromDate,o=e.numberOfMonths,l=void 0===o?1:o;return s&&yj(s,a)<0&&(a=bj(s,-1*(l-1))),i&&yj(a,i)<0&&(a=i),hj(a)}(t),r=function(t,n){var r=(0,e.useState)(t),a=r[0];return[void 0===n?a:n,r[1]]}(n,t.month),a=r[0],s=r[1];return[a,function(e){var n;if(!t.disableNavigation){var r=hj(e);s(r),null===(n=t.onMonthChange)||void 0===n||n.call(t,r)}}]}var tN=(0,e.createContext)(void 0);function nN(e){var t=Yj(),n=eN(),r=n[0],a=n[1],s=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,a=hj(e),s=yj(hj(bj(a,r)),a),i=[],o=0;o<s;o++){var l=bj(a,o);i.push(l)}return n&&(i=i.reverse()),i}(r,t),i=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,a=t.numberOfMonths,s=void 0===a?1:a,i=r?s:1,o=hj(e);if(!n)return bj(o,i);if(!(yj(n,e)<s))return bj(o,i)}}(r,t),o=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,a=t.numberOfMonths,s=r?void 0===a?1:a:1,i=hj(e);if(!n)return bj(i,-s);if(!(yj(i,n)<=0))return bj(i,-s)}}(r,t),l=function(e){return s.some(function(t){return wj(e,t)})},c={currentMonth:r,displayMonths:s,goToMonth:a,goToDate:function(e,n){l(e)||(n&&_j(e,n)?a(bj(e,1+-1*t.numberOfMonths)):a(e))},previousMonth:o,nextMonth:i,isDateDisplayed:l};return(0,zc.jsx)(tN.Provider,{value:c,children:e.children})}function rN(){var t=(0,e.useContext)(tN);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function aN(e){var t,n=Yj(),r=n.classNames,a=n.styles,s=n.components,i=rN().goToMonth,o=function(t){i(bj(t,e.displayIndex?-e.dis
2playIndex:0))},l=null!==(t=null===s||void 0===s?void 0:s.CaptionLabel)&&void 0!==t?t:Kj,c=(0,zc.jsx)(l,{id:e.id,displayMonth:e.displayMonth});return(0,zc.jsxs)("div",{className:r.caption_dropdowns,style:a.caption_dropdowns,children:[(0,zc.jsx)("div",{className:r.vhidden,children:c}),(0,zc.jsx)(Xj,{onChange:o,displayMonth:e.displayMonth}),(0,zc.jsx)(Qj,{onChange:o,displayMonth:e.displayMonth})]})}function sN(e){return(0,zc.jsx)("svg",Fj({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:(0,zc.jsx)("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function iN(e){return(0,zc.jsx)("svg",Fj({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:(0,zc.jsx)("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var oN=(0,e.forwardRef)(function(e,t){var n=Yj(),r=n.classNames,a=n.styles,s=[r.button_reset,r.button];e.className&&s.push(e.className);var i=s.join(" "),o=Fj(Fj({},a.button_reset),a.button);return e.style&&Object.assign(o,e.style),(0,zc.jsx)("button",Fj({},e,{ref:t,type:"button",className:i,style:o}))});function lN(e){var t,n,r=Yj(),a=r.dir,s=r.locale,i=r.classNames,o=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return(0,zc.jsx)(zc.Fragment,{});var f=c(e.previousMonth,{locale:s}),h=[i.nav_button,i.nav_button_previous].join(" "),p=u(e.nextMonth,{locale:s}),m=[i.nav_button,i.nav_button_next].join(" "),g=null!==(t=null===d||void 0===d?void 0:d.IconRight)&&void 0!==t?t:iN,v=null!==(n=null===d||void 0===d?void 0:d.IconLeft)&&void 0!==n?n:sN;return(0,zc.jsxs)("div",{className:i.nav,style:o.nav,children:[!e.hidePrevious&&(0,zc.jsx)(oN,{name:"previous-month","aria-label":f,className:h,style:o.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===a?(0,zc.jsx)(g,{className:i.nav_icon,style:o.nav_icon}):(0,zc.jsx)(v,{className:i.nav_icon,style:o.nav_icon})}),!e.hideNext&&(0,zc.jsx)(oN,{name:"next-month","aria-label":p,className:m,style:o.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===a?(0,zc.jsx)(v,{className:i.nav_icon,style:o.nav_icon}):(0,zc.jsx)(g,{className:i.nav_icon,style:o.nav_icon})})]})}function cN(e){var t=Yj().numberOfMonths,n=rN(),r=n.previousMonth,a=n.nextMonth,s=n.goToMonth,i=n.displayMonths,o=i.findIndex(function(t){return wj(e.displayMonth,t)}),l=0===o,c=o===i.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l);return(0,zc.jsx)(lN,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:a,previousMonth:r,onPreviousClick:function(){r&&s(r)},onNextClick:function(){a&&s(a)}})}function uN(e){var t,n,r=Yj(),a=r.classNames,s=r.disableNavigation,i=r.styles,o=r.captionLayout,l=r.components,c=null!==(t=null===l||void 0===l?void 0:l.CaptionLabel)&&void 0!==t?t:Kj;return n=s?(0,zc.jsx)(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===o?(0,zc.jsx)(aN,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===o?(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(aN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),(0,zc.jsx)(cN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),(0,zc.jsx)(cN,{displayMonth:e.displayMonth,id:e.id})]}),(0,zc.jsx)("div",{className:a.caption,style:i.caption,children:n})}function dN(e){var t=Yj(),n=t.footer,r=t.styles,a=t.classNames.tfoot;return n?(0,zc.jsx)("tfoot",{className:a,style:r.tfoot,children:(0,zc.jsx)("tr",{children:(0,zc.jsx)("td",{colSpan:8,children:n})})}):(0,zc.jsx)(zc.Fragment,{})}function fN(){var e=Yj(),t=e.classNames,n=e.styles,r=e.showWeekNumber,a=e.locale,s=e.weekStartsOn,i=e.ISOWeek,o=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=function(e,t,n){for(var r=n?Tk(new Date):Ek(new Date,{locale:e,weekStartsOn:t}),a=[],s=0;s<7;s++){var i=kj(r,s);a.push(i)}return a}(a,s,i);return(0,zc.jsxs)("tr",{style:n.head_row,className:t.head_row,children:[r&&(0,zc.jsx)("td",{style:n.head_cell,className:t.head_cell}),c.map(function(e,r){return(0,zc.jsx)("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(e,{locale:a}),children:o(e,{locale:a})},r)})]})}function hN(){var e,t=Yj(),n=t.classNames,r=t.styles,a=t.components,s=null!==(e=null===a||void 0===a?void 0:a.HeadRow)&&void 0!==e?e:fN;return(0,zc.jsx)("thead",{style:r.head,className:n.head,children:(0,zc.jsx)(s,{})})}function pN(e){var t=Yj(),n=t.locale,r=t.formatters.formatDay;return(0,zc.jsx)(zc.Fragment,{children:r(e.date,{locale:n})})}var mN=(0,e.createContext)(void 0);function gN(e){if(!Uj(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return(0,zc.jsx)(mN.Provider,{value:t,children:e.children})}return(0,zc.jsx)(vN,{initialProps:e.initialProps,children:e.children})}function vN(e){var t=e.initialProps,n=e.children,r=t.selected,a=t.min,s=t.max,i={disabled:[]};r&&i.disabled.push(function(e){var t=s&&r.length>s-1,n=r.some(function(t){return jj(t,e)});return Boolean(t&&!n)});var o={selected:r,onDayClick:function(e,n,i){var o,l;if((null===(o=t.onDayClick)||void 0===o||o.call(t,e,n,i),!Boolean(n.selected&&a&&(null===r||void 0===r?void 0:r.length)===a))&&!Boolean(!n.selected&&s&&(null===r||void 0===r?void 0:r.length)===s)){var c=r?Lj([],r,!0):[];if(n.selected){var u=c.findIndex(function(t){return jj(e,t)});c.splice(u,1)}else c.push(e);null===(l=t.onSelect)||void 0===l||l.call(t,c,e,n,i)}},modifiers:i};return(0,zc.jsx)(mN.Provider,{value:o,children:n})}function xN(){var t=(0,e.useContext)(mN);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}var yN,bN=(0,e.createContext)(void 0);function wN(e){if(!Hj(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return(0,zc.jsx)(bN.Provider,{value:t,children:e.children})}return(0,zc.jsx)(_N,{initialProps:e.initialProps,children:e.children})}function _N(e){var t=e.initialProps,n=e.children,r=t.selected,a=r||{},s=a.from,i=a.to,o=t.min,l=t.max,c={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(c.range_start=[s],i?(c.range_end=[i],jj(s,i)||(c.range_middle=[{after:s,before:i}])):c.range_end=[s]):i&&(c.range_start=[i],c.range_end=[i]),o&&(s&&!i&&c.disabled.push({after:Sj(s,o-1),before:kj(s,o-1)}),s&&i&&c.disabled.push({after:s,before:kj(s,o-1)}),!s&&i&&c.disabled.push({after:Sj(i,o-1),before:kj(i,o-1)})),l){if(s&&!i&&(c.disabled.push({before:kj(s,1-l)}),c.disabled.push({after:kj(s,l-1)})),s&&i){var u=l-(jk(i,s)+1);c.disabled.push({before:Sj(s,u)}),c.disabled.push({after:kj(i,u)})}!s&&i&&(c.disabled.push({before:kj(i,1-l)}),c.disabled.push({after:kj(i,l-1)}))}return(0,zc.jsx)(bN.Provider,{value:{selected:r,onDayClick:function(e,n,a){var s,i;null===(s=t.onDayClick)||void 0===s||s.call(t,e,n,a);var o=function(e,t){var n=t||{},r=n.from,a=n.to;if(r&&a){if(jj(a,e)&&jj(r,e))return;if(jj(a,e))return{from:a,to:void 0};if(jj(r,e))return;return Nj(r,e)?{from:e,to:a}:{from:r,to:e}}return a?Nj(e,a)?{from:a,to:e}:{from:e,to:a}:r?_j(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}(e,r);null===(i=t.onSelect)||void 0===i||i.call(t,o,e,n,a)},modifiers:c},children:n})}function kN(){var t=(0,e.useContext)(bN);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function jN(e){return Array.isArray(e)?Lj([],e,!0):void 0!==e?[e]:[]}!function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"}(yN||(yN={}));var NN=yN.Selected,SN=yN.Disabled,CN=yN.Hidden,EN=yN.Today,TN=yN.RangeEnd,IN=yN.RangeMiddle,PN=yN.RangeStart,RN=yN.Outside;var ON=(0,e.createContext)(void 0);function AN(e){var t=Yj(),n=function(e,t,n){var r,a=((r={})[NN]=jN(e.selected),r[SN]=jN(e.disabled),r[CN]=jN(e.hidden),r[EN]=[e.today],r[TN]=[],r[IN]=[],r[PN]=[],r[RN]=[],r);return e.fromDate&&a[SN].push({before:e.fromDate}),e.toDate&&a[SN].push({after:e.toDate}),Uj(e)?a[SN]=a[SN].concat(t.modifiers[SN]):Hj(e)&&(a[SN]=a[SN].concat(n.modifiers[SN]),a[PN]=n.modifiers[PN],a[IN]=n.modifiers[IN],a[TN]=n.modifiers[TN]),a}
2(t,xN(),kN()),r=function(e){var t={};return Object.entries(e).forEach(function(e){var n=e[0],r=e[1];t[n]=jN(r)}),t}(t.modifiers),a=Fj(Fj({},n),r);return(0,zc.jsx)(ON.Provider,{value:a,children:e.children})}function DN(){var t=(0,e.useContext)(ON);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function MN(e,t){return t.some(function(t){if("boolean"===typeof t)return t;if(ej(t))return jj(e,t);if(function(e){return Array.isArray(e)&&e.every(ej)}(t))return t.includes(e);if(function(e){return Boolean(e&&"object"===typeof e&&"from"in e)}(t))return function(e,t){var n,r=t.from,a=t.to;return r&&a?(jk(a,r)<0&&(r=(n=[a,r])[0],a=n[1]),jk(e,r)>=0&&jk(a,e)>=0):a?jj(a,e):!!r&&jj(r,e)}(e,t);if(function(e){return Boolean(e&&"object"===typeof e&&"dayOfWeek"in e)}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return Boolean(e&&"object"===typeof e&&"before"in e&&"after"in e)}(t)){var n=jk(t.before,e)>0,r=jk(t.after,e)<0;return Nj(t.before,t.after)?r&&n:n||r}return function(e){return Boolean(e&&"object"===typeof e&&"after"in e)}(t)?jk(e,t.after)>0:function(e){return Boolean(e&&"object"===typeof e&&"before"in e)}(t)?jk(t.before,e)>0:"function"===typeof t&&t(e)})}function FN(e,t,n){var r=Object.keys(t).reduce(function(n,r){var a=t[r];return MN(e,a)&&n.push(r),n},[]),a={};return r.forEach(function(e){return a[e]=!0}),n&&!wj(e,n)&&(a.outside=!0),a}function LN(e,t){var n=t.moveBy,r=t.direction,a=t.context,s=t.modifiers,i=t.retry,o=void 0===i?{count:0,lastFocused:e}:i,l=a.weekStartsOn,c=a.fromDate,u=a.toDate,d=a.locale,f={day:kj,week:Cj,month:bj,year:Ej,startOfWeek:function(e){return a.ISOWeek?Tk(e):Ek(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return a.ISOWeek?Ij(e):Tj(e,{locale:d,weekStartsOn:l})}}[n](e,"after"===r?1:-1);"before"===r&&c?f=Pj([c,f]):"after"===r&&u&&(f=Rj([u,f]));var h=!0;if(s){var p=FN(f,s);h=!p.disabled&&!p.hidden}return h?f:o.count>365?o.lastFocused:LN(f,{moveBy:n,direction:r,context:a,modifiers:s,retry:Fj(Fj({},o),{count:o.count+1})})}var UN=(0,e.createContext)(void 0);function HN(t){var n=rN(),r=DN(),a=(0,e.useState)(),s=a[0],i=a[1],o=(0,e.useState)(),l=o[0],c=o[1],u=function(e,t){for(var n,r,a=hj(e[0]),s=pj(e[e.length-1]),i=a;i<=s;){var o=FN(i,t);if(o.disabled||o.hidden)i=kj(i,1);else{if(o.selected)return i;o.today&&!r&&(r=i),n||(n=i),i=kj(i,1)}}return r||n}(n.displayMonths,r),d=(null!==s&&void 0!==s?s:l&&n.isDateDisplayed(l))?l:u,f=function(e){i(e)},h=Yj(),p=function(e,t){if(s){var a=LN(s,{moveBy:e,direction:t,context:h,modifiers:r});jj(s,a)||(n.goToDate(a,s),f(a))}},m={focusedDay:s,focusTarget:d,blur:function(){c(s),i(void 0)},focus:f,focusDayAfter:function(){return p("day","after")},focusDayBefore:function(){return p("day","before")},focusWeekAfter:function(){return p("week","after")},focusWeekBefore:function(){return p("week","before")},focusMonthBefore:function(){return p("month","before")},focusMonthAfter:function(){return p("month","after")},focusYearBefore:function(){return p("year","before")},focusYearAfter:function(){return p("year","after")},focusStartOfWeek:function(){return p("startOfWeek","before")},focusEndOfWeek:function(){return p("endOfWeek","after")}};return(0,zc.jsx)(UN.Provider,{value:m,children:t.children})}function zN(){var t=(0,e.useContext)(UN);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}var BN=(0,e.createContext)(void 0);function WN(e){if(!zj(e.initialProps)){var t={selected:void 0};return(0,zc.jsx)(BN.Provider,{value:t,children:e.children})}return(0,zc.jsx)(qN,{initialProps:e.initialProps,children:e.children})}function qN(e){var t=e.initialProps,n=e.children,r={selected:t.selected,onDayClick:function(e,n,r){var a,s,i;null===(a=t.onDayClick)||void 0===a||a.call(t,e,n,r),!n.selected||t.required?null===(i=t.onSelect)||void 0===i||i.call(t,e,e,n,r):null===(s=t.onSelect)||void 0===s||s.call(t,void 0,e,n,r)}};return(0,zc.jsx)(BN.Provider,{value:r,children:n})}function VN(){var t=(0,e.useContext)(BN);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function $N(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(t){var r=e.modifiersClassNames[t];if(r)n.push(r);else if(function(e){return Object.values(yN).includes(e)}(t)){var a=e.classNames["day_".concat(t)];a&&n.push(a)}}),n}function GN(t,n,r){var a,s,i,o=Yj(),l=zN(),c=function(e,t){return FN(e,DN(),t)}(t,n),u=function(e,t){var n=Yj(),r=VN(),a=xN(),s=kN(),i=zN(),o=i.focusDayAfter,l=i.focusDayBefore,c=i.focusWeekAfter,u=i.focusWeekBefore,d=i.blur,f=i.focus,h=i.focusMonthBefore,p=i.focusMonthAfter,m=i.focusYearBefore,g=i.focusYearAfter,v=i.focusStartOfWeek,x=i.focusEndOfWeek,y={onClick:function(i){var o,l,c,u;zj(n)?null===(o=r.onDayClick)||void 0===o||o.call(r,e,t,i):Uj(n)?null===(l=a.onDayCl
2ick)||void 0===l||l.call(a,e,t,i):Hj(n)?null===(c=s.onDayClick)||void 0===c||c.call(s,e,t,i):null===(u=n.onDayClick)||void 0===u||u.call(n,e,t,i)},onFocus:function(r){var a;f(e),null===(a=n.onDayFocus)||void 0===a||a.call(n,e,t,r)},onBlur:function(r){var a;d(),null===(a=n.onDayBlur)||void 0===a||a.call(n,e,t,r)},onKeyDown:function(r){var a;switch(r.key){case"ArrowLeft":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?o():l();break;case"ArrowRight":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?l():o();break;case"ArrowDown":r.preventDefault(),r.stopPropagation(),c();break;case"ArrowUp":r.preventDefault(),r.stopPropagation(),u();break;case"PageUp":r.preventDefault(),r.stopPropagation(),r.shiftKey?m():h();break;case"PageDown":r.preventDefault(),r.stopPropagation(),r.shiftKey?g():p();break;case"Home":r.preventDefault(),r.stopPropagation(),v();break;case"End":r.preventDefault(),r.stopPropagation(),x()}null===(a=n.onDayKeyDown)||void 0===a||a.call(n,e,t,r)},onKeyUp:function(r){var a;null===(a=n.onDayKeyUp)||void 0===a||a.call(n,e,t,r)},onMouseEnter:function(r){var a;null===(a=n.onDayMouseEnter)||void 0===a||a.call(n,e,t,r)},onMouseLeave:function(r){var a;null===(a=n.onDayMouseLeave)||void 0===a||a.call(n,e,t,r)},onPointerEnter:function(r){var a;null===(a=n.onDayPointerEnter)||void 0===a||a.call(n,e,t,r)},onPointerLeave:function(r){var a;null===(a=n.onDayPointerLeave)||void 0===a||a.call(n,e,t,r)},onTouchCancel:function(r){var a;null===(a=n.onDayTouchCancel)||void 0===a||a.call(n,e,t,r)},onTouchEnd:function(r){var a;null===(a=n.onDayTouchEnd)||void 0===a||a.call(n,e,t,r)},onTouchMove:function(r){var a;null===(a=n.onDayTouchMove)||void 0===a||a.call(n,e,t,r)},onTouchStart:function(r){var a;null===(a=n.onDayTouchStart)||void 0===a||a.call(n,e,t,r)}};return y}(t,c),d=function(){var e=Yj(),t=VN(),n=xN(),r=kN();return zj(e)?t.selected:Uj(e)?n.selected:Hj(e)?r.selected:void 0}(),f=Boolean(o.onDayClick||"default"!==o.mode);(0,e.useEffect)(function(){var e;c.outside||l.focusedDay&&f&&jj(l.focusedDay,t)&&(null===(e=r.current)||void 0===e||e.focus())},[l.focusedDay,t,r,f,c.outside]);var h=$N(o,c).join(" "),p=function(e,t){var n=Fj({},e.styles.day);return Object.keys(t).forEach(function(t){var r;n=Fj(Fj({},n),null===(r=e.modifiersStyles)||void 0===r?void 0:r[t])}),n}(o,c),m=Boolean(c.outside&&!o.showOutsideDays||c.hidden),g=null!==(i=null===(s=o.components)||void 0===s?void 0:s.DayContent)&&void 0!==i?i:pN,v={style:p,className:h,children:(0,zc.jsx)(g,{date:t,displayMonth:n,activeModifiers:c}),role:"gridcell"},x=l.focusTarget&&jj(l.focusTarget,t)&&!c.outside,y=l.focusedDay&&jj(l.focusedDay,t),b=Fj(Fj(Fj({},v),((a={disabled:c.disabled,role:"gridcell"})["aria-selected"]=c.selected,a.tabIndex=y||x?0:-1,a)),u);return{isButton:f,isHidden:m,activeModifiers:c,selectedDays:d,buttonProps:b,divProps:v}}function YN(t){var n=(0,e.useRef)(null),r=GN(t.date,t.displayMonth,n);return r.isHidden?(0,zc.jsx)("div",{role:"gridcell"}):r.isButton?(0,zc.jsx)(oN,Fj({name:"day",ref:n},r.buttonProps)):(0,zc.jsx)("div",Fj({},r.divProps))}function KN(e){var t=e.number,n=e.dates,r=Yj(),a=r.onWeekNumberClick,s=r.styles,i=r.classNames,o=r.locale,l=r.labels.labelWeekNumber,c=(0,r.formatters.formatWeekNumber)(Number(t),{locale:o});if(!a)return(0,zc.jsx)("span",{className:i.weeknumber,style:s.weeknumber,children:c});var u=l(Number(t),{locale:o});return(0,zc.jsx)(oN,{name:"week-number","aria-label":u,className:i.weeknumber,style:s.weeknumber,onClick:function(e){a(t,n,e)},children:c})}function ZN(e){var t,n,r,a=Yj(),s=a.styles,i=a.classNames,o=a.showWeekNumber,l=a.components,c=null!==(t=null===l||void 0===l?void 0:l.Day)&&void 0!==t?t:YN,u=null!==(n=null===l||void 0===l?void 0:l.WeekNumber)&&void 0!==n?n:KN;return o&&(r=(0,zc.jsx)("td",{className:i.cell,style:s.cell,children:(0,zc.jsx)(u,{number:e.weekNumber,dates:e.dates})})),(0,zc.jsxs)("tr",{className:i.row,style:s.row,children:[r,e.dates.map(function(t){return(0,zc.jsx)("td",{className:i.cell,style:s.cell,role:"presentation",children:(0,zc.jsx)(c,{displayMonth:e.displayMonth,date:t})},Oj(t))})]})}
2function JN(e,t,n){for(var r=(null===n||void 0===n?void 0:n.ISOWeek)?Ij(t):Tj(t,n),a=(null===n||void 0===n?void 0:n.ISOWeek)?Tk(e):Ek(e,n),s=jk(r,a),i=[],o=0;o<=s;o++)i.push(kj(a,o));return i.reduce(function(e,t){var r=(null===n||void 0===n?void 0:n.ISOWeek)?Rk(t):Dk(t,n),a=e.find(function(e){return e.weekNumber===r});return a?(a.dates.push(t),e):(e.push({weekNumber:r,dates:[t]}),e)},[])}function XN(e){var t,n,r,a=Yj(),s=a.locale,i=a.classNames,o=a.styles,l=a.hideHead,c=a.fixedWeeks,u=a.components,d=a.weekStartsOn,f=a.firstWeekContainsDate,h=a.ISOWeek,p=function(e,t){var n=JN(hj(e),pj(e),t);if(null===t||void 0===t?void 0:t.useFixedWeeks){var r=Mj(e,t);if(r<6){var a=n[n.length-1],s=a.dates[a.dates.length-1],i=Cj(s,6-r),o=JN(Cj(s,1),i,t);n.push.apply(n,o)}}return n}(e.displayMonth,{useFixedWeeks:Boolean(c),ISOWeek:h,locale:s,weekStartsOn:d,firstWeekContainsDate:f}),m=null!==(t=null===u||void 0===u?void 0:u.Head)&&void 0!==t?t:hN,g=null!==(n=null===u||void 0===u?void 0:u.Row)&&void 0!==n?n:ZN,v=null!==(r=null===u||void 0===u?void 0:u.Footer)&&void 0!==r?r:dN;return(0,zc.jsxs)("table",{id:e.id,className:i.table,style:o.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&(0,zc.jsx)(m,{}),(0,zc.jsx)("tbody",{className:i.tbody,style:o.tbody,children:p.map(function(t){return(0,zc.jsx)(g,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)})}),(0,zc.jsx)(v,{displayMonth:e.displayMonth})]})}var QN="undefined"!==typeof window&&window.document&&window.document.createElement?e.useLayoutEffect:e.useEffect,eS=!1,tS=0;function nS(){return"react-day-picker-".concat(++tS)}function rS(t){var n,r,a=Yj(),s=a.dir,i=a.classNames,o=a.styles,l=a.components,c=rN().displayMonths,u=function(t){var n,r=null!==t&&void 0!==t?t:eS?nS():null,a=(0,e.useState)(r),s=a[0],i=a[1];return QN(function(){null===s&&i(nS())},[]),(0,e.useEffect)(function(){!1===eS&&(eS=!0)},[]),null!==(n=null!==t&&void 0!==t?t:s)&&void 0!==n?n:void 0}(a.id?"".concat(a.id,"-").concat(t.displayIndex):void 0),d=a.id?"".concat(a.id,"-grid-").concat(t.displayIndex):void 0,f=[i.month],h=o.month,p=0===t.displayIndex,m=t.displayIndex===c.length-1,g=!p&&!m;"rtl"===s&&(m=(n=[p,m])[0],p=n[1]),p&&(f.push(i.caption_start),h=Fj(Fj({},h),o.caption_start)),m&&(f.push(i.caption_end),h=Fj(Fj({},h),o.caption_end)),g&&(f.push(i.caption_between),h=Fj(Fj({},h),o.caption_between));var v=null!==(r=null===l||void 0===l?void 0:l.Caption)&&void 0!==r?r:uN;return(0,zc.jsxs)("div",{className:f.join(" "),style:h,children:[(0,zc.jsx)(v,{id:u,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),(0,zc.jsx)(XN,{id:d,"aria-labelledby":u,displayMonth:t.displayMonth})]},t.displayIndex)}function aS(e){var t=Yj(),n=t.classNames,r=t.styles;return(0,zc.jsx)("div",{className:n.months,style:r.months,children:e.children})}function sS(t){var n,r,a=t.initialProps,s=Yj(),i=zN(),o=rN(),l=(0,e.useState)(!1),c=l[0],u=l[1];(0,e.useEffect)(function(){s.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),u(!0)))},[s.initialFocus,c,i.focus,i.focusTarget,i]);var d=[s.classNames.root,s.className];s.numberOfMonths>1&&d.push(s.classNames.multiple_months),s.showWeekNumber&&d.push(s.classNames.with_weeknumber);var f=Fj(Fj({},s.styles.root),s.style),h=Object.keys(a).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var n;return Fj(Fj({},e),((n={})[t]=a[t],n))},{}),p=null!==(r=null===(n=a.components)||void 0===n?void 0:n.Months)&&void 0!==r?r:aS;return(0,zc.jsx)("div",Fj({className:d.join(" "),style:f,dir:s.dir,id:s.id,nonce:a.nonce,title:a.title,lang:a.lang},h,{children:(0,zc.jsx)(p,{children:o.displayMonths.map(function(e,t){return(0,zc.jsx)(rS,{displayIndex:t,displayMonth:e},t)})})}))}function iS(e){var t=e.children,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["children"]);return(0,zc.jsx)(Gj,{initialProps:n,children:(0,zc.jsx)(nN,{children:(0,zc.jsx)(WN,{initialProps:n,children:(0,zc.jsx)(gN,{initialProps:n,children:(0,zc.jsx)(wN,{initialProps:n,children:(0,zc.jsx)(AN,{children:(0,zc.jsx)(HN,{children:t})})})})})})})}function oS(e){return(0,zc.jsx)(iS,Fj({},e,{children:(0,zc.jsx)(sS,{initialProps:e})}))}const lS=["className","classNames","showOutsideDays"],cS=["className"],uS=["className"];function dS(e){let t=e.className,n=e.classNames,r=e.showOutsideDays,a=void 0===r||r,s=Yc(e,lS);return(0,zc.jsx)(oS,Gc({showOutsideDays:a,className:Zm("p-3",t),classNames:Gc({months:"flex flex-col sm:flex-row space-y-4 sm:sp
2ace-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Zm(dg({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:Zm("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===s.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:Zm(dg({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible"},n),components:{IconLeft:e=>{let t=e.className,n=Yc(e,cS);return(0,zc.jsx)(dj,Gc({className:Zm("h-4 w-4 stroke-[4]",t)},n))},IconRight:e=>{let t=e.className,n=Yc(e,uS);return(0,zc.jsx)(fj,Gc({className:Zm("h-4 w-4 stroke-[4]",t)},n))}}},s))}async function fS(e){const t=await fetch("".concat("https://api.trievents.ca","/events/organization/").concat(e),{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!t.ok){const e=await t.text();throw new Error("Failed to fetch events: ".concat(t.status," - ").concat(e))}const n=await t.json();return Array.isArray(n)?n:[]}dS.displayName="Calendar";const hS=Iu("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const pS=function(){const t=sl(),n=rg().getTenantPath,r=(t=>{const n=l((0,e.useState)(new Date),2),r=n[0],a=n[1],s=l((0,e.useState)([]),2),i=s[0],o=s[1],c=l((0,e.useState)(!0),2),u=c[0],d=c[1],f=l((0,e.useState)(null),2),h=f[0],p=f[1];return(0,e.useEffect)(()=>{let e=!1;return(async()=>{try{if("string"!==typeof t)return p("No organization selected"),void d(!1);const n=await fS(t);e||o(n)}catch(h){console.error("Error fetching events:",h),p(h instanceof Error?h.message:"An error occurred")}finally{e||d(!1)}})(),()=>{e=!0}},[t]),{date:r,events:i,loading:u,error:h,onDateChange:e=>{e&&a(e)},tileClassName:e=>{let t=e.date;if("month"===e.view){const e=t.getDay();if(0===e||6===e)return i.find(e=>e.date.split("T")[0]===t.toISOString().split("T")[0])?"react-calendar__tile--has-event react-calendar__tile--weekend":"react-calendar__tile--weekend";if(i.find(e=>e.date.split("T")[0]===t.toISOString().split("T")[0]))return"react-calendar__tile--has-event"}return null},getEventsOnDate:e=>i.filter(t=>t.date.split("T")[0]===e.toISOString().split("T")[0])}})(ku()),a=r.date,s=r.events,i=r.loading,o=r.error,c=r.onDateChange,u=r.getEventsOnDate;return i?(0,zc.jsx)(uj,{showCreateEvent:!0,children:(0,zc.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,zc.jsx)(Yx,{className:"h-12 w-12 rounded-full"})})}):o?(0,zc.jsx)(uj,{showCreateEvent:!0,children:(0,zc.jsxs)(Iw,{variant:"destructive",children:[(0,zc.jsx)(Pw,{children:"Error"}),(0,zc.jsx)(Rw,{children:o})]})}):(0,zc.jsx)(uj,{showCreateEvent:!0,children:(0,zc.jsxs)("div",{className:"flex flex-col lg:grid lg:grid-cols-3 gap-4 pb-8",children:[(0,zc.jsxs)(Rb,{className:"w-full lg:col-span-2",children:[(0,zc.jsx)(Ob,{children:(0,zc.jsx)(Ab,{children:"Event Calendar"})}),(0,zc.jsx)(Mb,{className:"p-0",children:(0,zc.jsx)("div",{className:"calendar-container w-full h-full",children:(0,zc.jsx)(dS,{mode:"single",selected:a,onSelect:c,className:"h-full w-full flex",classNames:{months:"flex w-full flex-col sm:flex-row space-y-4 sm:sp
2ace-x-4 sm:space-y-0 flex-1",month:"space-y-4 w-full flex flex-col",table:"w-full h-full border-collapse space-y-1",head_row:"flex w-full",head_cell:"text-base xs:text-lg sm:text-xl font-semibold text-center w-[14.28%]",row:"w-full mt-2 flex",cell:"text-base xs:text-lg sm:text-xl p-0.5 xs:p-1 sm:p-2 text-center w-[14.28%] h-12 xs:h-14 sm:h-16",button:"text-base xs:text-lg sm:text-xl w-full h-full flex items-center justify-center transition-transform duration-200 hover:scale-110 bg-gray-100 rounded-lg",caption:"flex justify-center pt-1 xs:pt-2 sm:pt-3 relative items-center mb-2 xs:mb-3 sm:mb-4",caption_label:"text-lg xs:text-xl sm:text-2xl font-medium",nav:"space-x-1 flex items-center",nav_button:"!bg-black text-white h-7 w-7 sm:h-8 sm:w-8 md:h-9 md:w-9 max-w-[2.5rem] max-h-[2.5rem] p-0 text-base sm:text-lg md:text-xl flex items-center justify-center hover:scale-110 transition-transform rounded-lg"},modifiers:{hasEvent:e=>u(e).length>0,today:e=>{const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}},modifiersStyles:{hasEvent:{fontWeight:"bold",color:"#ffffff",backgroundColor:"#23d6e4",borderRadius:"0.5rem",transition:"transform 0.2s"},today:{border:"3px solid #000000",borderRadius:"0.5rem"}},onDayClick:e=>{u(e).length>0&&t(n("/events/".concat(e.toISOString().split("T")[0])))}})})})]}),(0,zc.jsxs)(Rb,{className:"w-full shadow",children:[(0,zc.jsx)(Ob,{children:(0,zc.jsx)(Ab,{children:"Upcoming Events"})}),(0,zc.jsx)(Mb,{children:(0,zc.jsx)("div",{className:"space-y-4",children:(()=>{const e=s.filter(e=>{const t=l(e.date.split("T")[0].split("-"),3),n=t[0],r=t[1],a=t[2],s=new Date(Number(n),Number(r)-1,Number(a)),i=new Date;if(s.toDateString()===i.toDateString()){const t=i.getHours(),n=i.getMinutes(),r=l(e.time_end?e.time_end.split(":").map(Number):[23,59],2),a=r[0],s=r[1];return t<a||t===a&&n<s}return s>i}).sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime()).slice(0,3);return 0===e.length?(0,zc.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center px-8",children:[(0,zc.jsx)(hS,{className:"h-16 w-16 text-muted-foreground mb-4"}),(0,zc.jsx)("p",{className:"text-muted-foreground mb-2 font-semibold text-lg",children:"No upcoming events"}),(0,zc.jsx)("p",{className:"text-sm text-black/70 max-w-xs",children:"Click the Create Event button to schedule an event"})]}):e.map(e=>{const r=l(e.date.split("T")[0].split("-"),3),a=r[0],s=r[1],i=r[2],o=new Date(Number(a),Number(s)-1,Number(i));return(0,zc.jsx)(Rb,{className:"group relative overflow-hidden transition-all duration-200 hover:scale-[1.02] cursor-pointer bg-black text-white border-white/10",onClick:()=>t(n("/event/".concat(e.uuid))),children:(0,zc.jsx)(Mb,{className:"p-4",children:(0,zc.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,zc.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zc.jsx)("h3",{className:"font-semibold text-lg truncate text-white",children:e.title}),(0,zc.jsx)(Nw,{variant:"secondary",className:"bg-white/10 text-white hover:bg-white/20 shrink-0 ml-2",children:oj(o,"MMM d")})]}),(0,zc.jsx)("p",{className:"text-sm text-white/60 truncate",children:oj(o,"EEEE, MMMM d, yyyy")}),e.location&&(0,zc.jsxs)("p",{className:"text-sm text-white/60 truncate flex items-center gap-1",children:[(0,zc.jsx)("span",{className:"text-primary shrink-0",children:"\ud83d\udccd"})," ",e.location]}),e.time_start&&e.time_end&&(0,zc.jsxs)("p",{className:"text-sm text-white/60 truncate",children:[oj(new Date("2000-01-01T".concat(e.time_start)),"h:mm a")," - ",oj(new Date("2000-01-01T".concat(e.time_end)),"h:mm a")]})]})})},e.uuid)})})()})})]})]})})},mS=Iu("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),gS=Iu("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),vS=Iu("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"}
2]]),xS=Iu("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"}]]),yS=Iu("refresh-cw",[["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"}]]),bS=e=>{switch(e){case"super_admin":return"Super Admin";case"admin":return"Admin";case"user":return"User";default:return e||"Member"}},wS=e=>{switch(e){case"super_admin":return"secondary";case"admin":return"default";default:return"outline"}},_S=e=>{switch(e){case"super_admin":return"bg-purple-100 text-purple-700";case"admin":return"bg-blue-100 text-blue-700";default:return"bg-gray-100 text-gray-700"}},kS=()=>{const t=l((0,e.useState)([]),2),n=t[0],r=t[1],a=l((0,e.useState)(!0),2),s=a[0],i=a[1],o=l((0,e.useState)(null),2),c=o[0],u=o[1],d=l((0,e.useState)(""),2),f=d[0],h=d[1],p=l((0,e.useState)(!0),2),m=p[0],g=p[1],v=l((0,e.useState)(""),2),x=v[0],y=v[1],b=l((0,e.useState)(!1),2),w=b[0],_=b[1],k=l((0,e.useState)(!1),2),j=k[0],N=k[1];(0,e.useEffect)(()=>{(async()=>{try{i(!0);const e=await(async()=>{const e=ku();if(!e)throw new Error("No tenant ID found");const t=await fetch("".concat("https://api.trievents.ca","/organizations/").concat(e,"/members"),{credentials:"include"});if(!t.ok){const e=await t.json();throw new Error(e.error||"Failed to fetch members")}const n=await t.json(),r=n.members.sort((e,t)=>{const n=(e.name||"").toLowerCase(),r=(t.name||"").toLowerCase();return n.localeCompare(r)});return{members:r,access_code:n.access_code}})();r(e.members),y(e.access_code)}catch(XF){console.error("Error fetching members:",XF),u(XF instanceof Error?XF.message:"Failed to fetch members")}finally{i(!1)}})()},[]);const S=""===f?n:n.filter(e=>{var t,n;return(null===(t=e.name)||void 0===t?void 0:t.toLowerCase().includes(f.toLowerCase()))||(null===(n=e.email)||void 0===n?void 0:n.toLowerCase().includes(f.toLowerCase()))});return s?(0,zc.jsx)(uj,{children:(0,zc.jsx)("div",{className:"space-y-6",children:(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsx)(Yx,{className:"h-8 w-[200px]"}),(0,zc.jsxs)("div",{className:"grid gap-4",children:[(0,zc.jsx)(Yx,{className:"h-12 w-full"}),(0,zc.jsx)(Yx,{className:"h-12 w-full"}),(0,zc.jsx)(Yx,{className:"h-12 w-full"})]})]})})}):c?(0,zc.jsx)(uj,{children:(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:c})})}):(0,zc.jsx)(uj,{children:(0,zc.jsxs)("div",{className:"space-y-6 pb-8 lg:pb-12",children:[(0,zc.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zc.jsx)("h2",{className:"text-3xl font-bold tracking-tight",children:"Members"}),(0,zc.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,zc.jsx)(Ru,{className:"h-4 w-4"}),(0,zc.jsxs)("span",{children:[n.length," ",1===n.length?"Member":"Members"]})]})]}),(0,zc.jsxs)("div",{className:"flex flex-col lg:flex-row gap-4",children:[(0,zc.jsx)("div",{className:"w-full lg:flex-1 lg:min-w-[200px]",children:(0,zc.jsxs)("div",{className:"relative",children:[(0,zc.jsx)(mS,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,zc.jsx)(pg,{type:"text",placeholder:"Search members...",value:f,onChange:e=>h(e.target.value),className:"pl-9"})]})}),(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row gap-4 w-full lg:w-auto",children:[(0,zc.jsx)("div",{className:"w-full md:flex-1 md:min-w-[200px]",children:(0,zc.jsxs)("div",{className:"relative",children:[(0,zc.jsx)(pg,{type:m?"password":"text",value:x,readOnly:!0,placeholder:"Organization Access Code",className:"pr-20"}),(0,zc.jsxs)("div",{className:"absolute right-0 top-0 h-full flex",children:[(0,zc.jsx)(fg,{variant:"ghost",size:"icon",className:"h-full w-10",onClick:()=>g(!m),children:m?(0,zc.jsx)(gS,{className:"h-4 w-4"}):(0,zc.jsx)(vS,{className:"h-4 w-4"})}),(0,zc.jsx)(fg,{variant:"ghost",size:"icon",className:"h-full w-10",onClick:async()=>{try{await navigator.clipboard.writeText(x),N(!0),setTimeout(()=>N(!1),2e3)}catch(XF){console.error("Failed to copy access code:",XF)}},children:(0,zc.jsx)(xS,{className:"h-4 w-4 ".concat(j?"text-green-500":"")}
2)})]})]})}),(0,zc.jsxs)(fg,{onClick:async()=>{_(!0),u(null);try{const e=await(async()=>{const e=ku();if(!e)throw new Error("No tenant ID found");const t=await fetch("".concat("https://api.trievents.ca","/organizations/").concat(e,"/refresh-access-code"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}});if(403===t.status)throw new Error("You do not have permission to refresh the access code. Only organization admins can perform this action.");if(!t.ok)throw new Error("Failed to refresh access code");return t.json()})();y(e.access_code)}catch(c){console.error("Error refreshing access code:",c),u(c instanceof Error?c.message:"An error occurred")}finally{_(!1)}},disabled:w,className:"w-full md:w-auto whitespace-nowrap transition-transform hover:scale-105",children:[(0,zc.jsx)(yS,{className:"h-4 w-4 mr-2 ".concat(w?"animate-spin":"")}),"Refresh Code"]})]})]}),S.length>0?(0,zc.jsx)("div",{className:"grid gap-4",children:S.map(e=>(0,zc.jsx)(Rb,{className:"overflow-hidden hover:shadow-md transition-shadow",children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[(0,zc.jsxs)("div",{className:"space-y-1 min-w-0 flex-1",children:[(0,zc.jsx)("p",{className:"font-medium truncate text-base",children:e.name||e.user_id}),(0,zc.jsx)("p",{className:"text-sm text-muted-foreground truncate",children:e.email})]}),(0,zc.jsx)("div",{className:"flex-shrink-0",children:(0,zc.jsx)(Nw,{variant:wS(e.role),className:_S(e.role),children:bS(e.role)})})]})})},e.user_id))}):(0,zc.jsx)(Rb,{children:(0,zc.jsx)(Mb,{className:"p-12 text-center text-muted-foreground",children:(0,zc.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,zc.jsx)(Ru,{className:"h-10 w-10"}),(0,zc.jsx)("p",{className:"text-lg font-medium",children:"No members found"}),(0,zc.jsx)("p",{className:"text-sm",children:"Try adjusting your search terms"})]})})})]})})},jS=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e/100),NS=e=>!0===e.refunded,SS=t=>{let n=t.transactions,r=t.isLoading,a=t.error;return r?(0,zc.jsx)("div",{className:"hidden md:block w-full",children:(0,zc.jsx)("div",{className:"border rounded-lg overflow-hidden w-full",children:(0,zc.jsx)("div",{className:"min-h-[500px] max-h-[500px] overflow-auto w-full bg-gray-50",children:(0,zc.jsxs)("div",{className:"grid w-full bg-white",style:{gridTemplateColumns:"minmax(140px, 1.5fr) minmax(140px, 2fr) minmax(100px, 1.2fr) minmax(80px, 1fr) minmax(80px, 1fr)"},children:[(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white",children:"Customer"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Event"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Amount"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Date"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"ID"}),[...Array(12)].map((t,n)=>(0,zc.jsxs)(e.Fragment,{children:[(0,zc.jsx)("div",{className:"border-b py-3 px-4",children:(0,zc.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse"}),(0,zc.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-3/4"})]})}),(0,zc.jsx)("div",{className:"border-b py-3 px-4 flex items-center",children:(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-full"})}),(0,zc.jsx)("div",{className:"border-b py-3 px-4 font-medium text-green-600 whitespace-nowrap text-sm flex items-center justify-center",children:(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-20"})}),(0,zc.jsx)("div",{className:"border-b py-3 px-4 whitespace-nowrap text-sm flex items-center justify-center",children:(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-24"})}),(0,zc.jsx)("div",{className:"border-b py-3 px-4 flex items-center",children:(0,zc.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-full"})})]},n))]})})})}):a?(0,zc.jsxs)(Iw,{variant:"destructive",children:[(0,zc.jsx)(Hb,{className:"h-4 w-4"}),(0,zc.jsx)(Rw,{children:a})]}):0===n.length?(0,zc.jsxs)("div",{className:"text-center py-12",children:[(0,zc.jsx)(Au,{className:"mx-auto h-12 w-12 text-muted-foreground"}),(0,zc.jsx)("h3",{className:"mt-4 text-lg font-semibold",children:"No transactions foun
2d"}),(0,zc.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"There are no transactions to display at this time."})]}):(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsx)("div",{className:"md:hidden space-y-4",children:n.map(e=>{var t,n,r,a,s,i;return(0,zc.jsx)(Rb,{children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-start gap-4",children:[(0,zc.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"font-medium truncate text-base",children:(null===(t=e.ticket)||void 0===t?void 0:t.customer_name)||e.billing_details.name||"N/A"})}),(0,zc.jsx)(tg,{children:(null===(n=e.ticket)||void 0===n?void 0:n.customer_name)||e.billing_details.name||"N/A"})]})}),(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"text-sm text-muted-foreground truncate mt-1",children:(null===(r=e.ticket)||void 0===r?void 0:r.customer_email)||e.billing_details.email||"N/A"})}),(0,zc.jsx)(tg,{children:(null===(a=e.ticket)||void 0===a?void 0:a.customer_email)||e.billing_details.email||"N/A"})]})})]}),(0,zc.jsxs)("div",{className:"text-right",children:[(0,zc.jsx)("p",{className:"font-medium text-base whitespace-nowrap ".concat(NS(e)?"text-red-500 line-through":"text-green-600"),children:jS(e.amount)}),NS(e)&&(0,zc.jsx)("p",{className:"text-xs text-red-500",children:"Refunded"})]})]}),(0,zc.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"truncate",children:(null===(s=e.event)||void 0===s?void 0:s.title)||"N/A"})}),(0,zc.jsx)(tg,{children:(null===(i=e.event)||void 0===i?void 0:i.title)||"N/A"})]})}),(0,zc.jsx)("p",{children:oj(new Date(e.createdAt),"MMM d, yyyy")}),(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsxs)("p",{className:"text-xs truncate",children:["ID: ",e.uuid]})}),(0,zc.jsx)(tg,{children:e.uuid})]})})]})]})})},e.uuid)})}),(0,zc.jsx)("div",{className:"hidden md:block w-full",children:(0,zc.jsx)("div",{className:"border rounded-lg overflow-hidden w-full",children:(0,zc.jsx)("div",{className:"min-h-[500px] max-h-[500px] overflow-auto w-full bg-gray-50",children:(0,zc.jsxs)("div",{className:"grid w-full bg-white",style:{gridTemplateColumns:"minmax(140px, 1.5fr) minmax(140px, 2fr) minmax(100px, 1.2fr) minmax(80px, 1fr) minmax(80px, 1fr)"},children:[(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white",children:"Customer"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Event"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Amount"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Date"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"ID"}),n.map(t=>{var n,r,a,s,i,o;return(0,zc.jsxs)(e.Fragment,{children:[(0,zc.jsx)("div",{className:"border-b py-2 px-4",children:(0,zc.jsxs)("div",{className:"min-w-0 space-y-0.5",children:[(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"font-medium truncate text-sm",children:(null===(n=t.ticket)||void 0===n?void 0:n.customer_name)||t.billing_details.name||"N/A"})}),(0,zc.jsx)(tg,{children:(null===(r=t.ticket)||void 0===r?void 0:r.customer_name)||t.billing_details.name||"N/A"})]})}),(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:(null===(a=t.ticket)||void 0===a?void 0:a.customer_email)||t.billing_details.email||"N/A"})}),(0,zc.jsx)(tg,{children:(null===(s=t.ticket)||void 0===s?void 0:s.customer_email)||t.billing_details.email||"N/A"})]})})]})}),(0,zc.jsx)("div",{className:"border-b py-2 px-4 flex items-center",children:(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"truncate text-sm w-full text-center",children:(null===(i=t.event)||void 0===i?void 0:i.title)||"
2N/A"})}),(0,zc.jsx)(tg,{children:(null===(o=t.event)||void 0===o?void 0:o.title)||"N/A"})]})})}),(0,zc.jsx)("div",{className:"border-b py-2 px-4 font-medium whitespace-nowrap text-sm flex items-center justify-center",children:(0,zc.jsxs)("div",{className:"text-center",children:[(0,zc.jsx)("p",{className:NS(t)?"text-red-500 line-through":"text-green-600",children:jS(t.amount)}),NS(t)&&(0,zc.jsx)("p",{className:"text-xs text-red-500",children:"Refunded"})]})}),(0,zc.jsx)("div",{className:"border-b py-2 px-4 whitespace-nowrap text-sm flex items-center justify-center",children:oj(new Date(t.createdAt),"MMM d, yyyy")}),(0,zc.jsx)("div",{className:"border-b py-2 px-4 flex items-center",children:(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"text-xs text-muted-foreground truncate w-full text-center",children:t.uuid})}),(0,zc.jsx)(tg,{children:t.uuid})]})})})]},t.uuid)})]})})})})]})},CS=Iu("hand-coins",[["path",{d:"M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17",key:"geh8rc"}],["path",{d:"m7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"1fto5m"}],["path",{d:"m2 16 6 6",key:"1pfhp9"}],["circle",{cx:"16",cy:"9",r:"2.9",key:"1n0dlu"}],["circle",{cx:"6",cy:"5",r:"3",key:"151irh"}]]),ES=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e/100),TS=t=>{var n,r,a;let s=t.requests,i=t.isLoading,o=t.error,c=t.showName,u=t.showModalName,d=t.showModalEmail,f=t.showBursaryModal,h=t.selectedBursary,p=t.onToggleNameVisibility,m=t.onToggleModalNameVisibility,g=t.onToggleModalEmailVisibility,v=t.onViewDetails,x=t.onAccept,y=t.onReject,b=t.onCloseModal,w=t.onError;const _=l((0,e.useState)(null),2),k=_[0],j=_[1];return(0,e.useEffect)(()=>{f&&!o||j(null)},[f,o]),i?(0,zc.jsx)("div",{className:"hidden md:block w-full",children:(0,zc.jsx)("div",{className:"border rounded-lg overflow-hidden w-full",children:(0,zc.jsx)("div",{className:"min-h-[500px] max-h-[500px] overflow-auto w-full bg-gray-50",children:(0,zc.jsxs)("div",{className:"grid w-full bg-white",style:{gridTemplateColumns:"minmax(80px, 1fr) minmax(70px, 1fr) minmax(60px, 0.8fr) minmax(60px, 0.7fr) minmax(60px, 0.8fr) minmax(70px, 0.7fr)"},children:[(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white",children:"Requester"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Event"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Amount"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Date"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Status"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Actions"}),[...Array(12)].map((t,n)=>(0,zc.jsxs)(e.Fragment,{children:[(0,zc.jsx)("div",{className:"border-b py-3 px-4",children:(0,zc.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse"}),(0,zc.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-3/4"})]})}),(0,zc.jsx)("div",{className:"border-b py-3 px-4 flex items-center",children:(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-full"})}),(0,zc.jsx)("div",{className:"border-b py-3 px-4 font-medium text-green-600 whitespace-nowrap text-sm flex items-center justify-center",children:(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-20"})}),(0,zc.jsx)("div",{className:"border-b py-3 px-4 whitespace-nowrap text-sm flex items-center justify-center",children:(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-24"})}),(0,zc.jsx)("div",{className:"border-b py-3 px-4 flex items-center justify-center",children:(0,zc.jsx)("div",{className:"h-5 bg-muted rounded-full animate-pulse w-20"})}),(0,zc.jsxs)("div",{className:"border-b py-3 px-4 flex items-center justify-center gap-2",children:[(0,zc.jsx)("div",{className:"h-8 bg-muted rounded animate-pulse w-20"}),(0,zc.jsx)("div",{className:"h-8 bg-muted rounded animate-pulse w-20"})]})]},n))]})})})}):0===s.length?(0,zc.jsxs)("div",{className:"text-center py-12",children:[(0,zc.jsx)(CS,{className:"mx-auto h-12 w-12 text-muted-foreground"}),(0,zc.jsx)("h3",{className:"mt-4 text-lg font-semibold",children:"No bursary requests found"}),(0,zc.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"There are no bursary requests to display at this time."})]}):(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsx)("div",{className:"md:hidden space-y-4",children:i?[...Array(3)].map((e,t)=>(0,zc.jsx)(Rb,{className:"p-4",children:(0,zc.jsxs)("div",{className:"space-y-3",children:[(0,zc.jsx)(Yx,{className:"h-5 w-3/4"}),(0,zc.jsx)(Yx,{className:"h-4 w-1/2"}),(0,zc.jsx)(Yx,{className:"h-4 w-1/3"})]})},t)):s.map(e=>{var t,n;return(0,zc.jsx)(Rb,{className:"p-4",children:(0,zc.jsxs)("div",{className:"space-y-3",children:[(0,zc.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zc.jsxs)("div",{className:"min-w-0",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"font-medium truncate text-sm",children:c[e.uuid]?e.requester_name:"Hidden"})}),(0,zc.jsx)(tg,{children:c[e.uuid]?e.requester_name:"Hidden"})]})}),(0,zc.jsx)(fg,{variant:"ghost",size:"icon",onClick:()=>p(e.uuid),className:"h-6 w-6",children:c[e.uuid]?(0,zc.jsx)(gS,{className:"h-4 w-4"}):(0,zc.jsx)(vS,{className:"h-4 w-4"})})]}),(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:c[e.uuid]?e.requester_email:"Hidden"})}),(0,zc.jsx)(tg,{children:c[e.uuid]?e.requester_email:"Hidden"})]})})]}),(0,zc.jsx)(Nw,{variant:"outline",className:Zm("rounded-full text-xs whitespace-nowrap w-[85px] justify-center","pending"===e.status&&"bg-yellow-100 text-yellow-800 border-yellow-200","approved"===e.status&&"bg-green-100 text-green-800 border-green-200","rejected"===e.status&&"bg-red-100 text-red-800 border-red-200"),children:e.status.charAt(0).toUpperCase()+e.status.slice(1)})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,zc.jsx)("span",{className:"text-muted-foreground w-16",children:"Event:"}),(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"truncate",children:(null===(t=e.event)||void 0===t?void 0:t.t
2itle)||"N/A"})}),(0,zc.jsx)(tg,{children:(null===(n=e.event)||void 0===n?void 0:n.title)||"N/A"})]})})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,zc.jsx)("span",{className:"text-muted-foreground w-16",children:"Amount:"}),(0,zc.jsx)("span",{className:"font-medium text-green-600",children:ES(e.amount)})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,zc.jsx)("span",{className:"text-muted-foreground w-16",children:"Date:"}),(0,zc.jsx)("span",{children:oj(new Date(e.updatedAt),"MMM d, yyyy")})]})]}),(0,zc.jsx)("div",{className:"pt-2",children:(0,zc.jsx)(fg,{variant:"default",size:"sm",onClick:()=>v(e),className:"w-full transition-transform hover:scale-105",children:"View Details"})})]})},e.uuid)})}),(0,zc.jsx)("div",{className:"hidden md:block w-full",children:(0,zc.jsx)("div",{className:"border rounded-lg overflow-hidden w-full",children:(0,zc.jsx)("div",{className:"min-h-[500px] max-h-[500px] overflow-auto w-full bg-gray-50",children:(0,zc.jsxs)("div",{className:"grid w-full bg-white",style:{gridTemplateColumns:"minmax(80px, 1fr) minmax(70px, 1fr) minmax(60px, 0.8fr) minmax(60px, 0.7fr) minmax(60px, 0.8fr) minmax(70px, 0.7fr)"},children:[(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white",children:"Requester"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Event"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Amount"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Date"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Status"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center",children:"Actions"}),i&&[...Array(3)].map((t,n)=>(0,zc.jsxs)(e.Fragment,{children:[(0,zc.jsx)("div",{className:"border-b py-2 px-4",children:(0,zc.jsx)(Yx,{className:"h-5 w-full"})}),(0,zc.jsx)("div",{className:"border-b py-2 px-2",children:(0,zc.jsx)(Yx,{className:"h-5 w-full"})}),(0,zc.jsx)("div",{className:"border-b py-2 px-2",children:(0,zc.jsx)(Yx,{className:"h-5 w-full"})}),(0,zc.jsx)("div",{className:"border-b py-2 px-2",children:(0,zc.jsx)(Yx,{className:"h-5 w-full"})}),(0,zc.jsx)("div",{className:"border-b py-2 px-2",children:(0,zc.jsx)(Yx,{className:"h-5 w-full"})}),(0,zc.jsx)("div",{className:"border-b py-2 px-2",children:(0,zc.jsx)(Yx,{className:"h-5 w-full"})})]},n)),!i&&s.map(t=>{var n,r;return(0,zc.jsxs)(e.Fragment,{children:[(0,zc.jsx)("div",{className:"border-b py-2 px-4",children:(0,zc.jsxs)("div",{className:"min-w-0 space-y-0.5",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-1",children:[(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"font-medium truncate text-sm",children:c[t.uuid]?t.requester_name:"Hidden"})}),(0,zc.jsx)(tg,{children:c[t.uuid]?t.requester_name:"Hidden"})]})}),(0,zc.jsx)(fg,{variant:"ghost",size:"icon",onClick:()=>p(t.uuid),className:"h-6 w-6",children:c[t.uuid]?(0,zc.jsx)(gS,{className:"h-4 w-4"}):(0,zc.jsx)(vS,{className:"h-4 w-4"})})]}),(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:c[t.uuid]?t.requester_email:"Hidden"})}),(0,zc.jsx)(tg,{children:c[t.uuid]?t.requester_email:"Hidden"})]})})]})}),(0,zc.jsx)("div",{className:"border-b py-2 px-2 flex items-center",children:(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"truncate text-sm w-full text-center",children:(null===(n=t.event)||void 0===n?void 0:n.title)||"N/A"})}),(0,zc.jsx)(tg,{children:(null===(r=t.event)||void 0===r?void 0:r.title)||"N/A"})]})})}),(0,zc.jsx)("div",{className:"border-b py-2 px-2 font-medium text-green-600 whitespace-nowrap text-sm flex items-center justify-center",children:ES(t.amount)}),(0,zc.jsx)("div",{className:"border-b py-2 px-2 whitespace-nowrap text-sm flex items-center justify-center",children:oj(new Date(t.updatedAt),"MMM d, yyyy")}),(0,zc.jsx)("div",{className:"border-b py-2 px-2 flex items-center justify-center",children:(0,zc.jsx)(Nw,{variant:"outline",className:Zm("rounded-full text-xs whitespace-nowrap w-[85px] justify-center","pending"===t.status&&"bg-yellow-100 text-yellow-800 border-yellow-200","approved"===t.status&&"bg-green-100 text-green-800 border-green-200","rejected"===t.status&&"bg-red-100 text-red-800 border-red-200"),children:t.status.charAt(0).toUpperCase()+t.status.slice(1)})}),(0,zc.jsx)("div",{className:"border-b py-2 px-2 flex items-center justify-center",children:(0,zc.jsx)(fg,{variant:"default",size:"sm",onClick:()=>v(t),className:"h-8 whitespace-nowrap transition-transform hover:scale-105",children:"Details"})})]},t.uuid)})]})})})}),(0,zc.jsx)(Uw,{open:f,onOpenChange:()=>{w(null),b()},children:(0,zc.jsxs)(Ww,{className:"sm:max-w-[425px] max-h-[90vh] overflow-y-auto",children:[(0,zc.jsx)(qw,{children:(0,zc.jsx)($w,{children:"Bursary Request Details"})}),h&&(0,zc.jsxs)("div",{className:"space-y-6",children:[o&&(0,zc.jsx)(Iw,{variant:"destructive",className:"mb-4",children:(0,zc.jsx)(Rw,{children:o})}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Requester Information"}),(0,zc.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("p",{className:"text-base font-medium",children:u[h.uuid]?h.requester_name:"Hidden"}),(0,zc.jsx)(fg,{variant:"ghost",size:"icon",onClick:()=>m(h.uuid),className:"h-6 w-6",children:u[h.uuid]?(0,zc.jsx)(gS,{className:"h-4 w-4"}):(0,zc.jsx)(vS,{className:"h-4 w-4"})})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("p",{className:"text-sm text-muted-foreground",children:d[h.uuid]?h.requester_email:"Hidden"}),(0,zc.jsx)(fg,{variant:"ghost",size:"icon",onClick:()=>g(h.uuid),className:"h-6 w-6",children:d[h.uuid]?(0,zc.jsx)(gS,{className:"h-4 w-4"}):(0,zc.jsx)(vS,{className:"h-4 w-4"})})]})]})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Request Details"}),(0,zc.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-4",children:[(0,zc.jsx)("p",{className:"text-sm text-muted-foreground",children:"Amount Requested:"}),(0,zc.jsx)("p",{className:"font-medium text-green-600",children:ES(h.amount)})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-4",children:[(0,zc.jsx)("p",{className:"text-sm text-muted-foreground",children:"Original Price:"}),(0,zc.jsx)("p",{className:"font-medium",children:ES(h.ticket_price)})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-4",children:[(0,zc.jsx)("p",{className:"text-sm text-muted-foreground",children:"Request Date:"}),(0,zc.jsx)("p",{className:"font-medium",children:oj(new Date(h.updatedAt),"MMM d, yyyy")})]})]})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Event Name"}),(0,zc.jsx)("div",{className:"mt-2",children:(0,zc.jsx)("p",{className:"font-medium",children:(null===(n=h.event)||void 0===n?void 0:n.title)||"
2N/A"})})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Reason for Request"}),(0,zc.jsx)("div",{className:"mt-2 max-h-[200px] overflow-y-auto",children:(0,zc.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:h.message||"No reason provided"})})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Status"}),(0,zc.jsx)("div",{className:"mt-2",children:(0,zc.jsx)(Nw,{variant:"outline",className:Zm("rounded-full text-xs whitespace-nowrap w-[85px] justify-center","pending"===(k||(null===h||void 0===h?void 0:h.status))&&"bg-yellow-100 text-yellow-800 border-yellow-200","approved"===(k||(null===h||void 0===h?void 0:h.status))&&"bg-green-100 text-green-800 border-green-200","rejected"===(k||(null===h||void 0===h?void 0:h.status))&&"bg-red-100 text-red-800 border-red-200"),children:(null===(r=k||(null===h||void 0===h?void 0:h.status))||void 0===r?void 0:r.charAt(0).toUpperCase())+(null===(a=k||(null===h||void 0===h?void 0:h.status))||void 0===a?void 0:a.slice(1))})})]})]}),!k&&"pending"===(null===h||void 0===h?void 0:h.status)&&(0,zc.jsx)("div",{className:"flex flex-col gap-4",children:(0,zc.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4",children:[(0,zc.jsxs)(fg,{variant:"outline",className:"flex-1 bg-green-100 text-green-800 hover:bg-green-200 transition-transform hover:scale-105",onClick:()=>(async e=>{try{await x(e),o||j("approved")}catch(t){}})(h.uuid),children:[(0,zc.jsx)(bw,{className:"mr-2 h-4 w-4"}),"Accept Request"]}),(0,zc.jsxs)(fg,{variant:"outline",className:"flex-1 bg-red-100 text-red-800 hover:bg-red-200 transition-transform hover:scale-105",onClick:()=>(async e=>{try{await y(e),o||j("rejected")}catch(t){}})(h.uuid),children:[(0,zc.jsx)(Ox,{className:"mr-2 h-4 w-4"}),"Reject Request"]})]})})]})]})})]})},IS=Iu("ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);function PS(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function RS(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function OS(e,t){return e.get(RS(e,t))}function AS(e,t,n){return e.set(RS(e,t),n),n}var DS;const MS=["scope","children"];function FS(t){const n=t+"CollectionProvider",r=l(Gu(n),2),a=r[0],s=r[1],i=l(a(n,{collectionRef:{current:null},itemMap:new Map}),2),o=i[0],c=i[1],u=t=>{const n=t.scope,r=t.children,a=e.useRef(null),s=e.useRef(new Map).current;return(0,zc.jsx)(o,{scope:n,itemMap:s,collectionRef:a,children:r})};u.displayName=n;const d=t+"CollectionSlot",f=Ju(d),h=e.forwardRef((e,t)=>{const n=e.scope,r=e.children,a=qu(t,c(d,n).collectionRef);return(0,zc.jsx)(f,{ref:a,children:r})});h.displayName=d;const p=t+"CollectionItemSlot",m="data-radix-collection-item",g=Ju(p),v=e.forwardRef((t,n)=>{const r=t.scope,a=t.children,s=Yc(t,MS),i=e.useRef(null),o=qu(n,i),l=c(p,r);return e.useEffect(()=>(l.itemMap.set(i,Gc({ref:i},s)),()=>{l.itemMap.delete(i)})),(0,zc.jsx)(g,Gc(Gc({},{[m]:""}),{},{ref:o,children:a}))});return v.displayName=p,[{Provider:u,Slot:h,ItemSlot:v},function(n){const r=c(t+"CollectionConsumer",n),a=e.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll("[".concat(m,"]"))),n=Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current));return n},[r.collectionRef,r.itemMap]);return a},s]}var LS=new WeakMap;DS=new WeakMap,Map;function US(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=function(e,t){const n=e.length,r=HS(t),a=r>=0?r:n+r;return a<0||a>=n?-1:a}(e,t);return-1===n?void 0:e[n]}function HS(e){return e!==e||0===e?0:Math.trunc(e)}var zS=e.createContext(void 0);function BS(t){const n=e.useContext(zS);return t||n||"ltr"}const WS=["__scopeRovingFocusGroup","orientation","loop","dir","currentTabStopId","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus"],qS=["__scopeRovingFocusGroup","focusable","active","tabStopId","children"];var VS="rovingFocusGroup.onEntryFocus",$S={bubbles:!1,cancelable:!0},GS="RovingFocusGroup",YS=l(FS(GS),3),KS=YS[0],ZS=YS[1],JS=YS[2],XS=l(Gu(GS,[JS]),2),QS=XS[0],eC=XS[1],tC=l(QS(GS),2),nC=tC[0],rC=tC[1],aC=e.forwardRef((e,t)=>
2(0,zc.jsx)(KS.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,zc.jsx)(KS.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,zc.jsx)(sC,Gc(Gc({},e),{},{ref:t}))})}));aC.displayName=GS;var sC=e.forwardRef((t,n)=>{const r=t.__scopeRovingFocusGroup,a=t.orientation,s=t.loop,i=void 0!==s&&s,o=t.dir,c=t.currentTabStopId,u=t.defaultCurrentTabStopId,d=t.onCurrentTabStopIdChange,f=t.onEntryFocus,h=t.preventScrollOnEntryFocus,p=void 0!==h&&h,m=Yc(t,WS),g=e.useRef(null),v=qu(n,g),x=BS(o),y=l(Jh({prop:c,defaultProp:null!==u&&void 0!==u?u:null,onChange:d,caller:GS}),2),b=y[0],w=y[1],_=l(e.useState(!1),2),k=_[0],j=_[1],N=id(f),S=ZS(r),C=e.useRef(!1),E=l(e.useState(0),2),T=E[0],I=E[1];return e.useEffect(()=>{const e=g.current;if(e)return e.addEventListener(VS,N),()=>e.removeEventListener(VS,N)},[N]),(0,zc.jsx)(nC,{scope:r,orientation:a,dir:x,loop:i,currentTabStopId:b,onItemFocus:e.useCallback(e=>w(e),[w]),onItemShiftTab:e.useCallback(()=>j(!0),[]),onFocusableItemAdd:e.useCallback(()=>I(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>I(e=>e-1),[]),children:(0,zc.jsx)(ad.div,Gc(Gc({tabIndex:k||0===T?-1:0,"data-orientation":a},m),{},{ref:v,style:Gc({outline:"none"},t.style),onMouseDown:zu(t.onMouseDown,()=>{C.current=!0}),onFocus:zu(t.onFocus,e=>{const t=!C.current;if(e.target===e.currentTarget&&t&&!k){const t=new CustomEvent(VS,$S);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);cC([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}C.current=!1}),onBlur:zu(t.onBlur,()=>j(!1))}))})}),iC="RovingFocusGroupItem",oC=e.forwardRef((t,n)=>{const r=t.__scopeRovingFocusGroup,a=t.focusable,s=void 0===a||a,i=t.active,o=void 0!==i&&i,l=t.tabStopId,c=t.children,u=Yc(t,qS),d=bd(),f=l||d,h=rC(iC,r),p=h.currentTabStopId===f,m=ZS(r),g=h.onFocusableItemAdd,v=h.onFocusableItemRemove,x=h.currentTabStopId;return e.useEffect(()=>{if(s)return g(),()=>v()},[s,g,v]),(0,zc.jsx)(KS.ItemSlot,{scope:r,id:f,focusable:s,active:o,children:(0,zc.jsx)(ad.span,Gc(Gc({tabIndex:p?0:-1,"data-orientation":h.orientation},u),{},{ref:n,onMouseDown:zu(t.onMouseDown,e=>{s?h.onItemFocus(f):e.preventDefault()}),onFocus:zu(t.onFocus,()=>h.onItemFocus(f)),onKeyDown:zu(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void h.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:lC[r]}(e,h.orientation,h.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let a=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)a.reverse();else if("prev"===t||"next"===t){"prev"===t&&a.reverse();const s=a.indexOf(e.currentTarget);a=h.loop?(r=s+1,(n=a).map((e,t)=>n[(r+t)%n.length])):a.slice(s+1)}setTimeout(()=>cC(a))}var n,r}),children:"function"===typeof c?c({isCurrentTabStop:p,hasTabStop:null!=x}):c}))})});oC.displayName=iC;var lC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cC(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var uC=aC,dC=oC;const fC=["__scopeTabs","value","onValueChange","defaultValue","orientation","dir","activationMode"],hC=["__scopeTabs","loop"],pC=["__scopeTabs","value","disabled"],mC=["__scopeTabs","value","forceMount","children"];var gC="Tabs",vC=l(Gu(gC,[eC]),2),xC=vC[0],yC=(vC[1],eC()),bC=l(xC(gC),2),wC=bC[0],_C=bC[1],kC=e.forwardRef((e,t)=>{const n=e.__scopeTabs,r=e.value,a=e.onValueChange,s=e.defaultValue,i=e.orientation,o=void 0===i?"horizontal":i,c=e.dir,u=e.activationMode,d=void 0===u?"automatic":u,f=Yc(e,fC),h=BS(c),p=l(Jh({prop:r,onChange:a,defaultProp:null!==s&&void 0!==s?s:"",caller:gC}),2),m=p[0],g=p[1];return(0,zc.jsx)(wC,{scope:n,baseId:bd(),value:m,onValueChange:g,orientation:o,dir:h,activationMode:d,children:(0,zc.jsx)(ad.div,Gc(Gc({dir:h,"data-orientation":o},f),{},{ref:t}))})});kC.displayName=gC;var jC="TabsList",NC=e.forwardRef((e,t)=>
2{const n=e.__scopeTabs,r=e.loop,a=void 0===r||r,s=Yc(e,hC),i=_C(jC,n),o=yC(n);return(0,zc.jsx)(uC,Gc(Gc({asChild:!0},o),{},{orientation:i.orientation,dir:i.dir,loop:a,children:(0,zc.jsx)(ad.div,Gc(Gc({role:"tablist","aria-orientation":i.orientation},s),{},{ref:t}))}))});NC.displayName=jC;var SC="TabsTrigger",CC=e.forwardRef((e,t)=>{const n=e.__scopeTabs,r=e.value,a=e.disabled,s=void 0!==a&&a,i=Yc(e,pC),o=_C(SC,n),l=yC(n),c=IC(o.baseId,r),u=PC(o.baseId,r),d=r===o.value;return(0,zc.jsx)(dC,Gc(Gc({asChild:!0},l),{},{focusable:!s,active:d,children:(0,zc.jsx)(ad.button,Gc(Gc({type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c},i),{},{ref:t,onMouseDown:zu(e.onMouseDown,e=>{s||0!==e.button||!1!==e.ctrlKey?e.preventDefault():o.onValueChange(r)}),onKeyDown:zu(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&o.onValueChange(r)}),onFocus:zu(e.onFocus,()=>{const e="manual"!==o.activationMode;d||s||!e||o.onValueChange(r)})}))}))});CC.displayName=SC;var EC="TabsContent",TC=e.forwardRef((t,n)=>{const r=t.__scopeTabs,a=t.value,s=t.forceMount,i=t.children,o=Yc(t,mC),l=_C(EC,r),c=IC(l.baseId,a),u=PC(l.baseId,a),d=a===l.value,f=e.useRef(d);return e.useEffect(()=>{const e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,zc.jsx)(Yh,{present:s||d,children:e=>{let r=e.present;return(0,zc.jsx)(ad.div,Gc(Gc({"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!r,id:u,tabIndex:0},o),{},{ref:n,style:Gc(Gc({},t.style),{},{animationDuration:f.current?"0s":void 0}),children:r&&i}))}})});function IC(e,t){return"".concat(e,"-trigger-").concat(t)}function PC(e,t){return"".concat(e,"-content-").concat(t)}TC.displayName=EC;var RC=NC,OC=CC,AC=TC;const DC=["className"],MC=["className"],FC=["className"],LC=kC,UC=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,DC);return(0,zc.jsx)(RC,Gc({ref:t,className:Zm("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n)},r))});UC.displayName=RC.displayName;const HC=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,MC);return(0,zc.jsx)(OC,Gc({ref:t,className:Zm("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",n)},r))});HC.displayName=OC.displayName;const zC=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,FC);return(0,zc.jsx)(AC,Gc({ref:t,className:Zm("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n)},r))});zC.displayName=AC.displayName;const BC=t=>{const n=l((0,e.useState)([]),2),r=n[0],a=n[1],s=l((0,e.useState)(!0),2),i=s[0],o=s[1],c=l((0,e.useState)(null),2),u=c[0],d=c[1],f=l((0,e.useState)(null),2),h=f[0],p=f[1],m=l((0,e.useState)(!1),2),g=m[0],v=m[1],x=l((0,e.useState)({}),2),y=x[0],b=x[1],w=l((0,e.useState)({}),2),_=w[0],k=w[1],j=l((0,e.useState)({}),2),N=j[0],S=j[1],C=l((0,e.useState)({pending:!0,approved:!0,rejected:!0}),2),E=C[0],T=C[1],I=l((0,e.useState)("all"),2),P=I[0],R=I[1],O=l((0,e.useState)(!1),2),A=O[0],D=O[1];(0,e.useEffect)(()=>{(async()=>{if(t){o(!0),d(null);try{const e=await(async e=>{const t=await fetch("".concat("https://api.trievents.ca","/bursary/organization/").concat(e),{credentials:"include"});if(!t.ok){const e=await t.json();throw new Error(e.error||"Failed to fetch bursary requests")}return t.json()})(t);a(e)}catch(XF){d(XF instanceof Error?XF.message:"An error occurred while fetching bursary requests"),console.error("Error fetching bursary requests:",XF)}finally{o(!1)}}})()},[t]);const M=(0,e.useMemo)(()=>{const e=new Map;return e.set("all","All Events"),r.forEach(t=>{var n;null!==(n=t.event)&&void 0!==n&&n.uuid&&e.set(t.event.uuid,t.event.title)}),Array.from(e.entries())},[r]),F=(0,e.useMemo)(()=>r.filter(e=>{var t;return("all"===P||(null===(t=e.event)||void 0===t?void 0:t.uuid)===P)&&E[e.status]}),[r,P,E]);return{bursaryRequests:r,isLoading:i,error:u,selectedBursary:h,showBursaryModal:g,showName:y,showModalName:_,showModalEmail:N,statusFilters:E,selectedBursaryEvent:P,showBursaryEventDropdown:A,filteredBursaryRequests:F,uniqueEvents:M,setShowBursaryModal:v,setSelectedBursaryEvent:R,setShowBursaryEventDropdown:D,handleAccept:async e=>{try{const t=r.find(t=>t.uuid===e);if(!t)throw new Error("Bursary request not found");await(async(e,t,n)=>{const r=await fetch("".concat("https://api.trievents.ca","/bursary/").concat(e,"/approve"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({transaction_uuid:t,amount:n})});if(!r.ok){const e=await r.json();throw new Error(e.error||"Failed to process refund")}})(e,t.transaction_uuid,t.amount),a(t=>t.map(t=>t.uuid===e?Gc(Gc({},t),{},{status:"approved"}):t))}catch(u){console.error("Error processing bursary approval:",u),d(u instanceof Error?u.message:"Failed to process bursary approval")}},handleReject:async e=>{try{await(async e=>{const t=await fetch("".concat("https://api.trievents.ca","/bursary/").concat(e,"/reject"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}});if(!t.ok){const e=await t.json();throw new Error(e.error||"Failed to reject bursary request")}})(e),a(t=>t.map(t=>t.uuid===e?Gc(Gc({},t),{},{status:"rejected"}):t))}catch(u){console.error("Error rejecting bursary request:",u),d(u instanceof Error?u.message:"Failed to reject bursary request")}},toggleNameVisibility:e=>{b(t=>Gc(Gc({},t),{},{[e]:!t[e]}))},toggleModalNameVisibility:e=>{k(t=>Gc(Gc({},t),{},{[e]:!t[e]}))},toggleModalEmailVisibility:e=>{S(t=>Gc(Gc({},t),{},{[e]:!t[e]}))},handleViewDetails:e=>{p(e),v(!0)},toggleStatusFilter:e=>{T(t=>Gc(Gc({},t),{},{[e]:!t[e]}))},setError:d}},WC=(t,n)=>{const r=l((0,e.useState)([]),2),a=r[0],s=r[1],i=l((0,e.useState)(!0),2),o=i[0],c=i[1],u=l((0,e.useState)(null),2),d=u[0],f=u[1],h=l((0,e.useState)(""),2),p=h[0],m=h[1],g=l((0,e.useState)("all"),2),v=g[0],x=g[1],y=l((0,e.useState)(!1),2),b=y[0],w=y[1];(0,e.useEffect)(()=>{const e=async()=>
2{if(t)try{c(!0);const e=await(async e=>{const t=await fetch("".concat("https://api.trievents.ca","/organizations/").concat(e,"/transactions"),{credentials:"include"});if(!t.ok)throw new Error("Failed to fetch transactions");return t.json()})(t);s(e)}catch(XF){f(XF instanceof Error?XF.message:"Failed to fetch transactions")}finally{c(!1)}};"transactions"===n&&e()},[t,n]);const _=(0,e.useMemo)(()=>{const e=new Map;return e.set("all","All Events"),a.forEach(t=>{t.event&&e.set(t.event.uuid,t.event.title)}),Array.from(e.entries())},[a]),k=(0,e.useMemo)(()=>a.filter(e=>{var t,n,r,a,s;return("all"===v||(null===(t=e.event)||void 0===t?void 0:t.uuid)===v)&&(((null===(n=e.ticket)||void 0===n?void 0:n.customer_name)||(null===(r=e.billing_details)||void 0===r?void 0:r.name)||"").toLowerCase().includes(p.toLowerCase())||((null===(a=e.ticket)||void 0===a?void 0:a.customer_email)||(null===(s=e.billing_details)||void 0===s?void 0:s.email)||"").toLowerCase().includes(p.toLowerCase()))}),[a,v,p]);return{transactions:a,isLoading:o,error:d,searchQuery:p,selectedEvent:v,showEventDropdown:b,uniqueEvents:_,filteredTransactions:k,setSearchQuery:m,setSelectedEvent:x,setShowEventDropdown:w}};const qC=function(){var t,n;const r=localStorage.getItem("tenantId"),a=l((0,e.useState)("transactions"),2),s=a[0],i=a[1],o=(0,e.useRef)(null),c=(0,e.useRef)(null),u=BC(r),d=u.isLoading,f=u.error,h=u.selectedBursary,p=u.showBursaryModal,m=u.showName,g=u.showModalName,v=u.showModalEmail,x=u.statusFilters,y=u.selectedBursaryEvent,b=u.showBursaryEventDropdown,w=u.filteredBursaryRequests,_=u.uniqueEvents,k=u.setShowBursaryModal,j=u.setSelectedBursaryEvent,N=u.setShowBursaryEventDropdown,S=u.handleAccept,C=u.handleReject,E=u.toggleNameVisibility,T=u.toggleModalNameVisibility,I=u.toggleModalEmailVisibility,P=u.handleViewDetails,R=u.toggleStatusFilter,O=u.setError,A=WC(r,s),D=A.isLoading,M=A.error,F=A.searchQuery,L=A.selectedEvent,U=A.showEventDropdown,H=A.uniqueEvents,z=A.filteredTransactions,B=A.setSearchQuery,W=A.setSelectedEvent,q=A.setShowEventDropdown;return(0,e.useEffect)(()=>{function e(e){o.current&&!o.current.contains(e.target)&&q(!1),c.current&&!c.current.contains(e.target)&&N(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,zc.jsx)(uj,{children:(0,zc.jsxs)("div",{className:"space-y-6",children:[(0,zc.jsx)("div",{className:"flex items-center justify-between",children:(0,zc.jsx)("h2",{className:"text-3xl font-bold tracking-tight",children:"Transactions"})}),(0,zc.jsxs)(LC,{defaultValue:"transactions",className:"space-y-4",onValueChange:i,children:[(0,zc.jsxs)(UC,{className:"transition-none",children:[(0,zc.jsxs)(HC,{value:"transactions",className:"flex items-center gap-2 transition-none",children:[(0,zc.jsx)(IS,{className:"h-4 w-4"}),"Ticket Sales"]}),(0,zc.jsxs)(HC,{value:"bursary",className:"flex items-center gap-2 transition-none",children:[(0,zc.jsx)(CS,{className:"h-4 w-4"}),"Bursary Requests"]})]}),(0,zc.jsx)(zC,{value:"transactions",className:"space-y-4",children:(0,zc.jsxs)(Rb,{children:[(0,zc.jsx)(Ob,{children:(0,zc.jsx)(Ab,{children:"Ticket Sales"})}),(0,zc.jsxs)(Mb,{children:[(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row md:justify-between md:items-center gap-4 mb-6",children:[(0,zc.jsxs)("div",{className:"relative w-full md:w-1/3",children:[(0,zc.jsx)(mS,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,zc.jsx)(pg,{type:"text",placeholder:"Search by customer name...",value:F,onChange:e=>B(e.target.value),className:"pl-9"})]}),(0,zc.jsxs)("div",{className:"relative w-full md:w-64",ref:o,children:[(0,zc.jsxs)(fg,{variant:"outline",onClick:()=>q(!U),className:"w-full justify-between transition-none",children:[(0,zc.jsx)("span",{className:"truncate",children:(null===(t=H.find(e=>l(e,1)[0]===L))||void 0===t?void 0:t[1])||"Select Event"}),(0,zc.jsx)("svg",{className:Zm("h-4 w-4 text-muted-foreground transition-transform duration-100",U&&"transform rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,zc.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),U&&(0,zc.jsx)("div",{className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md transition-all duration-100",children:(0,zc.jsx)("div",{className:"max-h-60 overflow-y-auto",children:H.map(e=>{let t=l(e,2),n=t[0],r=t[1];return(0,zc.jsx)(fg,{variant:"ghost",onClick:()=>{W(n),q(!1)},className:Zm("w-full justify-start font-normal",L===n&&"bg-accent"),children:r},n)})})})]})]}),(0,zc.jsx)(SS,{transactions:z,isLoading:D,error:M})]})]})}),(0,zc.jsx)(zC,{value:"bursary",className:"space-y-4",children:(0,zc.jsxs)(Rb,{children:[(0,zc.jsx)(Ob,{children:(0,zc.jsx)(Ab,{children:"Bursary Requests"})}),(0,zc.jsxs)(Mb,{children:[(0,zc.jsxs)("div",{className:"mb-6 flex flex-col md:flex-row md:justify-between md:items-center gap-4",children:[(0,zc.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,zc.jsx)(fg,{variant:x.pending?"default":"outline",onClick:()=>R("pending"),className:Zm("rounded-full text-xs px-3 h-8",x.pending&&"bg-yellow-100 text-yellow-800 hover:bg-yellow-200"),children:"Pending"}),(0,zc.jsx)(fg,{variant:x.approved?"default":"outline",onClick:()=>R("approved"),className:Zm("rounded-full text-xs px-3 h-8",x.approved&&"bg-green-100 text-green-800 hover:bg-green-200"),children:"Approved"}),(0,zc.jsx)(fg,{variant:x.rejected?"default":"outline",onClick:()=>R("rejected"),className:Zm("rounded-full text-xs px-3 h-8",x.rejected&&"bg-red-100 text-red-800 hover:bg-red-200"),children:"Rejected"})]}),(0,zc.jsxs)("div",{className:"relative w-full md:w-64",ref:c,children:[(0,zc.jsxs)(fg,{variant:"outline",onClick:()=>N(!b),className:"w-full justify-between transition-none",children:[(0,zc.jsx)("span",{className:"truncate",children:(null===(n=_.find(e=>l(e,1)[0]===y))||void 0===n?void 0:n[1])||"Select Event"}),(0,zc.jsx)("svg",{className:Zm("h-4 w-4 text-muted-foreground transition-transform duration-100",b&&"transform rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,zc.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),b&&(0,zc.jsx)("div",{className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md transition-all duration-100",children:(0,zc.jsx)("div",{className:"max-h-60 overflow-y-auto",children:_.map(e=>{let t=l(e,2),n=t[0],r=t[1];return(0,zc.jsx)(fg,{variant:"ghost",onClick:()=>{j(n),N(!1)},className:Zm("w-full justify-start font-normal",y===n&&"bg-accent"),children:r},n)})})})]})]}),(0,zc.jsx)(TS,{requests:w,isLoading:d,error:f,showName:m,showModalName:g,showModalEmail:v,showBursaryModal:p,selectedBursary:h,onToggleNameVisibility:E,onToggleModalNameVisibility:T,onToggleModalEmailVisibility:I,onViewDetails:P,onAccept:S,onReject:C,onCloseModal:()=>k(!1),onError:O})]})]})})]}),(0,zc.jsx)("div",{className:"h-8"})]})})},VC=()=>{const t=l((0,e.useState)(!1),2),n=t[0],r=(t[1],l((0,e.useState)(null),2)),a=r[0],s=(r[1],ng()),i=s.organization,o=s.loading,c=s.error,u=Y_(null===i||void 0===i?void 0:i.stripe_account_id);return n||o?(0,zc.jsx)(uj,{children:(0,zc.jsx)("div",{className:"space-y-6",children:(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsx)(Yx,{className:"h-8 w-[200px]"}),(0,zc.jsxs)("div",{className:"grid gap-4",children:[(0,zc.jsx)(Yx,{className:"h-12 w-full"}),(0,zc.jsx)(Yx,{className:"h-12 w-full"}),(0,zc.jsx)(Yx,{className:"h-12 w-full"})]})]})})}):a||c?(0,zc.jsx)(uj,{children:(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:a||(null===c||void 0===c?void 0:c.message)})})}):(0,zc.jsx)(uj,{children:(0,zc.jsxs)("div",{className:"space-y-6 sm:pb-0 pb-8 mb-6 md:mb-12",children:[(0,zc.jsx)("h2",{className:"text-3xl font-bold tracking-tight",children:"Finances"}),(null===i||void 0===i?void 0:i.stripe_account_id)&&u&&(0,zc.jsxs)(S_,{connectInstance:u,children:[(0,zc.jsx)(O_,{}),(0,zc.jsx)("h2",{className:"text-xl font-bold tracking-tight",children:"Account Management"}),(0,zc.jsx)(R_,{}),(0,zc.jsx)("h2",{className:"text-xl font-bold tracking-tight",children:"Payouts"}),(0,zc.jsx)(I_,{}),(0,zc.jsx)("h2",{className:"text-xl font-bold tracking-tight",children:"Payments"}),(0,zc.jsx)(T_,{}),(0,zc.jsx)("h2",{className:"text-xl font-bold tracking-tight",children:"Balances"}),(0,zc.jsx)(D_,{}),(0,zc.jsx)("h2",{className:"text-xl font-bold tracking-tight",children:"Documents"}),(0,zc.jsx)(A_,{})]})]})})},$C=Iu("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"}]]),GC=Iu("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),YC=Iu("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
2],["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"}]]),KC=["__scopeSwitch","name","checked","defaultChecked","required","disabled","value","onCheckedChange","form"],ZC=["__scopeSwitch"],JC=["__scopeSwitch","control","checked","bubbles"];var XC="Switch",QC=l(Gu(XC),2),eE=QC[0],tE=(QC[1],l(eE(XC),2)),nE=tE[0],rE=tE[1],aE=e.forwardRef((t,n)=>{const r=t.__scopeSwitch,a=t.name,s=t.checked,i=t.defaultChecked,o=t.required,c=t.disabled,u=t.value,d=void 0===u?"on":u,f=t.onCheckedChange,h=t.form,p=Yc(t,KC),m=l(e.useState(null),2),g=m[0],v=m[1],x=qu(n,e=>v(e)),y=e.useRef(!1),b=!g||(h||!!g.closest("form")),w=l(Jh({prop:s,defaultProp:null!==i&&void 0!==i&&i,onChange:f,caller:XC}),2),_=w[0],k=w[1];return(0,zc.jsxs)(nE,{scope:r,checked:_,disabled:c,children:[(0,zc.jsx)(ad.button,Gc(Gc({type:"button",role:"switch","aria-checked":_,"aria-required":o,"data-state":lE(_),"data-disabled":c?"":void 0,disabled:c,value:d},p),{},{ref:x,onClick:zu(t.onClick,e=>{k(e=>!e),b&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})})),b&&(0,zc.jsx)(oE,{control:g,bubbles:!y.current,name:a,value:d,checked:_,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});aE.displayName=XC;var sE="SwitchThumb",iE=e.forwardRef((e,t)=>{const n=e.__scopeSwitch,r=Yc(e,ZC),a=rE(sE,n);return(0,zc.jsx)(ad.span,Gc(Gc({"data-state":lE(a.checked),"data-disabled":a.disabled?"":void 0},r),{},{ref:t}))});iE.displayName=sE;var oE=e.forwardRef((t,n)=>{t.__scopeSwitch;let r=t.control,a=t.checked,s=t.bubbles,i=void 0===s||s,o=Yc(t,JC);const l=e.useRef(null),c=qu(l,n),u=Xb(a),d=vh(r);return e.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==a&&n){const t=new Event("click",{bubbles:i});n.call(e,a),e.dispatchEvent(t)}},[u,a,i]),(0,zc.jsx)("input",Gc(Gc({type:"checkbox","aria-hidden":!0,defaultChecked:a},o),{},{tabIndex:-1,ref:c,style:Gc(Gc(Gc({},o.style),d),{},{position:"absolute",pointerEvents:"none",opacity:0,margin:0})}))});function lE(e){return e?"checked":"unchecked"}oE.displayName="SwitchBubbleInput";var cE=aE,uE=iE;const dE=["className"],fE=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,dE);return(0,zc.jsx)(cE,Gc(Gc({className:Zm("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors 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 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",n)},r),{},{ref:t,children:(0,zc.jsx)(uE,{className:Zm("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}))});function hE(e,t){let n=l(t,2),r=n[0],a=n[1];return Math.min(a,Math.max(r,e))}fE.displayName=cE.displayName;const pE=["__scopeSelect","disabled"],mE=["__scopeSelect","className","style","children","placeholder"],gE=["__scopeSelect","children"],vE=["__scopeSelect","position","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","side","sideOffset","align","alignOffset","arrowPadding","collisionBoundary","collisionPadding","sticky","hideWhenDetached","avoidCollisions"],xE=["__scopeSelect","onPlaced"],yE=["__scopeSelect","align","collisionPadding"],bE=["__scopeSelect","nonce"],wE=["__scopeSelect"],_E=["__scopeSelect"],kE=["__scopeSelect","value","disabled","textValue"],jE=["__scopeSelect","className","style"],NE=["__scopeSelect"],SE=["__scopeSelect","onAutoScroll"],CE=["__scopeSelect"],EE=["__scopeSelect"],TE=["__scopeSelect","value"];var IE=[" ","Enter","ArrowUp","ArrowDown"],PE=[" ","Enter"],RE="Select",OE=l(FS(RE),3),AE=OE[0],DE=OE[1],ME=OE[2],FE=l(Gu(RE,[ME,jh]),2),LE=FE[0],UE=(FE[1],jh()),HE=l(LE(RE),2),zE=HE[0],BE=HE[1],WE=l(LE(RE),2),qE=WE[0],VE=WE[1],$E=t=>{const n=t.__scopeSelect,r=t.children,a=t.open,s=t.defaultOpen,i=t.onOpenChange,o=t.value,c=t.defaultValue,u=t.onValueChange,d=t.dir,f=t.name,h=t.autoComplete,p=t.disabled,m=t.required,g=t.form,v=UE(n),x=l(e.useState(null),2),y=x[0],b=x[1],w=l(e.useState(null),2),_=w[0],k=w[1],j=l(e.useState(!1),2),N=j[0],S=j[1],C=BS(d),E=l(Jh({prop:a,defaultProp:null!==s&&void 0!==s&&s,onChange:i,caller:RE}),2),T=E[0],I=E[1],P=l(Jh({prop:o,defaultProp:c,onChange:u,caller:RE}),2),R=P[0],O=P[1],A=e.useRef(null),D=!y||(g||!!y.closest("form")),M=l(e.useState(new Set),2),F=M[0],L=M[1],U=Array.from(F).map(e=>e.props.value).join(";");return(0,zc.jsx)(Bh,Gc(Gc({},v),{},{children:(0,zc.jsxs)(zE,{required:m,scope:n,trigger:y,onTriggerChange:b,valueNode:_,onValueNodeChange:k,valueNodeHasChildren:N,onValueNodeHasChildrenChange:S,contentId:bd(),value:R,onValueChange:O,open:T,onOpenChange:I,dir:C,triggerPointerDownPosRef:A,disabled:p,children:[(0,zc.jsx)(AE.Provider,{scope:n,children:(0,zc.jsx)(qE,{scope:t.__scopeSelect,onNativeOptionAdd:e.useCallback(e=>{L(t=>new Set(t).add(e))},[]),onNativeOptionRemove:e.useCallback(e=>{L(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),D?(0,zc.jsxs)(LT,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:h,value:R,onChange:e=>O(e.target.value),disabled:p,form:g,children:[void 0===R?(0,zc.jsx)("option",{value:""}):null,Array.from(F)]},U):null]})}))};$E.displayName=RE;
2var GE="SelectTrigger",YE=e.forwardRef((t,n)=>{const r=t.__scopeSelect,a=t.disabled,s=void 0!==a&&a,i=Yc(t,pE),o=UE(r),c=BE(GE,r),u=c.disabled||s,d=qu(n,c.onTriggerChange),f=DE(r),h=e.useRef("touch"),p=l(HT(e=>{const t=f().filter(e=>!e.disabled),n=t.find(e=>e.value===c.value),r=zT(t,e,n);void 0!==r&&c.onValueChange(r.value)}),3),m=p[0],g=p[1],v=p[2],x=e=>{u||(c.onOpenChange(!0),v()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,zc.jsx)(Wh,Gc(Gc({asChild:!0},o),{},{children:(0,zc.jsx)(ad.button,Gc(Gc({type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":UT(c.value)?"":void 0},i),{},{ref:d,onClick:zu(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==h.current&&x(e)}),onPointerDown:zu(i.onPointerDown,e=>{h.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(x(e),e.preventDefault())}),onKeyDown:zu(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||g(e.key),t&&" "===e.key||IE.includes(e.key)&&(x(),e.preventDefault())})}))}))});YE.displayName=GE;var KE="SelectValue",ZE=e.forwardRef((e,t)=>{const n=e.__scopeSelect,r=(e.className,e.style,e.children),a=e.placeholder,s=void 0===a?"":a,i=Yc(e,mE),o=BE(KE,n),l=o.onValueNodeHasChildrenChange,c=void 0!==r,u=qu(t,o.onValueNodeChange);return vd(()=>{l(c)},[l,c]),(0,zc.jsx)(ad.span,Gc(Gc({},i),{},{ref:u,style:{pointerEvents:"none"},children:UT(o.value)?(0,zc.jsx)(zc.Fragment,{children:s}):r}))});ZE.displayName=KE;var JE=e.forwardRef((e,t)=>{e.__scopeSelect;const n=e.children,r=Yc(e,gE);return(0,zc.jsx)(ad.span,Gc(Gc({"aria-hidden":!0},r),{},{ref:t,children:n||"\u25bc"}))});JE.displayName="SelectIcon";var XE=e=>(0,zc.jsx)(Gh,Gc({asChild:!0},e));XE.displayName="SelectPortal";var QE="SelectContent",eT=e.forwardRef((t,n)=>{const r=BE(QE,t.__scopeSelect),a=l(e.useState(),2),s=a[0],i=a[1];if(vd(()=>{i(new DocumentFragment)},[]),!r.open){const e=s;return e?so.createPortal((0,zc.jsx)(rT,{scope:t.__scopeSelect,children:(0,zc.jsx)(AE.Slot,{scope:t.__scopeSelect,children:(0,zc.jsx)("div",{children:t.children})})}),e):null}return(0,zc.jsx)(iT,Gc(Gc({},t),{},{ref:n}))});eT.displayName=QE;var tT=10,nT=l(LE(QE),2),rT=nT[0],aT=nT[1],sT=Ju("SelectContent.RemoveScroll"),iT=e.forwardRef((t,n)=>{const r=t.__scopeSelect,a=t.position,s=void 0===a?"item-aligned":a,i=t.onCloseAutoFocus,o=t.onEscapeKeyDown,c=t.onPointerDownOutside,u=t.side,d=t.sideOffset,f=t.align,h=t.alignOffset,p=t.arrowPadding,m=t.collisionBoundary,g=t.collisionPadding,v=t.sticky,x=t.hideWhenDetached,y=t.avoidCollisions,b=Yc(t,vE),w=BE(QE,r),_=l(e.useState(null),2),k=_[0],j=_[1],N=l(e.useState(null),2),S=N[0],C=N[1],E=qu(n,e=>j(e)),T=l(e.useState(null),2),I=T[0],P=T[1],R=l(e.useState(null),2),O=R[0],A=R[1],D=DE(r),M=l(e.useState(!1),2),F=M[0],L=M[1],U=e.useRef(!1);e.useEffect(()=>{if(k)return Av(k)},[k]),Ag();const H=e.useCallback(e=>{const t=oo(D().map(e=>e.ref.current)),n=t[0],r=l(t.slice(1).slice(-1),1)[0],a=document.activeElement;for(const s of e){if(s===a)return;if(null===s||void 0===s||s.scrollIntoView({block:"nearest"}),s===n&&S&&(S.scrollTop=0),s===r&&S&&(S.scrollTop=S.scrollHeight),null===s||void 0===s||s.focus(),document.activeElement!==a)return}},[D,S]),z=e.useCallback(()=>H([I,k]),[H,I,k]);e.useEffect(()=>{F&&z()},[F,z]);const B=w.onOpenChange,W=w.triggerPointerDownPosRef;e.useEffect(()=>{if(k){let e={x:0,y:0};const t=t=>{var n,r,a,s;e={x:Math.abs(Math.round(t.pageX)-(null!==(n=null===(r=W.current)||void 0===r?void 0:r.x)&&void 0!==n?n:0)),y:Math.abs(Math.round(t.pageY)-(null!==(a=null===(s=W.current)||void 0===s?void 0:s.y)&&void 0!==a?a:0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():k.contains(n.target)||B(!1),document.removeEventListener("pointermove",t),W.current=null};return null!==W.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[k,B,W]),e.useEffect(()=>{const e=()=>B(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[B]);const q=l(HT(e=>{const t=D().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=zT(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),2),V=q[0],$=q[1],G=e.useCallback((e,t,n)=>{const r=!U.current&&!n;(void 0!==w.value&&w.value===t||r)&&(P(e),r&&(U.current=!0))},[w.value]),Y=e.useCallback(()=>null===k||void 0===k?void 0:k.focus(),[k]),K=e.useCallback((e,t,n)=>{const r=!U.current&&!n;(void 0!==w.value&&w.value===t||r)&&A(e)},[w.value]),Z="popper"===s?lT:oT,J=Z===lT?{side:u,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:v,hideWhenDetached:x,avoidCollisions:y}:{};return(0,zc.jsx)(rT,{scope:r,content:k,viewport:S,onViewportChange:C,itemRefCallback:G,selectedItem:I,onItemLeave:Y,itemTextRefCallback:K,focusSelectedItem:z,selectedItemText:O,position:s,isPositioned:F,searchRef:V,children:(0,zc.jsx)(Sv,{as:sT,allowPinchZoom:!0,children:(0,zc.jsx)(Sg,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:zu(i,e=>{var t;null===(t=w.trigger)||void 0===t||t.focus({preventScroll:!0}),e.preventDefault()}),children:(0,zc.jsx)(hd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:(0,zc.jsx)(Z,Gc(Gc(Gc({role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault()},b),J),{},{onPlaced:()=>L(!0),ref:E,style:Gc({display:"flex",flexDirection:"column",outline:"none"},b.style),onKeyDown:zu(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;
2if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||$(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=D().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>H(t)),e.preventDefault()}})}))})})})})});iT.displayName="SelectContentImpl";var oT=e.forwardRef((t,n)=>{const r=t.__scopeSelect,a=t.onPlaced,s=Yc(t,xE),i=BE(QE,r),o=aT(QE,r),c=l(e.useState(null),2),u=c[0],d=c[1],f=l(e.useState(null),2),h=f[0],p=f[1],m=qu(n,e=>p(e)),g=DE(r),v=e.useRef(!1),x=e.useRef(!0),y=o.viewport,b=o.selectedItem,w=o.selectedItemText,_=o.focusSelectedItem,k=e.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&h&&y&&b&&w){const e=i.trigger.getBoundingClientRect(),t=h.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==i.dir){const a=r.left-t.left,s=n.left-a,i=e.left-s,o=e.width+i,l=Math.max(o,t.width),c=window.innerWidth-tT,d=hE(s,[tT,Math.max(tT,c-l)]);u.style.minWidth=o+"px",u.style.left=d+"px"}else{const a=t.right-r.right,s=window.innerWidth-n.right-a,i=window.innerWidth-e.right-s,o=e.width+i,l=Math.max(o,t.width),c=window.innerWidth-tT,d=hE(s,[tT,Math.max(tT,c-l)]);u.style.minWidth=o+"px",u.style.right=d+"px"}const s=g(),o=window.innerHeight-20,l=y.scrollHeight,c=window.getComputedStyle(h),d=parseInt(c.borderTopWidth,10),f=parseInt(c.paddingTop,10),p=parseInt(c.borderBottomWidth,10),m=d+f+l+parseInt(c.paddingBottom,10)+p,x=Math.min(5*b.offsetHeight,m),_=window.getComputedStyle(y),k=parseInt(_.paddingTop,10),j=parseInt(_.paddingBottom,10),N=e.top+e.height/2-tT,S=o-N,C=b.offsetHeight/2,E=d+f+(b.offsetTop+C),T=m-E;if(E<=N){const e=s.length>0&&b===s[s.length-1].ref.current;u.style.bottom="0px";const t=h.clientHeight-y.offsetTop-y.offsetHeight,n=E+Math.max(S,C+(e?j:0)+t+p);u.style.height=n+"px"}else{const e=s.length>0&&b===s[0].ref.current;u.style.top="0px";const t=Math.max(N,d+y.offsetTop+(e?k:0)+C)+T;u.style.height=t+"px",y.scrollTop=E-N+y.offsetTop}u.style.margin="".concat(tT,"px 0"),u.style.minHeight=x+"px",u.style.maxHeight=o+"px",null===a||void 0===a||a(),requestAnimationFrame(()=>v.current=!0)}},[g,i.trigger,i.valueNode,u,h,y,b,w,i.dir,a]);vd(()=>k(),[k]);const j=l(e.useState(),2),N=j[0],S=j[1];vd(()=>{h&&S(window.getComputedStyle(h).zIndex)},[h]);const C=e.useCallback(e=>{e&&!0===x.current&&(k(),null===_||void 0===_||_(),x.current=!1)},[k,_]);return(0,zc.jsx)(uT,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:C,children:(0,zc.jsx)("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:(0,zc.jsx)(ad.div,Gc(Gc({},s),{},{ref:m,style:Gc({boxSizing:"border-box",maxHeight:"100%"},s.style)}))})})});oT.displayName="SelectItemAlignedPosition";var lT=e.forwardRef((e,t)=>{const n=e.__scopeSelect,r=e.align,a=void 0===r?"start":r,s=e.collisionPadding,i=void 0===s?tT:s,o=Yc(e,yE),l=UE(n);return(0,zc.jsx)(qh,Gc(Gc(Gc({},l),o),{},{ref:t,align:a,collisionPadding:i,style:Gc(Gc({boxSizing:"border-box"},o.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)"})}))});lT.displayName="SelectPopperPosition";var cT=l(LE(QE,{}),2),uT=cT[0],dT=cT[1],fT="SelectViewport",hT=e.forwardRef((t,n)=>{const r=t.__scopeSelect,a=t.nonce,s=Yc(t,bE),i=aT(fT,r),o=dT(fT,r),l=qu(n,i.onViewportChange),c=e.useRef(0);return(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.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:a}),(0,zc.jsx)(AE.Slot,{scope:r,children:(0,zc.jsx)(ad.div,Gc(Gc({"data-radix-select-viewport":"",role:"presentation"},s),{},{ref:l,style:Gc({position:"relative",flex:1,overflow:"hidden auto"},s.style),onScroll:zu(s.onScroll,e=>{const t=e.currentTarget,n=o.contentWrapper,r=o.shouldExpandOnScrollRef;if(null!==r&&void 0!==r&&r.current&&n){const e=Math.abs(c.current-t.scrollTop);if(e>0){const r=window.innerHeight-20,a=parseFloat(n.style.minHeight),s=parseFloat(n.style.height),i=Math.max(a,s);if(i<r){const a=i+e,s=Math.min(r,a),o=a-s;n.style.height=s+"px","0px"===n.style.bottom&&(t.scrollTop=o>0?o:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})}))})]})});hT.displayName=fT;var pT="SelectGroup",mT=l(LE(pT),2),gT=mT[0],vT=mT[1],xT=e.forwardRef((e,t)=>
2{const n=e.__scopeSelect,r=Yc(e,wE),a=bd();return(0,zc.jsx)(gT,{scope:n,id:a,children:(0,zc.jsx)(ad.div,Gc(Gc({role:"group","aria-labelledby":a},r),{},{ref:t}))})});xT.displayName=pT;var yT="SelectLabel",bT=e.forwardRef((e,t)=>{const n=e.__scopeSelect,r=Yc(e,_E),a=vT(yT,n);return(0,zc.jsx)(ad.div,Gc(Gc({id:a.id},r),{},{ref:t}))});bT.displayName=yT;var wT="SelectItem",_T=l(LE(wT),2),kT=_T[0],jT=_T[1],NT=e.forwardRef((t,n)=>{const r=t.__scopeSelect,a=t.value,s=t.disabled,i=void 0!==s&&s,o=t.textValue,c=Yc(t,kE),u=BE(wT,r),d=aT(wT,r),f=u.value===a,h=l(e.useState(null!==o&&void 0!==o?o:""),2),p=h[0],m=h[1],g=l(e.useState(!1),2),v=g[0],x=g[1],y=qu(n,e=>{var t;return null===(t=d.itemRefCallback)||void 0===t?void 0:t.call(d,e,a,i)}),b=bd(),w=e.useRef("touch"),_=()=>{i||(u.onValueChange(a),u.onOpenChange(!1))};if(""===a)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(0,zc.jsx)(kT,{scope:r,value:a,disabled:i,textId:b,isSelected:f,onItemTextChange:e.useCallback(e=>{m(t=>{var n;return t||(null!==(n=null===e||void 0===e?void 0:e.textContent)&&void 0!==n?n:"").trim()})},[]),children:(0,zc.jsx)(AE.ItemSlot,{scope:r,value:a,disabled:i,textValue:p,children:(0,zc.jsx)(ad.div,Gc(Gc({role:"option","aria-labelledby":b,"data-highlighted":v?"":void 0,"aria-selected":f&&v,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},c),{},{ref:y,onFocus:zu(c.onFocus,()=>x(!0)),onBlur:zu(c.onBlur,()=>x(!1)),onClick:zu(c.onClick,()=>{"mouse"!==w.current&&_()}),onPointerUp:zu(c.onPointerUp,()=>{"mouse"===w.current&&_()}),onPointerDown:zu(c.onPointerDown,e=>{w.current=e.pointerType}),onPointerMove:zu(c.onPointerMove,e=>{var t;(w.current=e.pointerType,i)?null===(t=d.onItemLeave)||void 0===t||t.call(d):"mouse"===w.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:zu(c.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null===(t=d.onItemLeave)||void 0===t||t.call(d))}),onKeyDown:zu(c.onKeyDown,e=>{var t;""!==(null===(t=d.searchRef)||void 0===t?void 0:t.current)&&" "===e.key||(PE.includes(e.key)&&_()," "===e.key&&e.preventDefault())})}))})})});NT.displayName=wT;var ST="SelectItemText",CT=e.forwardRef((t,n)=>{const r=t.__scopeSelect,a=(t.className,t.style,Yc(t,jE)),s=BE(ST,r),i=aT(ST,r),o=jT(ST,r),c=VE(ST,r),u=l(e.useState(null),2),d=u[0],f=u[1],h=qu(n,e=>f(e),o.onItemTextChange,e=>{var t;return null===(t=i.itemTextRefCallback)||void 0===t?void 0:t.call(i,e,o.value,o.disabled)}),p=null===d||void 0===d?void 0:d.textContent,m=e.useMemo(()=>(0,zc.jsx)("option",{value:o.value,disabled:o.disabled,children:p},o.value),[o.disabled,o.value,p]),g=c.onNativeOptionAdd,v=c.onNativeOptionRemove;return vd(()=>(g(m),()=>v(m)),[g,v,m]),(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(ad.span,Gc(Gc({id:o.textId},a),{},{ref:h})),o.isSelected&&s.valueNode&&!s.valueNodeHasChildren?so.createPortal(a.children,s.valueNode):null]})});CT.displayName=ST;var ET="SelectItemIndicator",TT=e.forwardRef((e,t)=>{const n=e.__scopeSelect,r=Yc(e,NE);return jT(ET,n).isSelected?(0,zc.jsx)(ad.span,Gc(Gc({"aria-hidden":!0},r),{},{ref:t})):null});TT.displayName=ET;var IT="SelectScrollUpButton",PT=e.forwardRef((t,n)=>{const r=aT(IT,t.__scopeSelect),a=dT(IT,t.__scopeSelect),s=l(e.useState(!1),2),i=s[0],o=s[1],c=qu(n,a.onScrollButtonChange);return vd(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?(0,zc.jsx)(AT,Gc(Gc({},t),{},{ref:c,onAutoScroll:()=>{const e=r.viewport,t=r.selectedItem;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}})):null});PT.displayName=IT;var RT="SelectScrollDownButton",OT=e.forwardRef((t,n)=>{const r=aT(RT,t.__scopeSelect),a=dT(RT,t.__scopeSelect),s=l(e.useState(!1),2),i=s[0],o=s[1],c=qu(n,a.onScrollButtonChange);return vd(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?(0,zc.jsx)(AT,Gc(Gc({},t),{},{ref:c,onAutoScroll:()=>{const e=r.viewport,t=r.selectedItem;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}})):null});OT.displayName=RT;
2var AT=e.forwardRef((t,n)=>{const r=t.__scopeSelect,a=t.onAutoScroll,s=Yc(t,SE),i=aT("SelectScrollButton",r),o=e.useRef(null),l=DE(r),c=e.useCallback(()=>{null!==o.current&&(window.clearInterval(o.current),o.current=null)},[]);return e.useEffect(()=>()=>c(),[c]),vd(()=>{var e;const t=l().find(e=>e.ref.current===document.activeElement);null===t||void 0===t||null===(e=t.ref.current)||void 0===e||e.scrollIntoView({block:"nearest"})},[l]),(0,zc.jsx)(ad.div,Gc(Gc({"aria-hidden":!0},s),{},{ref:n,style:Gc({flexShrink:0},s.style),onPointerDown:zu(s.onPointerDown,()=>{null===o.current&&(o.current=window.setInterval(a,50))}),onPointerMove:zu(s.onPointerMove,()=>{var e;null===(e=i.onItemLeave)||void 0===e||e.call(i),null===o.current&&(o.current=window.setInterval(a,50))}),onPointerLeave:zu(s.onPointerLeave,()=>{c()})}))}),DT=e.forwardRef((e,t)=>{e.__scopeSelect;const n=Yc(e,CE);return(0,zc.jsx)(ad.div,Gc(Gc({"aria-hidden":!0},n),{},{ref:t}))});DT.displayName="SelectSeparator";var MT="SelectArrow",FT=e.forwardRef((e,t)=>{const n=e.__scopeSelect,r=Yc(e,EE),a=UE(n),s=BE(MT,n),i=aT(MT,n);return s.open&&"popper"===i.position?(0,zc.jsx)(Vh,Gc(Gc(Gc({},a),r),{},{ref:t})):null});FT.displayName=MT;var LT=e.forwardRef((t,n)=>{t.__scopeSelect;let r=t.value,a=Yc(t,TE);const s=e.useRef(null),i=qu(n,s),o=Xb(r);return e.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(o!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[o,r]),(0,zc.jsx)(ad.select,Gc(Gc({},a),{},{style:Gc(Gc({},Xh),a.style),ref:i,defaultValue:r}))});function UT(e){return""===e||void 0===e}function HT(t){const n=id(t),r=e.useRef(""),a=e.useRef(0),s=e.useCallback(e=>{const t=r.current+e;n(t),function e(t){r.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),i=e.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,s,i]}function zT(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=(i=e,o=Math.max(a,0),i.map((e,t)=>i[(o+t)%i.length]));var i,o;1===r.length&&(s=s.filter(e=>e!==n));const l=s.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}LT.displayName="SelectBubbleInput";var BT=$E,WT=YE,qT=ZE,VT=JE,$T=XE,GT=eT,YT=hT,KT=bT,ZT=NT,JT=CT,XT=TT,QT=PT,eI=OT,tI=DT;const nI=Iu("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),rI=Iu("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),aI=["className","children"],sI=["className"],iI=["className"],oI=["className","children","position"],lI=["className"],cI=["className","children"],uI=["className"],dI=BT,fI=qT,hI=e.forwardRef((e,t)=>{let n=e.className,r=e.children,a=Yc(e,aI);return(0,zc.jsxs)(WT,Gc(Gc({ref:t,className:Zm("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
2ing-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",n)},a),{},{children:[r,(0,zc.jsx)(VT,{asChild:!0,children:(0,zc.jsx)(nI,{className:"h-4 w-4 opacity-50"})})]}))});hI.displayName=WT.displayName;const pI=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,sI);return(0,zc.jsx)(QT,Gc(Gc({ref:t,className:Zm("flex cursor-default items-center justify-center py-1",n)},r),{},{children:(0,zc.jsx)(rI,{className:"h-4 w-4"})}))});pI.displayName=QT.displayName;const mI=e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,iI);return(0,zc.jsx)(eI,Gc(Gc({ref:t,className:Zm("flex cursor-default items-center justify-center py-1",n)},r),{},{children:(0,zc.jsx)(nI,{className:"h-4 w-4"})}))});mI.displayName=eI.displayName;const gI=e.forwardRef((e,t)=>{let n=e.className,r=e.children,a=e.position,s=void 0===a?"popper":a,i=Yc(e,oI);return(0,zc.jsx)($T,{children:(0,zc.jsxs)(GT,Gc(Gc({ref:t,className:Zm("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","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:s},i),{},{children:[(0,zc.jsx)(pI,{}),(0,zc.jsx)(YT,{className:Zm("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,zc.jsx)(mI,{})]}))})});gI.displayName=GT.displayName;e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,lI);return(0,zc.jsx)(KT,Gc({ref:t,className:Zm("py-1.5 pl-8 pr-2 text-sm font-semibold",n)},r))}).displayName=KT.displayName;const vI=e.forwardRef((e,t)=>{let n=e.className,r=e.children,a=Yc(e,cI);return(0,zc.jsxs)(ZT,Gc(Gc({ref:t,className:Zm("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n)},a),{},{children:[(0,zc.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,zc.jsx)(XT,{children:(0,zc.jsx)(bw,{className:"h-4 w-4"})})}),(0,zc.jsx)(JT,{children:r})]}))});vI.displayName=ZT.displayName;e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,uI);return(0,zc.jsx)(tI,Gc({ref:t,className:Zm("-mx-1 my-1 h-px bg-muted",n)},r))}).displayName=tI.displayName;const xI={async createTemplate(e){const t=await fetch("".concat("https://api.trievents.ca","/email/templates"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)});if(!t.ok){const e=await t.text();try{const t=JSON.parse(e);throw new Error(t.error||"Failed to create email template")}catch(n){throw new Error(e)}}return t.json()},async getTemplates(e){const t=new URLSearchParams;null!==e&&void 0!==e&&e.event_uuid&&t.append("event_uuid",e.event_uuid),null!==e&&void 0!==e&&e.template_type&&t.append("template_type",e.template_type),null!==e&&void 0!==e&&e.include_org_defaults&&t.append("include_org_defaults","true");const n="".concat("https://api.trievents.ca","/email/templates").concat(t.toString()?"?"+t.toString():""),r=await fetch(n,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!r.ok){const e=await r.text();try{const t=JSON.parse(e);throw new Error(t.error||"Failed to fetch email templates")}catch(a){throw new Error(e)}}return r.json()},async getTemplateById(e){const t=await fetch("".concat("https://api.trievents.ca","/email/templates/").concat(e),{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!t.ok){const e=await t.text();try{const t=JSON.parse(e);throw new Error(t.error||"Failed to fetch email template")}catch(n){throw new Error(e)}}return t.json()},async updateTemplate(e,t){const n=await fetch("".concat("https://api.trievents.ca","/email/templates/").concat(e),{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)});if(!n.ok){const e=await n.text();try{const t=JSON.parse(e);throw new Error(t.error||"Failed to update email template")}catch(r){throw new Error(e)}}return n.json()},async deleteTemplate(e){const t=await fetch("".concat("https://api.trievents.ca","/email/templates/").concat(e),{method:"DELETE",headers:{"Content-Type":"application/json"},credentials:"include"});if(!t.ok){const e=await t.text();try{const t=JSON.parse(e);throw new Error(t.error||"Failed to delete email template")}catch(n){throw new Error(e)}}return t.json()},async getEffectiveTemplate(e,t){const n=await fetch("".concat("https://api.trievents.ca","/email/templates/effective/").concat(e,"/").concat(t),{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!n.ok){const e=await n.text();try{const t=JSON.parse(e);throw new Error(t.error||"Failed to fetch effective template")}catch(r){throw new Error(e)}}return n.json()}},yI=["autoFetch"];const bI=function(){ku();const t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=l((0,e.useState)([]),2),r=n[0],a=n[1],s=l((0,e.useState)(!1),2),i=s[0],o=s[1],c=l((0,e.useState)(null),2),u=c[0],d=c[1],f=l((0,e.useState)(!1),2),h=f[0],p=f[1],m=l((0,e.useState)(!1),2),g=m[0],v=m[1],x=l((0,e.useState)(!1),2),y=x[0],b=x[1],w=t.autoFetch,_=void 0===w||w,k=Yc(t,yI),j=(0,e.useCallback)(async()=>{o(!0),d(null);try{const e=await xI.getTemplates(k);a(e.templates)}catch(XF){d(XF instanceof Error?XF.message:"Failed to fetch email templates"),a([])}finally{o(!1)}},[t.event_uuid,t.template_type,t.include_org_defaults]),N=(0,e.useCallback)(async e=>{p(!0),d(null);try{await xI.createTemplate(e),await j()}catch(XF){throw d(XF instanceof Error?XF.message:"Failed to create email template"),XF}finally{p(!1)}},[j]),S=(0,e.useCallback)(async(e,t)=>{v(!0),d(null);try{await xI.updateTemplate(e,t),await j()}catch(XF){throw d(XF instanceof Error?XF.message:"Failed to update email template"),XF}finally{v(!1)}},[j]),C=(0,e.useCallback)(async e=>{b(!0),d(null);try{await xI.deleteTemplate(e),await j()}catch(XF){throw d(XF instanceof Error?XF.message:"Failed to delete email template"),XF}finally{b(!1)}},[j]),E=(0,e.useCallback)(async(e,t)=>{try{return(await xI.getEffectiveTemplate(e,t)).template}catch(XF){return console.error("Failed to get effective template:",XF),null}},[]);return(0,e.useEffect)(()=>{_&&j()},[_,j]),{templates:r,loading:i,error:u,creating:h,updating:g,deleting:y,refetch:j,createTemplate:N,updateTemplate:S,deleteTemplate:C,getEffectiveTemplate:E}}(),n=t.templates,r=t.loading,a=(t.error,t.creating),s=t.updating,i=t.deleting,o=t.createTemplate,c=t.updateTemplate,u=t.deleteTemplate,d=(t.refetch,l((0,e.useState)(null),2)),f=d[0],h=d[1],p=l((0,e.useState)(!1),2),m=p[0],g=p[1],v=l((0,e.useState)(!1),2),x=v[0],y=v[1],b=l((0,e.useState)(!1),2),w=b[0],_=b[1],k=l((0,e.useState)(null),2),j=k[0],N=k[1],S=l((0,e.useState)({template_type:"ticket_confirmation",subject_line:"",custom_message:"",enabled:!0}),2),C=S[0],E=S[1],T=l((0,e.useState)({subject_line:"",custom_message:"",enabled:!0}),2),I=T[0],P=T[1],R=e=>{switch(e){case"ticket_confirmation":return"Ticket Confirmation";case"reminder":return"Event Reminder";case"follow_up":return"Follow Up";default:return e}};return r?(0,zc.jsxs)("div",{className:"space-y-6",children:[(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row md:justify-between md:items-center gap-4",children:[(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-96"}),(0,zc.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-80"}),(0,zc.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-64"})]}),(0,zc.jsx)("div",{className:"h-10 bg-muted rounded animate-pulse w-40"})]}),(0,zc.jsx)("div",{className:"grid gap-4",children:[1,2,3].map(e=>(0,zc.jsxs)(Rb,{children:[(0,zc.jsx)(Ob,{className:"pb-3",children:(0,zc.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[(0,zc.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,zc.jsx)("div",{className:"h-5 bg-muted rounded animate-pulse w-32"}),(0,zc.jsx)("div",{className:"h-5 bg-muted rounded animate-pulse w-16"}),(0,zc.jsx)("div",{className:"h-5 bg-muted rounded animate-pulse w-20"})]}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-48"})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("div",{className:"h-8 bg-muted rounded animate-pulse w-16"}),(0,zc.jsx)("div",{className:"h-8 bg-muted rounded animate-pulse w-16"})]})]})}),(0,zc.jsx)(Mb,{className:"pt-0",children:(0,zc.jsxs)("div",{className:"space-y-3",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-24 mb-2"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-full"})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-32 mb-2"}),(0,zc.jsx)("div",{className:"h-16 bg-muted rounded animate-pulse w-full"})]})]})})]},e))})]}):(0,zc.jsxs)("div",{className:"space-y-6",children:[(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row md:justify-between md:items-center gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("p",{className:"text-muted-foreground mt-2 text-sm md:text-base",children:"Customize your ticket confirmation emails by adding personalized messages that will appear in every confirmation email sent to your customers"}),(0,zc.jsx)("p",{className:"text-sm text-amber-600 mt-1",children:"Note: You can only create one template per organization"})]}),(0,zc.jsxs)(Uw,{open:m,onOpenChange:e=>{g(e),e||h(null)},children:[(0,zc.jsx)(Hw,{asChild:!0,children:(0,zc.jsxs)(fg,{className:"w-full md:w-auto",children:[(0,zc.jsx)(cj,{className:"h-4 w-4 mr-2"}),"Create Template"]})}),(0,zc.jsxs)(Ww,{className:"max-w-2l w-95-h-[90vh] overflow-y-auto",children:[(0,zc.jsxs)(qw,{children:[(0,zc.jsx)($w,{className:"text-lg md:text-xl",children:"Create Organization Email Template"}),(0,zc.jsx)(Gw,{className:"text-sm",children:"Add a custom message to your ticket confirmation emails that will be sent to all customers who purchase tickets"})]}),(0,zc.jsxs)("form",{onSubmit:async e=>{e.preventDefault();const t=n.find(e=>e.template_type===C.template_type);if(t)h("A ".concat(R(C.template_type)," template already exists. You can only have one template per type."));else try{const e={event_uuid:null,template_type:C.template_type,subject_line:C.subject_line||null,custom_message:C.custom_message||null,enabled:C.enabled,is_org_default:!0};await o(e),g(!1),h(null),E({template_type:"ticket_confirmation",subject_line:"",custom_message:"",enabled:!0})}catch(XF){}},className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"template_type",children:"Template Type"}),(0,zc.jsxs)(dI,{value:C.template_type,onValueChange:e=>{E(Gc(Gc({},C),{},{template_type:e})),h(null)},children:[(0,zc.jsx)(hI,{children:(0,zc.jsx)(fI,{})}),(0,zc.jsx)(gI,{children:(0,zc.jsxs)(vI,{value:"ticket_confirmation",disabled:n.some(e=>"ticket_confirmation"===e.template_type),children:["Ticket Confirmation ",n.some(e=>"ticket_confirmation"===e.template_type)&&"(Already exists)"]})})]}),(0,zc.jsx)("p",{className:"text-sm text-muted-foreground",children:"This message will appear in ticket confirmation emails for all events in your organization."})]}),f&&(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:f})}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"subject_line",children:"Custom Subject Line (Optional)"}),(0,zc.jsx)(pg,{id:"subject_line",value:C.subject_line,onChange:e=>E(Gc(Gc({},C),{},{subject_line:e.target.value})),placeholder:"Your Custom Event Title"})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"custom_message",children:"Custom Message"}),(0,zc.jsx)(Jb,{id:"custom_message",value:C.custom_message,onChange:e=>E(Gc(Gc({},C),{},{custom_message:e.target.value})),placeholder:"Add your custom message here. This will appear in the ticket confirmation email sent to customers.",rows:4})]}),(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)(fE,{checked:C.enabled,onCheckedChange:e=>E(Gc(Gc({},C),{},{enabled:e}))}),(0,zc.jsx)(Kb,{children:"Enabled"})]}),(0,zc.jsxs)(Vw,{className:"flex-col sm:flex-row gap-2",children:[(0,zc.jsx)(fg,{type:"submit",disabled:a,className:"w-full sm:w-auto",children:a?"Creating...":"Create Template"}),(0,zc.jsx)(fg,{type:"button",variant:"outline",onClick:()=>g(!1),className:"w-full sm:w-auto",children:"Cancel"})]})]})]})]})]}),(0,zc.jsx)("div",{className:"grid gap-4",children:0===n.length?(0,zc.jsx)(Rb,{children:(0,zc.jsxs)(Mb,{className:"flex flex-col items-center justify-center py-8",children:[(0,zc.jsx)(Ou,{className:"h-10 w-10 md:h-12 md:w-12 text-muted-foreground mb-4"}),(0,zc.jsx)("h3",{className:"text-lg font-semibold mb-2 text-center",children:"No email templates"}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center mb-4 text-sm md:text-base",children:"Customize your ticket confirmation emails by adding personalized messages that will be included in every confirmation email sent to your customers."}),(0,zc.jsxs)(fg,{onClick:()=>g(!0),className:"w-full sm:w-auto",children:[(0,zc.jsx)(cj,{className:"h-4 w-4 mr-2"}),"Create Template"]})]})}):n.map(e=>(0,zc.jsxs)(Rb,{children:[(0,zc.jsx)(Ob,{className:"pb-3",children:(0,zc.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[(0,zc.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,zc.jsxs)(Ab,{className:"flex flex-col sm:flex-row sm:items-center gap-2 text-base md:text-lg",children:[(0,zc.jsx)("span",{className:"truncate",children:R(e.template_type)}),(0,zc.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(0,zc.jsx)(Nw,{variant:"secondary",className:"text-xs",children:"Organization Template"}),!e.enabled&&(0,zc.jsx)(Nw,{variant:"outline",className:"text-xs",children:"Disabled"})]})]}),(0,zc.jsx)("div",{className:"flex items-center gap-4 mt-2 text-sm text-muted-foreground",children:e.event&&(0,zc.jsxs)("div",{className:"flex items-center gap-1",children:[(0,zc.jsx)(hS,{className:"h-4 w-4"}),(0,zc.jsx)("span",{className:"truncate",children:e.event.title})]})})]}
2),(0,zc.jsxs)("div",{className:"flex items-center gap-2 self-start sm:self-center w-full sm:w-auto",children:[(0,zc.jsxs)(fg,{variant:"outline",size:"sm",onClick:()=>(e=>{N(e),P({subject_line:e.subject_line||"",custom_message:e.custom_message||"",enabled:e.enabled}),y(!0)})(e),className:"flex-1",children:[(0,zc.jsx)(GC,{className:"h-4 w-4"}),(0,zc.jsx)("span",{className:"ml-1 sm:hidden",children:"Edit"})]}),(0,zc.jsxs)(fg,{variant:"outline",size:"sm",onClick:()=>(e=>{N(e),_(!0)})(e),className:"flex-1",children:[(0,zc.jsx)(YC,{className:"h-4 w-4"}),(0,zc.jsx)("span",{className:"ml-1 sm:hidden",children:"Delete"})]})]})]})}),(0,zc.jsx)(Mb,{className:"pt-0",children:(0,zc.jsxs)("div",{className:"space-y-3",children:[e.subject_line&&(0,zc.jsxs)("div",{children:[(0,zc.jsx)(Kb,{className:"text-sm font-medium",children:"Subject Line:"}),(0,zc.jsx)("p",{className:"text-sm break-words",children:e.subject_line})]}),e.custom_message&&(0,zc.jsxs)("div",{children:[(0,zc.jsx)(Kb,{className:"text-sm font-medium",children:"Custom Message:"}),(0,zc.jsx)("p",{className:"text-sm whitespace-pre-line bg-muted p-3 rounded break-words",children:e.custom_message})]})]})})]},e.uuid))}),(0,zc.jsx)(Uw,{open:x,onOpenChange:y,children:(0,zc.jsxs)(Ww,{className:"max-w-2l w-95-h-[90vh] overflow-y-auto",children:[(0,zc.jsxs)(qw,{children:[(0,zc.jsx)($w,{className:"text-lg md:text-xl",children:"Edit Email Template"}),(0,zc.jsx)(Gw,{className:"text-sm",children:"Update your email template settings"})]}),(0,zc.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),j)try{await c(j.uuid,I),y(!1),N(null)}catch(XF){}},className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"edit_subject_line",children:"Subject Line (Optional)"}),(0,zc.jsx)(pg,{id:"edit_subject_line",value:I.subject_line||"",onChange:e=>P(Gc(Gc({},I),{},{subject_line:e.target.value})),placeholder:"Custom subject line"})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)(Kb,{htmlFor:"edit_custom_message",children:"Custom Message"}),(0,zc.jsx)(Jb,{id:"edit_custom_message",value:I.custom_message||"",onChange:e=>P(Gc(Gc({},I),{},{custom_message:e.target.value})),placeholder:"Your custom message",rows:4})]}),(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)(fE,{checked:I.enabled,onCheckedChange:e=>P(Gc(Gc({},I),{},{enabled:e}))}),(0,zc.jsx)(Kb,{children:"Enabled"})]}),(0,zc.jsxs)(Vw,{className:"flex-col sm:flex-row gap-2",children:[(0,zc.jsx)(fg,{type:"button",variant:"outline",onClick:()=>y(!1),className:"w-full sm:w-auto",children:"Cancel"}),(0,zc.jsx)(fg,{type:"submit",disabled:s,className:"w-full sm:w-auto",children:s?"Updating...":"Update Template"})]})]})]})}),(0,zc.jsx)(Uw,{open:w,onOpenChange:_,children:(0,zc.jsxs)(Ww,{className:"max-w-2l w-95-h-[90vh] overflow-y-auto",children:[(0,zc.jsxs)(qw,{children:[(0,zc.jsx)($w,{className:"text-lg md:text-xl",children:"Delete Email Template"}),(0,zc.jsx)(Gw,{className:"text-sm",children:"Are you sure you want to delete this email template? This action cannot be undone."})]}),(0,zc.jsxs)(Vw,{className:"flex-col sm:flex-row gap-2",children:[(0,zc.jsx)(fg,{type:"button",variant:"destructive",className:"text-white w-full sm:w-auto",onClick:async()=>{if(j)try{await u(j.uuid),_(!1),N(null)}catch(XF){}},disabled:i,children:"Delete Template"}),(0,zc.jsx)(fg,{type:"button",variant:"outline",onClick:()=>_(!1),className:"w-full sm:w-auto",children:"Cancel"})]})]})})]})},wI=(Iu("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Iu("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])),_I=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n="".concat("https://api.trievents.ca","/email/tracker/emails?count=").concat(e,"&offset=").concat(t),r=await fetch(n,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!r.ok){const e=await r.text();throw new Error("Failed to fetch emails: ".concat(r.status," ").concat(e))}return r.json()};const kI=function(){const t=l((0,e.useState)(""),2),n=t[0],r=t[1],a=l((0,e.useState)("all"),2),s=a[0],i=a[1],o=l((0,e.useState)("all"),2),c=o[0],u=o[1],d=(()=>{const t=l((0,e.useState)([]),2),n=t[0],r=t[1],a=l((0,e.useState)(!0),2),s=a[0],i=a[1],o=l((0,e.useState)(null),2),c=o[0],u=o[1],d=l((0,e.useState)(50),2),f=d[0],h=d[1],p=l((0,e.useState)(0),2),m=p[0],g=p[1],v=l((0,e.useState)(0),2),x=v[0],y=v[1],b=async()=>{try{i(!0),u(null);const e=await _I(f,m);r(e.emails),y(e.total)}catch(XF){console.error("Error fetching emails:",XF),u(XF instanceof Error?XF.message:"Failed to fetch emails")}finally{i(!1)}};return(0,e.useEffect)(()=>{b()}
2,[f,m]),{emails:n,loading:s,error:c,total:x,count:f,offset:m,setCount:h,refreshData:()=>{b()},loadMore:()=>{g(e=>e+f)},loadPrevious:()=>{g(e=>Math.max(0,e-f))},resetPagination:()=>{g(0)},goToPage:e=>{g(e*f)}}})(),f=d.emails,h=d.loading,p=d.error,m=d.total,g=d.count,v=d.offset,x=d.refreshData,y=d.loadMore,b=d.loadPrevious,w=(d.resetPagination,e=>{switch(e.toLowerCase()){case"sent":return(0,zc.jsx)(Nw,{variant:"default",className:"bg-green-100 text-green-800",children:"Sent"});case"failed":return(0,zc.jsx)(Nw,{variant:"destructive",className:"text-white",children:"Failed"});default:return(0,zc.jsx)(Nw,{variant:"outline",children:e})}}),_=e=>{if(!e)return"N/A";try{const t=new Date(e);return isNaN(t.getTime())?(console.warn("Invalid date string:",e),"Invalid Date"):t.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch(p){return console.error("Error formatting date:",e,p),"Invalid Date"}},k=f.filter(e=>{const t=e.recipient.toLowerCase().includes(n.toLowerCase())||e.subject.toLowerCase().includes(n.toLowerCase())||e.event_name.toLowerCase().includes(n.toLowerCase()),r="all"===s||e.status===s,a="all"===c||e.email_type===c;return t&&r&&a}),j=h&&f.length>0;return h&&0===f.length?(0,zc.jsxs)("div",{className:"space-y-6",children:[(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row md:justify-between gap-4",children:[(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row gap-4 flex-1",children:[(0,zc.jsx)("div",{className:"relative flex-1",children:(0,zc.jsx)("div",{className:"h-10 bg-muted rounded animate-pulse"})}),(0,zc.jsx)("div",{className:"w-full md:w-48",children:(0,zc.jsx)("div",{className:"h-10 bg-muted rounded animate-pulse"})})]}),(0,zc.jsx)("div",{className:"w-full md:w-auto",children:(0,zc.jsx)("div",{className:"h-10 bg-muted rounded animate-pulse"})})]}),(0,zc.jsx)("div",{className:"space-y-4 md:hidden",children:[1,2,3,4,5,6,7,8,9,10].map(e=>(0,zc.jsx)(Rb,{className:"border-l-4 border-l-gray-300",children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsx)("div",{className:"flex justify-between items-start gap-4",children:(0,zc.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,zc.jsx)("div",{className:"h-5 bg-muted rounded animate-pulse mb-2"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-3/4"})]})}),(0,zc.jsxs)("div",{className:"flex justify-between items-center",children:[(0,zc.jsx)("div",{className:"h-6 w-20 bg-muted rounded animate-pulse"}),(0,zc.jsx)("div",{className:"h-6 w-16 bg-muted rounded animate-pulse"})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-32"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-40"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-36"})]})]})})},e))}),(0,zc.jsx)("div",{className:"hidden md:block",children:(0,zc.jsx)("div",{className:"border rounded-lg overflow-hidden w-full",children:(0,zc.jsxs)("div",{className:"min-h-[500px] max-h-[500px] overflow-auto w-full bg-gray-50",children:[(0,zc.jsx)("div",{className:"p-4 bg-blue-50 border-b border-blue-200",children:(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-full"})}),(0,zc.jsx)("div",{children:[1,2,3,4,5,6,7,8,9,10].map(e=>(0,zc.jsx)(Rb,{className:"rounded-none border-b border-gray-200 border-l-4 border-l-gray-300",children:(0,zc.jsxs)(Mb,{className:"p-4",children:[(0,zc.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,zc.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,zc.jsx)("div",{className:"h-5 bg-muted rounded animate-pulse mb-2"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-3/4"})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,zc.jsx)("div",{className:"h-6 w-20 bg-muted rounded animate-pulse"}),(0,zc.jsx)("div",{className:"h-6 w-16 bg-muted rounded animate-pulse"})]})]}),(0,zc.jsxs)("div",{className:"text-sm text-gray-600",children:[(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-32 inline-block"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-40 inline-block ml-4"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-36 inline-block ml-4"})]})]})},e))})]})})})]}):p?(0,zc.jsx)("div",{className:"space-y-6",children:(0,zc.jsx)(Rb,{children:(0,zc.jsxs)(Mb,{className:"flex flex-col items-center justify-center py-12",children:[(0,zc.jsx)(wI,{className:"h-12 w-12 text-red-500 mb-4"}),(0,zc.jsx)("h3",{className:"text-lg font-semibold mb-2 text-center",children:"Error Loading Emails"}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center text-sm mb-4",children:p}),(0,zc.jsxs)(fg,{onClick:x,variant:"outline",children:[(0,zc.jsx)(yS,{className:"h-4 w-4 mr-2"}),"Try Again"]})]})})}):(0,zc.jsxs)("div",{className:"space-y-6",children:[(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row md:justify-between gap-4",children:[(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row gap-4 flex-1",children:[(0,zc.jsxs)("div",{className:"relative flex-1",children:[(0,zc.jsx)(mS,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,zc.jsx)(pg,{type:"text",placeholder:"Search by recipient, subject, or event...",value:n,onChange:e=>r(e.target.value),className:"pl-9 h-10"})]}),(0,zc.jsx)("div",{className:"w-full md:w-48",children:(0,zc.jsxs)(dI,{value:s,onValueChange:i,children:[(0,zc.jsx)(hI,{className:"h-10",children:(0,zc.jsx)(fI,{placeholder:"Filter by status"})}),(0,zc.jsxs)(gI,{children:[(0,zc.jsx)(vI,{value:"all",children:"All Statuses"}),(0,zc.jsx)(vI,{value:"sent",children:"Sent"}),(0,zc.jsx)(vI,{value:"failed",children:"Failed"})]})]})}),(0,zc.jsx)("div",{className:"w-full md:w-48",children:(0,zc.jsxs)(dI,{value:c,onValueChange:u,children:[(0,zc.jsx)(hI,{className:"h-10",children:(0,zc.jsx)(fI,{placeholder:"Filter by email type"})}),(0,zc.jsxs)(gI,{children:[(0,zc.jsx)(vI,{value:"all",children:"All Email Types"}),(0,zc.jsx)(vI,{value:"Ticket Email",children:"Ticket Email"}),(0,zc.jsx)(vI,{value:"Email Blast",children:"Email Blast"})]})]})})]}),(0,zc.jsxs)(fg,{onClick:x,disabled:h,className:"h-10",children:[(0,zc.jsx)(yS,{className:"h-4 w-4 mr-2 ".concat(h?"animate-spin":"")}),"Refresh"]})]}),(0,zc.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zc.jsx)("div",{className:"hidden md:block text-sm text-muted-foreground",children:0===m?"No emails found":"Showing ".concat(v+1," to ").concat(Math.min(v+g,m)," of ").concat(m," emails")}),(0,zc.jsxs)("div",{className:"flex items-center gap-2 w-full md:w-auto",children:[(0,zc.jsxs)(fg,{variant:"outline",size:"sm",onClick:b,disabled:0===v||h,className:"flex-1 md:flex-none",children:[(0,zc.jsx)(dj,{className:"h-4 w-4"}),"Previous"]}),(0,zc.jsxs)(fg,{variant:"outline",size:"sm",onClick:y,disabled:h||v+g>=m,className:"flex-1 md:flex-none",children:["Next",(0,zc.jsx)(fj,{className:"h-4 w-4"})]})]})]}),(0,zc.jsxs)("div",{className:"md:hidden space-y-4",children:[(0,zc.jsx)("div",{className:"p-4 bg-blue-50 border border-blue-200 rounded-lg",children:(0,zc.jsxs)("p",{className:"text-sm text-blue-800",children:[(0,zc.jsx)("strong",{children:"Note:"}),' Emails may initially appear as "Sent" but can bounce back later and show as "Failed". Use the refresh button to check for updated delivery status. If an attendee\'s ticket email shows up as "Failed", try using the reissue feature on the event\'s attendees page to resend the email.']})}),j?(0,zc.jsx)("div",{className:"space-y-4",children:[1,2,3,4,5,6,7,8,9,10].map(e=>(0,zc.jsx)(Rb,{className:"border-l-4 border-l-gray-300",children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsx)("div",{className:"flex justify-between items-start gap-4",children:(0,zc.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,zc.jsx)("div",{className:"h-5 bg-muted rounded animate-pulse mb-2"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-3/4"})]})}),(0,zc.jsxs)("div",{className:"flex justify-between items-center",children:[(0,zc.jsx)("div",{className:"h-6 w-20 bg-muted rounded animate-pulse"}),(0,zc.jsx)("div",{className:"h-6 w-16 bg-muted rounded animate-pulse"})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-32"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-40"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-36"})]})]})})},e))}):0===k.length?(0,zc.jsx)(Rb,{children:(0,zc.jsxs)(Mb,{className:"flex flex-col items-center justify-center py-12",children:[(0,zc.jsx)($C,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,zc.jsx)("h3",{className:"text-lg font-semibold mb-2 text-center",children:"No email records foun
2d"}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center text-sm",children:n||"all"!==s?"Try adjusting your search or filter criteria.":"Emails will appear here once emails are sent."})]})}):(0,zc.jsx)("div",{className:"space-y-4",children:k.map(e=>(0,zc.jsx)(Rb,{className:"".concat("sent"===e.status?"border-l-4 border-l-green-500":"border-l-4 border-l-red-500"),children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsx)("div",{className:"flex justify-between items-start gap-4",children:(0,zc.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,zc.jsx)("p",{className:"font-medium truncate text-base",children:e.subject}),(0,zc.jsx)("p",{className:"text-sm text-muted-foreground truncate mt-1",children:e.recipient})]})}),(0,zc.jsxs)("div",{className:"flex justify-between items-center",children:[(0,zc.jsx)(Nw,{variant:"outline",className:"text-xs px-2 py-1 rounded-md",children:e.email_type}),w(e.status)]}),(0,zc.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,zc.jsxs)("p",{children:[(0,zc.jsx)("strong",{children:"Sent:"})," ",_(e.sent_at)]}),e.delivered_at&&(0,zc.jsxs)("p",{children:[(0,zc.jsx)("strong",{children:"Delivered:"})," ",_(e.delivered_at)]}),e.opened_at&&(0,zc.jsxs)("p",{children:[(0,zc.jsx)("strong",{children:"Opened:"})," ",_(e.opened_at)]}),e.bounce_details&&(0,zc.jsxs)("div",{className:"p-2 bg-red-50 border border-red-200 rounded text-sm text-red-700",children:[(0,zc.jsx)("strong",{children:"Bounce Reason:"})," ",e.bounce_details.Details||"Unknown"]})]})]})})},e.id))})]}),(0,zc.jsx)("div",{className:"hidden md:block",children:(0,zc.jsx)("div",{className:"border rounded-lg overflow-hidden w-full",children:(0,zc.jsxs)("div",{className:"min-h-[500px] max-h-[500px] overflow-auto w-full bg-gray-50",children:[(0,zc.jsx)("div",{className:"p-4 bg-blue-50 border-b border-blue-200",children:(0,zc.jsxs)("p",{className:"text-sm text-blue-800",children:[(0,zc.jsx)("strong",{children:"Note:"}),' Emails may initially appear as "Sent" but can bounce back later and show as "Failed". Use the refresh button to check for updated delivery status. If an attendee\'s ticket email shows up as "Failed", try using the reissue feature on the event\'s attendees page to resend the email.']})}),(0,zc.jsx)("div",{children:j?(0,zc.jsx)("div",{children:[1,2,3,4,5,6,7,8,9,10].map(e=>(0,zc.jsx)(Rb,{className:"rounded-none border-b border-gray-200 border-l-4 border-l-gray-300",children:(0,zc.jsxs)(Mb,{className:"p-4",children:[(0,zc.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,zc.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,zc.jsx)("div",{className:"h-5 bg-muted rounded animate-pulse mb-2"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-3/4"})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,zc.jsx)("div",{className:"h-6 w-20 bg-muted rounded animate-pulse"}),(0,zc.jsx)("div",{className:"h-6 w-16 bg-muted rounded animate-pulse"})]})]}),(0,zc.jsxs)("div",{className:"text-sm text-gray-600",children:[(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-32 inline-block"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-40 inline-block ml-4"}),(0,zc.jsx)("div",{className:"h-4 bg-muted rounded animate-pulse w-36 inline-block ml-4"})]})]})},e))}):0===k.length?(0,zc.jsx)(Rb,{className:"rounded-none",children:(0,zc.jsxs)(Mb,{className:"flex flex-col items-center justify-center py-8",children:[(0,zc.jsx)($C,{className:"h-10 w-10 md:h-12 md:w-12 text-muted-foreground mb-4"}),(0,zc.jsx)("h3",{className:"text-lg font-semibold mb-2 text-center",children:"No email records found"}),(0,zc.jsx)("p",{className:"text-muted-foreground text-center mb-4 text-sm md:text-base",children:n||"all"!==s?"Try adjusting your search or filter criteria.":"Emails will appear here once emails are sent."})]})}):(0,zc.jsx)(zc.Fragment,{children:k.map(e=>(0,zc.jsx)(Rb,{className:"rounded-none border-b border-gray-200 ".concat("sent"===e.status?"border-l-4 border-l-green-500":"border-l-4 border-l-red-500"),children:(0,zc.jsxs)(Mb,{className:"p-4",children:[(0,zc.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,zc.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,zc.jsx)("h3",{className:"font-medium text-gray-900 mb-1",children:e.subject}),(0,zc.jsxs)("p",{className:"text-sm text-gray-600",children:[(0,zc.jsx)("strong",{children:"To:"})," ",e.recipient]})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,zc.jsx)(Nw,{variant:"outline",className:"text-xs px-2 py-1 rounded-md",children:e.email_type}),w(e.status)]})]}),(0,zc.jsxs)("div",{className:"text-sm text-gray-600",children:[(0,zc.jsxs)("span",{children:[(0,zc.jsx)("strong",{children:"Sent:"})," ",_(e.sent_at)]}),e.delivered_at&&(0,zc.jsxs)("span",{className:"ml-4",children:[(0,zc.jsx)("strong",{children:"Delivered:"})," ",_(e.delivered_at)]}),e.opened_at&&(0,zc.jsxs)("span",{className:"ml-4",children:[(0,zc.jsx)("strong",{children:"Opened:"})," ",_(e.opened_at)]})]}),e.bounce_details&&(0,zc.jsxs)("div",{className:"mt-2 p-2 bg-red-50 border border-red-200 rounded text-sm text-red-700",children:[(0,zc.jsx)("strong",{children:"Bounce Reason:"})," ",e.bounce_details.Details||"Unknown"]})]})},e.id))})})]})})})]})};const jI=function(){const t=l((0,e.useState)("tracker"),2),n=(t[0],t[1]);return(0,zc.jsx)(uj,{children:(0,zc.jsxs)("div",{className:"space-y-6",children:[(0,zc.jsx)("div",{className:"flex items-center justify-between",children:(0,zc.jsx)("h2",{className:"text-3xl font-bold tracking-tight",children:"Email Dashboard"})}),(0,zc.jsxs)(LC,{defaultValue:"tracker",className:"space-y-4",onValueChange:n,children:[(0,zc.jsxs)(UC,{className:"transition-none",children:[(0,zc.jsxs)(HC,{value:"tracker",className:"flex items-center gap-2 transition-none",children:[(0,zc.jsx)($C,{className:"h-4 w-4"}),"Email Tracker"]}),(0,zc.jsxs)(HC,{value:"templates",className:"flex items-center gap-2 transition-none",children:[(0,zc.jsx)(Ou,{className:"h-4 w-4"}),"Email Templates"]})]}),(0,zc.jsx)(zC,{value:"templates",className:"space-y-4",children:(0,zc.jsxs)(Rb,{children:[(0,zc.jsx)(Ob,{children:(0,zc.jsx)(Ab,{children:"Email Templates"})}),(0,zc.jsx)(Mb,{children:(0,zc.jsx)(bI,{})})]})}),(0,zc.jsx)(zC,{value:"tracker",className:"space-y-4",children:(0,zc.jsxs)(Rb,{children:[(0,zc.jsx)(Ob,{children:(0,zc.jsx)(Ab,{children:"Email Tracker"})}),(0,zc.jsx)(Mb,{children:(0,zc.jsx)(kI,{})})]})})]}),(0,zc.jsx)("div",{className:"h-8"})]})})},NI=["__scopeMenu"],SI=["forceMount"],CI=["__scopeMenu","loop","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEntryFocus","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","disableOutsideScroll"],EI=["__scopeMenu"],TI=["__scopeMenu"],II=["disabled","onSelect"],PI=["__scopeMenu","disabled","textValue"],RI=["checked","onCheckedChange"],OI=["value","onValueChange"],AI=["value"],DI=["__scopeMenu","forceMount"],MI=["__scopeMenu"],FI=["__scopeMenu"],LI=["forceMount"];var UI=["Enter"," "],HI=["ArrowUp","PageDown","End"],zI=["ArrowDown","PageUp","Home",...HI],BI={ltr:[...UI,"ArrowRight"],rtl:[...UI,"ArrowLeft"]},WI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},qI="Menu",VI=l(FS(qI),3),$I=VI[0],GI=VI[1],YI=l(Gu(qI,[VI[2],jh,eC]),2),KI=YI[0],ZI=YI[1],JI=jh(),XI=eC(),QI=l(KI(qI),2),eP=QI[0],tP=QI[1],nP=l(KI(qI),2),rP=nP[0],aP=nP[1],sP=t=>{const n=t.__scopeMenu,r=t.open,a=void 0!==r&&r,s=t.children,i=t.dir,o=t.onOpenChange,c=t.modal,u=void 0===c||c,d=JI(n),f=l(e.useState(null),2),h=f[0],p=f[1],m=e.useRef(!1),g=id(o),v=BS(i);return e.useEffect(()=>{const e=()=>{m.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>m.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,zc.jsx)(Bh,Gc(Gc({},d),{},{children:(0,zc.jsx)(eP,{scope:n,open:a,onOpenChange:g,content:h,onContentChange:p,children:(0,zc.jsx)(rP,{scope:n,onClose:e.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:m,dir:v,modal:u,children:s})})}))};sP.displayName=qI;var iP=e.forwardRef((e,t)=>
2{const n=e.__scopeMenu,r=Yc(e,NI),a=JI(n);return(0,zc.jsx)(Wh,Gc(Gc(Gc({},a),r),{},{ref:t}))});iP.displayName="MenuAnchor";var oP="MenuPortal",lP=l(KI(oP,{forceMount:void 0}),2),cP=lP[0],uP=lP[1],dP=e=>{const t=e.__scopeMenu,n=e.forceMount,r=e.children,a=e.container,s=tP(oP,t);return(0,zc.jsx)(cP,{scope:t,forceMount:n,children:(0,zc.jsx)(Yh,{present:n||s.open,children:(0,zc.jsx)(Gh,{asChild:!0,container:a,children:r})})})};dP.displayName=oP;var fP="MenuContent",hP=l(KI(fP),2),pP=hP[0],mP=hP[1],gP=e.forwardRef((e,t)=>{const n=uP(fP,e.__scopeMenu),r=e.forceMount,a=void 0===r?n.forceMount:r,s=Yc(e,SI),i=tP(fP,e.__scopeMenu),o=aP(fP,e.__scopeMenu);return(0,zc.jsx)($I.Provider,{scope:e.__scopeMenu,children:(0,zc.jsx)(Yh,{present:a||i.open,children:(0,zc.jsx)($I.Slot,{scope:e.__scopeMenu,children:o.modal?(0,zc.jsx)(vP,Gc(Gc({},s),{},{ref:t})):(0,zc.jsx)(xP,Gc(Gc({},s),{},{ref:t}))})})})}),vP=e.forwardRef((t,n)=>{const r=tP(fP,t.__scopeMenu),a=e.useRef(null),s=qu(n,a);return e.useEffect(()=>{const e=a.current;if(e)return Av(e)},[]),(0,zc.jsx)(bP,Gc(Gc({},t),{},{ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:zu(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)}))}),xP=e.forwardRef((e,t)=>{const n=tP(fP,e.__scopeMenu);return(0,zc.jsx)(bP,Gc(Gc({},e),{},{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),yP=Ju("MenuContent.ScrollLock"),bP=e.forwardRef((t,n)=>{const r=t.__scopeMenu,a=t.loop,s=void 0!==a&&a,i=t.trapFocus,o=t.onOpenAutoFocus,c=t.onCloseAutoFocus,u=t.disableOutsidePointerEvents,d=t.onEntryFocus,f=t.onEscapeKeyDown,h=t.onPointerDownOutside,p=t.onFocusOutside,m=t.onInteractOutside,g=t.onDismiss,v=t.disableOutsideScroll,x=Yc(t,CI),y=tP(fP,r),b=aP(fP,r),w=JI(r),_=XI(r),k=GI(r),j=l(e.useState(null),2),N=j[0],S=j[1],C=e.useRef(null),E=qu(n,C,y.onContentChange),T=e.useRef(0),I=e.useRef(""),P=e.useRef(0),R=e.useRef(null),O=e.useRef("right"),A=e.useRef(0),D=v?Sv:e.Fragment,M=v?{as:yP,allowPinchZoom:!0}:void 0,F=e=>{var t,n;const r=I.current+e,a=k().filter(e=>!e.disabled),s=document.activeElement,i=null===(t=a.find(e=>e.ref.current===s))||void 0===t?void 0:t.textValue,o=function(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),a=r?t[0]:t,s=n?e.indexOf(n):-1;let i=(o=e,l=Math.max(s,0),o.map((e,t)=>o[(l+t)%o.length]));var o,l;1===a.length&&(i=i.filter(e=>e!==n));const c=i.find(e=>e.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}(a.map(e=>e.textValue),r,i),l=null===(n=a.find(e=>e.textValue===o))||void 0===n?void 0:n.ref.current;!function e(t){I.current=t,window.clearTimeout(T.current),""!==t&&(T.current=window.setTimeout(()=>e(""),1e3))}(r),l&&setTimeout(()=>l.focus())};e.useEffect(()=>()=>window.clearTimeout(T.current),[]),Ag();const L=e.useCallback(e=>{var t,n;return O.current===(null===(t=R.current)||void 0===t?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const n=e.x,r=e.y;let a=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const e=t[s],o=t[i],l=e.x,c=e.y,u=o.x,d=o.y;c>r!==d>r&&n<(u-l)*(r-c)/(d-c)+l&&(a=!a)}return a}(n,t)}(e,null===(n=R.current)||void 0===n?void 0:n.area)},[]);return(0,zc.jsx)(pP,{scope:r,searchRef:I,onItemEnter:e.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:e.useCallback(e=>{var t;L(e)||(null===(t=C.current)||void 0===t||t.focus(),S(null))},[L]),onTriggerLeave:e.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:P,onPointerGraceIntentChange:e.useCallback(e=>{R.current=e},[]),children:(0,zc.jsx)(D,Gc(Gc({},M),{},{children:(0,zc.jsx)(Sg,{asChild:!0,trapped:i,onMountAutoFocus:zu(o,e=>{var t;e.preventDefault(),null===(t=C.current)||void 0===t||t.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:(0,zc.jsx)(hd,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:m,onDismiss:g,children:(0,zc.jsx)(uC,Gc(Gc({asChild:!0},_),{},{dir:b.dir,orientation:"vertical",loop:s,currentTabStopId:N,onCurrentTabStopIdChange:S,onEntryFocus:zu(d,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,zc.jsx)(qh,Gc(Gc(Gc({role:"menu","aria-orientation":"vertical","data-state":JP(y.open),"data-radix-menu-content":"",dir:b.dir},w),x),{},{ref:E,style:Gc({outline:"none"},x.style),onKeyDown:zu(x.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.ke
2y.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&F(e.key));const a=C.current;if(e.target!==a)return;if(!zI.includes(e.key))return;e.preventDefault();const s=k().filter(e=>!e.disabled).map(e=>e.ref.current);HI.includes(e.key)&&s.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(s)}),onBlur:zu(t.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),I.current="")}),onPointerMove:zu(t.onPointerMove,eR(e=>{const t=e.target,n=A.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>A.current?"right":"left";O.current=t,A.current=e.clientX}}))}))}))})})}))})});gP.displayName=fP;var wP=e.forwardRef((e,t)=>{e.__scopeMenu;const n=Yc(e,EI);return(0,zc.jsx)(ad.div,Gc(Gc({role:"group"},n),{},{ref:t}))});wP.displayName="MenuGroup";var _P=e.forwardRef((e,t)=>{e.__scopeMenu;const n=Yc(e,TI);return(0,zc.jsx)(ad.div,Gc(Gc({},n),{},{ref:t}))});_P.displayName="MenuLabel";var kP="MenuItem",jP="menu.itemSelect",NP=e.forwardRef((t,n)=>{const r=t.disabled,a=void 0!==r&&r,s=t.onSelect,i=Yc(t,II),o=e.useRef(null),l=aP(kP,t.__scopeMenu),c=mP(kP,t.__scopeMenu),u=qu(n,o),d=e.useRef(!1);return(0,zc.jsx)(SP,Gc(Gc({},i),{},{ref:u,disabled:a,onClick:zu(t.onClick,()=>{const e=o.current;if(!a&&e){const t=new CustomEvent(jP,{bubbles:!0,cancelable:!0});e.addEventListener(jP,e=>null===s||void 0===s?void 0:s(e),{once:!0}),sd(e,t),t.defaultPrevented?d.current=!1:l.onClose()}}),onPointerDown:e=>{var n;null===(n=t.onPointerDown)||void 0===n||n.call(t,e),d.current=!0},onPointerUp:zu(t.onPointerUp,e=>{var t;d.current||null===(t=e.currentTarget)||void 0===t||t.click()}),onKeyDown:zu(t.onKeyDown,e=>{const t=""!==c.searchRef.current;a||t&&" "===e.key||UI.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})}))});NP.displayName=kP;var SP=e.forwardRef((t,n)=>{const r=t.__scopeMenu,a=t.disabled,s=void 0!==a&&a,i=t.textValue,o=Yc(t,PI),c=mP(kP,r),u=XI(r),d=e.useRef(null),f=qu(n,d),h=l(e.useState(!1),2),p=h[0],m=h[1],g=l(e.useState(""),2),v=g[0],x=g[1];return e.useEffect(()=>{const e=d.current;var t;e&&x((null!==(t=e.textContent)&&void 0!==t?t:"").trim())},[o.children]),(0,zc.jsx)($I.ItemSlot,{scope:r,disabled:s,textValue:null!==i&&void 0!==i?i:v,children:(0,zc.jsx)(dC,Gc(Gc({asChild:!0},u),{},{focusable:!s,children:(0,zc.jsx)(ad.div,Gc(Gc({role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0},o),{},{ref:f,onPointerMove:zu(t.onPointerMove,eR(e=>{if(s)c.onItemLeave(e);else if(c.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:zu(t.onPointerLeave,eR(e=>c.onItemLeave(e))),onFocus:zu(t.onFocus,()=>m(!0)),onBlur:zu(t.onBlur,()=>m(!1))}))}))})}),CP=e.forwardRef((e,t)=>{const n=e.checked,r=void 0!==n&&n,a=e.onCheckedChange,s=Yc(e,RI);return(0,zc.jsx)(FP,{scope:e.__scopeMenu,checked:r,children:(0,zc.jsx)(NP,Gc(Gc({role:"menuitemcheckbox","aria-checked":XP(r)?"mixed":r},s),{},{ref:t,"data-state":QP(r),onSelect:zu(s.onSelect,()=>null===a||void 0===a?void 0:a(!!XP(r)||!r),{checkForDefaultPrevented:!1})}))})});CP.displayName="MenuCheckboxItem";var EP="MenuRadioGroup",TP=l(KI(EP,{value:void 0,onValueChange:()=>{}}),2),IP=TP[0],PP=TP[1],RP=e.forwardRef((e,t)=>{const n=e.value,r=e.onValueChange,a=Yc(e,OI),s=id(r);return(0,zc.jsx)(IP,{scope:e.__scopeMenu,value:n,onValueChange:s,children:(0,zc.jsx)(wP,Gc(Gc({},a),{},{ref:t}))})});RP.displayName=EP;var OP="MenuRadioItem",AP=e.forwardRef((e,t)=>{const n=e.value,r=Yc(e,AI),a=PP(OP,e.__scopeMenu),s=n===a.value;return(0,zc.jsx)(FP,{scope:e.__scopeMenu,checked:s,children:(0,zc.jsx)(NP,Gc(Gc({role:"menuitemradio","aria-checked":s},r),{},{ref:t,"data-state":QP(s),onSelect:zu(r.onSelect,()=>{var e;return null===(e=a.onValueChange)||void 0===e?void 0:e.call(a,n)},{checkForDefaultPrevented:!1})}))})});AP.displayName=OP;var DP="MenuItemIndicator",MP=l(KI(DP,{checked:!1}),2),FP=MP[0],LP=MP[1],UP=e.forwardRef((e,t)=>{const n=e.__scopeMenu,r=e.forceMount,a=Yc(e,DI),s=LP(DP,n);return(0,zc.jsx)(Yh,{present:r||XP(s.checked)||!0===s.checked,children:(0,zc.jsx)(ad.span,Gc(Gc({},a),{},{ref:t,"data-state":QP(s.checked)}))})});UP.displayName=DP;var HP=e.forwardRef((e,t)=>
2{e.__scopeMenu;const n=Yc(e,MI);return(0,zc.jsx)(ad.div,Gc(Gc({role:"separator","aria-orientation":"horizontal"},n),{},{ref:t}))});HP.displayName="MenuSeparator";var zP=e.forwardRef((e,t)=>{const n=e.__scopeMenu,r=Yc(e,FI),a=JI(n);return(0,zc.jsx)(Vh,Gc(Gc(Gc({},a),r),{},{ref:t}))});zP.displayName="MenuArrow";var BP="MenuSub",WP=l(KI(BP),2),qP=WP[0],VP=WP[1],$P=t=>{const n=t.__scopeMenu,r=t.children,a=t.open,s=void 0!==a&&a,i=t.onOpenChange,o=tP(BP,n),c=JI(n),u=l(e.useState(null),2),d=u[0],f=u[1],h=l(e.useState(null),2),p=h[0],m=h[1],g=id(i);return e.useEffect(()=>(!1===o.open&&g(!1),()=>g(!1)),[o.open,g]),(0,zc.jsx)(Bh,Gc(Gc({},c),{},{children:(0,zc.jsx)(eP,{scope:n,open:s,onOpenChange:g,content:p,onContentChange:m,children:(0,zc.jsx)(qP,{scope:n,contentId:bd(),triggerId:bd(),trigger:d,onTriggerChange:f,children:r})})}))};$P.displayName=BP;var GP="MenuSubTrigger",YP=e.forwardRef((t,n)=>{const r=tP(GP,t.__scopeMenu),a=aP(GP,t.__scopeMenu),s=VP(GP,t.__scopeMenu),i=mP(GP,t.__scopeMenu),o=e.useRef(null),l=i.pointerGraceTimerRef,c=i.onPointerGraceIntentChange,u={__scopeMenu:t.__scopeMenu},d=e.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return e.useEffect(()=>d,[d]),e.useEffect(()=>{const e=l.current;return()=>{window.clearTimeout(e),c(null)}},[l,c]),(0,zc.jsx)(iP,Gc(Gc({asChild:!0},u),{},{children:(0,zc.jsx)(SP,Gc(Gc({id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":JP(r.open)},t),{},{ref:Wu(n,s.onTriggerChange),onClick:e=>{var n;null===(n=t.onClick)||void 0===n||n.call(t,e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:zu(t.onPointerMove,eR(e=>{i.onItemEnter(e),e.defaultPrevented||t.disabled||r.open||o.current||(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:zu(t.onPointerLeave,eR(e=>{var t;d();const n=null===(t=r.content)||void 0===t?void 0:t.getBoundingClientRect();if(n){var a;const t=null===(a=r.content)||void 0===a?void 0:a.dataset.side,s="right"===t,o=s?-5:5,c=n[s?"left":"right"],u=n[s?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:n.top},{x:u,y:n.top},{x:u,y:n.bottom},{x:c,y:n.bottom}],side:t}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:zu(t.onKeyDown,e=>{const n=""!==i.searchRef.current;var s;t.disabled||n&&" "===e.key||BI[a.dir].includes(e.key)&&(r.onOpenChange(!0),null===(s=r.content)||void 0===s||s.focus(),e.preventDefault())})}))}))});YP.displayName=GP;var KP="MenuSubContent",ZP=e.forwardRef((t,n)=>{const r=uP(fP,t.__scopeMenu),a=t.forceMount,s=void 0===a?r.forceMount:a,i=Yc(t,LI),o=tP(fP,t.__scopeMenu),l=aP(fP,t.__scopeMenu),c=VP(KP,t.__scopeMenu),u=e.useRef(null),d=qu(n,u);return(0,zc.jsx)($I.Provider,{scope:t.__scopeMenu,children:(0,zc.jsx)(Yh,{present:s||o.open,children:(0,zc.jsx)($I.Slot,{scope:t.__scopeMenu,children:(0,zc.jsx)(bP,Gc(Gc({id:c.contentId,"aria-labelledby":c.triggerId},i),{},{ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;l.isUsingKeyboardRef.current&&(null===(t=u.current)||void 0===t||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:zu(t.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:zu(t.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:zu(t.onKeyDown,e=>{const t=e.currentTarget.contains(e.target),n=WI[l.dir].includes(e.key);var r;t&&n&&(o.onOpenChange(!1),null===(r=c.trigger)||void 0===r||r.focus(),e.preventDefault())})}))})})})});function JP(e){return e?"open":"closed"}function XP(e){return"indeterminate"===e}function QP(e){return XP(e)?"indeterminate":e?"checked":"unchecked"}function eR(e){return t=>"mouse"===t.pointerType?e(t):void 0}ZP.displayName=KP;var tR=sP,nR=iP,rR=dP,aR=gP,sR=wP,iR=_P,oR=NP,lR=CP,cR=RP,uR=AP,dR=UP,fR=HP,hR=zP,pR=YP,mR=ZP;const gR=["__scopeDropdownMenu","disabled"],vR=["__scopeDropdownMenu"],xR=["__scopeDropdownMenu"],yR=["__scopeDropdownMenu"],bR=["__scopeDropdownMenu"],wR=["__scopeDropdownMenu"],_R=["__scopeDropdownMenu"],kR=["__scopeDropdownMenu"],jR=["__scopeDropdownMenu"],NR=["__scopeDropdownMenu"],SR=["__scopeDropdownMenu"],CR=["__scopeDropdownMenu"],ER=["__scopeDropdownMenu"],TR=["__scopeDropdownMenu"];var IR="DropdownMenu",PR=l(Gu(IR,[ZI]),2),RR=PR[0],OR=(PR[1],ZI()),AR=l(RR(IR),2),DR=AR[0],MR=AR[1],FR=t=>{const n=t.__scopeDropdownMenu,r=t.children,a=t.dir,s=t.open,i=t.defaultOpen,o=t.onOpenChange,c=t.modal,u=void 0===c||c,d=OR(n),f=e.useRef(null),h=l(Jh({prop:s,defaultProp:null!==i&&void 0!==i&&i,onChange:o,caller:IR}),2),p=h[0],m=h[1];return(0,zc.jsx)(DR,{scope:n,triggerId:bd(),triggerRef:f,contentId:bd(),open:p,onOpenChange:m,onOpenToggle:e.useCallback(()=>m(e=>!e),[m]),modal:u,children:(0,zc.jsx)(tR,Gc(Gc({},d),{},{open:p,onOpenChange:m,dir:a,modal:u,children:r}))})};FR.displayName=IR;var LR="DropdownMenuTrigger",UR=e.forwardRef((e,t)=>
2{const n=e.__scopeDropdownMenu,r=e.disabled,a=void 0!==r&&r,s=Yc(e,gR),i=MR(LR,n),o=OR(n);return(0,zc.jsx)(nR,Gc(Gc({asChild:!0},o),{},{children:(0,zc.jsx)(ad.button,Gc(Gc({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":a?"":void 0,disabled:a},s),{},{ref:Wu(t,i.triggerRef),onPointerDown:zu(e.onPointerDown,e=>{a||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:zu(e.onKeyDown,e=>{a||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})}))}))});UR.displayName=LR;var HR=e=>{const t=e.__scopeDropdownMenu,n=Yc(e,vR),r=OR(t);return(0,zc.jsx)(rR,Gc(Gc({},r),n))};HR.displayName="DropdownMenuPortal";var zR="DropdownMenuContent",BR=e.forwardRef((t,n)=>{const r=t.__scopeDropdownMenu,a=Yc(t,xR),s=MR(zR,r),i=OR(r),o=e.useRef(!1);return(0,zc.jsx)(aR,Gc(Gc(Gc({id:s.contentId,"aria-labelledby":s.triggerId},i),a),{},{ref:n,onCloseAutoFocus:zu(t.onCloseAutoFocus,e=>{var t;o.current||null===(t=s.triggerRef.current)||void 0===t||t.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:zu(t.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;s.modal&&!r||(o.current=!0)}),style:Gc(Gc({},t.style),{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"})}))});BR.displayName=zR;var WR=e.forwardRef((e,t)=>{const n=e.__scopeDropdownMenu,r=Yc(e,yR),a=OR(n);return(0,zc.jsx)(sR,Gc(Gc(Gc({},a),r),{},{ref:t}))});WR.displayName="DropdownMenuGroup";var qR=e.forwardRef((e,t)=>{const n=e.__scopeDropdownMenu,r=Yc(e,bR),a=OR(n);return(0,zc.jsx)(iR,Gc(Gc(Gc({},a),r),{},{ref:t}))});qR.displayName="DropdownMenuLabel";var VR=e.forwardRef((e,t)=>{const n=e.__scopeDropdownMenu,r=Yc(e,wR),a=OR(n);return(0,zc.jsx)(oR,Gc(Gc(Gc({},a),r),{},{ref:t}))});VR.displayName="DropdownMenuItem";var $R=e.forwardRef((e,t)=>{const n=e.__scopeDropdownMenu,r=Yc(e,_R),a=OR(n);return(0,zc.jsx)(lR,Gc(Gc(Gc({},a),r),{},{ref:t}))});$R.displayName="DropdownMenuCheckboxItem";var GR=e.forwardRef((e,t)=>{const n=e.__scopeDropdownMenu,r=Yc(e,kR),a=OR(n);return(0,zc.jsx)(cR,Gc(Gc(Gc({},a),r),{},{ref:t}))});GR.displayName="DropdownMenuRadioGroup";var YR=e.forwardRef((e,t)=>{const n=e.__scopeDropdownMenu,r=Yc(e,jR),a=OR(n);return(0,zc.jsx)(uR,Gc(Gc(Gc({},a),r),{},{ref:t}))});YR.displayName="DropdownMenuRadioItem";var KR=e.forwardRef((e,t)=>{const n=e.__scopeDropdownMenu,r=Yc(e,NR),a=OR(n);return(0,zc.jsx)(dR,Gc(Gc(Gc({},a),r),{},{ref:t}))});KR.displayName="DropdownMenuItemIndicator";var ZR=e.forwardRef((e,t)=>{const n=e.__scopeDropdownMenu,r=Yc(e,SR),a=OR(n);return(0,zc.jsx)(fR,Gc(Gc(Gc({},a),r),{},{ref:t}))});ZR.displayName="DropdownMenuSeparator";var JR=e.forwardRef((e,t)=>{const n=e.__scopeDropdownMenu,r=Yc(e,CR),a=OR(n);return(0,zc.jsx)(hR,Gc(Gc(Gc({},a),r),{},{ref:t}))});JR.displayName="DropdownMenuArrow";var XR=e.forwardRef((e,t)=>{const n=e.__scopeDropdownMenu,r=Yc(e,ER),a=OR(n);return(0,zc.jsx)(pR,Gc(Gc(Gc({},a),r),{},{ref:t}))});XR.displayName="DropdownMenuSubTrigger";var QR=e.forwardRef((e,t)=>{const n=e.__scopeDropdownMenu,r=Yc(e,TR),a=OR(n);return(0,zc.jsx)(mR,Gc(Gc(Gc({},a),r),{},{ref:t,style:Gc(Gc({},e.style),{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"})}))});QR.displayName="DropdownMenuSubContent";var eO=HR,tO=BR,nO=qR,rO=VR,aO=$R,sO=YR,iO=KR,oO=ZR,lO=XR,cO=QR;const uO=["className","inset","children"],dO=["className"],fO=["className","sideOffset"],hO=["className","inset"],pO=["className","children","checked"],mO=["className","children"],gO=["className","inset"],vO=["className"],xO=FR,yO=UR;e.forwardRef((e,t)=>
2{let n=e.className,r=e.inset,a=e.children,s=Yc(e,uO);return(0,zc.jsxs)(lO,Gc(Gc({ref:t,className:Zm("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",n)},s),{},{children:[a,(0,zc.jsx)(fj,{className:"ml-auto"})]}))}).displayName=lO.displayName;e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,dO);return(0,zc.jsx)(cO,Gc({ref:t,className:Zm("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",n)},r))}).displayName=cO.displayName;const bO=e.forwardRef((e,t)=>{let n=e.className,r=e.sideOffset,a=void 0===r?4:r,s=Yc(e,fO);return(0,zc.jsx)(eO,{children:(0,zc.jsx)(tO,Gc({ref:t,sideOffset:a,className:Zm("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 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 origin-[--radix-dropdown-menu-content-transform-origin]",n)},s))})});bO.displayName=tO.displayName;const wO=e.forwardRef((e,t)=>{let n=e.className,r=e.inset,a=Yc(e,hO);return(0,zc.jsx)(rO,Gc({ref:t,className:Zm("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",r&&"pl-8",n)},a))});wO.displayName=rO.displayName;e.forwardRef((e,t)=>{let n=e.className,r=e.children,a=e.checked,s=Yc(e,pO);return(0,zc.jsxs)(aO,Gc(Gc({ref:t,className:Zm("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),checked:a},s),{},{children:[(0,zc.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,zc.jsx)(iO,{children:(0,zc.jsx)(bw,{className:"h-4 w-4"})})}),r]}))}).displayName=aO.displayName;e.forwardRef((e,t)=>{let n=e.className,r=e.children,a=Yc(e,mO);return(0,zc.jsxs)(sO,Gc(Gc({ref:t,className:Zm("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n)},a),{},{children:[(0,zc.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,zc.jsx)(iO,{children:(0,zc.jsx)(Yw,{className:"h-2 w-2 fill-current"})})}),r]}))}).displayName=sO.displayName;e.forwardRef((e,t)=>{let n=e.className,r=e.inset,a=Yc(e,gO);return(0,zc.jsx)(nO,Gc({ref:t,className:Zm("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",n)},a))}).displayName=nO.displayName;e.forwardRef((e,t)=>{let n=e.className,r=Yc(e,vO);return(0,zc.jsx)(oO,Gc({ref:t,className:Zm("-mx-1 my-1 h-px bg-muted",n)},r))}).displayName=oO.displayName;const _O={async createEvent(e){const t=e.ticket_tiers.reduce((e,t)=>e+parseInt(t.tickets_available.toString()),0),n=Gc(Gc({},e),{},{stripe_enabled:e.stripe_enabled?1:0,e_transfer_enabled:e.e_transfer_enabled?1:0,bursary_enabled:e.bursary_enabled?1:0,date:e.date,tickets_available:t,time_start:e.time_start,time_end:e.time_end,event_organizers:[],bursary_options:e.bursary_enabled&&"fixed"===e.bursary_type?e.bursary_options:[]}),r=await fetch("".concat("https://api.trievents.ca","/events/"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)});if(!r.ok){const e=await r.text();try{const t=JSON.parse(e);throw new Error(t.message||"Failed to create event")}catch(a){throw new Error(e)}}return r.json()}},kO=()=>{const t=sl(),n=rg().getTenantPath,r=r_(),a=r.validatePhone,s=r.filterPhoneInput,i=l((0,e.useState)({title:"",description:"",image:"",date:"",location:"",time_start:"",time_end:"",stripe_enabled:!1,e_transfer_enabled:!1,contact_email:"",contact_number:"",ticket_tiers:[{name:"",price:NaN,description:"",tickets_available:NaN}],bursary_enabled:!1,bursary_type:"custom",bursary_options:[{amount:NaN,description:""}],waivers_enabled:!1,waiver_items:[]}),2),o=i[0],c=i[1],u=l((0,e.useState)({}),2),d=u[0],f=u[1],h=l((0,e.useState)(!1),2),p=h[0],m=h[1],g=l((0,e.useState)(""),2),v=g[0],x=g[1];return{formData:o,errors:d,loading:p,successMessage:v,handleChange:e=>{const t=e.target,n=t.name,r=t.value,a=t.type,i=e.target.checked,o="contact_number"===n?s(r):r;c(e=>Gc(Gc({},e),{},{[n]:"checkbox"===a?i:o})),f(e=>{const t=Gc({},e);return delete t[n],t})},handleSubmit:async()=>
2{if(!(()=>{let e={};o.title.trim()||(e.title="Title is required"),o.description&&o.description.length>5e3&&(e.description="Description cannot exceed 5,000 characters"),o.date||(e.date="Date is required"),o.location||(e.location="Location is required"),o.time_start||(e.time_start="Start time is required"),o.time_end||(e.time_end="End time is required"),o.contact_email||(e.contact_email="Contact email is required"),o.contact_number||(e.contact_number="Contact number is required");const t=(new Date).toISOString().split("T")[0];if(o.date<t&&(e.date="Event date must be in the future"),o.time_start&&o.time_end&&o.time_end<=o.time_start&&(e.time_end="End time must be after start time"),o.contact_email&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o.contact_email)&&(e.contact_email="Please enter a valid email address"),o.contact_number){const t=a(o.contact_number);t&&(e.contact_number=t)}return o.ticket_tiers&&0!==o.ticket_tiers.length?o.ticket_tiers.forEach((t,n)=>{t.name||(e["tier_".concat(n,"_name")]="Tier name is required"),t.description||(e["tier_".concat(n,"_description")]="Description is required"),isNaN(t.price)?e["tier_".concat(n,"_price")]="Price is required":t.price<0?e["tier_".concat(n,"_price")]="Price cannot be negative":t.price>0&&t.price<2&&(e["tier_".concat(n,"_price")]="Non-free tickets must be at least $2"),isNaN(t.tickets_available)?e["tier_".concat(n,"_tickets")]="Tickets available is required":t.tickets_available<=0&&(e["tier_".concat(n,"_tickets")]="Tickets available must be greater than 0")}):e.ticket_tiers="At least one ticket tier is required",o.bursary_enabled&&("fixed"!==o.bursary_type||o.bursary_options&&0!==o.bursary_options.length?"fixed"===o.bursary_type&&o.bursary_options.forEach((t,n)=>{isNaN(t.amount)?e["bursary_".concat(n,"_amount")]="Amount is required":t.amount<=0&&(e["bursary_".concat(n,"_amount")]="Amount must be greater than 0"),t.description||(e["bursary_".concat(n,"_description")]="Description is required")}):e.bursary_options="At least one bursary option is required"),!o.waivers_enabled||o.waiver_items&&0!==o.waiver_items.length?o.waivers_enabled&&o.waiver_items&&o.waiver_items.forEach((t,n)=>{if(t.message&&""!==t.message.trim()||(e["waiver_".concat(n,"_message")]="Todo message is required"),"link"===t.type)if(t.link&&""!==t.link.trim())try{const r=new URL(t.link);"http:"!==r.protocol&&"https:"!==r.protocol&&(e["waiver_".concat(n,"_link")]="Link must be a valid HTTP or HTTPS URL")}catch(r){e["waiver_".concat(n,"_link")]="Please enter a valid URL (e.g., https://example.com)"}else e["waiver_".concat(n,"_link")]="Todo link is required"}):e.waiver_items="At least one todo item is required when todo is enabled",f(e),0===Object.keys(e).length})())return!1;m(!0);try{return await _O.createEvent(o),x("Event created successfully!"),t(n("/dashboard")),!0}catch(e){return f(e=>Gc(Gc({},e),{},{apiError:"Failed to create event. Please check your information and try again."})),!1}finally{m(!1)}},addTicketTier:()=>{c(e=>Gc(Gc({},e),{},{ticket_tiers:[...e.ticket_tiers,{name:"",price:NaN,description:"",tickets_available:NaN}]})),f({})},removeTicketTier:e=>{c(t=>Gc(Gc({},t),{},{ticket_tiers:t.ticket_tiers.filter((t,n)=>n!==e)})),f({})},handleTicketTierChange:(e,t,n)=>{c(r=>Gc(Gc({},r),{},{ticket_tiers:r.ticket_tiers.map((r,a)=>a===e?Gc(Gc({},r),{},{[t]:("price"===t||"tickets_available"===t)&&"string"===typeof n?""===n?NaN:parseFloat(n):n}):r)})),f({})},addBursaryOption:()=>{c(e=>Gc(Gc({},e),{},{bursary_options:[...e.bursary_options,{amount:NaN,description:""}]})),f({})},removeBursaryOption:e=>{c(t=>Gc(Gc({},t),{}
2,{bursary_options:t.bursary_options.filter((t,n)=>n!==e)})),f({})},handleBursaryOptionChange:(e,t,n)=>{c(r=>Gc(Gc({},r),{},{bursary_options:r.bursary_options.map((r,a)=>a===e?Gc(Gc({},r),{},{[t]:"amount"===t&&"string"===typeof n?""===n?NaN:parseFloat(n):n}):r)})),f(n=>{const r=Gc({},n);return delete r["bursary_".concat(e,"_").concat(t)],r})},addWaiverItem:e=>{c(t=>Gc(Gc({},t),{},{waiver_items:[...t.waiver_items,{type:e,message:"",uuid:crypto.randomUUID()}]})),f(e=>{const t=Gc({},e);return delete t.waiver_items,t})},removeWaiverItem:e=>{c(t=>Gc(Gc({},t),{},{waiver_items:t.waiver_items.filter((t,n)=>n!==e)})),f(t=>{const n=Gc({},t);return delete n.waiver_items,Object.keys(n).forEach(t=>{t.startsWith("waiver_".concat(e,"_"))&&delete n[t]}),n})},handleWaiverItemChange:(e,t,n)=>{c(r=>Gc(Gc({},r),{},{waiver_items:r.waiver_items.map((r,a)=>a===e?Gc(Gc({},r),{},{[t]:n}):r)})),f(n=>{const r=Gc({},n);return delete r["waiver_".concat(e,"_").concat(t)],r})}}},jO=e=>{let t=e.to,n=e.text,r=void 0===n?"Back":n;return(0,zc.jsx)(fg,{variant:"outline",className:"mb-6 transform hover:scale-105 transition-all duration-200",asChild:!0,children:(0,zc.jsxs)(Ol,{to:t,children:[(0,zc.jsx)(y_,{className:"h-4 w-4 mr-2"}),r]})})};const NO=function(){const e=rg().getTenantPath,t=kO(),n=t.formData,r=t.errors,a=t.loading,s=t.successMessage,i=t.handleChange,o=t.handleSubmit,l=t.addTicketTier,c=t.removeTicketTier,u=t.handleTicketTierChange,d=t.addBursaryOption,f=t.removeBursaryOption,h=t.handleBursaryOptionChange,p=t.handleWaiverItemChange,m=t.addWaiverItem,g=t.removeWaiverItem;return a?(0,zc.jsx)(Bc,{isLoading:!0,children:(0,zc.jsx)("div",{})}):(0,zc.jsx)("section",{className:"bg-background",children:(0,zc.jsxs)("div",{className:"container mx-auto pb-12",children:[(0,zc.jsx)("div",{className:"mb-0 md:mb-6",children:(0,zc.jsx)(jO,{to:e("/dashboard"),text:"Back to Dashboard"})}),(0,zc.jsx)(Rb,{className:"border-none bg-[#23d6e4] text-white",children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsx)("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:(0,zc.jsxs)("div",{children:[(0,zc.jsx)(Ab,{className:"text-3xl font-bold mb-2 text-white",children:"Create Event"}),(0,zc.jsx)(Db,{className:"text-white/80",children:"Set up a new event for your organization"})]})})})}),(0,zc.jsx)(Rb,{className:"mt-6",children:(0,zc.jsxs)(Mb,{className:"p-6",children:[s&&(0,zc.jsx)(Iw,{className:"mb-6",children:(0,zc.jsx)(Rw,{children:s})}),r.apiError&&(0,zc.jsx)(Iw,{variant:"destructive",className:"mb-6",children:(0,zc.jsx)(Rw,{children:r.apiError})}),(0,zc.jsx)("form",{onSubmit:e=>{e.preventDefault(),o()},className:"space-y-6",children:(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,zc.jsx)(pg,{type:"text",name:"title",value:n.title,onChange:i,placeholder:"Event Title",className:"h-12 text-lg border-2 focus:border-black"}),r.title&&(0,zc.jsx)("p",{className:"text-destructive text-sm mt-1",children:r.title})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,zc.jsx)("textarea",{name:"description",value:n.description,onChange:i,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 text-sm focus:border-black",rows:4,maxLength:5e3}),(0,zc.jsxs)("div",{className:"flex justify-between items-center mt-1",children:[r.description&&(0,zc.jsx)("p",{className:"text-destructive text-sm",children:r.description}),(0,zc.jsxs)("p",{className:"text-muted-foreground text-sm ml-auto",children:[5e3-n.description.length," characters remaining"]})]})]}),(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Date"}),(0,zc.jsx)("input",{type:"date",name:"date",value:n.date,onChange:i,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12 [-webkit-appearance:none] [appearance:none]"}),r.date&&(0,zc.jsx)("p",{className:"text-destructive text-sm mt-1",children:r.date})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Location"}),(0,zc.jsx)(pg,{type:"text",name:"location",value:n.location,onChange:i,placeholder:"Event Location",className:"h-12 text-lg border-2 focus:border-black"}),r.location&&(0,zc.jsx)("p",{className:"text-destructive text-sm mt-1",children:r.location})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Start Time"}),(0,zc.jsx)("input",{type:"time",name:"time_start",value:n.time_start,onCh
2ange:i,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12 [-webkit-appearance:none] [appearance:none]"}),r.time_start&&(0,zc.jsx)("p",{className:"text-destructive text-sm mt-1",children:r.time_start})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"End Time"}),(0,zc.jsx)("input",{type:"time",name:"time_end",value:n.time_end,onChange:i,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12 [-webkit-appearance:none] [appearance:none]"}),r.time_end&&(0,zc.jsx)("p",{className:"text-destructive text-sm mt-1",children:r.time_end})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Contact Email"}),(0,zc.jsx)(pg,{type:"email",name:"contact_email",value:n.contact_email,onChange:i,placeholder:"Contact Email",className:"h-12 text-lg border-2 focus:border-black"}),r.contact_email&&(0,zc.jsx)("p",{className:"text-destructive text-sm mt-1",children:r.contact_email})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Contact Number"}),(0,zc.jsx)(pg,{type:"tel",name:"contact_number",value:n.contact_number,onChange:i,placeholder:"Contact Number",className:"h-12 text-lg border-2 focus:border-black"}),r.contact_number&&(0,zc.jsx)("p",{className:"text-destructive text-sm mt-1",children:r.contact_number})]})]}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center",children:[(0,zc.jsx)("h3",{className:"text-xl font-semibold",children:"Ticket Tiers"}),(0,zc.jsx)(fg,{onClick:e=>{e.preventDefault(),l()},variant:"outline",className:"bg-black text-white hover:bg-black/90 hover:text-white transition-transform duration-200 hover:scale-105",children:"Add Tier"})]}),r.ticket_tiers&&(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:r.ticket_tiers})}),n.ticket_tiers.map((e,t)=>(0,zc.jsx)(Rb,{className:"bg-muted/50 hover:shadow-md transition-shadow",children:(0,zc.jsxs)(Mb,{className:"p-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,zc.jsxs)("h4",{className:"text-lg font-semibold",children:["Tier ",t+1]}),n.ticket_tiers.length>1&&(0,zc.jsx)(fg,{variant:"ghost",size:"sm",onClick:()=>c(t),className:"text-destructive hover:text-destructive/90",children:(0,zc.jsx)(YC,{className:"h-4 w-4"})})]}),(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Tier Name"}),(0,zc.jsx)(pg,{type:"text",value:e.name,onChange:e=>u(t,"name",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12"}),r["tier_".concat(t,"_name")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:r["tier_".concat(t,"_name")]})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Price (CAD)"}),(0,zc.jsx)(pg,{type:"number",value:isNaN(e.price)?"":e.price,onChange:e=>u(t,"price",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",min:"0",step:"0.01"}),r["tier_".concat(t,"_price")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:r["tier_".concat(t,"_price")]})]}),(0,zc.jsxs)("div",{className:"md:col-span-2",children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,zc.jsx)("textarea",{value:e.description,onChange:e=>u(t,"description",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 text-sm focus:border-black",rows:2}),r["tier_".concat(t,"_description")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:r["tier_".concat(t,"_description")]})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Total Tickets Available"}),(0,zc.jsx)(pg,{type:"number",value:isNaN(e.tickets_available)?"":e.tickets_available,onChange:e=>u(t,"tickets_available",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",min:"0"}),r["tier_".concat(t,"_tickets")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:r["tier_".concat(t,"_tickets")]})]})]})]})},t))]}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)(fE,{id:"bursary-enabled",checked:n.bursary_enabled,onCheckedChange:e=>i({target:{name:"bursary_enabled",type:"checkbox",checked:e}})}),(0,zc.jsx)("label",{htmlFor:"bursary-enabled",className:"text-sm font-medium text-foreground",children:"Enable Bursary Requests"})]}),n.bursary_enabled&&(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Bursary Type"}),(0,zc.jsxs)("select",{name:"bursary_type",value:n.bursary_type,onCh
2ange:i,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",children:[(0,zc.jsx)("option",{value:"custom",children:"Let users choose their amount"}),(0,zc.jsx)("option",{value:"fixed",children:"Provide fixed bursary options"})]})]}),"fixed"===n.bursary_type&&(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center",children:[(0,zc.jsx)("h3",{className:"text-xl font-semibold",children:"Bursary Options"}),(0,zc.jsx)(fg,{onClick:e=>{e.preventDefault(),d()},variant:"outline",className:"bg-black text-white hover:bg-black/90 hover:text-white transition-transform duration-200 hover:scale-105",children:"Add Option"})]}),r.bursary_options&&(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:r.bursary_options})}),n.bursary_options.map((e,t)=>(0,zc.jsx)(Rb,{className:"bg-muted/50 hover:shadow-md transition-shadow",children:(0,zc.jsxs)(Mb,{className:"p-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,zc.jsxs)("h4",{className:"text-lg font-semibold",children:["Option ",t+1]}),n.bursary_options.length>1&&(0,zc.jsx)(fg,{variant:"ghost",size:"sm",onClick:()=>f(t),className:"text-destructive hover:text-destructive/90",children:(0,zc.jsx)(YC,{className:"h-4 w-4"})})]}),(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Amount (CAD)"}),(0,zc.jsx)("input",{type:"number",value:isNaN(e.amount)?"":e.amount,onChange:e=>h(t,"amount",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",placeholder:"0.00",min:"0",step:"0.01"}),r["bursary_".concat(t,"_amount")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:r["bursary_".concat(t,"_amount")]})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,zc.jsx)("input",{type:"text",value:e.description,onChange:e=>h(t,"description",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",placeholder:""}),r["bursary_".concat(t,"_description")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:r["bursary_".concat(t,"_description")]})]})]})]})},t))]})]})]}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)(fE,{id:"waivers-enabled",checked:n.waivers_enabled,onCheckedChange:e=>i({target:{name:"waivers_enabled",type:"checkbox",checked:e}})}),(0,zc.jsx)("label",{htmlFor:"waivers-enabled",className:"text-sm font-medium text-foreground",children:"Enable Todo/Checklist"}),(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("div",{className:"rounded-full bg-gray-200 hover:bg-gray-300 text-gray-600 hover:text-gray-800 w-5 h-5 flex items-center justify-center cursor-help text-xs font-medium transition-colors duration-200 border border-gray-300",children:"?"})}),(0,zc.jsx)(tg,{children:(0,zc.jsx)("p",{children:"Add items that must be completed to attend the event i.e. todo items, acknowledgements, waivers, etc."})})]})]}),n.waivers_enabled&&(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center",children:[(0,zc.jsx)("h3",{className:"text-xl font-semibold",children:"Todo Options"}),(0,zc.jsxs)(xO,{children:[(0,zc.jsx)(yO,{asChild:!0,children:(0,zc.jsx)(fg,{variant:"outline",className:"bg-black text-white hover:bg-black/90 hover:text-white transition-transform duration-200 hover:scale-105",children:"Add Item"})}),(0,zc.jsxs)(bO,{children:[(0,zc.jsx)(wO,{onClick:()=>m("link"),children:"Link"}),(0,zc.jsx)(wO,{onClick:()=>m("checkbox"),children:"Checkbox"})]})]})]}),r.waiver_items&&(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:r.waiver_items})}),n.waiver_items.map((e,t)=>(0,zc.jsx)(Rb,{className:"bg-muted/50 hover:shadow-md transition-shadow",children:(0,zc.jsxs)(Mb,{className:"p-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,zc.jsx)("h4",{className:"text-lg font-semibold",children:"checkbox"===e.type?"Checkbox":"Link"}),(0,zc.jsx)(fg,{variant:"ghost",size:"sm",onClick:()=>g(t),className:"text-destructive hover:text-destructive/90",children:(0,zc.jsx)(YC,{className:"h-4 w-4"})})]}),"checkbox"===e.type&&(0,zc.jsx)("div",{className:"grid grid-cols-1 gap-4",children:(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Message"}),(0,zc.jsx)(pg,{type:"text",value:e.message,onChange:e=>p(t,"message",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",placeholder:"Enter a message to display with the item"}),r["waiver_".concat(t,"_message")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:r["waiver_".concat(t,"_message")]})]})}),"link"===e.type&&(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Message"}),(0,zc.jsx)(pg,{type:"text",value:e.message,onChange:e=>p(t,"message",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",placeholder:"Enter a message to display with the item"}),r["waiver_".concat(t,"_message")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:r["waiver_".concat(t,"_message")]})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Link"}),(0,zc.jsx)(pg,{type:"url",value:e.link,onChange:e=>p(t,"link",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",placeholder:"https://example.com",pattern:"https?://.+",title:"Please enter a valid URL starting with http:// or https://"}),r["waiver_".concat(t,"_link")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:r["waiver_".concat(t,"_link")]})]})]})]})},e.uuid))]})]}),(0,zc.jsx)("div",{className:"flex justify-end gap-4",children:(0,zc.jsx)(fg,{type:"submit",className:"w-full md:w-[200px] bg-black text-white hover:bg-black/90 hover:text-white transition-transform duration-200 hover:scale-105",disabled:a,children:a?"Creating...":"Create Event"})})]})})]})})]})})};function SO(e){if(!e)return"Invalid date";const t=l(e.split("T")[0].split("-").map(Number),3),n=t[0],r=t[1],a=t[2];return"".concat(["January","February","March","April","May","June","July","August","September","October","November","December"][r-1]," ").concat(a,", ").concat(n)}const CO=function(){const t=il().date,n=rg().getTenantPath,r=((t,n)=>{const r=l((0,e.useState)([]),2),a=r[0],s=r[1],i=l((0,e.useState)(!0),2),o=i[0],c=i[1],u=l((0,e.useState)(null),2),d=u[0],f=u[1],h=l((0,e.useState)({}),2),p=h[0],m=h[1];return(0,e.useEffect)(()=>
2{if(!t||!n)return f("No date or organization provided"),void c(!1);(async()=>{try{const e=(await fS(n)).filter(e=>e.date.split("T")[0]===t).sort((e,t)=>{const n=e.time_start.split(":").map(Number),r=t.time_start.split(":").map(Number);return n[0]!==r[0]?n[0]-r[0]:n[1]-r[1]});s(e);const r=e.map(async e=>{try{const t=await Qw(e.uuid),n=(await Jw(t)).reduce((e,t)=>e+(t.tickets_available||0),0);return{[e.uuid]:n}}catch(d){return console.error("Error fetching event details:",d),{[e.uuid]:0}}}),a=(await Promise.all(r)).reduce((e,t)=>Gc(Gc({},e),t),{});m(a),setTimeout(()=>c(!1),1e3)}catch(XF){f(XF instanceof Error?XF.message:"An error occurred"),c(!1)}})()},[t,n]),{events:a,loading:o,error:d,eventTicketsAvailable:p}})(t,localStorage.getItem("tenantId")),a=r.events,s=r.loading,i=r.error,o=r.eventTicketsAvailable;return s?(0,zc.jsx)(Wb,{loading:!0}):i?(0,zc.jsx)("section",{className:"min-h-screen bg-background",children:(0,zc.jsx)("div",{className:"container mx-auto",children:(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:i})})})}):(0,zc.jsx)("section",{className:"bg-background",children:(0,zc.jsx)("div",{className:"container mx-auto pb-12",children:(0,zc.jsxs)("div",{children:[(0,zc.jsx)("div",{className:"mb-0 md:mb-6",children:(0,zc.jsx)(jO,{to:n("/dashboard"),text:"Back to Dashboard"})}),(0,zc.jsx)(Rb,{className:"border-none bg-[#23d6e4] text-white",children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsxs)(Ab,{className:"text-3xl font-bold mb-2 text-white",children:["Events on ",SO(t)]}),(0,zc.jsx)("p",{className:"text-white/80",children:"Browse and manage events scheduled for this day"})]}),(0,zc.jsx)(fg,{asChild:!0,size:"lg",className:"w-full md:w-auto gap-3 text-lg transition-transform duration-200 hover:scale-105",children:(0,zc.jsxs)(Ol,{to:n("/events/create"),children:[(0,zc.jsx)(cj,{className:"h-6 w-6 stroke-[3.5]"}),"Create Event"]})})]})})}),a.length>0?(0,zc.jsxs)("div",{className:"mt-6 space-y-6",children:[(0,zc.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:1===a.length?"1 Event Found":"".concat(a.length," Events Found")}),(0,zc.jsx)("div",{className:"grid gap-6 sm:grid-cols-1 lg:grid-cols-2",children:a.map(e=>(0,zc.jsxs)(Rb,{className:"group overflow-hidden transition-all duration-300 hover:shadow-lg",children:[e.image&&(0,zc.jsx)("div",{className:"relative h-48 w-full",children:(0,zc.jsx)("img",{src:e.image,alt:e.title,className:"w-full h-full object-cover"})}),(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)("h3",{className:"text-2xl font-semibold tracking-tight truncate",children:e.title}),(0,zc.jsx)("p",{className:"text-muted-foreground truncate",children:e.description})]}),(0,zc.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)(hS,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,zc.jsx)("span",{className:"text-muted-foreground truncate",children:SO(e.date)})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"text-muted-foreground shrink-0",children:"Time:"}),(0,zc.jsxs)("span",{className:"truncate",children:[e.time_start," - ",e.time_end]})]}),e.location&&(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"text-muted-foreground shrink-0",children:"Location:"}),(0,zc.jsx)("span",{className:"truncate",children:e.location})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"text-muted-foreground shrink-0",children:"Contact:"}),(0,zc.jsx)("span",{className:"truncate",children:e.contact_email})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)("span",{className:"text-muted-foreground shrink-0",children:"Tickets Available:"}),(0,zc.jsx)(Nw,{variant:"secondary",className:"shrink-0",children:o[e.uuid]||0})]})]}),(0,zc.jsx)(fg,{asChild:!0,className:"w-full mt-4 bg-[#23d6e4] text-white transition-transform duration-200 hover:scale-105",children:(0,zc.jsx)(Ol,{to:n("/event/".concat(e.uuid)),children:"View Event"})})]})})]},e.uuid))})]}):(0,zc.jsx)(Rb,{className:"border-dashed",children:(0,zc.jsxs)(Mb,{className:"p-8 text-center",children:[(0,zc.jsx)(hS,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4"}),(0,zc.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No events on this day"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Check another date or create a new event"})]})})]})})})}
2,EO=Iu("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),TO=Iu("map-pin",[["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"}]]),IO=Iu("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]),PO=Iu("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),RO=Iu("external-link",[["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"}]]),OO={async getEvent(e){const t=await fetch("".concat("https://api.trievents.ca","/events/event/").concat(e),{credentials:"include",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error("Failed to fetch event");const n=await t.json();return Gc(Gc({},n),{},{tickets_available:n.tickets_available||0})},async getPricesForEvent(e){const t=await fetch("".concat("https://api.trievents.ca","/prices/event/").concat(e),{credentials:"include",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error("Failed to fetch prices");return(await t.json()).map(e=>Gc(Gc({},e),{},{dollar_cost:e.unit_amount/100}))},async getTicketsAvailableForPrice(e){const t=await fetch("".concat("https://api.trievents.ca","/tickets/get-tickets-left-for-price/").concat(e),{credentials:"include",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error("Failed to fetch tickets available");return t.json()},async updateEvent(e,t){const n=await fetch("".concat("https://api.trievents.ca","/events/").concat(e),{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const e=n.headers.get("content-type");let t="Failed to update event";if(e&&e.includes("application/json")){const e=await n.json();t=e.message||e.error||t}else{t=await n.text()||t}throw new Error(t)}return n.json()},async deleteEvent(e){const t=await fetch("".concat("https://api.trievents.ca","/events/").concat(e),{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"}});if(!t.ok){const e=t.headers.get("content-type");let n="Failed to delete event";if(e&&e.includes("application/json")){const e=await t.json();n=e.message||e.error||n}else{n=await t.text()||n}throw new Error(n)}}};function AO(t){sl(),rg().getTenantPath;const n=ku(),r=r_(),a=r.validatePhone,s=r.filterPhoneInput,i=l((0,e.useState)(null),2),o=i[0],c=i[1],u=l((0,e.useState)(!0),2),d=u[0],f=u[1],h=l((0,e.useState)(null),2),p=h[0],m=h[1],g=l((0,e.useState)(!1),2),v=g[0],x=g[1],y=l((0,e.useState)(!1),2),b=y[0],w=y[1],_=l((0,e.useState)(""),2),k=_[0],j=_[1],N=l((0,e.useState)({title:"",description:"",date:"",location:"",time_start:"",time_end:"",contact_email:"",contact_number:"",tickets_available:0,bursary_enabled:!1,bursary_type:"custom",bursary_options:[{amount:0,description:""}],ticket_sales_active:!0,waivers_enabled:!1,waiver_items:[]}),2),S=N[0],C=N[1],E=l((0,e.useState)([]),2),T=E[0],I=E[1],P=l((0,e.useState)(0),2),R=P[0],O=P[1],A=l((0,e.useState)({}),2),D=A[0],M=A[1],F=l((0,e.useState)({}),2),L=F[0],U=F[1],H=l((0,e.useState)([]),2),z=H[0],B=H[1],W=l((0,e.useState)({}),2),q=W[0],V=W[1];(0,e.useEffect)(()=>{(async()=>{try{if(!n)return m("No organization selected"),void f(!1);const e=await OO.getEvent(t);c(e);const r=await OO.getPricesForEvent(t);I(r);const a=r.reduce((e,t)=>Gc(Gc({},e),{},{[t.uuid]:t.tickets_available}),{});U(a);const s=r.map(e=>OO.getTicketsAvailableForPrice(e.uuid).then(t=>({[e.uuid]:t})).catch(t=>(console.error("Error fetching tickets available for price:",t),{[e.uuid]:0}))),i=(await Promise.all(s)).reduce((e,t)=>Gc(Gc({},e),t),{});M(i);const o=Object.values(i).reduce((e,t)=>
2e+("number"===typeof t?t:0),0);O(o),f(!1)}catch(XF){m(XF instanceof Error?XF.message:"An error occurred"),f(!1)}})()},[t,n]);return{event:o,loading:d,error:p,isEditing:v,showDelete:b,message:k,formData:S,prices:T,ticketsAvailable:R,ticketsAvailableByPrice:D,originalTotalTickets:L,deletedPriceIds:z,errors:q,setIsEditing:x,setShowDelete:w,setMessage:j,setFormData:C,setPrices:I,setDeletedPriceIds:B,handleEdit:()=>{var e;if(!o)return;const t=new Date(o.date).toISOString().split("T")[0];C({title:o.title||"",description:o.description||"",date:t,location:o.location||"",time_start:o.time_start||"",time_end:o.time_end||"",contact_email:o.contact_email||"",contact_number:o.contact_number||"",tickets_available:o.tickets_available||0,bursary_enabled:o.bursary_enabled,bursary_type:o.bursary_type||"custom",bursary_options:o.bursary_options||[{amount:0,description:""}],ticket_sales_active:null===(e=o.ticket_sales_active)||void 0===e||e,waivers_enabled:o.waivers_enabled,waiver_items:o.waiver_items||[]}),w(!0),x(!0)},handleCancel:()=>{x(!1),w(!1),j(""),V({}),window.location.reload()},handleUpdate:async()=>{if(!o)return;if(!(()=>{let e={};if(S.title.trim()||(e.title="Title is required"),S.description&&S.description.length>5e3&&(e.description="Description cannot exceed 5,000 characters"),S.date||(e.date="Date is required"),S.location||(e.location="Location is required"),S.time_start||(e.time_start="Start time is required"),S.time_end||(e.time_end="End time is required"),S.contact_email||(e.contact_email="Contact email is required"),S.contact_number||(e.contact_number="Contact number is required"),S.time_start&&S.time_end&&S.time_end<=S.time_start&&(e.time_end="End time must be after start time"),S.contact_email&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(S.contact_email)&&(e.contact_email="Please enter a valid email address"),S.contact_number){const t=a(S.contact_number);t&&(e.contact_number=t)}return T&&0!==T.length?T.forEach((t,n)=>{t.nickname||(e["tier_".concat(n,"_name")]="Tier name is required"),t.description||(e["tier_".concat(n,"_description")]="Description is required"),isNaN(t.dollar_cost)?e["tier_".concat(n,"_price")]="Price is required":t.dollar_cost<0?e["tier_".concat(n,"_price")]="Price cannot be negative":t.dollar_cost>0&&t.dollar_cost<2&&(e["tier_".concat(n,"_price")]="Non-free tickets must be at least $2"),isNaN(t.tickets_available)?e["tier_".concat(n,"_tickets")]="Tickets available is required":t.tickets_available<=0&&(e["tier_".concat(n,"_tickets")]="Tickets available must be greater than 0")}):e.ticket_tiers="At least one ticket tier is required",S.bursary_enabled&&("fixed"!==S.bursary_type||S.bursary_options&&0!==S.bursary_options.length?"fixed"===S.bursary_type&&S.bursary_options.forEach((t,n)=>{isNaN(Number(t.amount))?e["bursary_".concat(n,"_amount")]="Amount is required":Number(t.amount)<=0&&(e["bursary_".concat(n,"_amount")]="Amount must be greater than 0"),t.description||(e["bursary_".concat(n,"_description")]="Description is required")}):e.bursary_options="At least one bursary option is required"),!S.waivers_enabled||S.waiver_items&&0!==S.waiver_items.length?S.waivers_enabled&&S.waiver_items&&S.waiver_items.forEach((t,n)=>{if(t.message&&""!==t.message.trim()||(e["waiver_".concat(n,"_message")]="Todo message is required"),"link"===t.type)if(t.link&&""!==t.link.trim())try{const r=new URL(t.link);"http:"!==r.protocol&&"https:"!==r.protocol&&(e["waiver_".concat(n,"_link")]="Link must be a valid HTTP or HTTPS URL")}catch(p){e["waiver_".concat(n,"_link")]="Please enter a valid URL (e.g., https://example.com)"}else e["waiver_".concat(n,"_link")]="Todo link is required"}):e.waiver_items="At least one todo item is required when todo is enabled",V(e),0===Object.keys(e).length})())return;if(T.find(e=>{var t;const n=L[e.uuid]-(null!==(t=D[e.uuid])&&void 0!==t?t:0);return e.tickets_available<n}))j("Total tickets available cannot be lower than tickets sold");else try{const e=T.map(e=>Gc(Gc({},e),{},{unit_amount:100*e.dollar_cost})),r=Gc(Gc({},S),{},{date:"".concat(S.date,"T00:00:00.000Z"),org_uuid:n,event_organizers:o.event_organizers||[],stripe_enabled:o.stripe_enabled||0,e_transfer_enabled:o.e_transfer_enabled||0,stripe_product_id:o.stripe_product_id||null,tickets_available:S.tickets_available,deleted_prices:z,updated_prices:e,bursary_options:S.bursary_options.map(e=>Gc(Gc({},e),{},{amount:Number(e.amount)})),waiver_items:S.waiver_items});await OO.updateEvent(t,r),c(e=>e?Gc(Gc(Gc({},e),S),{},{date:"".concat(S.date,"T00:00:00.000Z"),bursary_options:S.bursary_options.map(e=>Gc(Gc({},e),{},{amount:Number(e.amount)})),waiver_items:S.waiver_items}):null),j(""),V({}),x(!1),w(!1),B([]),window.location.reload()}catch(p){console.error("Update error:",p),j("Failed to update event. Please check your information and try again.")}},handleDelete:async()=>{try{await OO.deleteEvent(t)}catch(p){throw console.error("Delete error:",p),p}},handleChange:e=>{const t=e.target,n=t.name,r=t.value,a=t.type,i="contact_number"===n?s(r):r;C(e=>{const t=Gc(Gc({},e),{},{[n]:"number"===a?Number(i):i});return"bursary_type"===n&&"fixed"===i&&0===e.bursary_options.length&&(t.bursary_options=[{amount:0,description:""}]),t}),V(e=>{const t=Gc({},e);return delete t[n],t})}
2,handlePriceTierChange:(e,t,n)=>{I(r=>r.map((r,a)=>a===e?Gc(Gc({},r),{},{[t]:("unit_amount"===t||"dollar_cost"===t||"tickets_available"===t)&&"string"===typeof n?""===n?NaN:Number(n):n}):r)),V({})},addPrice:()=>{I(e=>[...e,{uuid:void 0,nickname:"",unit_amount:0,dollar_cost:NaN,description:"",tickets_available:NaN}]),V({})},deletePrice:e=>{T[e].uuid&&B(t=>[...t,T[e].uuid]),I(t=>t.filter((t,n)=>n!==e)),V({})},handleBursaryOptionChange:(e,t,n)=>{C(r=>Gc(Gc({},r),{},{bursary_options:r.bursary_options.map((r,a)=>a===e?Gc(Gc({},r),{},{[t]:"amount"===t&&"string"===typeof n?""===n?NaN:Number(n):n}):r)})),V({})},addBursaryOption:()=>{C(e=>Gc(Gc({},e),{},{bursary_options:[...e.bursary_options,{amount:NaN,description:""}]})),V({})},removeBursaryOption:e=>{C(t=>Gc(Gc({},t),{},{bursary_options:t.bursary_options.filter((t,n)=>n!==e)})),V({})},addWaiverItem:e=>{C(t=>Gc(Gc({},t),{},{waiver_items:[...t.waiver_items,{type:e,message:"",uuid:crypto.randomUUID(),link:"link"===e?"":void 0}]})),V(e=>{const t=Gc({},e);return delete t.waiver_items,t})},removeWaiverItem:e=>{C(t=>Gc(Gc({},t),{},{waiver_items:t.waiver_items.filter((t,n)=>n!==e)})),V(t=>{const n=Gc({},t);return delete n.waiver_items,Object.keys(n).forEach(t=>{t.startsWith("waiver_".concat(e,"_"))&&delete n[t]}),n})},handleWaiverItemChange:(e,t,n)=>{C(r=>Gc(Gc({},r),{},{waiver_items:r.waiver_items.map((r,a)=>a===e?Gc(Gc({},r),{},{[t]:n}):r)})),V(n=>{const r=Gc({},n);return delete r["waiver_".concat(e,"_").concat(t)],r})}}}function DO(e){const t=l(e.split("T")[0].split("-").map(Number),3),n=t[0],r=t[1],a=t[2];return"".concat(["January","February","March","April","May","June","July","August","September","October","November","December"][r-1]," ").concat(a,", ").concat(n)}const MO=()=>{var t;const n=il().uuid,r=sl(),a=rg().getTenantPath,s=l(e.useState(!1),2),i=s[0],o=s[1],c=l(e.useState(!1),2),u=c[0],d=c[1],f=AO(n),h=f.event,p=f.loading,m=f.error,g=f.isEditing,v=f.showDelete,x=f.message,y=f.formData,b=f.prices,w=f.ticketsAvailable,_=f.ticketsAvailableByPrice,k=f.originalTotalTickets,j=f.errors,N=f.setMessage,S=f.setFormData,C=f.handleEdit,E=f.handleCancel,T=f.handleUpdate,I=f.handleDelete,P=f.handleChange,R=f.handlePriceTierChange,O=f.addPrice,A=f.deletePrice,D=f.handleBursaryOptionChange,M=f.addBursaryOption,F=f.removeBursaryOption,L=f.addWaiverItem,U=f.removeWaiverItem,H=f.handleWaiverItemChange;return p?(0,zc.jsx)(Wb,{loading:p}):m?(0,zc.jsx)("section",{className:"min-h-screen bg-background",children:(0,zc.jsx)("div",{className:"container mx-auto px-4 py-8",children:(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:m})})})}):h?(0,zc.jsx)("section",{className:"bg-background",children:(0,zc.jsx)("div",{className:"container mx-auto pb-12",children:(0,zc.jsxs)("div",{children:[(0,zc.jsx)("div",{className:"mb-0 md:mb-6",children:(0,zc.jsx)(jO,{to:a("/dashboard"),text:"Back to Dashboard"})}),(0,zc.jsxs)("div",{className:"mb-8 p-4 bg-yellow-50 border-l-4 border-yellow-400 rounded shadow flex flex-col md:flex-row gap-4 items-start md:items-center",children:[(0,zc.jsx)("span",{className:"font-semibold text-yellow-700 mr-4",children:"Custom Orientation Checkout (TEMP):"}),(0,zc.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,zc.jsx)("a",{href:"/orientation/computing",className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition",children:"Computing Orientation"}),(0,zc.jsx)("a",{href:"/orientation/nursing",className:"px-4 py-2 bg-pink-600 text-white rounded hover:bg-pink-700 transition",children:"Nursing Orientation"}),(0,zc.jsx)("a",{href:"/orientation/healthsciences",className:"px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition",children:"Health Sci Orientation"}),(0,zc.jsx)("a",{href:"/orientation/commerce",className:"px-4 py-2 bg-red-600 text-white rounded hover:bg-red-700 transition",children:"Commerce Orientation"}),(0,zc.jsx)("a",{href:"/asterisk",className:"px-4 py-2 bg-black text-white rounded hover:bg-gray-700 transition",children:"Asterisk"})]})]}),(0,zc.jsx)(Rb,{className:"border-none bg-[#23d6e4] text-white",children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)(Ab,{className:"text-3xl font-bold mb-2 text-white",children:h.title}),(0,zc.jsx)(Db,{className:"text-white/80",children:"Event Details"})]}),!g&&(0,zc.jsxs)(fg,{onClick:C,size:"lg",className:"w-full md:w-auto gap-3 text-lg transition-transform duration-200 hover:scale-105",children:[(0,zc.jsx)(GC,{className:"h-6 w-6 stroke-[3.5]"}),"Edit Event"]})]})})}),(0,zc.jsx)("div",{className:"mt-6 space-y-6",children:g?(0,zc.jsx)(Rb,{className:"mt-6",children:(0,zc.jsxs)(Mb,{className:"p-6 space-y-6",children:[(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,zc.jsx)("input",{type:"text",name:"title",value:y.title,onChange:P,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12"}),j.title&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j.title})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,zc.jsx)("textarea",{name:"description",value:y.description,onChange:P,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black",rows:4,maxLength:5e3}),(0,zc.jsxs)("div",{className:"flex justify-between items-center mt-1",children:[j.description&&(0,zc.jsx)("p",{className:"text-destructive text-sm",children:j.description}),(0,zc.jsxs)("p",{className:"text-muted-foreground text-sm ml-auto",children:[5e3-y.description.length," characters remaining"]})]})]})]}),(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Date"}),(0,zc.jsx)("input",{type:"date",name:"date",value:y.date,onChange:P,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12 [-webkit-appearance:none] [appearance:none]"}),j.date&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j.date})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Location"}),(0,zc.jsx)("input",{type:"text",name:"location",value:y.location,onChange:P,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12"}),j.location&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j.location})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Start Time"}),(0,zc.jsx)("input",{type:"time",name:"time_start",value:y.time_start,onCh
2ange:P,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12 [-webkit-appearance:none] [appearance:none]"}),j.time_start&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j.time_start})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"End Time"}),(0,zc.jsx)("input",{type:"time",name:"time_end",value:y.time_end,onChange:P,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12 [-webkit-appearance:none] [appearance:none]"}),j.time_end&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j.time_end})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Contact Email"}),(0,zc.jsx)("input",{type:"email",name:"contact_email",value:y.contact_email,onChange:P,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12"}),j.contact_email&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j.contact_email})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Contact Number"}),(0,zc.jsx)("input",{type:"tel",name:"contact_number",value:y.contact_number,onChange:P,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12"}),j.contact_number&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j.contact_number})]})]}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center",children:[(0,zc.jsx)("h3",{className:"text-xl font-semibold",children:"Ticket Tiers"}),(0,zc.jsx)(fg,{onClick:O,variant:"outline",className:"bg-black text-white hover:bg-black/90 hover:text-white transition-transform duration-200 hover:scale-105",children:"Add Tier"})]}),b&&b.map((e,t)=>{var n;return(0,zc.jsx)(Rb,{className:"bg-muted/50 hover:shadow-md transition-shadow",children:(0,zc.jsxs)(Mb,{className:"p-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,zc.jsxs)("h4",{className:"text-lg font-semibold",children:["Tier ",t+1]}),b.length>1&&(0,zc.jsx)(fg,{variant:"ghost",size:"sm",onClick:()=>A(t),className:"text-destructive hover:text-destructive/90",children:(0,zc.jsx)(YC,{className:"h-4 w-4"})})]}),(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Tier Name"}),(0,zc.jsx)("input",{type:"text",value:e.nickname,onChange:e=>R(t,"nickname",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12"}),j["tier_".concat(t,"_name")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j["tier_".concat(t,"_name")]})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Price (CAD)"}),(0,zc.jsx)("input",{type:"number",value:isNaN(e.dollar_cost)?"":e.dollar_cost,onChange:e=>R(t,"dollar_cost",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",min:"0",step:"0.01"}),j["tier_".concat(t,"_price")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j["tier_".concat(t,"_price")]})]}),(0,zc.jsxs)("div",{className:"md:col-span-2",children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,zc.jsx)("textarea",{value:e.description,onChange:e=>R(t,"description",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black",rows:2}),j["tier_".concat(t,"_description")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j["tier_".concat(t,"_description")]})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Total Tickets Available"}),(0,zc.jsx)("input",{type:"number",value:isNaN(e.tickets_available)?"":e.tickets_available,onChange:e=>R(t,"tickets_available",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",min:"0"}),j["tier_".concat(t,"_tickets")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j["tier_".concat(t,"_tickets")]}),(0,zc.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:void 0!==_[e.uuid]&&(0,zc.jsxs)("span",{children:[k[e.uuid]-(null!==(n=_[e.uuid])&&void 0!==n?n:0)," tickets sold so far"]})})]})]})]})},e.uuid?e.uuid:t)})]}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)(fE,{id:"bursary-enabled",checked:y.bursary_enabled,onCheckedChange:e=>S(t=>Gc(Gc({},t),{},{bursary_enabled:e}))}),(0,zc.jsx)("label",{htmlFor:"bursary-enabled",className:"text-sm font-medium text-foreground",children:"Enable Bursary Requests"})]}),y.bursary_enabled&&(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Bursary Type"}),(0,zc.jsxs)("select",{name:"bursary_type",value:y.bursary_type,onCh
2ange:P,className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",children:[(0,zc.jsx)("option",{value:"custom",children:"Let users choose their amount"}),(0,zc.jsx)("option",{value:"fixed",children:"Provide fixed bursary options"})]})]}),"fixed"===y.bursary_type&&(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center",children:[(0,zc.jsx)("h3",{className:"text-xl font-semibold",children:"Bursary Options"}),(0,zc.jsx)(fg,{onClick:M,variant:"outline",className:"bg-black text-white hover:bg-black/90 hover:text-white transition-transform duration-200 hover:scale-105",children:"Add Option"})]}),y.bursary_options.map((e,t)=>(0,zc.jsx)(Rb,{className:"bg-muted/50 hover:shadow-md transition-shadow",children:(0,zc.jsxs)(Mb,{className:"p-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,zc.jsxs)("h4",{className:"text-lg font-semibold",children:["Option ",t+1]}),y.bursary_options.length>1&&(0,zc.jsx)(fg,{variant:"ghost",size:"sm",onClick:()=>F(t),className:"text-destructive hover:text-destructive/90",children:(0,zc.jsx)(YC,{className:"h-4 w-4"})})]}),(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Amount (CAD)"}),(0,zc.jsx)("input",{type:"number",value:isNaN(Number(e.amount))?"":e.amount,onChange:e=>D(t,"amount",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",placeholder:"0.00",min:"0",step:"0.01"}),j["bursary_".concat(t,"_amount")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j["bursary_".concat(t,"_amount")]})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,zc.jsx)("input",{type:"text",value:e.description,onChange:e=>D(t,"description",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12"}),j["bursary_".concat(t,"_description")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j["bursary_".concat(t,"_description")]})]})]})]})},t))]})]})]}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)(fE,{id:"waivers-enabled",checked:y.waivers_enabled,onCheckedChange:e=>S(t=>Gc(Gc({},t),{},{waivers_enabled:e}))}),(0,zc.jsx)("label",{htmlFor:"waivers-enabled",className:"text-sm font-medium text-foreground",children:"Enable Todo/Checklist"}),(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("div",{className:"rounded-full bg-gray-200 hover:bg-gray-300 text-gray-600 hover:text-gray-800 w-5 h-5 flex items-center justify-center cursor-help text-xs font-medium transition-colors duration-200 border border-gray-300",children:"?"})}),(0,zc.jsx)(tg,{children:(0,zc.jsx)("p",{children:"Add items that must be completed to attend the event i.e. todo items, acknowledgements, waivers, etc."})})]})]}),y.waivers_enabled&&(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center",children:[(0,zc.jsx)("h3",{className:"text-xl font-semibold",children:"Todo Options"}),(0,zc.jsxs)(xO,{children:[(0,zc.jsx)(yO,{asChild:!0,children:(0,zc.jsx)(fg,{variant:"outline",className:"bg-black text-white hover:bg-black/90 hover:text-white transition-transform duration-200 hover:scale-105",children:"Add Item"})}),(0,zc.jsxs)(bO,{children:[(0,zc.jsx)(wO,{onClick:()=>L("link"),children:"Link"}),(0,zc.jsx)(wO,{onClick:()=>L("checkbox"),children:"Checkbox"})]})]})]}),j.waiver_items&&(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:j.waiver_items})}),y.waiver_items.map((e,t)=>(0,zc.jsx)(Rb,{className:"bg-muted/50 hover:shadow-md transition-shadow",children:(0,zc.jsxs)(Mb,{className:"p-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,zc.jsx)("h4",{className:"text-lg font-semibold",children:"checkbox"===e.type?"Checkbox":"Link"}),(0,zc.jsx)(fg,{variant:"ghost",size:"sm",onClick:()=>U(t),className:"text-destructive hover:text-destructive/90",children:(0,zc.jsx)(YC,{className:"h-4 w-4"})})]}),"checkbox"===e.type&&(0,zc.jsx)("div",{className:"grid grid-cols-1 gap-4",children:(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Message"}),(0,zc.jsx)(pg,{type:"text",value:e.message,onChange:e=>H(t,"message",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",placeholder:"Enter a message to display with the item"}),j["waiver_".concat(t,"_message")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j["waiver_".concat(t,"_message")]})]})}),"link"===e.type&&(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Message"}),(0,zc.jsx)(pg,{type:"text",value:e.message,onChange:e=>H(t,"message",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",placeholder:"Enter a message to display with the item"}),j["waiver_".concat(t,"_message")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j["waiver_".concat(t,"_message")]})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Link"}),(0,zc.jsx)(pg,{type:"url",value:e.link||"",onChange:e=>H(t,"link",e.target.value),className:"w-full rounded-md border-2 border-input bg-background px-4 py-2 focus:border-black h-12",placeholder:"https://example.com",pattern:"https?://.+",title:"Please enter a valid URL starting with http:// or https://"}),j["waiver_".concat(t,"_link")]&&(0,zc.jsx)("p",{className:"text-sm text-destructive mt-1",children:j["waiver_".concat(t,"_link")]})]})]})]})},e.uuid))]})]}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)(fE,{id:"ticket-sales",checked:y.ticket_sales_active,onCheckedChange:e=>S(t=>Gc(Gc({},t),{},{ticket_sales_active:e}))}),(0,zc.jsx)("label",{htmlFor:"ticket-sales",className:"text-sm font-medium text-foreground",children:"Enable Ticket Sales"})]}),!y.ticket_sales_active&&(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:"Ticket sales are currently disabled. This will prevent new ticket purchases but won't affect existing tickets."})})]}),x&&(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:x})}),(0,zc.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between gap-4",children:[v&&(0,zc.jsxs)(fg,{onClick:()=>{o(!0)},variant:"destructive",className:"w-full sm:w-auto text-white transition-transform duration-200 hover:scale-105",children:[(0,zc.jsx)(YC,{className:"mr-2 h-4 w-4"}),"Delete Event"]}),(0,zc.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4",children:[(0,zc.jsx)(fg,{onClick:T,className:"w-full sm:w-auto bg-black text-white hover:bg-black/90 hover:text-white transition-transform duration-200 hover:scale-105",children:"Save Changes"}),(0,zc.jsx)(fg,{onClick:E,variant:"outline",className:"w-full sm:w-auto transition-transform duration-200 hover:scale-105",children:"Cancel"})]})]}),(0,zc.jsx)(Uw,{open:i,onOpenChange:o,children:(0,zc.jsxs)(Ww,{children:[(0,zc.jsxs)(qw,{children:[(0,zc.jsx)($w,{children:"Delete Event"}),(0,zc.jsx)(Gw,{children:"Are you sure you want to delete this event? This action cannot be undone and will invalidate all existing tickets."})]}),(0,zc.jsxs)(Vw,{children:[(0,zc.jsx)(fg,{variant:"outline",onClick:()=>o(!1),disabled:u,children:"Cancel"}),(0,zc.jsx)(fg,{variant:"destructive",onClick:async()=>
2{if(h){d(!0);try{await I(),o(!1),r(a("/dashboard"))}catch(m){N(m instanceof Error?m.message:"Failed to delete event"),o(!1)}finally{d(!1)}}},disabled:u,className:"text-white ".concat(u?"opacity-50 cursor-not-allowed":""),children:u?(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)("span",{className:"animate-spin mr-2",children:"\u23f3"}),"Deleting..."]}):(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(YC,{className:"mr-2 h-4 w-4"}),"Delete Event"]})})]})]})})]})}):(0,zc.jsxs)("div",{className:"space-y-6",children:[h.image&&(0,zc.jsx)(Rb,{className:"overflow-hidden",children:(0,zc.jsx)("img",{src:h.image,alt:h.title,className:"w-full h-64 object-cover"})}),(0,zc.jsx)(Rb,{children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"space-y-6",children:[(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsx)("h3",{className:"text-2xl font-semibold",children:"Description"}),(0,zc.jsx)(qb,{className:"text-muted-foreground",children:h.description})]}),(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)(hS,{className:"h-5 w-5 text-muted-foreground shrink-0"}),(0,zc.jsxs)("div",{className:"min-w-0",children:[(0,zc.jsx)("p",{className:"text-sm font-medium truncate",children:"Date"}),(0,zc.jsx)("p",{className:"text-muted-foreground truncate",children:DO(h.date)})]})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)(EO,{className:"h-5 w-5 text-muted-foreground shrink-0"}),(0,zc.jsxs)("div",{className:"min-w-0",children:[(0,zc.jsx)("p",{className:"text-sm font-medium truncate",children:"Time"}),(0,zc.jsxs)("p",{className:"text-muted-foreground truncate",children:[h.time_start," - ",h.time_end]})]})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)(TO,{className:"h-5 w-5 text-muted-foreground shrink-0"}),(0,zc.jsxs)("div",{className:"min-w-0",children:[(0,zc.jsx)("p",{className:"text-sm font-medium truncate",children:"Location"}),(0,zc.jsx)("p",{className:"text-muted-foreground truncate",children:h.location})]})]})]}),(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)(Ou,{className:"h-5 w-5 text-muted-foreground shrink-0"}),(0,zc.jsxs)("div",{className:"min-w-0",children:[(0,zc.jsx)("p",{className:"text-sm font-medium truncate",children:"Contact Email"}),(0,zc.jsx)("p",{className:"text-muted-foreground truncate",children:h.contact_email})]})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)(IO,{className:"h-5 w-5 text-muted-foreground shrink-0"}),(0,zc.jsxs)("div",{className:"min-w-0",children:[(0,zc.jsx)("p",{className:"text-sm font-medium truncate",children:"Contact Number"}),(0,zc.jsx)("p",{className:"text-muted-foreground truncate",children:h.contact_number})]})]}),(0,zc.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zc.jsx)(IS,{className:"h-5 w-5 text-muted-foreground shrink-0"}),(0,zc.jsxs)("div",{className:"min-w-0",children:[(0,zc.jsx)("p",{className:"text-sm font-medium truncate",children:"Tickets Available"}),(0,zc.jsx)(Nw,{variant:"secondary",className:"shrink-0",children:w})]})]})]})]}),b&&b.length>0&&(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsx)("h3",{className:"text-2xl font-semibold",children:"Ticket Tiers"}),(0,zc.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:b.map(e=>{var t;return(0,zc.jsx)(Rb,{className:"bg-muted/50 hover:shadow-md transition-shadow",children:(0,zc.jsx)(Mb,{className:"p-4",children:(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-start",children:[(0,zc.jsxs)("div",{className:"min-w-0",children:[(0,zc.jsx)("h4",{className:"font-semibold truncate",children:e.nickname}),(0,zc.jsx)("p",{className:"text-sm text-muted-foreground truncate",children:e.description})]}),(0,zc.jsxs)(Nw,{variant:"secondary",className:"shrink-0 ml-2",children:["$",e.dollar_cost]})]}),(0,zc.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,zc.jsx)("span",{className:"text-muted-foreground truncate",children:void 0!==_[e.uuid]&&(0,zc.jsxs)("span",{children:[k[e.uuid]-(null!==(t=_[e.uuid])&&void 0!==t?t:0)," sold"]})}),(0,zc.jsxs)("span",{className:"font-medium shrink-0 ml-2",children:[e.tickets_available," total tickets"]})]})]})})},e.uuid)})})]}),h.bursary_enabled&&(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsx)("h3",{className:"text-2xl font-semibold",children:"Bursary Options"}),"custom"===h.bursary_type?(0,zc.jsx)("p",{className:"text-muted-foreground",children:"Users can request custom bursary amounts for this event."}):(0,zc.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:null===(t=h.bursary_options)||void 0===t?void 0:t.map((e,t)=>(0,zc.jsx)(Rb,{className:"bg-muted/50 hover:shadow-md transition-shadow",children:(0,zc.jsx)(Mb,{className:"p-4",children:(0,zc.jsx)("div",{className:"space-y-2",children:(0,zc.jsxs)("div",{className:"flex justify-between items-start",children:[(0,zc.jsx)("p",{className:"text-sm text-muted-foreground truncate",children:e.description}),(0,zc.jsxs)(Nw,{variant:"secondary",className:"shrink-0 ml-2",children:["$",e.amount]})]})})})},t))})]}),!h.ticket_sales_active&&(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:"Ticket sales are currently disabled for this event."})}),(0,zc.jsxs)("div",{className:"flex flex-col xl:flex-row gap-4",children:[(0,zc.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 order-1 xl:order-2 w-full",children:[(0,zc.jsx)(fg,{asChild:!0,variant:"outline",className:"w-full transition-transform duration-200 hover:scale-105",children:(0,zc.jsxs)(Ol,{to:a("/event/".concat(n,"/attendees")),children:[(0,zc.jsx)(Ru,{className:"mr-2 h-4 w-4"}),"View Attendees"]})}),(0,zc.jsx)(fg,{asChild:!0,variant:"outline",className:"w-full transition-transform duration-200 hover:scale-105",children:(0,zc.jsxs)(Ol,{to:a("/event/".concat(n,"/notify-attendees")),children:[(0,zc.jsx)(PO,{className:"mr-2 h-4 w-4"}),"Notify Attendees"]})})]}),(0,zc.jsxs)(fg,{onClick:()=>{h&&r("/checkout/".concat(h.uuid))},className:"w-full xl:w-auto transition-transform duration-200 hover:scale-105 order-2 xl:order-1",children:[(0,zc.jsx)(RO,{className:"mr-2 h-4 w-4"}),"View Checkout Page"]})]})]})})})]})})]})})}):(0,zc.jsx)("section",{className:"min-h-screen bg-background",children:(0,zc.jsx)("div",{className:"container mx-auto px-4 py-8",children:(0,zc.jsx)(Iw,{children:(0,zc.jsx)(Rw,{children:"Event not found"})})})})},FO=Iu("download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),LO=async e=>{const t=await fetch("".concat("https://api.trievents.ca","/tickets/event/").concat(e,"/attendees"),{credentials:"include",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error("Failed to fetch attendees");return t.json()},UO=async(e,t)=>{const n=await fetch("".concat("https://api.trievents.ca","/tickets/reissue/").concat(e),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({newEmail:t})});if(!n.ok){const e=await n.json();throw new Error(e.error||"Failed to reissue ticket")}},HO=async e=>{const t=await fetch("".concat("https://api.trievents.ca","/tickets/refund/").concat(e),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({uuid:e})});if(t.ok){return{ok:!0,message:(await t.json()).message}}return{ok:!1,message:(await t.json()).message||"Failed to refund"}},zO=()=>{const t=il().uuid,n=rg().getTenantPath,r=(t=>{const n=l((0,e.useState)([]),2),r=n[0],a=n[1],s=l((0,e.useState)(!0),2),i=s[0],o=s[1],c=l((0,e.useState)(null),2),u=c[0],d=c[1],f=(0,e.useCallback)(async()=>{try{o(!0),d(null);const e=await LO(t);a(e)}catch(XF){d(XF instanceof Error?XF.message:"An error occurred")}finally{o(!1)}},[t]),h=(0,e.useCallback)(async()=>{await f()},[f]);return(0,e.useEffect)(()=>{f();const e=setTimeout(()=>{o(!1)},1e3);return()=>clearTimeout(e)},[t]),{attendees:r,loading:i,error:u,handleExportCSV:()=>{const e=r.map(e=>[e.name,e.email,e.phone||"-",e.ticket_type,e.ticket_burned?"Used":"Unused",oj(new Date(e.purchase_date),"MMM d, yyyy")]),t=[["Name","Email","Phone","Ticket Type","Status","Purchase Date"].join(","),...e.map(e=>e.map(e=>'"'.concat(e,'"')).join(","))].join("\n"),n=new Blob([t],{type:"text/csv;charset=utf-8;"}),a=document.createElement("a"),s=URL.createObjectURL(n);a.setAttribute("href",s),a.setAttribute("download","attendees_".concat(oj(new Date,"yyyy-MM-dd"),".csv")),a.style.visibility="hidden",document.body.appendChild(a),a.click(),document.body.removeChild(a)},refreshAttendees:h}})(t),a=r.attendees,s=r.loading,i=r.error,o=r.handleExportCSV,c=r.refreshAttendees,u=l(e.useState(""),2),d=u[0],f=u[1],h=l(e.useState(null),2),p=h[0],m=h[1],g=l(e.useState(""),2),v=g[0],x=g[1],y=l(e.useState(!1),2),b=y[0],w=y[1],_=l(e.useState(!1),2),k=_[0],j=_[1],N=l(e.useState(!1),2),S=N[0],C=N[1],E=l(e.useState(!1),2),T=E[0],I=E[1],P=e.useMemo(()=>
2{if(!d.trim())return a;const e=d.toLowerCase();return a.filter(t=>t.name.toLowerCase().includes(e))},[a,d]);return s?(0,zc.jsx)(Wb,{loading:s}):i?(0,zc.jsx)("section",{className:"min-h-screen bg-background",children:(0,zc.jsx)("div",{className:"container mx-auto px-4 py-8",children:(0,zc.jsx)(Iw,{variant:"destructive",children:(0,zc.jsx)(Rw,{children:i})})})}):(0,zc.jsx)("section",{className:"bg-background",children:(0,zc.jsxs)("div",{className:"container mx-auto pb-12",children:[(0,zc.jsx)(Uw,{open:k,onOpenChange:j,children:(0,zc.jsxs)(Ww,{children:[(0,zc.jsxs)(qw,{children:[(0,zc.jsx)($w,{children:"Reissue Ticket"}),(0,zc.jsx)(Gw,{children:"Enter the new email address to reissue the ticket to."})]}),(0,zc.jsx)("div",{className:"py-4",children:(0,zc.jsx)(pg,{type:"email",placeholder:"New email address",value:v,onChange:e=>x(e.target.value)})}),(0,zc.jsxs)(Vw,{className:"gap-4",children:[(0,zc.jsx)(fg,{variant:"outline",onClick:()=>{m(null),x(""),j(!1)},className:"order-1 md:order-2",children:"Cancel"}),(0,zc.jsx)(fg,{onClick:async()=>{if(p)try{w(!0),await UO(p.uuid,v),ou.success("Ticket has been reissued successfully"),m(null),x(""),j(!1),await c()}catch(i){ou.error(i instanceof Error?i.message:"Failed to reissue ticket")}finally{w(!1)}},disabled:b||!v,className:"order-2 md:order-1",children:b?"Reissuing...":"Reissue Ticket"})]})]})}),(0,zc.jsx)(Uw,{open:S,onOpenChange:C,children:(0,zc.jsxs)(Ww,{children:[(0,zc.jsxs)(qw,{children:[(0,zc.jsx)($w,{children:"Refund Confirmation"}),(0,zc.jsxs)(Gw,{children:[(0,zc.jsxs)("p",{children:["Are you sure you want to refund the ticket issued to ",null===p||void 0===p?void 0:p.email,"?"]}),(0,zc.jsx)("p",{children:"(Note: The service fee will not be refunded to your organization)"})]})]}),(0,zc.jsxs)(Vw,{className:"gap-4",children:[(0,zc.jsx)(fg,{variant:"outline",onClick:()=>{m(null),C(!1)},className:"order-1 md:order-2",children:"Cancel"}),(0,zc.jsx)(fg,{onClick:async()=>{if(p)try{I(!0);const e=await HO(p.uuid);m(null),C(!1),await c(),e.ok?ou.success("Ticket refunded!"):"No associated transaction"===e.message?ou.error("Could not refund, please contact [email protected]"):ou.error("Could not refund, please try again")}catch(i){ou.error("Could not refund, please try again")}finally{I(!1)}},disabled:T,className:"order-2 md:order-1",children:T?"Refunding...":"Refund"})]})]})}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)("div",{className:"mb-0 md:mb-6",children:(0,zc.jsx)(jO,{to:n("/event/".concat(t)),text:"Back to Event"})}),(0,zc.jsx)(Rb,{className:"border-none bg-[#23d6e4] text-white",children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)(Ab,{className:"text-3xl font-bold mb-2 text-white",children:"Event Attendees"}),(0,zc.jsx)(Db,{className:"text-white/80",children:"View and manage event attendees"})]}),(0,zc.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[(0,zc.jsxs)(Nw,{variant:"secondary",className:"h-10 px-4 text-base whitespace-nowrap",children:[a.length," ",1===a.length?"Attendee":"Attendees"]}),(0,zc.jsxs)(fg,{onClick:o,size:"lg",className:"w-full md:w-auto gap-3 text-lg transition-transform duration-200 hover:scale-105",children:[(0,zc.jsx)(FO,{className:"h-6 w-6 stroke-[3.5]"}),"Export CSV"]})]})]})})}),(0,zc.jsx)("div",{className:"mt-6",children:0===a.length?(0,zc.jsx)(Rb,{children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"text-center py-8",children:[(0,zc.jsx)(Ru,{className:"mx-auto h-12 w-12 text-muted-foreground"}),(0,zc.jsx)("h3",{className:"mt-4 text-lg font-semibold",children:"No attendees found"}),(0,zc.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"There are no attendees for this event yet."})]})})}):(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"relative",children:[(0,zc.jsx)(mS,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,zc.jsx)(pg,{placeholder:"Search attendees by name...",value:d,onChange:e=>f(e.target.value),className:"pl-9"})]}),(0,zc.jsx)("div",{className:"md:hidden space-y-4",children:P.map((e,t)=>(0,zc.jsx)(Rb,{children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"space-y-4",children:[(0,zc.jsxs)("div",{className:"flex justify-between items-start gap-4",children:[(0,zc.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"font-medium truncate text-base",children:e.name})}),(0,zc.jsx)(tg,{children:e.name})]})}),(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"text-sm text-muted-foreground truncate mt-1",children:e.email})}),(0,zc.jsx)(tg,{children:e.email})]})})]}),(0,zc.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,zc.jsx)(Nw,{variant:"outline",className:Zm("rounded-full text-xs whitespace-nowrap min-w-[65px] flex items-center justify-center",e.ticket_burned?"bg-red-100 text-red-800 border-red-200":"bg-green-100 text-green-800 border-green-200"),children:e.ticket_burned?"Used":"Unused"}),!e.ticket_burned&&(0,zc.jsxs)(xO,{children:[(0,zc.jsx)(yO,{asChild:!0,children:(0,zc.jsx)(fg,{variant:"outline",size:"sm",className:"gap-2",children:"Actions"})}),(0,zc.jsxs)(bO,{children:[(0,zc.jsx)(wO,{className:"cursor-pointer",onClick:()=>{m(e),j(!0)},children:"Reissue"}),(0,zc.jsx)(wO,{className:"cursor-pointer",onClick:()=>{m(e),C(!0)},children:"Refund"})]})]})]})]}),(0,zc.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground",children:[(0,zc.jsxs)("p",{children:["Phone: ",e.phone||"-"]}),(0,zc.jsxs)("p",{children:["Ticket: ",e.ticket_type]}),(0,zc.jsxs)("p",{children:["Purchased: ",oj(new Date(e.purchase_date),"MMM d, yyyy")]})]})]})})},t))}),(0,zc.jsx)("div",{className:"hidden md:block w-full",children:(0,zc.jsx)("div",{className:"border rounded-lg overflow-hidden w-full",children:(0,zc.jsx)("div",{className:"min-h-[500px] max-h-[500px] overflow-auto w-full bg-gray-50",children:(0,zc.jsxs)("div",{className:"grid w-full bg-white",style:{gridTemplateColumns:"minmax(140px, 1.5fr) minmax(140px, 2fr) minmax(100px, 1.2fr) minmax(80px, 1fr) minmax(80px, 1fr) minmax(100px, 1fr)"},children:[(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white truncate",children:"Name"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center truncate",children:"Email"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center truncate",children:"Phone"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center truncate",children:"Ticket Type"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center truncate",children:"Status"}),(0,zc.jsx)("div",{className:"sticky top-0 bg-black z-10 border-b py-2 px-4 font-medium text-white text-center truncate",children:"Actions"}),P.map((t,n)=>(0,zc.jsxs)(e.Fragment,{children:[(0,zc.jsx)("div",{className:"border-b py-2 px-4 flex items-center min-h-[48px]",children:(0,zc.jsx)("div",{className:"min-w-0 space-y-0.5",children:(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"font-medium truncate text-sm",children:t.name})}),(0,zc.jsx)(tg,{children:t.name})]})})})}),(0,zc.jsx)("div",{className:"border-b py-2 px-4 flex items-center min-h-[48px]",children:(0,zc.jsx)(Xm,{children:(0,zc.jsxs)(Qm,{children:[(0,zc.jsx)(eg,{asChild:!0,children:(0,zc.jsx)("p",{className:"truncate text-sm w-full text-center",children:t.email})}),(0,zc.jsx)(tg,{children:t.email})]})})}),(0,zc.jsx)("div",{className:"border-b py-2 px-4 flex items-center min-h-[48px]",children:(0,zc.jsx)("p",{className:"text-sm w-full text-center",children:t.phone||"-"})}),(0,zc.jsx)("div",{className:"border-b py-2 px-4 flex items-center min-h-[48px]",children:(0,zc.jsx)("p",{className:"text-sm w-full text-center",children:t.ticket_type})}),(0,zc.jsx)("div",{className:"border-b py-2 px-4 flex items-center justify-center min-h-[48px]",children:(0,zc.jsx)(Nw,{variant:"outline",className:Zm("rounded-full text-xs whitespace-nowrap min-w-[65px] flex items-center justify-center",t.ticket_burned?"bg-red-100 text-red-800 border-red-200":"bg-green-100 text-green-800 border-green-200"),children:t.ticket_burned?"Used":"Unused"})}),(0,zc.jsx)("div",{className:"border-b py-2 px-4 flex items-center justify-center min-h-[48px]",children:!t.ticket_burned&&(0,zc.jsxs)(xO,{children:[(0,zc.jsx)(yO,{asChild:!0,children:(0,zc.jsx)(fg,{variant:"outline",children:"Actions"})}),(0,zc.jsxs)(bO,{children:[(0,zc.jsx)(wO,{className:"cursor-pointer",onClick:()=>{m(t),j(!0)},children:"Reissue"}),(0,zc.jsx)(wO,{className:"cursor-pointer",onClick:()=>{m(t),C(!0)},children:"Refund"})]})]})})]},n))]})})})})]})})]})]})})};const BO=["children"],WO=["_f"],qO=["name"],VO=["_f"],$O=["ref","message","type"],GO=["formControl"];var YO=e=>
2"checkbox"===e.type,KO=e=>e instanceof Date,ZO=e=>null==e;const JO=e=>"object"===typeof e;var XO=e=>!ZO(e)&&!Array.isArray(e)&&JO(e)&&!KO(e),QO=e=>XO(e)&&e.target?YO(e.target)?e.target.checked:e.target.value:e,eA=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),tA="undefined"!==typeof window&&"undefined"!==typeof window.HTMLElement&&"undefined"!==typeof document;function nA(e){let t;const n=Array.isArray(e),r="undefined"!==typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(tA&&(e instanceof Blob||r)||!n&&!XO(e))return e;if(t=n?[]:{},n||(e=>{const t=e.constructor&&e.constructor.prototype;return XO(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=nA(e[n]));else t=e}return t}var rA=e=>/^\w*$/.test(e),aA=e=>void 0===e,sA=e=>Array.isArray(e)?e.filter(Boolean):[],iA=e=>sA(e.replace(/["|']|\]/g,"").split(/\.|\[/)),oA=(e,t,n)=>{if(!t||!XO(e))return n;const r=(rA(t)?[t]:iA(t)).reduce((e,t)=>ZO(e)?e:e[t],e);return aA(r)||r===e?aA(e[t])?n:e[t]:r},lA=e=>"boolean"===typeof e,cA=(e,t,n)=>{let r=-1;const a=rA(t)?[t]:iA(t),s=a.length,i=s-1;for(;++r<s;){const t=a[r];let s=n;if(r!==i){const n=e[t];s=XO(n)||Array.isArray(n)?n:isNaN(+a[r+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=s,e=e[t]}};const uA="blur",dA="focusout",fA="change",hA="onBlur",pA="onChange",mA="onSubmit",gA="onTouched",vA="all",xA="max",yA="min",bA="maxLength",wA="minLength",_A="pattern",kA="required",jA="validate",NA=e.createContext(null);NA.displayName="HookFormContext";const SA=()=>e.useContext(NA);var CA=function(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const a={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(a,s,{get:()=>{const a=s;return t._proxyFormState[a]!==vA&&(t._proxyFormState[a]=!r||vA),n&&(n[a]=!0),e[a]}});return a};const EA="undefined"!==typeof window?e.useLayoutEffect:e.useEffect;function TA(t){const n=SA(),r=t||{},a=r.control,s=void 0===a?n.control:a,i=r.disabled,o=r.name,c=r.exact,u=l(e.useState(s._formState),2),d=u[0],f=u[1],h=e.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return EA(()=>s._subscribe({name:o,formState:h.current,exact:c,callback:e=>{!i&&f(Gc(Gc({},s._formState),e))}}),[o,i,c]),e.useEffect(()=>{h.current.isValid&&s._setValid(!0)},[s]),e.useMemo(()=>CA(d,s,h.current,!1),[d,s])}var IA=e=>"string"===typeof e,PA=(e,t,n,r,a)=>IA(e)?(r&&t.watch.add(e),oA(n,e,a)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),oA(n,e))):(r&&(t.watchAll=!0),n);function RA(t){const n=SA(),r=t.name,a=t.disabled,s=t.control,i=void 0===s?n.control:s,o=t.shouldUnregister,c=eA(i._names.array,r),u=function(t){const n=SA(),r=t||{},a=r.control,s=void 0===a?n.control:a,i=r.name,o=r.defaultValue,c=r.disabled,u=r.exact,d=e.useRef(o),f=l(e.useState(s._getWatch(i,d.current)),2),h=f[0],p=f[1];return EA(()=>s._subscribe({name:i,formState:{values:!0},exact:u,callback:e=>!c&&p(PA(i,s._names,e.values||s._formValues,!1,d.current))}),[i,s,c,u]),e.useEffect(()=>s._removeUnmounted()),h}({control:i,name:r,defaultValue:oA(i._formValues,r,oA(i._defaultValues,r,t.defaultValue)),exact:!0}),d=TA({control:i,name:r,exact:!0}),f=e.useRef(t),h=e.useRef(i.register(r,Gc(Gc({},t.rules),{},{value:u},lA(t.disabled)?{disabled:t.disabled}:{}))),p=e.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!oA(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!oA(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!oA(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!oA(d.validatingFields,r)},error:{enumerable:!0,get:()=>oA(d.errors,r)}}),[d,r]),m=e.useCallback(e=>h.current.onChange({target:{value:QO(e),name:r},type:fA}),[r]),g=e.useCallback(()=>h.current.onBlur({target:{value:oA(i._formValues,r),name:r},type:uA}),[r,i._formValues]),v=e.useCallback(e=>{const t=oA(i._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[i._fields,r]),x=e.useMemo(()=>Gc(Gc({name:r,value:u},lA(a)||d.disabled?{disabled:d.disabled||a}:{}),{},{onChange:m,onBlur:g,ref:v}),[r,a,d.disabled,m,g,v,u]);return e.useEffect(()=>{const e=i._options.shouldUnregister||o;
2i.register(r,Gc(Gc({},f.current.rules),lA(f.current.disabled)?{disabled:f.current.disabled}:{}));const t=(e,t)=>{const n=oA(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(r,!0),e){const e=nA(oA(i._options.defaultValues,r));cA(i._defaultValues,r,e),aA(oA(i._formValues,r))&&cA(i._formValues,r,e)}return!c&&i.register(r),()=>{(c?e&&!i._state.action:e)?i.unregister(r):t(r,!1)}},[r,i,c,o]),e.useEffect(()=>{i._setDisabledField({disabled:a,name:r})},[a,r,i]),e.useMemo(()=>({field:x,formState:d,fieldState:p}),[x,d,p])}const OA=e=>e.render(RA(e));var AA=(e,t,n,r,a)=>t?Gc(Gc({},n[e]),{},{types:Gc(Gc({},n[e]&&n[e].types?n[e].types:{}),{},{[r]:a||!0})}):{},DA=e=>Array.isArray(e)?e:[e],MA=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},FA=e=>ZO(e)||!JO(e);function LA(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WeakSet;if(FA(e)||FA(t))return e===t;if(KO(e)&&KO(t))return e.getTime()===t.getTime();const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const s of r){const r=e[s];if(!a.includes(s))return!1;if("ref"!==s){const e=t[s];if(KO(r)&&KO(e)||XO(r)&&XO(e)||Array.isArray(r)&&Array.isArray(e)?!LA(r,e,n):r!==e)return!1}}return!0}var UA=e=>XO(e)&&!Object.keys(e).length,HA=e=>"file"===e.type,zA=e=>"function"===typeof e,BA=e=>{if(!tA)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},WA=e=>"select-multiple"===e.type,qA=e=>"radio"===e.type,VA=e=>BA(e)&&e.isConnected;function $A(e,t){const n=Array.isArray(t)?t:rA(t)?[t]:iA(t),r=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=aA(e)?r++:e[t[r++]];return e}(e,n),a=n.length-1,s=n[a];return r&&delete r[s],0!==a&&(XO(r)&&UA(r)||Array.isArray(r)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!aA(e[t]))return!1;return!0}(r))&&$A(e,n.slice(0,-1)),e}var GA=e=>{for(const t in e)if(zA(e[t]))return!0;return!1};function YA(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Array.isArray(e);if(XO(e)||n)for(const r in e)Array.isArray(e[r])||XO(e[r])&&!GA(e[r])?(t[r]=Array.isArray(e[r])?[]:{},YA(e[r],t[r])):ZO(e[r])||(t[r]=!0);return t}function KA(e,t,n){const r=Array.isArray(e);if(XO(e)||r)for(const a in e)Array.isArray(e[a])||XO(e[a])&&!GA(e[a])?aA(t)||FA(n[a])?n[a]=Array.isArray(e[a])?YA(e[a],[]):Gc({},YA(e[a])):KA(e[a],ZO(t)?{}:t[a],n[a]):n[a]=!LA(e[a],t[a]);return n}var ZA=(e,t)=>KA(e,t,YA(t));const JA={value:!1,isValid:!1},XA={value:!0,isValid:!0};var QA=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!aA(e[0].attributes.value)?aA(e[0].value)||""===e[0].value?XA:{value:e[0].value,isValid:!0}:XA:JA}return JA},eD=(e,t)=>{let n=t.valueAsNumber,r=t.valueAsDate,a=t.setValueAs;return aA(e)?e:n?""===e?NaN:e?+e:e:r&&IA(e)?new Date(e):a?a(e):e};const tD={isValid:!1,value:null};var nD=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,tD):tD;function rD(e){const t=e.ref;return HA(t)?t.files:qA(t)?nD(e.refs).value:WA(t)?[...t.selectedOptions].map(e=>e.value):YO(t)?QA(e.refs).value:eD(aA(t.value)?e.ref.value:t.value,e)}var aD=e=>e instanceof RegExp,sD=e=>aA(e)?e:aD(e)?e.source:XO(e)?aD(e.value)?e.value.source:e.value:e,iD=e=>({isOnSubmit:!e||e===mA,isOnBlur:e===hA,isOnChange:e===pA,isOnAll:e===vA,isOnTouch:e===gA});const oD="AsyncFunction";var lD=e=>!!e&&!!e.validate&&!!(zA(e.validate)&&e.validate.constructor.name===oD||XO(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===oD)),cD=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const uD=(e,t,n,r)=>{for(const a of n||Object.keys(e)){const n=oA(e,a);if(n){const e=n._f,s=Yc(n,WO);if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!r)return!0;if(e.ref&&t(e.ref,e.name)&&!r)return!0;
2if(uD(s,t))break}else if(XO(s)&&uD(s,t))break}}};function dD(e,t,n){const r=oA(e,n);if(r||rA(n))return{error:r,name:n};const a=n.split(".");for(;a.length;){const r=a.join("."),s=oA(t,r),i=oA(e,r);if(s&&!Array.isArray(s)&&n!==r)return{name:n};if(i&&i.type)return{name:r,error:i};if(i&&i.root&&i.root.type)return{name:"".concat(r,".root"),error:i.root};a.pop()}return{name:n}}var fD=(e,t,n)=>{const r=DA(oA(e,n));return cA(r,"root",t[n]),cA(e,n,r),e},hD=e=>IA(e);function pD(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"validate";if(hD(e)||Array.isArray(e)&&e.every(hD)||lA(e)&&!e)return{type:n,message:hD(e)?e:"",ref:t}}var mD=e=>XO(e)&&!aD(e)?e:{value:e,message:""},gD=async(e,t,n,r,a,s)=>{const i=e._f,o=i.ref,l=i.refs,c=i.required,u=i.maxLength,d=i.minLength,f=i.min,h=i.max,p=i.pattern,m=i.validate,g=i.name,v=i.valueAsNumber,x=i.mount,y=oA(n,g);if(!x||t.has(g))return{};const b=l?l[0]:o,w=e=>{a&&b.reportValidity&&(b.setCustomValidity(lA(e)?"":e||""),b.reportValidity())},_={},k=qA(o),j=YO(o),N=k||j,S=(v||HA(o))&&aA(o.value)&&aA(y)||BA(o)&&""===o.value||""===y||Array.isArray(y)&&!y.length,C=AA.bind(null,g,r,_),E=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:bA,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:wA;const s=e?t:n;_[g]=Gc({type:e?r:a,message:s,ref:o},C(e?r:a,s))};if(s?!Array.isArray(y)||!y.length:c&&(!N&&(S||ZO(y))||lA(y)&&!y||j&&!QA(l).isValid||k&&!nD(l).isValid)){const e=hD(c)?{value:!!c,message:c}:mD(c),t=e.value,n=e.message;if(t&&(_[g]=Gc({type:kA,message:n,ref:b},C(kA,n)),!r))return w(n),_}if(!S&&(!ZO(f)||!ZO(h))){let e,t;const n=mD(h),a=mD(f);if(ZO(y)||isNaN(y)){const r=o.valueAsDate||new Date(y),s=e=>new Date((new Date).toDateString()+" "+e),i="time"==o.type,l="week"==o.type;IA(n.value)&&y&&(e=i?s(y)>s(n.value):l?y>n.value:r>new Date(n.value)),IA(a.value)&&y&&(t=i?s(y)<s(a.value):l?y<a.value:r<new Date(a.value))}else{const r=o.valueAsNumber||(y?+y:y);ZO(n.value)||(e=r>n.value),ZO(a.value)||(t=r<a.value)}if((e||t)&&(E(!!e,n.message,a.message,xA,yA),!r))return w(_[g].message),_}if((u||d)&&!S&&(IA(y)||s&&Array.isArray(y))){const e=mD(u),t=mD(d),n=!ZO(e.value)&&y.length>+e.value,a=!ZO(t.value)&&y.length<+t.value;if((n||a)&&(E(n,e.message,t.message),!r))return w(_[g].message),_}if(p&&!S&&IA(y)){const e=mD(p),t=e.value,n=e.message;if(aD(t)&&!y.match(t)&&(_[g]=Gc({type:_A,message:n,ref:o},C(_A,n)),!r))return w(n),_}if(m)if(zA(m)){const e=pD(await m(y,n),b);if(e&&(_[g]=Gc(Gc({},e),C(jA,e.message)),!r))return w(e.message),_}else if(XO(m)){let e={};for(const t in m){if(!UA(e)&&!r)break;const a=pD(await m[t](y,n),b,t);a&&(e=Gc(Gc({},a),C(t,a.message)),w(a.message),r&&(_[g]=e))}if(!UA(e)&&(_[g]=Gc({ref:b},e),!r))return _}return w(!0),_};const vD={mode:mA,reValidateMode:pA,shouldFocusError:!0};function xD(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Gc(Gc({},vD),t),r={submitCount:0,isDirty:!1,isReady:!1,isLoading:zA(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},a={},s=(XO(n.defaultValues)||XO(n.values))&&nA(n.defaultValues||n.values)||{},i=n.shouldUnregister?{}:nA(s),o={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d=Gc({},u);const f={array:MA(),state:MA()},h=n.criteriaMode===vA,p=async e=>{if(!n.disabled&&(u.isValid||d.isValid||e)){const e=n.resolver?UA((await y()).errors):await b(a,!0);e!==r.isValid&&f.state.next({isValid:e})}},m=(e,t)=>{!n.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?cA(r.validatingFields,e,t):$A(r.validatingFields,e))}),f.state.next({validatingFields:r.validatingFields,isValidating:!UA(r.validatingFields)}))},g=(e,t,n,r)=>{const l=oA(a,e);if(l){const a=oA(i,e,aA(n)?oA(s,e):n);aA(a)||r&&r.defaultChecked||t?cA(i,e,t?a:rD(l._f)):k(e,a),o.mount&&p()}},v=(e,t,a,i,o)=>{let l=!1,c=!1;const h={name:e};
2if(!n.disabled){if(!a||i){(u.isDirty||d.isDirty)&&(c=r.isDirty,r.isDirty=h.isDirty=w(),l=c!==h.isDirty);const n=LA(oA(s,e),t);c=!!oA(r.dirtyFields,e),n?$A(r.dirtyFields,e):cA(r.dirtyFields,e,!0),h.dirtyFields=r.dirtyFields,l=l||(u.dirtyFields||d.dirtyFields)&&c!==!n}if(a){const t=oA(r.touchedFields,e);t||(cA(r.touchedFields,e,a),h.touchedFields=r.touchedFields,l=l||(u.touchedFields||d.touchedFields)&&t!==a)}l&&o&&f.state.next(h)}return l?h:{}},x=(t,a,s,i)=>{const o=oA(r.errors,t),l=(u.isValid||d.isValid)&&lA(a)&&r.isValid!==a;var h;if(n.delayError&&s?(h=()=>((e,t)=>{cA(r.errors,e,t),f.state.next({errors:r.errors})})(t,s),e=e=>{clearTimeout(c),c=setTimeout(h,e)},e(n.delayError)):(clearTimeout(c),e=null,s?cA(r.errors,t,s):$A(r.errors,t)),(s?!LA(o,s):o)||!UA(i)||l){const e=Gc(Gc(Gc({},i),l&&lA(a)?{isValid:a}:{}),{},{errors:r.errors,name:t});r=Gc(Gc({},r),e),f.state.next(e)}},y=async e=>{m(e,!0);const t=await n.resolver(i,n.context,((e,t,n,r)=>{const a={};for(const s of e){const e=oA(t,s);e&&cA(a,s,e._f)}return{criteriaMode:n,names:[...e],fields:a,shouldUseNativeValidation:r}})(e||l.mount,a,n.criteriaMode,n.shouldUseNativeValidation));return m(e),t},b=async function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{valid:!0};for(const s in e){const o=e[s];if(o){const e=o._f,c=Yc(o,VO);if(e){const c=l.array.has(e.name),d=o._f&&lD(o._f);d&&u.validatingFields&&m([s],!0);const f=await gD(o,l.disabled,i,h,n.shouldUseNativeValidation&&!t,c);if(d&&u.validatingFields&&m([s]),f[e.name]&&(a.valid=!1,t))break;!t&&(oA(f,e.name)?c?fD(r.errors,f,e.name):cA(r.errors,e.name,f[e.name]):$A(r.errors,e.name))}!UA(c)&&await b(c,t,a)}}return a.valid},w=(e,t)=>!n.disabled&&(e&&t&&cA(i,e,t),!LA(T(),s)),_=(e,t,n)=>PA(e,l,Gc({},o.mount?i:aA(t)?s:IA(e)?{[e]:t}:t),n,t),k=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=oA(a,e);let s=t;if(r){const n=r._f;n&&(!n.disabled&&cA(i,e,eD(t,n)),s=BA(n.ref)&&ZO(t)?"":t,WA(n.ref)?[...n.ref.options].forEach(e=>e.selected=s.includes(e.value)):n.refs?YO(n.ref)?n.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(s)?e.checked=!!s.find(t=>t===e.value):e.checked=s===e.value||!!s)}):n.refs.forEach(e=>e.checked=e.value===s):HA(n.ref)?n.ref.value="":(n.ref.value=s,n.ref.type||f.state.next({name:e,values:nA(i)})))}(n.shouldDirty||n.shouldTouch)&&v(e,s,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&E(e)},j=(e,t,n)=>{for(const r in t){if(!t.hasOwnProperty(r))return;const s=t[r],i=e+"."+r,o=oA(a,i);(l.array.has(e)||XO(s)||o&&!o._f)&&!KO(s)?j(i,s,n):k(i,s,n)}},N=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const c=oA(a,e),h=l.array.has(e),p=nA(t);cA(i,e,p),h?(f.array.next({name:e,values:nA(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&n.shouldDirty&&f.state.next({name:e,dirtyFields:ZA(s,i),isDirty:w(e,p)})):!c||c._f||ZO(p)?k(e,p,n):j(e,p,n),cD(e,l)&&f.state.next(Gc({},r)),f.state.next({name:o.mount?e:void 0,values:nA(i)})},S=async t=>{o.mount=!0;const s=t.target;let c=s.name,g=!0;const w=oA(a,c),_=e=>{g=Number.isNaN(e)||KO(e)&&isNaN(e.getTime())||LA(e,oA(i,c,e))},k=iD(n.mode),j=iD(n.reValidateMode);if(w){let o,N;const S=s.type?rD(w._f):QO(t),C=t.type===uA||t.type===dA,T=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(w._f)&&!n.resolver&&!oA(r.errors,c)&&!w._f.deps||((e,t,n,r,a)=>!a.isOnAll&&(!n&&a.isOnTouch?!(t||e):(n?r.isOnBlur:a.isOnBlur)?!e:!(n?r.isOnChange:a.isOnChange)||e))(C,oA(r.touchedFields,c),r.isSubmitted,j,k),I=cD(c,l,C);cA(i,c,S),C?(w._f.onBlur&&w._f.onBlur(t),e&&e(0)):w._f.onChange&&w._f.onChange(t);const P=v(c,S,C),R=!UA(P)||I;if(!C&&f.state.next({name:c,type:t.type,values:nA(i)}),T)return(u.isValid||d.isValid)&&("onBlur"===n.mode?C&&p():C||p()),R&&f.state.next(Gc({name:c},I?{}:P));if(!C&&I&&f.state.next(Gc({},r)),n.resolver){const e=(await y([c])).errors;if(_(S),g){const t=dD(r.errors,a,c),n=dD(e,a,t.name||c);o=n.error,c=n.name,N=UA(e)}}else m([c],!0),o=(await gD(w,l.disabled,i,h,n.shouldUseNativeValidation))[c],m([c]),_(S),g&&(o?N=!1:(u.isValid||d.isValid)&&(N=await b(a,!0)));g&&(w._f.deps&&E(w._f.deps),x(c,N,o,P))}},C=(e,t)=>{if(oA(r.errors,t)&&e.focus)return e.focus(),1},E=async function(e){let t,s,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=DA(e);if(n.resolver){const n=await(async e=>{const t=(await y(e)).errors;if(e)for(const n of e){const e=oA(t,n);e?cA(r.errors,n,e):$A(r.errors,n)}else r.errors=t;return t})(aA(e)?e:o);t=UA(n),s=e?!o.some(e=>oA(n,e)):t}else e?(s=(await Promise.all(o.map(async e=>{const t=oA(a,e);return await b(t&&t._f?{[e]:t}:t)}))).every(Boolean),(s||r.isValid)&&p()):s=t=await b(a);return f.state.next(Gc(Gc(Gc({},!IA(e)||(u.isValid||d.isValid)&&t!==r.isValid?{}:{name:e}),n.resolver||!e?{isValid:t}:{}),{},{errors:r.errors})),i.shouldFocus&&!s&&uD(a,C,e?o:l.mount),s},T=e=>{const t=Gc({},o.mount?i:s);return aA(e)?t:IA(e)?oA(t,e):e.map(e=>oA(t,e))},I=(e,t)=>({invalid:!!oA((t||r).errors,e),isDirty:!!oA((t||r).dirtyFields,e),error:oA((t||r).errors,e),isValidating:!!oA(r.validatingFields,e),isTouched:!!oA((t||r).touchedFields,e)}),P=(e,t,n)=>{const s=(oA(a,e,{_f:{}})._f||{}).ref,i=oA(r.errors,e)||{},o=(i.ref,i.message,i.type,Yc(i,$O));cA(r.errors,e,Gc(Gc(Gc({},o),t),{},{ref:s})),f.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&s&&s.focus&&s.focus()},R=e=>f.state.subscribe({next:t=>{var n,a,s;n=e.name,a=t.name,s=e.exact,n&&a&&n!==a&&!DA(n).some(e=>e&&(s?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,n,r)=>{n(e),e.name;const a=Yc(e,qO);return UA(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!r||vA))})(t,e.formState||u,H,e.reRenderRoot)||e.callback(Gc(Gc({values:Gc({},i)},r),t))}}).unsubscribe,O=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(const o of e?DA(e):l.mount)l.mount.delete(o),l.array.delete(o),t.keepValue||($A(a,o),$A(i,o)),!t.keepError&&$A(r.errors,o),!t.keepDirty&&$A(r.dirtyFields,o),!t.keepTouched&&$A(r.touchedFields,o),!t.keepIsValidating&&$A(r.validatingFields,o),!n.shouldUnregister&&!t.keepDefaultValue&&$A(s,o);f.state.next({values:nA(i)}),f.state.next(Gc(Gc({},r),t.keepDirty?{isDirty:w()}:{})),!t.keepIsValid&&p()},A=e=>{let t=e.disabled,n=e.name;(lA(t)&&o.mount||t||l.disabled.has(n))&&(t?l.disabled.add(n):l.disabled.delete(n))},D=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=oA(a,e);const i=lA(t.disabled)||lA(n.disabled);return cA(a,e,Gc(Gc({},r||{}),{},{_f:Gc(Gc({},r&&r._f?r._f:{ref:{name:e}}),{},{name:e,mount:!0},t)}
2)),l.mount.add(e),r?A({disabled:lA(t.disabled)?t.disabled:n.disabled,name:e}):g(e,!0,t.value),Gc(Gc(Gc({},i?{disabled:t.disabled||n.disabled}:{}),n.progressive?{required:!!t.required,min:sD(t.min),max:sD(t.max),minLength:sD(t.minLength),maxLength:sD(t.maxLength),pattern:sD(t.pattern)}:{}),{},{name:e,onChange:S,onBlur:S,ref:i=>{if(i){D(e,t),r=oA(a,e);const n=aA(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,o=(e=>qA(e)||YO(e))(n),l=r._f.refs||[];if(o?l.find(e=>e===n):n===r._f.ref)return;cA(a,e,{_f:Gc(Gc({},r._f),o?{refs:[...l.filter(VA),n,...Array.isArray(oA(s,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n})}),g(e,!1,void 0,n)}else r=oA(a,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!eA(l.array,e)||!o.action)&&l.unMount.add(e)}})},M=()=>n.shouldFocusError&&uD(a,C,l.mount),F=(e,t)=>async s=>{let o;s&&(s.preventDefault&&s.preventDefault(),s.persist&&s.persist());let c=nA(i);if(f.state.next({isSubmitting:!0}),n.resolver){const e=await y(),t=e.errors,n=e.values;r.errors=t,c=nA(n)}else await b(a);if(l.disabled.size)for(const e of l.disabled)$A(c,e);if($A(r.errors,"root"),UA(r.errors)){f.state.next({errors:{}});try{await e(c,s)}catch(u){o=u}}else t&&await t(Gc({},r.errors),s),M(),setTimeout(M);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:UA(r.errors)&&!o,submitCount:r.submitCount+1,errors:r.errors}),o)throw o},L=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const c=e?nA(e):s,d=nA(c),h=UA(e),p=h?s:d;if(t.keepDefaultValues||(s=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(ZA(s,i))]);for(const t of Array.from(e))oA(r.dirtyFields,t)?cA(p,t,oA(i,t)):N(t,oA(p,t))}else{if(tA&&aA(e))for(const e of l.mount){const t=oA(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(BA(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)N(e,oA(p,e));else a={}}i=n.shouldUnregister?t.keepDefaultValues?nA(s):{}:nA(p),f.array.next({values:Gc({},p)}),f.state.next({values:Gc({},p)})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,o.watch=!!n.shouldUnregister,f.state.next({submitCount:t.keepSubmitCount?r.submitCount:0,isDirty:!h&&(t.keepDirty?r.isDirty:!(!t.keepDefaultValues||LA(e,s))),isSubmitted:!!t.keepIsSubmitted&&r.isSubmitted,dirtyFields:h?{}:t.keepDirtyValues?t.keepDefaultValues&&i?ZA(s,i):r.dirtyFields:t.keepDefaultValues&&e?ZA(s,e):t.keepDirty?r.dirtyFields:{},touchedFields:t.keepTouched?r.touchedFields:{},errors:t.keepErrors?r.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1})},U=(e,t)=>L(zA(e)?e(i):e,t),H=e=>{r=Gc(Gc({},r),e)},z={control:{register:D,unregister:O,getFieldState:I,handleSubmit:F,setError:P,_subscribe:R,_runSchema:y,_focusError:M,_getWatch:_,_getDirty:w,_setValid:p,_setFieldArray:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=arguments.length>2?arguments[2]:void 0,c=arguments.length>3?arguments[3]:void 0,h=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],p=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(c&&l&&!n.disabled){if(o.action=!0,p&&Array.isArray(oA(a,e))){const t=l(oA(a,e),c.argA,c.argB);h&&cA(a,e,t)}if(p&&Array.isArray(oA(r.errors,e))){const t=l(oA(r.errors,e),c.argA,c.argB);h&&cA(r.errors,e,t),((e,t)=>{!sA(oA(e,t)).length&&$A(e,t)})(r.errors,e)}if((u.touchedFields||d.touchedFields)&&p&&Array.isArray(oA(r.touchedFields,e))){const t=l(oA(r.touchedFields,e),c.argA,c.argB);h&&cA(r.touchedFields,e,t)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=ZA(s,i)),f.state.next({name:e,isDirty:w(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else cA(i,e,t)},_setDisabledField:A,_setErrors:e=>{r.errors=e,f.state.next({errors:r.errors,isValid:!1})},_getFieldArray:e=>sA(oA(o.mount?i:s,e,n.shouldUnregister?oA(s,e,[]):[])),_reset:L,_resetDefaultValues:()=>zA(n.defaultValues)&&n.defaultValues().then(e=>{U(e,n.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=oA(a,e);t&&(t._f.refs?t._f.refs.every(e=>!VA(e)):!VA(t._f.ref))&&O(e)}l.unMount=new Set},_disableForm:e=>{lA(e)&&(f.state.next({disabled:e}),uD(a,(t,n)=>{const r=oA(a,n);r&&(t.disabled=r._f.disabled||e,Array.isArray(r._f.refs)&&r._f.refs.forEac
2h(t=>{t.disabled=r._f.disabled||e}))},0,!1))},_subjects:f,_proxyFormState:u,get _fields(){return a},get _formValues(){return i},get _state(){return o},set _state(e){o=e},get _defaultValues(){return s},get _names(){return l},set _names(e){l=e},get _formState(){return r},get _options(){return n},set _options(e){n=Gc(Gc({},n),e)}},subscribe:e=>(o.mount=!0,d=Gc(Gc({},d),e.formState),R(Gc(Gc({},e),{},{formState:d}))),trigger:E,register:D,handleSubmit:F,watch:(e,t)=>zA(e)?f.state.subscribe({next:n=>e(_(void 0,t),n)}):_(e,t,!0),setValue:N,getValues:T,reset:U,resetField:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oA(a,e)&&(aA(t.defaultValue)?N(e,nA(oA(s,e))):(N(e,t.defaultValue),cA(s,e,nA(t.defaultValue))),t.keepTouched||$A(r.touchedFields,e),t.keepDirty||($A(r.dirtyFields,e),r.isDirty=t.defaultValue?w(e,nA(oA(s,e))):w()),t.keepError||($A(r.errors,e),u.isValid&&p()),f.state.next(Gc({},r)))},clearErrors:e=>{e&&DA(e).forEach(e=>$A(r.errors,e)),f.state.next({errors:e?r.errors:{}})},unregister:O,setError:P,setFocus:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=oA(a,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&zA(e.select)&&e.select())}},getFieldState:I};return Gc(Gc({},z),{},{formControl:z})}function yD(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.useRef(void 0),r=e.useRef(void 0),a=l(e.useState({isDirty:!1,isValidating:!1,isLoading:zA(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:zA(t.defaultValues)?void 0:t.defaultValues}),2),s=a[0],i=a[1];if(!n.current)if(t.formControl)n.current=Gc(Gc({},t.formControl),{},{formState:s}),t.defaultValues&&!zA(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const e=xD(t),r=(e.formControl,Yc(e,GO));n.current=Gc(Gc({},r),{},{formState:s})}const o=n.current.control;return o._options=t,EA(()=>{const e=o._subscribe({formState:o._proxyFormState,callback:()=>i(Gc({},o._formState)),reRenderRoot:!0});return i(e=>Gc(Gc({},e),{},{isReady:!0})),o._formState.isReady=!0,e},[o]),e.useEffect(()=>o._disableForm(t.disabled),[o,t.disabled]),e.useEffect(()=>{t.mode&&(o._options.mode=t.mode),t.reValidateMode&&(o._options.reValidateMode=t.reValidateMode)},[o,t.mode,t.reValidateMode]),e.useEffect(()=>{t.errors&&(o._setErrors(t.errors),o._focusError())},[o,t.errors]),e.useEffect(()=>{t.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,t.shouldUnregister]),e.useEffect(()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();e!==s.isDirty&&o._subjects.state.next({isDirty:e})}},[o,s.isDirty]),e.useEffect(()=>{t.values&&!LA(t.values,r.current)?(o._reset(t.values,Gc({keepFieldsRef:!0},o._options.resetOptions)),r.current=t.values,i(e=>Gc({},e))):o._resetDefaultValues()},[o,t.values]),e.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next(Gc({},o._formState))),o._removeUnmounted()}),n.current.formState=CA(s,o),n.current}const bD=(e,t,n)=>{if(e&&"reportValidity"in e){const r=oA(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},wD=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?bD(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>bD(t,n,e))}},_D=(e,t)=>{t.shouldUseNativeValidation&&wD(e,t);const n={};for(const r in e){const a=oA(t.fields,r),s=Object.assign(e[r]||{},{ref:a&&a.ref});if(kD(t.names||Object.keys(e),r)){const e=Object.assign({},oA(n,r));cA(e,"root",s),cA(n,r,e)}else cA(n,r,s)}return n},kD=(e,t)=>{const n=jD(t);return e.some(e=>jD(e).match("^".concat(n,"\\.\\d+")))};function jD(e){return e.replace(/\]|\[/g,"")}Object.freeze({status:"aborted"});function ND(e,t,n){var r;function a(n,r){var a,s,i;Object.defineProperty(n,"_zod",{value:null!==(a=n._zod)&&void 0!==a?a:{},enumerable:!1}),null!==(s=(i=n._zod).traits)&&void 0!==s||(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(const e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}const s=null!==(r=null===n||void 0===n?void 0:n.Parent)&&void 0!==r?r:Object;class i extends s{}function o(e){var t,r;const s=null!==n&&void 0!==n&&n.Parent?new i:this;a(s,e),null!==(t=(r=s._zod).deferred)&&void 0!==t||(r.deferred=[]);for(const n of s._zod.deferred)n();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(o,"init",{value:a}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>{var r;return!!(null!==n&&void 0!==n&&n.Parent&&t instanceof n.Parent)||(null===t||void 0===t||null===(r=t._zod)||void 0===r||null===(r=r.traits)||void 0===r?void 0:r.has(e))}}),Object.defineProperty(o,"name",{value:e}),o}Symbol("zod_brand");
2class SD extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const CD={};function ED(e){return e&&Object.assign(CD,e),CD}function TD(e,t){return"bigint"===typeof t?t.toString():t}const ID=Error.captureStackTrace?Error.captureStackTrace:function(){};PD=()=>{var e;if("undefined"!==typeof navigator&&null!==(e=navigator)&&void 0!==e&&null!==(e=e.userAgent)&&void 0!==e&&e.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(S){return!1}};var PD;new Set(["string","number","symbol"]),new Set(["string","number","bigint","boolean","symbol","undefined"]);Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MAX_VALUE,Number.MAX_VALUE;function RD(e){return"string"===typeof e?e:null===e||void 0===e?void 0:e.message}function OD(e,t,n){var r;const a=Gc(Gc({},e),{},{path:null!==(r=e.path)&&void 0!==r?r:[]});if(!e.message){var s,i,o,l,c,u,d,f,h;const r=null!==(s=null!==(i=null!==(o=null!==(l=RD(null===(c=e.inst)||void 0===c||null===(c=c._zod.def)||void 0===c||null===(u=c.error)||void 0===u?void 0:u.call(c,e)))&&void 0!==l?l:RD(null===t||void 0===t||null===(d=t.error)||void 0===d?void 0:d.call(t,e)))&&void 0!==o?o:RD(null===(f=n.customError)||void 0===f?void 0:f.call(n,e)))&&void 0!==i?i:RD(null===(h=n.localeError)||void 0===h?void 0:h.call(n,e)))&&void 0!==s?s:"Invalid input";a.message=r}return delete a.inst,delete a.continue,null!==t&&void 0!==t&&t.reportInput||delete a.input,a}const AD=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,TD,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},DD=ND("$ZodError",AD),MD=ND("$ZodError",AD,{Parent:Error});const FD=e=>(t,n,r,a)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new SD;if(i.issues.length){var o;const t=new(null!==(o=null===a||void 0===a?void 0:a.Err)&&void 0!==o?o:e)(i.issues.map(e=>OD(e,s,ED())));throw ID(t,null===a||void 0===a?void 0:a.callee),t}return i.value},LD=FD(MD),UD=e=>async(t,n,r,a)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){var o;const t=new(null!==(o=null===a||void 0===a?void 0:a.Err)&&void 0!==o?o:e)(i.issues.map(e=>OD(e,s,ED())));throw ID(t,null===a||void 0===a?void 0:a.callee),t}return i.value},HD=UD(MD);function zD(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function BD(e,t){for(var n={};e.length;){var r=e[0],a=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var o=r.unionErrors[0].errors[0];n[i]={message:o.message,type:o.code}}else n[i]={message:s,type:a};if("unionErrors"in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=n[i].types,c=l&&l[r.code];n[i]=AA(i,t,n,a,c?[].concat(c,r.message):r.message)}e.shift()}return n}function WD(e,t){for(var n={};e.length;){var r=e[0],a=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("invalid_union"===r.code){var o=r.errors[0][0];n[i]={message:o.message,type:o.code}}else n[i]={message:s,type:a};if("invalid_union"===r.code&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var l=n[i].types,c=l&&l[r.code];n[i]=AA(i,t,n,a,c?[].concat(c,r.message):r.message)}e.shift()}return n}function qD(e,t,n){if(void 0===n&&(n={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(r,a,s){try{return Promise.resolve(zD(function(){return Promise.resolve(e["sync"===n.mode?"parse":"parseAsync"](r,t)).then(function(e){return s.shouldUseNativeValidation&&wD({},s),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:_D(BD(e.errors,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(f){return Promise.reject(f)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(r,a,s){try{return Promise.resolve(zD(function(){return Promise.resolve(("sync"===n.mode?LD:HD)(e,r,t)).then(function(e){return s.shouldUseNativeValidation&&wD({},s),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof DD}(e))return{values:{},errors:_D(WD(e.issues,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(f){return Promise.reject(f)}};throw new Error("Invalid input: not a Zod schema")}var VD,$D;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter(e=>
2"number"!==typeof t[t[e]]),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"===typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"===typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"===typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" | ";return e.map(e=>"string"===typeof e?"'".concat(e,"'"):e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"===typeof t?t.toString():t}(VD||(VD={})),function(e){e.mergeShapes=(e,t)=>Gc(Gc({},e),t)}($D||($D={}));const GD=VD.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),YD=e=>{switch(typeof e){case"undefined":return GD.undefined;case"string":return GD.string;case"number":return Number.isNaN(e)?GD.nan:GD.number;case"boolean":return GD.boolean;case"function":return GD.function;case"bigint":return GD.bigint;case"symbol":return GD.symbol;case"object":return Array.isArray(e)?GD.array:null===e?GD.null:e.then&&"function"===typeof e.then&&e.catch&&"function"===typeof e.catch?GD.promise:"undefined"!==typeof Map&&e instanceof Map?GD.map:"undefined"!==typeof Set&&e instanceof Set?GD.set:"undefined"!==typeof Date&&e instanceof Date?GD.date:GD.object;default:return GD.unknown}}
2,KD=VD.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 ZD extends Error{get errors(){return this.issues}constructor(e){var t;super(),t=this,this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.issues=[...t.issues,...e]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof ZD))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,VD.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>e.message;const t={},n=[];for(const r of this.issues)if(r.path.length>0){const n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}ZD.create=e=>new ZD(e);const JD=(e,t)=>{let n;switch(e.code){case KD.invalid_type:n=e.received===GD.undefined?"Required":"Expected ".concat(e.expected,", received ").concat(e.received);break;case KD.invalid_literal:n="Invalid literal value, expected ".concat(JSON.stringify(e.expected,VD.jsonStringifyReplacer));break;case KD.unrecognized_keys:n="Unrecognized key(s) in object: ".concat(VD.joinValues(e.keys,", "));break;case KD.invalid_union:n="Invalid input";break;case KD.invalid_union_discriminator:n="Invalid discriminator value. Expected ".concat(VD.joinValues(e.options));break;case KD.invalid_enum_value:n="Invalid enum value. Expected ".concat(VD.joinValues(e.options),", received '").concat(e.received,"'");break;case KD.invalid_arguments:n="Invalid function arguments";break;case KD.invalid_return_type:n="Invalid function return type";break;case KD.invalid_date:n="Invalid date";break;case KD.invalid_string:"object"===typeof e.validation?"includes"in e.validation?(n='Invalid input: must include "'.concat(e.validation.includes,'"'),"number"===typeof e.validation.position&&(n="".concat(n," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?n='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?n='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):VD.assertNever(e.validation):n="regex"!==e.validation?"Invalid ".concat(e.validation):"Invalid";break;case KD.too_small:n="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):"number"===e.type||"bigint"===e.type?"Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):"date"===e.type?"Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):"Invalid input";break;case KD.too_big:n="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):"number"===e.type?"Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"bigint"===e.type?"BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"date"===e.type?"Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):"Invalid input";break;case KD.custom:n="Invalid input";break;case KD.invalid_intersection_types:n="Intersection results could not be merged";break;case KD.not_multiple_of:n="Number must be a multiple of ".concat(e.multipleOf);break;case KD.not_finite:n="Number must be finite";break;default:n=t.defaultError,VD.assertNever(e)}return{message:n}};let XD=JD;
2function QD(){return XD}var eM;!function(e){e.errToObj=e=>"string"===typeof e?{message:e}:e||{},e.toString=e=>"string"===typeof e?e:null===e||void 0===e?void 0:e.message}(eM||(eM={}));const tM=e=>{const t=e.data,n=e.path,r=e.errorMaps,a=e.issueData,s=[...n,...a.path||[]],i=Gc(Gc({},a),{},{path:s});if(void 0!==a.message)return Gc(Gc({},a),{},{path:s,message:a.message});let o="";const l=r.filter(e=>!!e).slice().reverse();for(const c of l)o=c(i,{data:t,defaultError:o}).message;return Gc(Gc({},a),{},{path:s,message:o})};function nM(e,t){const n=QD(),r=tM({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===JD?void 0:JD].filter(e=>!!e)});e.common.issues.push(r)}class rM{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return aM;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const e=await r.key,t=await r.value;n.push({key:e,value:t})}return rM.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const t=r.key,a=r.value;if("aborted"===t.status)return aM;if("aborted"===a.status)return aM;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||"undefined"===typeof a.value&&!r.alwaysSet||(n[t.value]=a.value)}return{status:e.value,value:n}}}const aM=Object.freeze({status:"aborted"}),sM=e=>({status:"dirty",value:e}),iM=e=>({status:"valid",value:e}),oM=e=>"aborted"===e.status,lM=e=>"dirty"===e.status,cM=e=>"valid"===e.status,uM=e=>"undefined"!==typeof Promise&&e instanceof Promise;class dM{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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 fM=(e,t)=>{if(cM(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 t=new ZD(e.common.issues);return this._error=t,this._error}}};function hM(e){if(!e)return{};const t=e.errorMap,n=e.invalid_type_error,r=e.required_error,a=e.description;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(t,a)=>{var s;const i=e.message;return"invalid_enum_value"===t.code?{message:null!==i&&void 0!==i?i:a.defaultError}:"undefined"===typeof a.data?{message:null!==(o=null!==i&&void 0!==i?i:r)&&void 0!==o?o:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(s=null!==i&&void 0!==i?i:n)&&void 0!==s?s:a.defaultError};var o},description:a}}class pM{get description(){return this._def.description}_getType(e){return YD(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:YD(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new rM,ctx:{common:e.parent.common,data:e.data,parsedType:YD(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(uM(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null===t||void 0===t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null===t||void 0===t?void 0:t.errorMap},path:(null===t||void 0===t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:YD(e)},a=this._parseSync({data:e,path:r.path,parent:r});return fM(r,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:YD(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return cM(n)?{value:n.value}:{issues:t.common.issues}}catch(XF){var n;null!==XF&&void 0!==XF&&null!==(n=XF.message)&&void 0!==n&&null!==(n=n.toLowerCase())&&void 0!==n&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>cM(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null===t||void 0===t?void 0:t.errorMap,async:!0},path:(null===t||void 0===t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:YD(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(uM(r)?r:Promise.resolve(r));return fM(n,a)}refine(e,t){return this._refinement((n,r)=>{const a=e(n),s=()=>r.addIssue(Gc({code:KD.custom},(e=>"string"===typeof t||"undefined"===typeof t?{message:t}:"function"===typeof t?t(e):t)(n)));return"undefined"!==typeof Promise&&a instanceof Promise?a.then(e=>!!e||(s(),!1)):!!a||(s(),!1)})}refinement(e,t){return this._refinement((n,r)=>!!e(n)||(r.addIssue("function"===typeof t?t(n,r):t),!1))}_refinement(e){return new fF({schema:this,typeName:wF.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return hF.create(this,this._def)}nullable(){return pF.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return JM.create(this)}promise(){return dF.create(this,this._def)}or(e){return eF.create([this,e],this._def)}and(e){return nF.create(this,e,this._def)}transform(e){return new fF(Gc(Gc({},hM(this._def)),{},{schema:this,typeName:wF.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){const t="function"===typeof e?e:()=>e;return new mF(Gc(Gc({},hM(this._def)),{},{innerType:this,defaultValue:t,typeName:wF.ZodDefault}))}brand(){return new xF(Gc({typeName:wF.ZodBranded,type:this},hM(this._def)))}catch(e){const t="function"===typeof e?e:()=>e;return new gF(Gc(Gc({},hM(this._def)),{},{innerType:this,catchValue:t,typeName:wF.ZodCatch}))}describe(e){return new(0,this.constructor)(Gc(Gc({},this._def),{},{description:e}))}pipe(e){return yF.create(this,e)}readonly(){return bF.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mM=/^c[^\s-]{8,}
2$/i,gM=/^[0-9a-z]+$/,vM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,xM=/^[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,yM=/^[a-z0-9_-]{21}$/i,bM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,wM=/^[-+]?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)?)??$/,_M=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let kM;const jM=/^(?:(?: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])$/,NM=/^(?:(?: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])$/,SM=/^(([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]))$/,CM=/^(([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])$/,EM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,TM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,IM="((\\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])))",PM=new RegExp("^".concat(IM,"$"));function RM(e){let t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):null==e.precision&&(t="".concat(t,"(\\.\\d+)?"));const n=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(n)}function OM(e){return new RegExp("^".concat(RM(e),"$"))}function AM(e){let t="".concat(IM,"T").concat(RM(e));const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(n.join("|"),")"),new RegExp("^".concat(t,"$"))}function DM(e,t){return!("v4"!==t&&t||!jM.test(e))||!("v6"!==t&&t||!SM.test(e))}function MM(e,t){if(!bM.test(e))return!1;try{const n=e.split("."),r=l(n,1)[0];if(!r)return!1;const a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(a));return"object"===typeof s&&null!==s&&((!("typ"in s)||"JWT"===(null===s||void 0===s?void 0:s.typ))&&(!!s.alg&&(!t||s.alg===t)))}catch(n){return!1}}function FM(e,t){return!("v4"!==t&&t||!NM.test(e))||!("v6"!==t&&t||!CM.test(e))}class LM extends pM{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==GD.string){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.string,received:t.parsedType}),aM}const t=new rM;let n;for(const a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),nM(n,{code:KD.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("max"===a.kind)e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),nM(n,{code:KD.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){const r=e.data.length>a.value,s=e.data.length<a.value;(r||s)&&(n=this._getOrReturnCtx(e,n),r?nM(n,{code:KD.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&nM(n,{code:KD.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)_M.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"email",code:KD.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)kM||(kM=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),kM.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"emoji",code:KD.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)xM.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"uuid",code:KD.invalid_string,message:a.message}),t.dirty());else if("nanoid"===a.kind)yM.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"nanoid",code:KD.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)mM.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"cuid",code:KD.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)gM.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"cuid2",code:KD.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)vM.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"ulid",code:KD.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),nM(n,{validation:"url",code:KD.invalid_string,message:a.message}),t.dirty()}else if("regex"===a.kind){a.regex.lastIndex=0;a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"regex",code:KD.invalid_string,message:a.message}),t.dirty())}else if("trim"===a.kind)e.data=e.data.trim();else if("includes"===a.kind)e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),nM(n,{code:KD.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),t.dirty());else if("toLowerCase"===a.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===a.kind)e.data=e.data.toUpperCase();else if("startsWith"===a.kind)e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),nM(n,{code:KD.invalid_string,validation:{startsWith:a.value},message:a.message}),t.dirty());else if("endsWith"===a.kind)e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),nM(n,{code:KD.invalid_string,validation:{endsWith:a.value},message:a.message}),t.dirty());else if("datetime"===a.kind){AM(a).test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{code:KD.invalid_string,validation:"datetime",message:a.message}),t.dirty())}else if("date"===a.kind){PM.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{code:KD.invalid_string,validation:"date",message:a.message}),t.dirty())}else if("time"===a.kind){OM(a).test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{code:KD.invalid_string,validation:"time",message:a.message}),t.dirty())}else"duration"===a.kind?wM.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"duration",code:KD.invalid_string,message:a.message}),t.dirty()):"ip"===a.kind?DM(e.data,a.version)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"ip",code:KD.invalid_string,message:a.message}),t.dirty()):"jwt"===a.kind?MM(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"jwt",code:KD.invalid_string,message:a.message}),t.dirty()):"cidr"===a.kind?FM(e.data,a.version)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"cidr",code:KD.invalid_string,message:a.message}),t.dirty()):"base64"===a.kind?EM.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"base64",code:KD.invalid_string,message:a.message}),t.dirty()):"base64url"===a.kind?TM.test(e.data)||(n=this._getOrReturnCtx(e,n),nM(n,{validation:"base64url",code:KD.invalid_string,message:a.message}),t.dirty()):VD.assertNever(a);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),Gc({validation:t,code:KD.invalid_string},eM.errToObj(n)))}_addCheck(e){return new LM(Gc(Gc({},this._def),{},{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(Gc({kind:"email"},eM.errToObj(e)))}url(e){return this._addCheck(Gc({kind:"url"},eM.errToObj(e)))}emoji(e){return this._addCheck(Gc({kind:"emoji"},eM.errToObj(e)))}uuid(e){return this._addCheck(Gc({kind:"uuid"},eM.errToObj(e)))}nanoid(e){return this._addCheck(Gc({kind:"nanoid"},eM.errToObj(e)))}cuid(e){return this._addCheck(Gc({kind:"cuid"},eM.errToObj(e)))}cuid2(e){return this._addCheck(Gc({kind:"cuid2"},eM.errToObj(e)))}ulid(e){return this._addCheck(Gc({kind:"ulid"},eM.errToObj(e)))}base64(e){return this._addCheck(Gc({kind:"base64"},eM.errToObj(e)))}base64url(e){return this._addCheck(Gc({kind:"base64url"},eM.errToObj(e)))}jwt(e){return this._addCheck(Gc({kind:"jwt"},eM.errToObj(e)))}ip(e){return this._addCheck(Gc({kind:"ip"},eM.errToObj(e)))}cidr(e){return this._addCheck(Gc({kind:"cidr"},eM.errToObj(e)))}datetime(e){var t,n;return"string"===typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(Gc({kind:"datetime",precision:"undefined"===typeof(null===e||void 0===e?void 0:e.precision)?null:null===e||void 0===e?void 0:e.precision,offset:null!==(t=null===e||void 0===e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null===e||void 0===e?void 0:e.local)&&void 0!==n&&n},eM.errToObj(null===e||void 0===e?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"===typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(Gc({kind:"time",precision:"undefined"===typeof(null===e||void 0===e?void 0:e.precision)?null:null===e||void 0===e?void 0:e.precision},eM.errToObj(null===e||void 0===e?void 0:e.message)))}duration(e){return this._addCheck(Gc({kind:"duration"},eM.errToObj(e)))}regex(e,t){return this._addCheck(Gc({kind:"regex",regex:e},eM.errToObj(t)))}includes(e,t){return this._addCheck(Gc({kind:"includes",value:e,position:null===t||void 0===t?void 0:t.position},eM.errToObj(null===t||void 0===t?void 0:t.message)))}startsWith(e,t){return this._addCheck(Gc({kind:"startsWith",value:e},eM.errToObj(t)))}endsWith(e,t){return this._addCheck(Gc({kind:"endsWith",value:e},eM.errToObj(t)))}min(e,t){return this._addCheck(Gc({kind:"min",value:e},eM.errToObj(t)))}max(e,t){return this._addCheck(Gc({kind:"max",value:e},eM.errToObj(t)))}length(e,t){return this._addCheck(Gc({kind:"length",value:e},eM.errToObj(t)))}nonempty(e){return this.min(1,eM.errToObj(e))}trim(){return new LM(Gc(Gc({},this._def),{},{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new LM(Gc(Gc({},this._def),{},{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new LM(Gc(Gc({},this._def),{},{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}
2get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function UM(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}LM.create=e=>{var t;return new LM(Gc({checks:[],typeName:wF.ZodString,coerce:null!==(t=null===e||void 0===e?void 0:e.coerce)&&void 0!==t&&t},hM(e)))};class HM extends pM{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==GD.number){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.number,received:t.parsedType}),aM}let t;const n=new rM;for(const r of this._def.checks)if("int"===r.kind)VD.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),nM(t,{code:KD.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),nM(t,{code:KD.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),nM(t,{code:KD.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==UM(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),nM(t,{code:KD.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),nM(t,{code:KD.not_finite,message:r.message}),n.dirty()):VD.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,eM.toString(t))}gt(e,t){return this.setLimit("min",e,!1,eM.toString(t))}lte(e,t){return this.setLimit("max",e,!0,eM.toString(t))}lt(e,t){return this.setLimit("max",e,!1,eM.toString(t))}setLimit(e,t,n,r){return new HM(Gc(Gc({},this._def),{},{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:eM.toString(r)}]}))}_addCheck(e){return new HM(Gc(Gc({},this._def),{},{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:eM.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:eM.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:eM.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:eM.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:eM.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:eM.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:eM.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:eM.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:eM.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&VD.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}HM.create=e=>new HM(Gc({checks:[],typeName:wF.ZodNumber,coerce:(null===e||void 0===e?void 0:e.coerce)||!1},hM(e)));class zM extends pM{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(r){return this._getInvalidInput(e)}if(this._getType(e)!==GD.bigint)return this._getInvalidInput(e);let t;const n=new rM;for(const a of this._def.checks)if("min"===a.kind){(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),nM(t,{code:KD.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty())}else if("max"===a.kind){(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),nM(t,{code:KD.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty())}else"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),nM(t,{code:KD.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):VD.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.bigint,received:t.parsedType}),aM}gte(e,t){return this.setLimit("min",e,!0,eM.toString(t))}gt(e,t){return this.setLimit("min",e,!1,eM.toString(t))}lte(e,t){return this.setLimit("max",e,!0,eM.toString(t))}lt(e,t){return this.setLimit("max",e,!1,eM.toString(t))}setLimit(e,t,n,r){return new zM(Gc(Gc({},this._def),{},{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:eM.toString(r)}]}))}_addCheck(e){return new zM(Gc(Gc({},this._def),{},{checks:[...this._def.checks,e]}))}
2positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:eM.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:eM.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:eM.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:eM.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:eM.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}zM.create=e=>{var t;return new zM(Gc({checks:[],typeName:wF.ZodBigInt,coerce:null!==(t=null===e||void 0===e?void 0:e.coerce)&&void 0!==t&&t},hM(e)))};class BM extends pM{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==GD.boolean){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.boolean,received:t.parsedType}),aM}return iM(e.data)}}BM.create=e=>new BM(Gc({typeName:wF.ZodBoolean,coerce:(null===e||void 0===e?void 0:e.coerce)||!1},hM(e)));class WM extends pM{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==GD.date){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.date,received:t.parsedType}),aM}if(Number.isNaN(e.data.getTime())){return nM(this._getOrReturnCtx(e),{code:KD.invalid_date}),aM}const t=new rM;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),nM(n,{code:KD.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),nM(n,{code:KD.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):VD.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new WM(Gc(Gc({},this._def),{},{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:eM.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:eM.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}WM.create=e=>new WM(Gc({checks:[],coerce:(null===e||void 0===e?void 0:e.coerce)||!1,typeName:wF.ZodDate},hM(e)));class qM extends pM{_parse(e){if(this._getType(e)!==GD.symbol){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.symbol,received:t.parsedType}),aM}return iM(e.data)}}qM.create=e=>new qM(Gc({typeName:wF.ZodSymbol},hM(e)));class VM extends pM{_parse(e){if(this._getType(e)!==GD.undefined){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.undefined,received:t.parsedType}),aM}return iM(e.data)}}VM.create=e=>new VM(Gc({typeName:wF.ZodUndefined},hM(e)));class $M extends pM{_parse(e){if(this._getType(e)!==GD.null){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.null,received:t.parsedType}),aM}return iM(e.data)}}$M.create=e=>new $M(Gc({typeName:wF.ZodNull},hM(e)));class GM extends pM{constructor(){super(...arguments),this._any=!0}_parse(e){return iM(e.data)}}GM.create=e=>new GM(Gc({typeName:wF.ZodAny},hM(e)));class YM extends pM{constructor(){super(...arguments),this._unknown=!0}_parse(e){return iM(e.data)}}YM.create=e=>new YM(Gc({typeName:wF.ZodUnknown},hM(e)));class KM extends pM{_parse(e){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.never,received:t.parsedType}),aM}}KM.create=e=>new KM(Gc({typeName:wF.ZodNever},hM(e)));class ZM extends pM{_parse(e){if(this._getType(e)!==GD.undefined){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.void,received:t.parsedType}),aM}return iM(e.data)}}ZM.create=e=>new ZM(Gc({typeName:wF.ZodVoid},hM(e)));class JM extends pM{_parse(e){const t=this._processInputParams(e),n=t.ctx,r=t.status,a=this._def;if(n.parsedType!==GD.array)return nM(n,{code:KD.invalid_type,expected:GD.array,received:n.parsedType}),aM;if(null!==a.exactLength){const e=n.data.length>a.exactLength.value,t=n.data.length<a.exactLength.value;(e||t)&&(nM(n,{code:e?KD.too_big:KD.too_small,minimum:t?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&n.data.length<a.minLength.value&&(nM(n,{code:KD.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&n.data.length>a.maxLength.value&&(nM(n,{code:KD.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((e,t)=>a.type._parseAsync(new dM(n,e,n.path,t)))).then(e=>rM.mergeArray(r,e));const s=[...n.data].map((e,t)=>a.type._parseSync(new dM(n,e,n.path,t)));return rM.mergeArray(r,s)}
2get element(){return this._def.type}min(e,t){return new JM(Gc(Gc({},this._def),{},{minLength:{value:e,message:eM.toString(t)}}))}max(e,t){return new JM(Gc(Gc({},this._def),{},{maxLength:{value:e,message:eM.toString(t)}}))}length(e,t){return new JM(Gc(Gc({},this._def),{},{exactLength:{value:e,message:eM.toString(t)}}))}nonempty(e){return this.min(1,e)}}function XM(e){if(e instanceof QM){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=hF.create(XM(r))}return new QM(Gc(Gc({},e._def),{},{shape:()=>t}))}return e instanceof JM?new JM(Gc(Gc({},e._def),{},{type:XM(e.element)})):e instanceof hF?hF.create(XM(e.unwrap())):e instanceof pF?pF.create(XM(e.unwrap())):e instanceof rF?rF.create(e.items.map(e=>XM(e))):e}JM.create=(e,t)=>new JM(Gc({type:e,minLength:null,maxLength:null,exactLength:null,typeName:wF.ZodArray},hM(t)));class QM extends pM{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=VD.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==GD.object){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.object,received:t.parsedType}),aM}const t=this._processInputParams(e),n=t.status,r=t.ctx,a=this._getCached(),s=a.shape,i=a.keys,o=[];if(!(this._def.catchall instanceof KM&&"strip"===this._def.unknownKeys))for(const c in r.data)i.includes(c)||o.push(c);const l=[];for(const c of i){const e=s[c],t=r.data[c];l.push({key:{status:"valid",value:c},value:e._parse(new dM(r,t,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof KM){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of o)l.push({key:{status:"valid",value:t},value:{status:"valid",value:r.data[t]}});else if("strict"===e)o.length>0&&(nM(r,{code:KD.unrecognized_keys,keys:o}),n.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const n=r.data[t];l.push({key:{status:"valid",value:t},value:e._parse(new dM(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of l){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>rM.mergeObjectSync(n,e)):rM.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return eM.errToObj,new QM(Gc(Gc({},this._def),{},{unknownKeys:"strict"},void 0!==e?{errorMap:(t,n)=>{var r,a,s,i;const o=null!==(r=null===(a=(s=this._def).errorMap)||void 0===a?void 0:a.call(s,t,n).message)&&void 0!==r?r:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=eM.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}))}strip(){return new QM(Gc(Gc({},this._def),{},{unknownKeys:"strip"}))}passthrough(){return new QM(Gc(Gc({},this._def),{},{unknownKeys:"passthrough"}))}extend(e){return new QM(Gc(Gc({},this._def),{},{shape:()=>Gc(Gc({},this._def.shape()),e)}))}merge(e){return new QM({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Gc(Gc({},this._def.shape()),e._def.shape()),typeName:wF.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new QM(Gc(Gc({},this._def),{},{catchall:e}))}pick(e){const t={};for(const n of VD.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new QM(Gc(Gc({},this._def),{},{shape:()=>t}))}omit(e){const t={};for(const n of VD.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new QM(Gc(Gc({},this._def),{},{shape:()=>t}))}deepPartial(){return XM(this)}partial(e){const t={};for(const n of VD.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new QM(Gc(Gc({},this._def),{},{shape:()=>t}))}required(e){const t={};for(const n of VD.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof hF;)e=e._def.innerType;t[n]=e}return new QM(Gc(Gc({},this._def),{},{shape:()=>t}))}keyof(){return lF(VD.objectKeys(this.shape))}}QM.create=(e,t)=>new QM(Gc({shape:()=>e,unknownKeys:"strip",catchall:KM.create(),typeName:wF.ZodObject},hM(t))),QM.strictCreate=(e,t)=>
2new QM(Gc({shape:()=>e,unknownKeys:"strict",catchall:KM.create(),typeName:wF.ZodObject},hM(t))),QM.lazycreate=(e,t)=>new QM(Gc({shape:e,unknownKeys:"strip",catchall:KM.create(),typeName:wF.ZodObject},hM(t)));class eF extends pM{_parse(e){const t=this._processInputParams(e).ctx,n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{const n=Gc(Gc({},t),{},{common:Gc(Gc({},t.common),{},{issues:[]}),parent:null});return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const n=e.map(e=>new ZD(e.ctx.common.issues));return nM(t,{code:KD.invalid_union,unionErrors:n}),aM});{let e;const r=[];for(const s of n){const n=Gc(Gc({},t),{},{common:Gc(Gc({},t.common),{},{issues:[]}),parent:null}),a=s._parseSync({data:t.data,path:t.path,parent:n});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=r.map(e=>new ZD(e));return nM(t,{code:KD.invalid_union,unionErrors:a}),aM}}get options(){return this._def.options}}eF.create=(e,t)=>new eF(Gc({options:e,typeName:wF.ZodUnion},hM(t)));function tF(e,t){const n=YD(e),r=YD(t);if(e===t)return{valid:!0,data:e};if(n===GD.object&&r===GD.object){const n=VD.objectKeys(t),r=VD.objectKeys(e).filter(e=>-1!==n.indexOf(e)),a=Gc(Gc({},e),t);for(const s of r){const n=tF(e[s],t[s]);if(!n.valid)return{valid:!1};a[s]=n.data}return{valid:!0,data:a}}if(n===GD.array&&r===GD.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const a=tF(e[r],t[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return n===GD.date&&r===GD.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class nF extends pM{_parse(e){const t=this._processInputParams(e),n=t.status,r=t.ctx,a=(e,t)=>{if(oM(e)||oM(t))return aM;const a=tF(e.value,t.value);return a.valid?((lM(e)||lM(t))&&n.dirty(),{status:n.value,value:a.data}):(nM(r,{code:KD.invalid_intersection_types}),aM)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(e=>{let t=l(e,2),n=t[0],r=t[1];return a(n,r)}):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}nF.create=(e,t,n)=>new nF(Gc({left:e,right:t,typeName:wF.ZodIntersection},hM(n)));class rF extends pM{_parse(e){const t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==GD.array)return nM(r,{code:KD.invalid_type,expected:GD.array,received:r.parsedType}),aM;if(r.data.length<this._def.items.length)return nM(r,{code:KD.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),aM;!this._def.rest&&r.data.length>this._def.items.length&&(nM(r,{code:KD.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new dM(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(a).then(e=>rM.mergeArray(n,e)):rM.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new rF(Gc(Gc({},this._def),{},{rest:e}))}}rF.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new rF(Gc({items:e,typeName:wF.ZodTuple,rest:null},hM(t)))};class aF extends pM{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==GD.map)return nM(r,{code:KD.invalid_type,expected:GD.map,received:r.parsedType}),aM;const a=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map((e,t)=>{let n=l(e,2),i=n[0],o=n[1];return{key:a._parse(new dM(r,i,r.path,[t,"key"])),value:s._parse(new dM(r,o,r.path,[t,"value"]))}});if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const t of i){const r=await t.key,a=await t.value;if("aborted"===r.status||"aborted"===a.status)return aM;"dirty"!==r.status&&"dirty"!==a.status||n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}})}{const e=new Map;for(const t of i){const r=t.key,a=t.value;if("aborted"===r.status||"aborted"===a.status)return aM;"dirty"!==r.status&&"dirty"!==a.status||n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}}}}
2aF.create=(e,t,n)=>new aF(Gc({valueType:t,keyType:e,typeName:wF.ZodMap},hM(n)));class sF extends pM{_parse(e){const t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==GD.set)return nM(r,{code:KD.invalid_type,expected:GD.set,received:r.parsedType}),aM;const a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(nM(r,{code:KD.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(nM(r,{code:KD.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const s=this._def.valueType;function i(e){const t=new Set;for(const r of e){if("aborted"===r.status)return aM;"dirty"===r.status&&n.dirty(),t.add(r.value)}return{status:n.value,value:t}}const o=[...r.data.values()].map((e,t)=>s._parse(new dM(r,e,r.path,t)));return r.common.async?Promise.all(o).then(e=>i(e)):i(o)}min(e,t){return new sF(Gc(Gc({},this._def),{},{minSize:{value:e,message:eM.toString(t)}}))}max(e,t){return new sF(Gc(Gc({},this._def),{},{maxSize:{value:e,message:eM.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}sF.create=(e,t)=>new sF(Gc({valueType:e,minSize:null,maxSize:null,typeName:wF.ZodSet},hM(t)));class iF extends pM{get schema(){return this._def.getter()}_parse(e){const t=this._processInputParams(e).ctx;return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}iF.create=(e,t)=>new iF(Gc({getter:e,typeName:wF.ZodLazy},hM(t)));class oF extends pM{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return nM(t,{received:t.data,code:KD.invalid_literal,expected:this._def.value}),aM}return{status:"valid",value:e.data}}get value(){return this._def.value}}function lF(e,t){return new cF(Gc({values:e,typeName:wF.ZodEnum},hM(t)))}oF.create=(e,t)=>new oF(Gc({value:e,typeName:wF.ZodLiteral},hM(t)));class cF extends pM{_parse(e){if("string"!==typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return nM(t,{expected:VD.joinValues(n),received:t.parsedType,code:KD.invalid_type}),aM}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return nM(t,{received:t.data,code:KD.invalid_enum_value,options:n}),aM}return iM(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return cF.create(e,Gc(Gc({},this._def),t))}exclude(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return cF.create(this.options.filter(t=>!e.includes(t)),Gc(Gc({},this._def),t))}}cF.create=lF;class uF extends pM{_parse(e){const t=VD.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==GD.string&&n.parsedType!==GD.number){const e=VD.objectValues(t);return nM(n,{expected:VD.joinValues(e),received:n.parsedType,code:KD.invalid_type}),aM}if(this._cache||(this._cache=new Set(VD.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=VD.objectValues(t);return nM(n,{received:n.data,code:KD.invalid_enum_value,options:e}),aM}return iM(e.data)}get enum(){return this._def.values}}uF.create=(e,t)=>new uF(Gc({values:e,typeName:wF.ZodNativeEnum},hM(t)));class dF extends pM{unwrap(){return this._def.type}_parse(e){const t=this._processInputParams(e).ctx;if(t.parsedType!==GD.promise&&!1===t.common.async)return nM(t,{code:KD.invalid_type,expected:GD.promise,received:t.parsedType}),aM;const n=t.parsedType===GD.promise?t.data:Promise.resolve(t.data);return iM(n.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}dF.create=(e,t)=>new dF(Gc({type:e,typeName:wF.ZodPromise},hM(t)));class fF extends pM{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===wF.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const t=this._processInputParams(e),n=t.status,r=t.ctx,a=this._def.effect||null,s={addIssue:e=>{nM(r,e),e.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){const e=a.transform(r.data,s);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===n.value)return aM;const t=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===t.status?aM:"dirty"===t.status||"dirty"===n.value?sM(t.value):t});{if("aborted"===n.value)return aM;const t=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===t.status?aM:"dirty"===t.status||"dirty"===n.value?sM(t.value):t}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,s);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const t=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===t.status?aM:("dirty"===t.status&&n.dirty(),e(t.value),{status:n.value,value:t.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>"aborted"===t.status?aM:("dirty"===t.status&&n.dirty(),e(t.value).then(()=>({status:n.value,value:t.value}))))}if("transform"===a.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!cM(e))return aM;const t=a.transform(e.value,s);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:t}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>cM(e)?Promise.resolve(a.transform(e.value,s)).then(e=>({status:n.value,value:e})):aM)}VD.assertNever(a)}}
2fF.create=(e,t,n)=>new fF(Gc({schema:e,typeName:wF.ZodEffects,effect:t},hM(n))),fF.createWithPreprocess=(e,t,n)=>new fF(Gc({schema:t,effect:{type:"preprocess",transform:e},typeName:wF.ZodEffects},hM(n)));class hF extends pM{_parse(e){return this._getType(e)===GD.undefined?iM(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}hF.create=(e,t)=>new hF(Gc({innerType:e,typeName:wF.ZodOptional},hM(t)));class pF extends pM{_parse(e){return this._getType(e)===GD.null?iM(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}pF.create=(e,t)=>new pF(Gc({innerType:e,typeName:wF.ZodNullable},hM(t)));class mF extends pM{_parse(e){const t=this._processInputParams(e).ctx;let n=t.data;return t.parsedType===GD.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}mF.create=(e,t)=>new mF(Gc({innerType:e,typeName:wF.ZodDefault,defaultValue:"function"===typeof t.default?t.default:()=>t.default},hM(t)));class gF extends pM{_parse(e){const t=this._processInputParams(e).ctx,n=Gc(Gc({},t),{},{common:Gc(Gc({},t.common),{},{issues:[]})}),r=this._def.innerType._parse({data:n.data,path:n.path,parent:Gc({},n)});return uM(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZD(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new ZD(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}gF.create=(e,t)=>new gF(Gc({innerType:e,typeName:wF.ZodCatch,catchValue:"function"===typeof t.catch?t.catch:()=>t.catch},hM(t)));class vF extends pM{_parse(e){if(this._getType(e)!==GD.nan){const t=this._getOrReturnCtx(e);return nM(t,{code:KD.invalid_type,expected:GD.nan,received:t.parsedType}),aM}return{status:"valid",value:e.data}}}vF.create=e=>new vF(Gc({typeName:wF.ZodNaN},hM(e)));Symbol("zod_brand");class xF extends pM{_parse(e){const t=this._processInputParams(e).ctx,n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class yF extends pM{_parse(e){const t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?aM:"dirty"===e.status?(n.dirty(),sM(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?aM:"dirty"===e.status?(n.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new yF({in:e,out:t,typeName:wF.ZodPipeline})}}class bF extends pM{_parse(e){const t=this._def.innerType._parse(e),n=e=>(cM(e)&&(e.value=Object.freeze(e.value)),e);return uM(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}bF.create=(e,t)=>new bF(Gc({innerType:e,typeName:wF.ZodReadonly},hM(t)));QM.lazycreate;var wF;!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"}(wF||(wF={}));const _F=LM.create,kF=(HM.create,vF.create,zM.create,BM.create,WM.create,qM.create,VM.create,$M.create,GM.create,YM.create,KM.create,ZM.create,JM.create,QM.create);QM.strictCreate,eF.create,nF.create,rF.create,aF.create,sF.create,iF.create,oF.create,cF.create,uF.create,dF.create,fF.create,hF.create,pF.create,fF.createWithPreprocess,yF.create;const jF=["className"],NF=["className"],SF=["className"],CF=t=>{const n=t.children,r=Yc(t,BO);return e.createElement(NA.Provider,{value:r},n)},EF=e.createContext({}),TF=e=>{let t=Object.assign({},(ag(e),e));return(0,zc.jsx)(EF.Provider,{value:{name:t.name},children:(0,zc.jsx)(OA,Gc({},t))})},IF=()=>{const t=e.useContext(EF),n=e.useContext(PF),r=SA().getFieldState,a=TA({name:t.name}),s=r(t.name,a);if(!t)throw new Error("useFormField should be used within <FormField>");const i=n.id;return Gc({id:i,name:t.name,formItemId:"".concat(i,"-form-item"),formDescriptionId:"".concat(i,"-form-item-description"),formMessageId:"".concat(i,"-form-item-message")},s)},PF=e.createContext({});function RF(t){let n=t.className,r=Yc(t,jF);const a=e.useId();return(0,zc.jsx)(PF.Provider,{value:{id:a},children:(0,zc.jsx)("div",Gc({"data-slot":"form-item",className:Zm("grid gap-2",n)},r))})}function OF(e){let t=e.className,n=Yc(e,NF);const r=IF(),a=r.error,s=r.formItemId;return(0,zc.jsx)(Kb,Gc({"data-slot":"form-label","data-error":!!a,className:Zm("data-[error=true]:text-destructive",t),htmlFor:s},n))}function AF(e){let t=Object.assign({},(ag(e),e));const n=IF(),r=n.error,a=n.formItemId,s=n.formDescriptionId,i=n.formMessageId;return(0,zc.jsx)(Xu,Gc({"data-slot":"form-control",id:a,"aria-describedby":r?"".concat(s," ").concat(i):"".concat(s),"aria-invalid":!!r},t))}function DF(e){var t;let n=e.className,r=Yc(e,SF);
2const a=IF(),s=a.error,i=a.formMessageId,o=s?String(null!==(t=null===s||void 0===s?void 0:s.message)&&void 0!==t?t:""):r.children;return o?(0,zc.jsx)("p",Gc(Gc({"data-slot":"form-message",id:i,className:Zm("text-destructive text-sm",n)},r),{},{children:o})):null}const MF=Iu("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),FF=Iu("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"}]]),LF=async(e,t)=>{const n=await fetch("".concat("https://api.trievents.ca","/events/notify/").concat(e),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)});if(!n.ok)throw new Error("Error sending emails. Please try again.");return n.json()},UF=async(e,t)=>{const n=await fetch("".concat("https://api.trievents.ca","/events/notify-sms/").concat(e),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)});if(!n.ok)throw new Error("Error sending SMS messages. Please try again.");return n.json()},HF=kF({subject:_F().min(1,"Subject is required"),content:_F().min(1,"Content is required")});function zF(e){let t=e.onSubmit,n=e.isSubmitting;const r=yD({resolver:qD(HF),defaultValues:{subject:"",content:""}});return(0,zc.jsx)(CF,Gc(Gc({},r),{},{children:(0,zc.jsxs)("form",{onSubmit:r.handleSubmit(t),className:"flex flex-col h-[400px]",children:[(0,zc.jsx)(TF,{control:r.control,name:"subject",render:e=>{let t=e.field;return(0,zc.jsxs)(RF,{children:[(0,zc.jsx)(OF,{className:"text-lg",children:"Subject"}),(0,zc.jsx)(AF,{children:(0,zc.jsx)(pg,Gc({placeholder:"Enter email subject",className:"h-12 text-lg",style:{fontSize:"1.125rem"}},t))}),(0,zc.jsx)(DF,{})]})}}),(0,zc.jsx)("div",{className:"flex-grow mt-6",children:(0,zc.jsx)(TF,{control:r.control,name:"content",render:e=>{let t=e.field;return(0,zc.jsxs)(RF,{className:"h-full flex flex-col",children:[(0,zc.jsx)(OF,{className:"text-lg",children:"Content"}),(0,zc.jsx)(AF,{className:"flex-grow",children:(0,zc.jsx)(Jb,Gc({placeholder:"Enter email body",className:"resize-none h-full text-lg",style:{fontSize:"1.125rem"}},t))}),(0,zc.jsx)(DF,{})]})}})}),(0,zc.jsx)(fg,{type:"submit",className:"w-full h-12 text-lg mt-6",disabled:n,children:n?"Sending...":(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(FF,{className:"mr-2 h-5 w-5"}),"Send Email"]})})]})}))}function BF(e){let t=e.onSubmit,n=e.isSubmitting;const r=yD({resolver:qD(kF({message:_F().min(1,"Message is required").max(160,"Message must be 160 characters or less")})),defaultValues:{message:""}});return(0,zc.jsx)(CF,Gc(Gc({},r),{},{children:(0,zc.jsxs)("form",{onSubmit:r.handleSubmit(t),className:"flex flex-col h-[400px]",children:[(0,zc.jsx)("div",{className:"space-y-6 flex-grow",children:(0,zc.jsx)(TF,{control:r.control,name:"message",render:e=>{let t=e.field;return(0,zc.jsxs)(RF,{className:"flex-grow flex flex-col h-full",children:[(0,zc.jsx)(OF,{className:"text-lg",children:"Message"}),(0,zc.jsx)(AF,{className:"flex-grow",children:(0,zc.jsx)(Jb,Gc({placeholder:"Enter SMS message",className:"resize-none h-full text-lg",style:{fontSize:"1.125rem"}},t))}),(0,zc.jsx)(DF,{})]})}})}),(0,zc.jsx)(fg,{type:"submit",className:"w-full h-12 text-lg mt-6",disabled:n,children:n?"Sending...":(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(FF,{className:"mr-2 h-5 w-5"}),"Send SMS"]})})]})}))}function WF(){const t=il().uuid,n=sl(),r=rg().getTenantPath,a=l((0,e.useState)(!1),2),s=a[0],i=a[1],o=l((0,e.useState)("email"),2),c=(o[0],o[1]);return(0,zc.jsxs)("div",{className:"pb-12 md:pb-6",children:[(0,zc.jsx)("div",{className:"mb-0 md:mb-6",children:(0,zc.jsx)(jO,{to:r("/event/".concat(t)),text:"Back to Event"})}),(0,zc.jsx)(Rb,{className:"border-none bg-[#23d6e4] text-white",children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsx)("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:(0,zc.jsxs)("div",{children:[(0,zc.jsx)(Ab,{className:"text-3xl font-bold mb-2 text-white",children:"Notify Attendees"}),(0,zc.jsx)(Db,{className:"text-white/80",children:"Send a notification to all attendees of this event"})]})})})}),(0,zc.jsx)(Rb,{className:"mt-6",children:(0,zc.jsx)(Mb,{className:"p-6 pb-8",children:(0,zc.jsxs)(LC,{defaultValue:"email",className:"space-y-4",onValueChange:c,children:[(0,zc.jsxs)(UC,{className:"transition-none",children:[(0,zc.jsxs)(HC,{value:"email",className:"flex items-center gap-2 transition-none",children:[(0,zc.jsx)(Ou,{className:"h-4 w-4"}),"Email"]}),(0,zc.jsxs)(HC,{value:"sms",className:"flex items-center gap-2 transition-none",children:[(0,zc.jsx)(MF,{className:"h-4 w-4"}),"SMS"]})]}),(0,zc.jsxs)("div",{children:[(0,zc.jsx)(zC,{value:"email",className:"h-full",children:(0,zc.jsx)(zF,{onSubmit:async function(e){i(!0);try{const a=await LF(t,e);ou.success(a.message),setTimeout(()=>{n(r("/event/".concat(t)))},1500)}catch(a){ou.error("Failed to submit the form. Please try again.")}finally{i(!1)}},isSubmitting:s})}),(0,zc.jsx)(zC,{value:"sms",className:"h-full",children:(0,zc.jsx)(BF,{onSubmit:async function(e){i(!0);try{const a=await UF(t,e);ou.success(a.message),setTimeout(()=>{n(r("/event/".concat(t)))},1500)}catch(a){ou.error("Failed to send SMS. Please try again.")}finally{i(!1)}},isSubmitting:s})})]})]})})})]})}const qF=Iu("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),VF=Iu("building-2",[["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"}
2],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);const $F=()=>{var t,n;const r=il().uuid,a=l((0,e.useState)(null),2),s=a[0],i=a[1],o=l((0,e.useState)(null),2),c=o[0],u=o[1],f=l((0,e.useState)(null),2),h=f[0],p=f[1],m=l((0,e.useState)(!0),2),g=m[0],v=m[1],x=l((0,e.useState)(""),2),y=x[0],b=x[1],w=l((0,e.useState)(null),2),_=w[0],k=w[1];(0,e.useEffect)(()=>{(async()=>{try{const e=await async function(e){const t=await fetch("".concat("https://api.trievents.ca","/tickets/validate/").concat(e),{credentials:"include"});if(404===t.status)throw new Error("That ticket does not exist.");if(401===t.status)throw new Error("Please log in to your organization to view this ticket.");if(403===t.status){if((await t.json()).accessDenied)throw new Error("You do not have access to this ticket. Please log in to the correct organization.");throw new Error("Access denied.")}if(!t.ok)throw new Error("Failed to fetch ticket.");return t.json()}(r);if(!e.valid)return void u("Ticket has already been used.");if(i(e.ticket),e.ticket.event_uuid)try{const t=await Xw(e.ticket.event_uuid);b(t.title),k(t)}catch(d){u("Could not fetch event details.")}}catch(XF){u("An error occurred while validating the ticket. "+(XF instanceof Error?XF.message:String(XF)))}finally{v(!1)}})()},[r]);if(g)return(0,zc.jsx)(Wb,{});if(c){const e=c.includes("do not have access to this ticket"),t=c.includes("Please log in to your organization");return(0,zc.jsx)("div",{className:"relative min-h-screen bg-gradient-to-br from-blue-50 via-white to-teal-50 overflow-x-hidden flex items-center justify-center",children:(0,zc.jsx)("div",{className:"container mx-auto px-4 py-8 relative z-10",children:(0,zc.jsx)("div",{className:"max-w-lg mx-auto",children:(0,zc.jsxs)(Rb,{className:"w-full shadow-xl border-0 bg-white/90 backdrop-blur-md",children:[(0,zc.jsx)(Ob,{children:(0,zc.jsx)(Ab,{className:"text-2xl text-center text-black",children:t?"Authentication Required":e?"Access Denied":"Invalid Ticket"})}),(0,zc.jsx)(Mb,{children:(0,zc.jsx)(Iw,{variant:t||e?"default":"destructive",className:t||e?"bg-blue-50 border-blue-200":"bg-red-50 border-red-200",children:(0,zc.jsx)("div",{className:"flex items-center",children:(0,zc.jsx)(Rw,{className:t||e?"text-blue-700":"text-red-700",children:c})})})})]})})})})}return s?(0,zc.jsx)("div",{className:"relative min-h-screen bg-gradient-to-br from-blue-50 via-white to-teal-50 overflow-x-hidden flex items-center justify-center",children:(0,zc.jsx)("div",{className:"container mx-auto px-4 py-8 relative z-10",children:(0,zc.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,zc.jsxs)(Rb,{className:"w-full shadow-xl border-0 bg-white/90 backdrop-blur-md",children:[(0,zc.jsx)(Ob,{className:"space-y-4 border-b border-gray-100",children:(0,zc.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)(Ab,{className:"text-3xl text-black",children:y||"Event Ticket"}),(0,zc.jsxs)("div",{className:"space-y-2 mt-3",children:[(0,zc.jsxs)("div",{className:"flex items-center text-black",children:[(0,zc.jsx)(hS,{className:"h-4 w-4 mr-2"}),(0,zc.jsx)("p",{className:"text-sm",children:(null===_||void 0===_?void 0:_.date)&&(j=_.date,j.split("T")[0])})]}),(0,zc.jsxs)("div",{className:"flex items-center text-black",children:[(0,zc.jsx)(EO,{className:"h-4 w-4 mr-2"}),(0,zc.jsx)("p",{className:"text-sm",children:null!==_&&void 0!==_&&_.time_start&&null!==_&&void 0!==_&&_.time_end?"".concat(_.time_start," - ").concat(_.time_end):(null===_||void 0===_?void 0:_.time_start)||"Time not specified"})]}),(0,zc.jsxs)("div",{className:"flex items-center text-black",children:[(0,zc.jsx)(TO,{className:"h-4 w-4 mr-2"}),(0,zc.jsx)("p",{className:"text-sm",children:null===_||void 0===_?void 0:_.location})]})]}),(0,zc.jsxs)(Db,{className:"text-base text-gray-600 mt-3",children:["Purchased on ",new Date(s.createdAt).toLocaleDateString()]})]}),(0,zc.jsx)(Nw,{variant:s.ticket_burned?"destructive":"secondary",className:"text-base px-4 py-1.5 ".concat(s.ticket_burned?"bg-red-100 text-red-700":"bg-blue-100 text-blue-700"),children:s.ticket_burned?"Used":"Valid"})]})}),(0,zc.jsxs)(Mb,{className:"space-y-6 pt-6",children:[(0,zc.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsxs)("div",{className:"flex items-center text-black",children:[(0,zc.jsx)(qF,{className:"h-4 w-4 mr-2"}),(0,zc.jsx)("p",{className:"text-sm font-medium",children:"Customer Name"})]}),(0,zc.jsx)("p",{className:"text-lg text-black",children:s.customer_name})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsxs)("div",{className:"flex items-center text-black",children:[(0,zc.jsx)(Ou,{className:"h-4 w-4 mr-2"}),(0,zc.jsx)("p",{className:"text-sm font-medium",children:"Customer Email"})]}),(0,zc.jsx)("p",{className:"text-lg text-black",children:s.customer_email})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsxs)("div",{className:"flex items-center text-black",children:[(0,zc.jsx)(IS,{className:"h-4 w-4 mr-2"}),(0,zc.jsx)("p",{className:"text-sm font-medium",children:"Ticket Type"})]}),(0,zc.jsx)("p",{className:"text-lg text-black",children:(null===(t=s.price)||void 0===t?void 0:t.nickname)||"Standard"})]}),(0,zc.jsxs)("div",{className:"space-y-2",children:[(0,zc.jsxs)("div",{className:"flex items-center text-black",children:[(0,zc.jsx)(VF,{className:"h-4 w-4 mr-2"}),(0,zc.jsx)("p",{className:"text-sm font-medium",children:"Organization"})]}),(0,zc.jsx)("p",{className:"text-lg text-black",children:null===(n=s.organization)||void 0===n?void 0:n.name})]})]}),h&&(0,zc.jsx)(Iw,{className:"bg-green-50 border-green-200",children:(0,zc.jsxs)("div",{className:"flex items-center",children:[(0,zc.jsx)(s_,{className:"h-5 w-5 mr-2 text-green-600"}),(0,zc.jsx)(Rw,{className:"text-green-700",children:h})]})})]}),!s.ticket_burned&&(0,zc.jsx)(Fb,{className:"border-t border-gray-100 pt-6",children:(0,zc.jsx)(fg,{onClick:async()=>{try{const e=await async function(e){const t=await fetch("".concat("https://api.trievents.ca","/tickets/burn/").concat(e),{method:"GET",credentials:"include"});if(401===t.status)throw new Error("Please log in to your organization to burn this ticket.");if(403===t.status){if((await t.json()).accessDenied)throw new Error("You do not have access to this ticket. Please log in to the correct organization.");throw new Error("Access denied.")}if(!t.ok)throw new Error("Failed to burn the ticket.");return t.json()}(r);e.burned?(p("Ticket has been successfully burned."),i(e=>e?Gc(Gc({},e),{},{ticket_burned:!0}):null)):u("Failed to burn the ticket.")}catch(XF){u("An error occurred while burning the ticket. "+(XF instanceof Error?XF.message:String(XF)))}},className:"w-full bg-[#23d6e4] hover:bg-[#1bc4d1] text-white text-lg font-semibold shadow-md border-0",size:"lg",children:"Validate & Burn Ticket"})})]})})})}):(0,zc.jsx)("div",{className:"relative min-h-screen bg-gradient-to-br from-blue-50 via-white to-teal-50 overflow-x-hidden flex items-center justify-center",children:(0,zc.jsx)("div",{className:"container mx-auto px-4 py-8 relative z-10",children:(0,zc.jsx)("div",{className:"max-w-lg mx-auto",children:(0,zc.jsxs)(Rb,{className:"w-full shadow-xl border-0 bg-white/90 backdrop-blur-md",children:[(0,zc.jsx)(Ob,{children:(0,zc.jsx)(Ab,{className:"text-2xl text-center text-black",children:"Ticket Not Found"})}),(0,zc.jsx)(Mb,{children:(0,zc.jsx)(Iw,{variant:"destructive",className:"bg-red-50 border-red-200",children:(0,zc.jsx)("div",{className:"flex items-center",children:(0,zc.jsx)(Rw,{className:"text-red-700",children:"The requested ticket could not be found."})})})})]})})})});var j},GF=e=>{const t=e.checked;return(0,zc.jsx)(Rb,{className:Zm("transition-all duration-200 hover:shadow-md",t&&"border-green-200 bg-green-50/50"),children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"flex items-start space-x-4",children:[(0,zc.jsx)("div",{className:"flex-shrink-0 mt-1",children:(0,zc.jsx)(_w,{id:e.waiverItem.uuid,onCheckedChange:e.checkboxClickedFn,checked:e.checked,disabled:"link"===e.waiverItem.type,className:"h-5 w-5 border-2 data-[state=checked]:bg-primary data-[state=checked]:border-primary"})}),(0,zc.jsxs)("div",{className:"flex-1 min-w-0",children:["checkbox"===e.waiverItem.type&&(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)("p",{className:"text-lg font-normal",children:e.waiverItem.message}),t&&(0,zc.jsx)(s_,{className:"h-5 w-5 text-green-600 flex-shrink-0"})]}),"link"===e.waiverItem.type&&(0,zc.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zc.jsx)("a",{onClick:e.linkCl
2ickedFn,target:"_blank",rel:"noopener noreferrer",href:e.waiverItem.link,className:"text-lg font-normal text-blue-600 hover:text-blue-800 underline transition-colors",children:e.waiverItem.message}),t&&(0,zc.jsx)(s_,{className:"h-5 w-5 text-green-600 flex-shrink-0"})]}),"link"===e.waiverItem.type&&(0,zc.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Click the link above to review the content. The item will be automatically marked as completed."})]})]})})})},YF=()=>{const t=il().uuid,n=l((0,e.useState)([]),2),r=n[0],a=n[1],s=l((0,e.useState)([]),2),i=s[0],o=s[1],c=l((0,e.useState)(!1),2),u=c[0],f=c[1],h=l((0,e.useState)(!1),2),p=h[0],m=h[1],g=sl();if((0,e.useEffect)(()=>{(async()=>{f(!0);try{const e=await(async e=>{const t=await fetch("".concat("https://api.trievents.ca","/tickets/get-waiver-details/").concat(e));if(!t.ok)throw new Error("Failed to fetch event details");return t.json()})(t);a(e.waiver_items),o(e.completed_items)}catch(e){console.error("Error fetching data:",e),g("/error",{state:{errorCode:e instanceof Error?e.message:"Unknown error"}})}f(!1)})()},[t,g]),u)return(0,zc.jsx)(Wb,{});if(0===r.length)return(0,zc.jsx)("section",{className:"bg-background min-h-screen",children:(0,zc.jsx)("div",{className:"container mx-auto px-4 py-8",children:(0,zc.jsx)(Rb,{className:"max-w-md mx-auto",children:(0,zc.jsxs)(Mb,{className:"p-8 text-center",children:[(0,zc.jsx)("h1",{className:"text-2xl font-semibold mb-2",children:"No Todo Items Found"}),(0,zc.jsx)("p",{className:"text-muted-foreground",children:"There are no required items to complete for this ticket."})]})})})});const v=i.length,x=r.length,y=v===x;return(0,zc.jsx)("section",{className:"bg-background min-h-screen",children:(0,zc.jsx)("div",{className:"container mx-auto px-4 py-8 md:py-16",children:(0,zc.jsxs)("div",{className:"max-w-2xl mx-auto space-y-6",children:[(0,zc.jsx)(Rb,{className:"border-none bg-[#23d6e4] text-white",children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"text-center",children:[(0,zc.jsx)(Ab,{className:"text-3xl font-bold mb-2 text-white",children:"Complete Required Items"}),(0,zc.jsx)(Db,{className:"text-white/80",children:"Please complete all required items before attending the event"})]})})}),(0,zc.jsx)(Rb,{children:(0,zc.jsxs)(Mb,{className:"p-6",children:[(0,zc.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,zc.jsxs)("div",{children:[(0,zc.jsx)("h3",{className:"text-lg font-semibold",children:"Progress"}),(0,zc.jsxs)("p",{className:"text-sm text-muted-foreground",children:[v," of ",x," items completed"]})]}),(0,zc.jsxs)(Nw,{variant:y?"default":"secondary",children:[Math.round(v/x*100),"%"]})]}),(0,zc.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,zc.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:"".concat(v/x*100,"%")}})})]})}),(0,zc.jsx)("div",{className:"space-y-4",children:r.map(e=>(0,zc.jsx)(GF,{waiverItem:e,linkClickedFn:()=>{return t=e.uuid,void(i.includes(t)||o([...i,t]));var t},checkboxClickedFn:t=>((e,t)=>{o(n=>t?[...n,e]:n.filter(t=>t!==e))})(e.uuid,t),checked:i.includes(e.uuid)},e.uuid))}),(0,zc.jsx)(Rb,{children:(0,zc.jsx)(Mb,{className:"p-6",children:(0,zc.jsxs)("div",{className:"text-center",children:[(0,zc.jsx)(fg,{onClick:async()=>{m(!0);try{(await fetch("".concat("https://api.trievents.ca","/tickets/update-waiver-items/").concat(t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({completed_items:i})})).ok?ou.success("Submission received!"):ou.error("There was an error with your submission, please try again")}catch(d){ou.error("There was an error with your submission, please try again")}m(!1)},disabled:!y||p,className:"w-full md:w-auto bg-black text-white hover:bg-black/90 hover:text-white transition-transform duration-200 hover:scale-105",size:"lg",children:p?(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)("span",{className:"animate-spin mr-2",children:"\u23f3"}),"Submitting..."]}):(0,zc.jsxs)(zc.Fragment,{children:[(0,zc.jsx)(s_,{className:"mr-2 h-4 w-4"}),"Submit All Items"]})}),!y&&(0,zc.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:"Please complete all items before submitting"})]})})})]})})})};mu().init(_u);const KF=function(){const t=l((0,e.useState)(!0),2),n=t[0],r=t[1];return(0,e.useEffect)(()=>{setTimeout(()=>{r(!1)},200)},[]),(0,zc.jsxs)(pu.SuperTokensWrapper,{children:[(0,zc.jsx)(Hc,{children:(0,zc.jsx)("title",{children:"TriEvents"})}),(0,zc.jsx)(Bc,{isLoading:n,children:(0,zc.jsxs)(Il,{children:[(0,zc.jsxs)(jl,{children:[(0,zc.jsx)(_l,{path:"/error",element:(0,zc.jsx)(Bb,{})}),(0,zc.jsx)(_l,{path:"/checkout/:uuid",element:(0,zc.jsx)(a_,{})}),(0,zc.jsx)(_l,{path:"/checkout/success",element:(0,zc.jsx)(i_,{})}),(0,zc.jsx)(_l,{path:"/orientation/computing",element:(0,zc.jsx)(c_,{})}),(0,zc.jsx)(_l,{path:"/orientation/nursing",element:(0,zc.jsx)(u_,{})}),(0,zc.jsx)(_l,{path:"/orientation/healthsciences",element:(0,zc.jsx)(d_,{})}),(0,zc.jsx)(_l,{path:"/orientation/commerce",element:(0,zc.jsx)(f_,{})}),(0,zc.jsx)(_l,{path:"/asterisk",element:(0,zc.jsx)(h_,{})}),(0,zc.jsx)(_l,{path:"/",element:(0,zc.jsx)(Ub,{})}),(0,zc.jsx)(_l,{path:"/auth",element:(0,zc.jsx)(ok,{children:(0,zc.jsx)(x_,{})})}),(0,zc.jsx)(_l,{path:"/organization/create",element:(0,zc.jsx)(ok,{children:(0,zc.jsx)(w_,{})})}),(0,zc.jsx)(_l,{path:"/organization/onboarding",element:(0,zc.jsx)(Q_,{})}),(0,zc.jsx)(_l,{path:"/:orgId/login",element:(0,zc.jsx)(ok,{children:(0,zc.jsx)(nk,{})})}),(0,zc.jsx)(_l,{path:"/:orgId/join",element:(0,zc.jsx)(ok,{children:(0,zc.jsx)(ak,{})})}),(0,zc.jsx)(_l,{path:"/:orgId/auth/reset-password",element:(0,zc.jsx)(ik,{})}),(0,zc.jsx)(_l,{path:"/ticket/validate/:uuid",element:(0,zc.jsx)($F,{})}),(0,zc.jsx)(_l,{path:"/ticket/todo-list/:uuid",element:(0,zc.jsx)(YF,{})}),(0,zc.jsx)(_l,{path:"/:orgId/*",element:(0,zc.jsx)(Ey,{children:(0,zc.jsxs)(jl,{children:[(0,zc.jsx)(_l,{path:"/dashboard",element:(0,zc.jsx)(gu.SessionAuth,{children:(0,zc.jsx)(pS,{})})}),(0,zc.jsx)(_l,{path:"/members",element:(0,zc.jsx)(gu.SessionAuth,{children:(0,zc.jsx)(kS,{})})}),(0,zc.jsx)(_l,{path:"/email-dashboard",element:(0,zc.jsx)(gu.SessionAuth,{children:(0,zc.jsx)(jI,{})})}),(0,zc.jsx)(_l,{path:"/transactions",element:(0,zc.jsx)(gu.SessionAuth,{children:(0,zc.jsx)(qC,{})})}),(0,zc.jsx)(_l,{path:"/finances",element:(0,zc.jsx)(gu.SessionAuth,{children:(0,zc.jsx)(VC,{})})}),(0,zc.jsx)(_l,{path:"/events/create",element:(0,zc.jsx)(gu.SessionAuth,{children:(0,zc.jsx)(NO,{})})}),(0,zc.jsx)(_l,{path:"/events/:date",element:(0,zc.jsx)(gu.SessionAuth,{children:(0,zc.jsx)(CO,{})})}),(0,zc.jsx)(_l,{path:"/event/:uuid",element:(0,zc.jsx)(gu.SessionAuth,{children:(0,zc.jsx)(MO,{})})}),(0,zc.jsx)(_l,{path:"/event/:uuid/notify-attendees",element:(0,zc.jsx)(gu.SessionAuth,{children:(0,zc.jsx)(WF,{})})}),(0,zc.jsx)(_l,{path:"/event/:uuid/attendees",element:(0,zc.jsx)(gu.SessionAuth,{children:(0,zc.jsx)(zO,{})})}),(0,zc.jsx)(_l,{path:"*",element:(0,zc.jsx)(wl,{to:"/error",replace:!0})})]})})})]}),(0,zc.jsx)(hu,{})]})})]})},ZF=e=>{e&&e instanceof Function&&n.e(453).then(n.bind(n,6453)).then(t=>{let n=t.getCLS,r=t.getFID,a=t.getFCP,s=t.getLCP,i=t.getTTFB;n(e),r(e),a(e),s(e),i(e)})},JF=document.getElementById("root");
2if(!JF)throw new Error("Failed to find the root element");r.createRoot(JF).render((0,zc.jsx)(e.StrictMode,{children:(0,zc.jsx)(Xi,{apiKey:"phc_9dVpM3DKkl5dSVNZOPQrbqNkigw4GlgnmiY9ndwPYAp",options:{api_host:"https://us.i.posthog.com/",defaults:"2025-05-24",capture_exceptions:!0},children:(0,zc.jsx)(KF,{})})})),ZF()})()})();
3//# sourceMappingURL=main.2dca2070.js.map

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.